ITK Function Reference

(V10000.1.0.60_20160308.00)
Modules | Macros | Functions
Project

Modules

 Project Errors
 

Macros

#define PROJ_desc_size_c   240
 
#define PROJ_id_size_c   64
 
#define PROJ_name_size_c   32
 
#define PROJECT_create_msg   "PROJECT_create"
 
#define PROJECTTEAM_AUTHOR_ROLE   "Project Author"
 

Functions

TCCORE_API int PROJ__set_default_project (int member_count, tag_t *members, tag_t project)
 
TCCORE_API int PROJ_activate_project (tag_t project, logical activate)
 
TCCORE_API int PROJ_add_author_members (tag_t project, int author_count, tag_t *authors)
 
TCCORE_API int PROJ_add_members (tag_t project, int user_count, tag_t *users_groups_groupmembers)
 
TCCORE_API int PROJ_ask_assigned_objects (const char *project_id, int *object_count, tag_t **objects)
 
TCCORE_API int PROJ_ask_author_members (tag_t project, int *author_count, tag_t **authors)
 
TCCORE_API int PROJ_ask_id (tag_t project, char id[PROJ_id_size_c+1])
 
TCCORE_API int PROJ_ask_id2 (tag_t project, char **id)
 
TCCORE_API int PROJ_ask_name (tag_t project, char name[PROJ_name_size_c+1])
 
TCCORE_API int PROJ_ask_name2 (tag_t project, char **name)
 
TCCORE_API int PROJ_ask_team (tag_t project, int *member_count, tag_t **members, int *administrator_count, tag_t **administrator_tags, int *privileged_user_count, tag_t **privileged_user_tags)
 
TCCORE_API int PROJ_assign_objects (int project_count, tag_t *projects, int object_count, tag_t *objects)
 
TCCORE_API int PROJ_assign_team (tag_t project, int member_count, tag_t *members, tag_t project_administrator, int privileged_user_count, tag_t *privileged_users)
 
TCCORE_API int PROJ_assign_team_members (tag_t project, int member_count, tag_t *members, int administrator_count, tag_t *administrators, int privileged_user_count, tag_t *privileged_users)
 
TCCORE_API int PROJ_copy_project (tag_t source_project, const char *project_id, const char *project_name, const char *project_description, logical active, logical visible, logical use_program_security, tag_t *project)
 
TCCORE_API int PROJ_create_project (const char *project_id, const char *name, const char *description, tag_t *project)
 
TCCORE_API int PROJ_create_project_with_options (const char *project_id, const char *name, const char *description, const logical use_program_level_security, tag_t *project)
 
TCCORE_API int PROJ_edit_project_options (tag_t project, const logical use_program_level_security)
 
TCCORE_API int PROJ_find (const char *project_id, tag_t *project)
 
TCCORE_API int PROJ_find_objects_in_projects (const char *project_id, int filter_criteria, const char **filter_names, const char **filter_values, int *number_objects, tag_t **objects)
 
TCCORE_API int PROJ_find_user_project (tag_t user, logical include_inactive, int *count, tag_t **projects)
 
TCCORE_API int PROJ_find_user_projects (tag_t user, logical active_projects_only, logical privileged_projects_only, logical programs_only, int *n_projects, tag_t **projects)
 
TCCORE_API int PROJ_initialize (tag_t project, const char id[PROJ_id_size_c+1], const char name[PROJ_name_size_c+1], const char desc[PROJ_desc_size_c+1])
 
TCCORE_API int PROJ_initialize2 (tag_t project, const char *id, const char *name, const char *description)
 
TCCORE_API int PROJ_is_project_active (tag_t project, logical *active)
 
TCCORE_API int PROJ_is_user_a_member (tag_t project, tag_t user, logical *answer)
 
TCCORE_API int PROJ_is_user_a_privileged_member (tag_t project, tag_t user, logical *answer)
 
TCCORE_API int PROJ_remove_author_members (tag_t project, int author_count, tag_t *authors)
 
TCCORE_API int PROJ_remove_members (tag_t project, int user_count, tag_t *users_groups_groupmembers)
 
TCCORE_API int PROJ_remove_objects (int project_count, tag_t *projects, int object_count, tag_t *objects)
 

Detailed Description

Macro Definition Documentation

#define PROJ_desc_size_c   240

Definition at line 22 of file project.h.

#define PROJ_id_size_c   64

Definition at line 20 of file project.h.

#define PROJ_name_size_c   32

Definition at line 21 of file project.h.

