public interface SubjectOntologyAssignmentSession extends OsidSession
This session provides methods to re-assign Subjects
to
Ontologies.
A Subject
may map to multiple
Ontologies
and removing the last reference to a
Subject
is the equivalent of deleting it. Each Ontology
may have its own authorizations governing who is allowed to
operate on it.
Adding a reference of a Subject
to another
Ontology
is not a copy operation (eg: does not change its
Id
).
Modifier and Type | Method and Description |
---|---|
void |
assignSubjectToOntology(Id subjectId,
Id ontologyId)
Adds an existing
Subject to an Ontology. |
boolean |
canAssignSubjects()
Tests if this user can alter subject/ontology mappings.
|
boolean |
canAssignSubjectsToOntology(Id ontologyId)
Tests if this user can alter subject/ontology mappings.
|
IdList |
getAssignableOntologyIds(Id ontologyId)
Gets a list of ontologies including and under the given ontology node
in which any subject can be assigned.
|
IdList |
getAssignableOntologyIdsForSubject(Id ontologyId,
Id subjectId)
Gets a list of ontologies including and under the given ontology node
in which a specific subject can be assigned.
|
void |
reassignSubjectToOntology(Id subjectId,
Id fromOntologyId,
Id toOntologyId)
Moves a
Subject from one Ontology to
another. |
void |
unassignSubjectFromOntology(Id subjectId,
Id ontologyId)
Removes a
Subject from an Ontology. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignSubjects()
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false
if mapping is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canAssignSubjectsToOntology(Id ontologyId)
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users.ontologyId
- the Id
of the Ontology
false
if mapping is not authorized, true
otherwiseNullArgumentException
- ontologyId
is
null
mandatory
- This method must be implemented. IdList getAssignableOntologyIds(Id ontologyId) throws OperationFailedException
ontologyId
- the Id
of the Ontology
Ids
NullArgumentException
- ontologyId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. IdList getAssignableOntologyIdsForSubject(Id ontologyId, Id subjectId) throws OperationFailedException
ontologyId
- the Id
of the Ontology
subjectId
- the Id
of the Subject
Ids
NullArgumentException
- ontologyId
or
subjectId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignSubjectToOntology(Id subjectId, Id ontologyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Subject
to an Ontology.
subjectId
- the Id
of the Subject
ontologyId
- the Id
of the Ontology
AlreadyExistsException
- subjectId
is
already assigned to ontologyId
NotFoundException
- subjectId
or
ontologyId
not foundNullArgumentException
- subjectId
or
ontologyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignSubjectFromOntology(Id subjectId, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Subject
from an Ontology.
subjectId
- the Id
of the Subject
ontologyId
- the Id
of the Ontology
NotFoundException
- subjectId
or
ontologyId
not found or subjectId
not
assigned to ontologyId
NullArgumentException
- subjectId
or
ontologyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void reassignSubjectToOntology(Id subjectId, Id fromOntologyId, Id toOntologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Subject
from one Ontology
to
another. Mappings to other Ontologies
are unaffected.subjectId
- the Id
of the Subject
fromOntologyId
- the Id
of the current
Ontology
toOntologyId
- the Id
of the destination
Ontology
NotFoundException
- subjectId, fromOntologyId,
or toOntologyId
not found or
subjectId
not mapped to fromOntologyId
NullArgumentException
- subjectId,
fromOntologyId,
or toOntologyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.