Interface CompetencyBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CompetencyAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Competencies in
bulk. The data for create and update is provided by the consumer via the
form object. OsidForms are requested for each create or update and
may not be reused.
Create and update operations differ in their usage. To create a
Competency , a CompetencyForm is requested using
getCompetencyFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
CompetencyForms will indicate that it is to be used with a create
operation and can be used to examine metdata or validate data prior to
creation. Once a CompetencyForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CompetencyForm corresponds
to an attempted transaction.
The CompetencyForms returned from
getCompetencyFormsForCreate() may be linked to the originating request
through the peer Ids of the CompetencyForm . In the case
where there may be duplicates, any CompetencyForm of the same peer
Ids may be used for a create operation.
Once a batch of CompetencyForms are submitted for create, a
CreateResponse is returned for each CompetencyForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCompetencies() ,
errors specific to an individual CompetencyForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CompetencyForm through the
CompetencyForm Id .
For updates, CompetencyForms are requested to the
Competency Id that is to be updated using
getCompetencyFormsForUpdate() where the reference Id in the
CompetencyForm may be used to link the request. Similarly, the
CompetencyForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
CompetencyForm can only be used once for a successful update and cannot
be reused.
Once a batch of CompetencyForms are submitted for update, an
UpdateResponse is returned for each CompetencyForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCompetencies() ,
errors specific to an individual CompetencyForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CompetencyForm through the
CompetencyForm Id .
The delete operations delete Competencies in bulk. To unmap a
Competency from the current Foundry , the
CompetencyFoundryAssignmentSession should be used. These delete
operations attempt to remove the Competency itself thus removing
it from all known Foundry catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCompetencies(AliasRequestList aliasRequests) Adds anIdto aCompetencyfor the purpose of creating compatibility.createCompetencies(CompetencyBatchFormList competencyForms) Creates a new set ofCompetencies.Deletes allCompetenciesin thisFoundry.deleteCompetencies(IdList competencyIds) Deletes competencies for the givenIds.getCompetencyFormsForCreate(long number, Type[] competencyRecordTypes) Gets the competency forms for creating a bunch of new competencies.getCompetencyFormsForUpdate(IdList competencyIds) Gets the competency forms for updating an existing set of competencies.updateCompetencies(CompetencyBatchFormList competencyForms) Updates existing competencies.Methods inherited from interface CompetencyAdminSession
aliasCompetency, canCreateCompetency, canCreateCompetencyWithRecordTypes, canDeleteCompetencies, canManageCompetencyAliases, canUpdateCompetencies, createCompetency, deleteCompetency, getCompetencyFormForCreate, getCompetencyFormForUpdate, getJob, getJobId, updateCompetencyModifier and TypeMethodDescriptionvoidaliasCompetency(Id competencyId, Id aliasId) Adds anIdto aCompetencyfor the purpose of creating compatibility.booleanTests if this user can create competencies.booleancanCreateCompetencyWithRecordTypes(Type[] competencyRecordTypes) Tests if this user can create a singleCompetencyusing the desired record types.booleanTests if this user can delete competencies.booleanTests if this user can manageIdaliases for competencies.booleanTests if this user can update competencies.createCompetency(CompetencyForm competencyForm) Creates a newCompetency.voiddeleteCompetency(Id competencyId) Deletes aCompetency.getCompetencyFormForCreate(Type[] competencyRecordTypes) Gets the competency form for creating new competencies.getCompetencyFormForUpdate(Id competencyId) Gets the competency form for updating an existing competency.getJob()Gets theJobassociated with this session.getJobId()Gets theJobIdassociated with this session.voidupdateCompetency(CompetencyForm competencyForm) Updates an existing competency.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCompetencyFormsForCreate
CompetencyBatchFormList getCompetencyFormsForCreate(long number, Type[] competencyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the competency forms for creating a bunch of new competencies.- Parameters:
number- the number of forms to retrievecompetencyRecordTypes- array of competency record types to be included in each create operation or an empty list if none- Returns:
- the competency forms
- Throws:
NullArgumentException-competencyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCompetencies
CreateResponseList createCompetencies(CompetencyBatchFormList competencyForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCompetencies. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
competencyForms- the competency forms- Returns:
- the create responses
- Throws:
NullArgumentException-competencyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCompetencyFormsForUpdate
CompetencyBatchFormList getCompetencyFormsForUpdate(IdList competencyIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the competency forms for updating an existing set of competencies. A new competency form should be requested for each update transaction.- Parameters:
competencyIds- theIdsof theCompetency- Returns:
- the competency form
- Throws:
NotFoundException- acompetencyIdis not foundNullArgumentException-competencyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCompetencies
UpdateResponseList updateCompetencies(CompetencyBatchFormList competencyForms) throws OperationFailedException, PermissionDeniedException Updates existing competencies. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
competencyForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-competencyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCompetencies
DeleteResponseList deleteAllCompetencies() throws OperationFailedException, PermissionDeniedExceptionDeletes allCompetenciesin thisFoundry.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCompetencies
DeleteResponseList deleteCompetencies(IdList competencyIds) throws OperationFailedException, PermissionDeniedException Deletes competencies for the givenIds.- Parameters:
competencyIds- theIdsof the competencies to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-competencyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCompetencies
AliasResponseList aliasCompetencies(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCompetencyfor the purpose of creating compatibility. The primaryIdof theCompetencyis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another competency, it is reassigned to the given competencyId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-