Interface CatalogueBatchAdminSession
- All Superinterfaces:
AutoCloseable, CatalogueAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Catalogues 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
Catalogue , a CatalogueForm is requested using
getCatalogueFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
CatalogueForms 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 CatalogueForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each CatalogueForm corresponds to an
attempted transaction.
The CatalogueForms returned from
getCatalogueFormsForCreate() may be linked to the originating request
through the peer Ids of the CatalogueForm . In the case
where there may be duplicates, any CatalogueForm of the same peer
Ids may be used for a create operation.
Once a batch of CatalogueForms are submitted for create, a
CreateResponse is returned for each CatalogueForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCatalogues() ,
errors specific to an individual CatalogueForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CatalogueForm through the
CatalogueForm Id .
For updates, CatalogueForms are requested to the
Catalogue Id that is to be updated using
getCatalogueFormsForUpdate() where the reference Id in the
CatalogueForm may be used to link the request. Similarly, the
CatalogueForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The CatalogueForm
can only be used once for a successful update and cannot be reused.
Once a batch of CatalogueForms are submitted for update, an
UpdateResponse is returned for each CatalogueForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCatalogues() ,
errors specific to an individual CatalogueForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CatalogueForm through the
CatalogueForm Id .
The delete operations delete Catalogues in bulk. To unmap a
Catalogue from the current Calendar , the
CatalogueCalendarAssignmentSession should be used. These delete
operations attempt to remove the Catalogue itself thus removing it
from all known Calendar catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCatalogues(AliasRequestList aliasRequests) Adds anIdto aCataloguefor the purpose of creating compatibility.createCatalogues(CatalogueBatchFormList catalogueForms) Creates a new set ofCatalogues.Deletes allCataloguesin thisCalendar.deleteCatalogues(IdList catalogueIds) Deletes catalogues for the givenIds.getCatalogueFormsForCreate(long number, Type[] catalogueRecordTypes) Gets the catalogue forms for creating a bunch of new catalogues.getCatalogueFormsForUpdate(IdList catalogueIds) Gets the catalogue forms for updating an existing set of catalogues.updateCatalogues(CatalogueBatchFormList catalogueForms) Updates existing catalogues.Methods inherited from interface CatalogueAdminSession
aliasCatalogue, canCreateCatalogues, canCreateCatalogueWithRecordTypes, canDeleteCatalogues, canManageCatalogueAliases, canUpdateCatalogues, createCatalogue, deleteCatalogue, getCatalogueFormForCreate, getCatalogueFormForUpdate, updateCatalogueModifier and TypeMethodDescriptionvoidaliasCatalogue(Id catalogueId, Id aliasId) Adds anIdto aCataloguefor the purpose of creating compatibility.booleanTests if this user can createCatalogues.booleancanCreateCatalogueWithRecordTypes(Type[] catalogueRecordTypes) Tests if this user can create a singleCatalogueusing the desired record types.booleanTests if this user can deleteCataloguesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forCatalogues.booleanTests if this user can updateCatalogues.createCatalogue(CatalogueForm catalogueForm) Creates a newCatalogue.voiddeleteCatalogue(Id catalogueId) Deletes aCatalogue.getCatalogueFormForCreate(Type[] catalogueRecordTypes) Gets the catalogue form for creating new catalogues.getCatalogueFormForUpdate(Id catalogueId) Gets the catalogue form for updating an existing catalogue.voidupdateCatalogue(CatalogueForm catalogueForm) Updates an existing catalogue.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
-
getCatalogueFormsForCreate
CatalogueBatchFormList getCatalogueFormsForCreate(long number, Type[] catalogueRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the catalogue forms for creating a bunch of new catalogues.- Parameters:
number- the number of forms to retrievecatalogueRecordTypes- array of catalogue record types to be included in each create operation or an empty list if none- Returns:
- the catalogue forms
- Throws:
NullArgumentException-catalogueRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCatalogues
CreateResponseList createCatalogues(CatalogueBatchFormList catalogueForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCatalogues. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
catalogueForms- the catalogue forms- Returns:
- the create responses
- Throws:
NullArgumentException-catalogueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCatalogueFormsForUpdate
CatalogueBatchFormList getCatalogueFormsForUpdate(IdList catalogueIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the catalogue forms for updating an existing set of catalogues. A new catalogue form should be requested for each update transaction.- Parameters:
catalogueIds- theIdsof theCatalogue- Returns:
- the catalogue form
- Throws:
NotFoundException- acatalogueIdis not foundNullArgumentException-catalogueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCatalogues
UpdateResponseList updateCatalogues(CatalogueBatchFormList catalogueForms) throws OperationFailedException, PermissionDeniedException Updates existing catalogues. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
catalogueForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-catalogueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCatalogues
Deletes allCataloguesin thisCalendar.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCatalogues
DeleteResponseList deleteCatalogues(IdList catalogueIds) throws OperationFailedException, PermissionDeniedException Deletes catalogues for the givenIds.- Parameters:
catalogueIds- theIdsof the catalogues to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-catalogueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCatalogues
AliasResponseList aliasCatalogues(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCataloguefor the purpose of creating compatibility. The primaryIdof theCatalogueis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another catalogue, it is reassigned to the given catalogueId.- 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.
-