Interface IdiomBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, IdiomAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Idioms 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 an
Idiom , an IdiomForm is requested using
getIdiomFormsForCreate() specifying the desired texts and record
Types or none if no record Typ es are needed. Each of the
retur ned IdiomForms 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 an IdiomForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each IdiomForm corresponds to an
attempted transac tion .
The Idiom Forms returned from getIdiomFormsForCreate() may
be linked to the originating request through the peer Ids of the
IdiomForm . In the case where there may be duplicates, a ny
IdiomForm of the same peer Ids may be used for a create operation.
Once a batch of IdiomForms are submitted for create, a
CreateResponse is returned for each IdiomForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createIdioms() , errors specific to an
individual IdiomForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
IdiomForm through the IdiomForm Id .
For updates, IdiomForms are re quested to the Idiom I
d that is to be updated using getIdiomFormsForUpdate()
where the reference Id in the IdiomForm may be used to link the request.
Similarly, the IdiomForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The IdiomForm
can only be used once for a successful update and cannot be reused.
Once a batch of IdiomForms are submitted for update, an Up
dateResponse is returned for each IdiomForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateIdioms() , errors specific to an
individual IdiomForm are indicated in the corresponding
UpdateResponse . Up dateResponses may be linked to the
originating IdiomForm through the IdiomForm Id .
The delete operations delete Idio ms in bulk. To unmap an
Idiom from the current Press , the
IdiomPressAssignmentSession should be used. These delete operations
attempt to remove the Idiom itself thus removing it from all known
Press catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasIdioms(AliasRequestList aliasRequests) Adds anIdto anIdiomfor the purpose of creating compatibility.createIdioms(IdiomBatchFormList IdiomForms) Creates a new set ofIdioms.Deletes allIdiomsin thisPress.deleteIdioms(IdList IdiomIds) Deletes idioms for the givenIds.getIdiomFormsForCreate(IdList textIds, Type[] IdiomRecordTypes) Gets the idioms forms for creating a bunch of new idioms.getIdiomFormsForUpdate(IdList IdiomIds) Gets the idiom forms for updating an existing set of idioms.updateIdioms(IdiomBatchFormList IdiomForms) Updates existing idioms.Methods inherited from interface IdiomAdminSession
aliasIdiom, canCreateIdioms, canCreateIdiomWithRecordTypes, canDeleteIdioms, canManageIdiomAliases, canUpdateIdioms, createIdiom, deleteIdiom, getIdiomFormForCreate, getIdiomFormForUpdate, getPress, getPressId, updateIdiomModifier and TypeMethodDescriptionvoidaliasIdiom(Id idiomId, Id aliasId) Adds anIdto anIdiomfor the purpose of creating compatibility.booleanTests if this user can createIdioms.booleancanCreateIdiomWithRecordTypes(Type[] idiomRecordTypes) Tests if this user can create a singleIdiomusing the desired record types.booleanTests if this user can deleteIdioms.booleanTests if this user can manageIdaliases forIdioms.booleanTests if this user can updateIdioms.createIdiom(IdiomForm idiomForm) Creates a newIdiom.voiddeleteIdiom(Id idiomId) Deletes anIdiom.getIdiomFormForCreate(Id textId, Type[] idiomRecordTypes) Gets the idiom form for creating new idioms.getIdiomFormForUpdate(Id idiomId) Gets the idiom form for updating an existing idiom.getPress()Gets thePressassociated with this session.Gets thePressIdassociated with this session.voidupdateIdiom(IdiomForm idiomForm) Updates an existing idiom.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
-
getIdiomFormsForCreate
IdiomBatchFormList getIdiomFormsForCreate(IdList textIds, Type[] IdiomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the idioms forms for creating a bunch of new idioms. A new form is returned for each supplied textId.- Parameters:
textIds- a list of textIdsIdiomRecordTypes- array of idiom record types to be included in each create operation or an empty list if none- Returns:
- the idiom forms
- Throws:
NotFoundException- atextIdis not foundNullArgumentException-textIdsorIdiomRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createIdioms
CreateResponseList createIdioms(IdiomBatchFormList IdiomForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofIdioms. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
IdiomForms- the idiom forms- Returns:
- the create responses
- Throws:
NullArgumentException-IdiomFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getIdiomFormsForUpdate
IdiomBatchFormList getIdiomFormsForUpdate(IdList IdiomIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the idiom forms for updating an existing set of idioms. A new idiom form should be requested for each update transaction.- Parameters:
IdiomIds- theIdsof theIdiom- Returns:
- the idiom form
- Throws:
NotFoundException- anIdiomIdis not foundNullArgumentException-IdiomIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateIdioms
UpdateResponseList updateIdioms(IdiomBatchFormList IdiomForms) throws OperationFailedException, PermissionDeniedException Updates existing idioms. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
IdiomForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-IdiomFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllIdioms
Deletes allIdiomsin thisPress.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIdioms
DeleteResponseList deleteIdioms(IdList IdiomIds) throws OperationFailedException, PermissionDeniedException Deletes idioms for the givenIds.- Parameters:
IdiomIds- theIdsof the idioms to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-IdiomIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasIdioms
AliasResponseList aliasIdioms(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anIdiomfor the purpose of creating compatibility. The primaryIdof the Idiom is determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another idiom, it is reassigned to the given idiomId.- 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.
-