public interface CatalogueAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasCatalogue(Id catalogueId,
Id aliasId)
Adds an
Id to a Catalogue for the
purpose of creating compatibility. |
boolean |
canCreateCatalogues()
Tests if this user can create
Catalogues. |
boolean |
canCreateCatalogueWithRecordTypes(Type[] catalogueRecordTypes)
Tests if this user can create a single
Catalogue using
the desired record types. |
boolean |
canDeleteCatalogues()
Tests if this user can delete
Catalogues A return of
true does not guarantee successful authorization. |
boolean |
canManageCatalogueAliases()
Tests if this user can manage
Id aliases for
Catalogues. |
boolean |
canUpdateCatalogues()
Tests if this user can update
Catalogues. |
Catalogue |
createCatalogue(CatalogueForm catalogueForm)
Creates a new
Catalogue. |
void |
deleteCatalogue(Id catalogueId)
Deletes a
Catalogue. |
CatalogueForm |
getCatalogueFormForCreate(Type[] catalogueRecordTypes)
Gets the catalogue form for creating new catalogues.
|
CatalogueForm |
getCatalogueFormForUpdate(Id catalogueId)
Gets the catalogue form for updating an existing catalogue.
|
void |
updateCatalogue(CatalogueForm catalogueForm)
Updates an existing catalogue.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateCatalogues()
Catalogues. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Catalogue will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Catalogue creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCatalogueWithRecordTypes(Type[] catalogueRecordTypes)
Catalogue using
the desired record types. While
OfferingManager.getCatalogueRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Catalogue.
Providing an empty array tests if a Catalogue can be
created with no records.catalogueRecordTypes - array of types true if Catalogue creation using
the specified record Types is supported,
false otherwiseNullArgumentException - catalogueRecordTypes
is null mandatory - This method must be implemented. CatalogueForm getCatalogueFormForCreate(Type[] catalogueRecordTypes) throws OperationFailedException, PermissionDeniedException
catalogueRecordTypes - array of typesNullArgumentException - catalogueRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - cannot get form for requested
record typesmandatory - This method must be implemented. Catalogue createCatalogue(CatalogueForm catalogueForm) throws OperationFailedException, PermissionDeniedException
Catalogue. catalogueForm - the form for this Catalogue Catalogue IllegalStateException - catalogueForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - catalogueForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - catalogueForm did
not originate from getCatalogueFormForCreate() mandatory - This method must be implemented. boolean canUpdateCatalogues()
Catalogues. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Catalogue will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Catalogue modification
is not authorized, true otherwisemandatory - This method must be implemented. CatalogueForm getCatalogueFormForUpdate(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
catalogueId - the Id of the Catalogue
NotFoundException - catalogueId is not
foundNullArgumentException - catalogueId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateCatalogue(CatalogueForm catalogueForm) throws OperationFailedException, PermissionDeniedException
catalogueForm - the form containing the elements to be updatedIllegalStateException - catalogueForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - catalogueForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - catalogueForm did not
originate from getCataloguetFormForUpdate() mandatory - This method must be implemented. boolean canDeleteCatalogues()
Catalogues A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Catalogue will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false if Catalogue deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteCatalogue(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Catalogue. catalogueId - the Id of the Catalogue
to removeNotFoundException - catalogueId not
foundNullArgumentException - catalogueId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCatalogueAliases()
Id aliases for
Catalogues. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Catalogue aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasCatalogue(Id catalogueId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Catalogue for the
purpose of creating compatibility. The primary Id of
the Item is determined by the provider. The new
Id is an alias to the primary Id. If the alias
is a pointer to another catalogue, it is reassigned to the given
catalogue Id. catalogueId - the Id of a Catalogue
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - catalogueId not
foundNullArgumentException - catalogueId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.