public interface OntologyAdminSession extends OsidSession
This session creates, updates, and deletes Ontologies.
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
Ontology, an OntologyForm is requested using
getOntologyFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned OntologyForm 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 OntologyForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
OntologyForm corresponds to an attempted transaction.
For updates, OntologyForms are requested to the
Ontology Id that is to be updated using
getOntologyFormForUpdate(). Similarly, the OntologyForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The OntologyForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Ontologies.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasOntology(Id ontologyId,
Id aliasId)
Adds an
Id to an Ontology for the
purpose of creating compatibility. |
boolean |
canCreateOntologies()
Tests if this user can create
Ontologies. |
boolean |
canCreateOntologyWithRecordTypes(Type[] ontologyRecordTypes)
Tests if this user can create a single
Ontology using
the desired record types. |
boolean |
canDeleteOntologies()
Tests if this user can delete ontologies.
|
boolean |
canManageOntologyAliases()
Tests if this user can manage
Id aliases for
ontologies. |
boolean |
canUpdateOntologies()
Tests if this user can update
Ontologies. |
OntologyForm |
createOntology(OntologyForm ontologyForm)
Creates a new
Ontology. |
void |
deleteOntology(Id ontologyId)
Deletes an
Ontology. |
OntologyForm |
getOntologyFormForCreate(Type[] ontologyRecordTypes)
Gets the ontology form for creating new ontologies.
|
OntologyForm |
getOntologyFormForUpdate(Id ontologyId)
Gets the ontology form for updating an existing ontology.
|
void |
updateOntology(OntologyForm ontologyForm)
Updates an existing ontology.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateOntologies()
Ontologies. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Ontology 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 Ontology creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateOntologyWithRecordTypes(Type[] ontologyRecordTypes)
Ontology using
the desired record types. While
OntologyManager.getOntologyRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Ontology.
Providing an empty array tests if an Ontology can be
created with no records.ontologyRecordTypes - array of ontology record types true if Ontology creation using
the specified Types is supported, false
otherwiseNullArgumentException - ontologyRecordTypes
is null mandatory - This method must be implemented. OntologyForm getOntologyFormForCreate(Type[] ontologyRecordTypes) throws OperationFailedException, PermissionDeniedException
ontologyRecordTypes - array of ontology record typesNullArgumentException - ontologyRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. OntologyForm createOntology(OntologyForm ontologyForm) throws OperationFailedException, PermissionDeniedException
Ontology. ontologyForm - the form for this Ontology Ontology IllegalStateException - ontologyForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - ontologyForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - ontologyForm did
not originate from getOntologyFormForCreate() mandatory - This method must be implemented. boolean canUpdateOntologies()
Ontologies. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Ontology 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 Ontology modification
is not authorized, true otherwisemandatory - This method must be implemented. OntologyForm getOntologyFormForUpdate(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id of the Ontology
NotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateOntology(OntologyForm ontologyForm) throws OperationFailedException, PermissionDeniedException
ontologyForm - the form containing the elements to be updatedIllegalStateException - ontologyForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - ontologyForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - ontologyForm did
not originate from getOntologyFormForUpdate() mandatory - This method must be implemented. boolean canDeleteOntologies()
Ontology 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 Ontology deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteOntology(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ontology. ontologyId - the Id of the Ontology
to removeNotFoundException - ontologyId not foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageOntologyAliases()
Id aliases for
ontologies. 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 Ontology aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasOntology(Id ontologyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Ontology for the
purpose of creating compatibility. The primary Id of
the Ontology is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another ontology, it is
reassigned to the given ontology Id. ontologyId - the Id of an Ontology aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - ontologyId not foundNullArgumentException - ontologyId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.