#define PROJECT_create_msg   "PROJECT_create"

Definition at line 19 of file project.h.

#define PROJECTTEAM_AUTHOR_ROLE   "Project Author"

Definition at line 23 of file project.h.

Function Documentation

TCCORE_API int PROJ__set_default_project ( int  member_count,
tag_t members,
tag_t  project 
)

Sets a project as default Project for a list of Project members.
If the logged-in user has a User Context, it updates the Project within the User Context. Otherwise, it creates a new User Context and sets the current project.

Returns
Parameters
member_count(I) Number of Project members
members(I) A list of tags of Project members to be set as default
project(I) The Project tag
TCCORE_API int PROJ_activate_project ( tag_t  project,
logical  activate 
)

Activates or de-activates a Project.

Returns
Parameters
project(I) The Project to activate
activate(I) If the Project is activate
TCCORE_API int PROJ_add_author_members ( tag_t  project,
int  author_count,
tag_t authors 
)

Adds users as Project authors (privileged users that can add/remove objects to/from a Project).
Ensure that a user to be added as a Project Author is already a Project member.

Returns
Parameters
project(I) A Project tag that the given users will be removed
author_count(I) Number of authors to add
authors(I) author_count List of authors on the project
TCCORE_API int PROJ_add_members ( tag_t  project,
int  user_count,
tag_t users_groups_groupmembers 
)

Adds users as a regular Project member (non-privileged member).

Returns
Parameters
project(I) The Project to which the users are to be added
user_count(I) Number of members to be added
users_groups_groupmembers(I) user_count List of Users/Groups/GroupMembers that are to be added as members of the given Project
TCCORE_API int PROJ_ask_assigned_objects ( const char *  project_id,
int *  object_count,
tag_t **  objects 
)

Retrieves the objects assigned to a Project.

Returns
Parameters
project_id(I) The identification string (ID) of the Project
object_count(O) Number of assigned objects
objects(OF) object_count The assigned objects
TCCORE_API int PROJ_ask_author_members ( tag_t  project,
int *  author_count,
tag_t **  authors 
)

Retrieves the Project author users (privileged users that can add/remove objects from a Project).

Returns
Parameters
project(I) The Project
author_count(O) Number of authors
authors(OF) author_count List of authors on the Project
TCCORE_API int PROJ_ask_id ( tag_t  project,
char  id[PROJ_id_size_c+1] 
)
Retrieves identification string (ID) for a specified Project. 
Returns
Deprecated:
This function is deprecated and will be removed from Tc12.
Use PROJ_ask_id2 instead.
Parameters
project(I) The Project tag
id(O) The Project identification string (ID)
TCCORE_API int PROJ_ask_id2 ( tag_t  project,
char **  id 
)

Retrieves identification string (ID) for a specified Project.

Returns
Parameters
project(I) The Project to identify
id(OF) The Project identification string
TCCORE_API int PROJ_ask_name ( tag_t  project,
char  name[PROJ_name_size_c+1] 
)

Retrieves the name of the specified Project.

Returns
Deprecated:
This function is deprecated and will be removed from Tc12. In Tc10 onwards, please use PROJ_ask_name2
Parameters
project(I) The Project tag
name(O) The Project name string
TCCORE_API int PROJ_ask_name2 ( tag_t  project,
char **  name 
)

Retrieves the name of the specified Project.

Returns
Parameters
project(I) The Project
name(OF) The Project name string
TCCORE_API int PROJ_ask_team ( tag_t  project,
int *  member_count,
tag_t **  members,
int *  administrator_count,
tag_t **  administrator_tags,
int *  privileged_user_count,
tag_t **  privileged_user_tags 
)

Retrieves the team of the given Project, including information about members, administrators and privileged users.

Returns
Parameters
project(I) The Project
member_count(O) Number of project members found
members(OF) member_count The list of Project members
administrator_count(O) Number of Project admins
administrator_tags(OF) administrator_count The list of Project team administrators
privileged_user_count(O) Number of privileged users
privileged_user_tags(OF) privileged_user_count The list of privileged users
TCCORE_API int PROJ_assign_objects ( int  project_count,
tag_t projects,
int  object_count,
tag_t objects 
)

Assigns objects to specified projects.

Returns
Parameters
project_count(I) Number of the Project
projects(I) Projects to be assigned
object_count(I) Number of the objects
objects(I) Objects to assign for Projects
TCCORE_API int PROJ_assign_team ( tag_t  project,
int  member_count,
tag_t members,
tag_t  project_administrator,
int  privileged_user_count,
tag_t privileged_users 
)

