Interface CatalogueAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CatalogueBatchAdminSession
This session creates, updates, and deletes Catalogues . 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
getCatalogueFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
CatalogueForm 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 the 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.
For updates, CatalogueForms are requested to the
Catalogue Id that is to be updated using
getCatalogueFormForUpdate() . 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.
The delete operations delete Catalogues . It is safer to
remove all mappings to the Catalogue catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
canCreateCatalogues
boolean canCreateCatalogues()Tests if this user can createCatalogues. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCataloguewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifCataloguecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCatalogueWithRecordTypes
Tests if this user can create a singleCatalogueusing the desired record types. WhileOfferingManager.getCatalogueRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCatalogue. Providing an empty array tests if aCataloguecan be created with no records.- Parameters:
catalogueRecordTypes- array of types- Returns:
trueifCataloguecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-catalogueRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCatalogueFormForCreate
CatalogueForm getCatalogueFormForCreate(Type[] catalogueRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the catalogue form for creating new catalogues. A new form should be requested for each create transaction.- Parameters:
catalogueRecordTypes- array of types- Returns:
- the catalogue form
- Throws:
NullArgumentException-catalogueRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- cannot get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCatalogue
Catalogue createCatalogue(CatalogueForm catalogueForm) throws OperationFailedException, PermissionDeniedException Creates a newCatalogue.- Parameters:
catalogueForm- the form for thisCatalogue- Returns:
- the new
Catalogue - Throws:
IllegalStateException-catalogueFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-catalogueFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-catalogueFormdid not originate fromgetCatalogueFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCatalogues
boolean canUpdateCatalogues()Tests if this user can updateCatalogues. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCataloguewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifCataloguemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCatalogueFormForUpdate
CatalogueForm getCatalogueFormForUpdate(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the catalogue form for updating an existing catalogue. A new catalogue form should be requested for each update transaction.- Parameters:
catalogueId- theIdof theCatalogue- Returns:
- the catalogue form
- Throws:
NotFoundException-catalogueIdis not foundNullArgumentException-catalogueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCatalogue
void updateCatalogue(CatalogueForm catalogueForm) throws OperationFailedException, PermissionDeniedException Updates an existing catalogue.- Parameters:
catalogueForm- the form containing the elements to be updated- Throws:
IllegalStateException-catalogueFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-catalogueFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-catalogueForm did not originate from getCataloguetFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCatalogues
boolean canDeleteCatalogues()Tests if this user can deleteCataloguesA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCataloguewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifCataloguedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCatalogue
void deleteCatalogue(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCatalogue.- Parameters:
catalogueId- theIdof theCatalogueto remove- Throws:
NotFoundException-catalogueIdnot foundNullArgumentException-catalogueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCatalogueAliases
boolean canManageCatalogueAliases()Tests if this user can manageIdaliases forCatalogues. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCataloguealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCatalogue
void aliasCatalogue(Id catalogueId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCataloguefor the purpose of creating compatibility. The primaryIdof theItemis 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:
catalogueId- theIdof aCataloguealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-catalogueIdnot foundNullArgumentException-catalogueIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-