Interface IdiomAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
IdiomBatchAdminSession
This session creates, updates, and deletes Idioms . 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
Idiom , an IdiomForm is requested using
getIdiomFormForCreate() specifying the desired text and record
Types or none if no record Types are needed. The returned
IdiomForm 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 IdiomForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each IdiomForm corresponds to an attempted
transidiom.
For updates, IdiomForms are requested to the Idiom
Id that is to be updated using getIdiomFormForUpdate() .
Similarly, the IdiomForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
IdiomForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Idioms . To unmap an
Idiom from the current Press , the
IdiomPressAssignmentSession should be used. These delete operations
attempt to remove the Idiom itself thus removing it from all known
Press catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasIdiom(Id idiomId, Id aliasId) Adds anIdto anIdiomfor the purpose of creating compatibility.booleanTests if this user can createIdioms.booleancanCreateIdiomWithRecordTypes(Type[] idiomRecordTypes) Tests if this user can create a singleIdiomusing the desired record types.booleanTests if this user can deleteIdioms.booleanTests if this user can manageIdaliases forIdioms.booleanTests if this user can updateIdioms.createIdiom(IdiomForm idiomForm) Creates a newIdiom.voiddeleteIdiom(Id idiomId) Deletes anIdiom.getIdiomFormForCreate(Id textId, Type[] idiomRecordTypes) Gets the idiom form for creating new idioms.getIdiomFormForUpdate(Id idiomId) Gets the idiom form for updating an existing idiom.getPress()Gets thePressassociated with this session.Gets thePressIdassociated with this session.voidupdateIdiom(IdiomForm idiomForm) Updates an existing idiom.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
-
getPressId
Id getPressId()Gets thePressIdassociated with this session.- Returns:
- the
Press Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPress
Gets thePressassociated with this session.- Returns:
- the press
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateIdioms
boolean canCreateIdioms()Tests if this user can createIdioms. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anIdiomwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifIdiomcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateIdiomWithRecordTypes
Tests if this user can create a singleIdiomusing the desired record types. WhileLexiconManager.getIdiomRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificIdiom. Providing an empty array tests if anIdiomcan be created with no records.- Parameters:
idiomRecordTypes- array of idiom record types- Returns:
trueifIdiomcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-idiomRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getIdiomFormForCreate
IdiomForm getIdiomFormForCreate(Id textId, Type[] idiomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the idiom form for creating new idioms. A new form should be requested for each create transidiom.- Parameters:
textId- a textIdidiomRecordTypes- array of idiom record types- Returns:
- the idiom form
- Throws:
NotFoundException-textIdis not foundNullArgumentException-textIdoridiomRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createIdiom
Creates a newIdiom.- Parameters:
idiomForm- the form for thisIdiom- Returns:
- the new
Idiom - Throws:
IllegalStateException-idiomFormalready used in a create transidiomInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-idiomFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-idiomFormdid not originate fromgetIdiomFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateIdioms
boolean canUpdateIdioms()Tests if this user can updateIdioms. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anIdiomwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifIdiommodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getIdiomFormForUpdate
IdiomForm getIdiomFormForUpdate(Id idiomId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the idiom form for updating an existing idiom. A new idiom form should be requested for each update transidiom.- Parameters:
idiomId- theIdof theIdiom- Returns:
- the idiom form
- Throws:
NotFoundException-idiomIdis not foundNullArgumentException-idiomIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateIdiom
Updates an existing idiom.- Parameters:
idiomForm- the form containing the elements to be updated- Throws:
IllegalStateException-idiomFormalready used in an update transidiomInvalidArgumentException- the form contains an invalid valueNullArgumentException-idiomFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-idiomFormdid not originate fromgetIdiomFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteIdioms
boolean canDeleteIdioms()Tests if this user can deleteIdioms. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anIdiomwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifIdiomdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteIdiom
void deleteIdiom(Id idiomId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anIdiom.- Parameters:
idiomId- theIdof theIdiomto remove- Throws:
NotFoundException-idiomIdnot foundNullArgumentException-idiomIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageIdiomAliases
boolean canManageIdiomAliases()Tests if this user can manageIdaliases forIdioms. 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:
falseifIdiomaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasIdiom
void aliasIdiom(Id idiomId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anIdiomfor the purpose of creating compatibility. The primaryIdof theIdiomis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another idiom, it is reassigned to the given idiomId.- Parameters:
idiomId- theIdof anIdiomaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-idiomIdnot foundNullArgumentException-idiomIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-