Assigns a team to the given Project.

Returns
Parameters
project(I) The Project
member_count(I) Number of the Project members
members(I) member_count Members to add.
This can be Users, Group Members and Group objects. If any other object type is provided, it will be discarded.
project_administrator(I) The user that will be a Project administrator. It can be NULLTAG.
privileged_user_count(I) Number of privileged users.
If a zero or negative number is provided, no privileged users will be assigned to the project.
privileged_users(I) privileged_user_count The list of privileged users
TCCORE_API int PROJ_assign_team_members ( tag_t  project,
int  member_count,
tag_t members,
int  administrator_count,
tag_t administrators,
int  privileged_user_count,
tag_t privileged_users 
)

Assigns team members to the given Project. This API supports multiple project team administrators.

Returns
Parameters
project(I) The Project
member_count(I) Number of the Project members
members(I) member_count Members to add.
This can be Group Members and Group objects. If any other object type is provided, it will be discarded.
administrator_count(I) Number of Project administrators
administrators(I) administrator_count The list of Project team administrators
privileged_user_count(I) Number of privileged users.
If a zero or negative number is provided, no privileged users will be assigned to the project.
privileged_users(I) privileged_user_count The list of privileged users
TCCORE_API int PROJ_copy_project ( tag_t  source_project,
const char *  project_id,
const char *  project_name,
const char *  project_description,
logical  active,
logical  visible,
logical  use_program_security,
tag_t project 
)

Creates a new Project based on an existing Project.
The members, team administrators, administrator and privileged users are copied from the source project.

Returns
Parameters
source_project(I) The Project to be copied from
project_id(I) The identification string (ID) of the new Project
project_name(I) Name of the new Project
project_description(I) Description of the new Project
active(I) Defines if the Project is active
visible(I) If it is visible
use_program_security(I) If it uses program level security
project(O) The newly created project
TCCORE_API int PROJ_create_project ( const char *  project_id,
const char *  name,
const char *  description,
tag_t project 
)

Creates a new Project with the given ID, name and description.

Returns
Parameters
project_id(I) The identification string (ID) of the Project
name(I) Name of the Project that is to be created
description(I) Description of the Project that is to be created
project(O) The new Project
TCCORE_API int PROJ_create_project_with_options ( const char *  project_id,
const char *  name,
const char *  description,
const logical  use_program_level_security,
tag_t project 
)

Creates a new Project with the given ID, name, description and use_program_level_security option.

Returns
Parameters
project_id(I) The identification string (ID) of the Project
name(I) Name of the Project
description(I) Description of the Project
use_program_level_security(I) When set to true, a Programs are created instead of a Project
project(O) The new Project
TCCORE_API int PROJ_edit_project_options ( tag_t  project,
const logical  use_program_level_security 
)

Changes program level security of a Project.

Returns
Parameters
project(I) The Project
use_program_level_security(I) When set to true, a Programs are created instead of a Project
TCCORE_API int PROJ_find ( const char *  project_id,
tag_t project 
)

Searches the database for the Project with given Project identifier string.
A NULLTAG will be returned if no Project with the matching identifier found.
The search will always be case insensitive.

Returns
Parameters
project_id(I) ID of the Project to find
project(O) Tag of the found Project
TCCORE_API int PROJ_find_objects_in_projects ( const char *  project_id,
int  filter_criteria,
const char **  filter_names,
const char **  filter_values,
int *  number_objects,
tag_t **  objects 
)

Finds all the objects in a Project according to a criteria.
The object and client application responsible for the loading of the objects are also retrieved by this function.
Wildcard characters are supported in filter_values (* matches 0 or more and ? matches single character)

This ITK offers good performances for Projects containing large amount of data.

Returns
ITK_ok always.
Note
No object is returned if project_id is invalid or if filter_criteria, filter_name, filter_values do not match any objects.
Parameters
project_id(I) The Project ID
filter_criteria(I) Additional criteria count
filter_names(I) Criteria names.
Valid values are "Name" and "Type".
filter_values(I) Criteria values
number_objects(O) Number of objects found
objects(OF) number_objects Objects in the Project
TCCORE_API int PROJ_find_user_project ( tag_t  user,
logical  include_inactive,
int *  count,
tag_t **  projects 
)

Retrieves all the Projects assigned to the provided user, including inactive Projects (if the include_inactive flag is set to true).

Note
If the user is NULLTAG, all the Projects defined in the database are returned.
Returns
Parameters
user(I) User of the Project
include_inactive(I) Includes inactive Projects
count(O) Number of Projects found
projects(OF) count The projects
TCCORE_API int PROJ_find_user_projects ( tag_t  user,
logical  active_projects_only,
logical  privileged_projects_only,
logical  programs_only,
int *  n_projects,
tag_t **  projects 
)

Retrieves all the Projects assigned to the given user.

Note
If the user is NULLTAG, all the projects defined in the database are retrieved:
  • including active projects only if the active_projects_only flag is set to true.
  • including privileged Projects only if privileged_projects_only flag is set to true.
  • including programs Projects only if programs_only flag is set to true.
  • if the given user is NULLTAG, all the Projects defined in DB are retrieved.
Returns
Parameters
user(I) Tag of the given user
active_projects_only(I) If set to true, it includes active projects only
privileged_projects_only(I) If set to true, it includes privileged Projects only privileged only
programs_only(I) If set to true, it includes programs Projects only
n_projects(O) Number of Projects
projects(OF) n_projects Projects found for this user
TCCORE_API int PROJ_initialize ( tag_t  project,
const char  id[PROJ_id_size_c+1],
const char  name[PROJ_name_size_c+1],
const char  desc[PROJ_desc_size_c+1] 
)

Initializes a Project object.
It is not saved to the database until an explicit call to AOM_save occurs.
An id, name and description must be specified.
You normally use this function with a subclass of Project. For example, using a specialized class of Project:

  1. Call POM_create_instance to create the object in memory.
  2. Use PROJ_initialize to initialize the attributes which were inherited from Project.
  3. Use additional POM calls to initialize the attributes comprising your specialization of Project.
Deprecated:
This function is deprecated and will be removed from Tc12. In Tc10 onwards, please use PROJ_initialize2
Parameters
project(I) Project to initialize
id(I) The Project identification string
name(I) The Project name string
desc(I) The Project descriprtion string
TCCORE_API int PROJ_initialize2 ( tag_t  project,
const char *  id,
const char *  name,
const char *  description 
)
Parameters
project(I) The Project
id(I) The Project identification string (ID) of the Project
name(I) Name of the Project that is to be created
description(I) Description of the Project
TCCORE_API int PROJ_is_project_active ( tag_t  project,
logical active 
)

Retrieves the activation status of a Project.

Returns
Parameters
project(I) The Project to activate
active(O) The activation status
TCCORE_API int PROJ_is_user_a_member ( tag_t  project,
tag_t  user,
logical answer 
)

Checks if a given user is a regular Project member (non-privileged member) of a given Project.

Returns
  • ITK_ok on success, or if NULLTAG is provided for both parameters (in which case answer is false).
  • POM_invalid_tag if any of project or user is invalid.
Parameters
project(I) The Project
user(I) The user
answer(O) Indicates if the user is a member of the Project
TCCORE_API int PROJ_is_user_a_privileged_member ( tag_t  project,
tag_t  user,
logical answer 
)

Asks if a given user is a regular Project member (non-privileged member) of a given Project.

Returns
  • ITK_ok on success, or if NULLTAG is provided for both parameters (in which case answer is false).
  • POM_invalid_tag if any of project or user is invalid.
Parameters
project(I) A Project tag
user(I) A user tag
answer(O) Flag indicating if a a given userTag is a privileged member (a Project author, a Project administrator, or a Project team administrator) of a given Project
TCCORE_API int PROJ_remove_author_members ( tag_t  project,
int  author_count,
tag_t authors 
)

Removes Project authors (privileged users that can add/remove objects to/from a Project) from a Project.

Returns
Parameters
project(I) A Project tag that the given users will be added as members
author_count(I) Number of authors to add
authors(I) author_count List of authors on the Project
TCCORE_API int PROJ_remove_members ( tag_t  project,
int  user_count,
tag_t users_groups_groupmembers 
)

Removes members from a Project.

Returns
Parameters
project(I) A Project tag that the given users will be removed
user_count(I) Number of members to be removed
users_groups_groupmembers(I) user_count List of Users/Groups/GroupMembers that are to be added as members of the given Project
TCCORE_API int PROJ_remove_objects ( int  project_count,
tag_t projects,
int  object_count,
tag_t objects 
)

Removes objects from the specified projects.

Returns
Parameters
project_count(I) Number of the Project
projects(I) Projects to be removed
object_count(I) Number of the objects
objects(I) object_count Objects to remove from Projects