OSID Logo
OSID Specifications
lexicon package
Version 3.1.0
Interfaceosid.lexicon.TextAdminSession
Implementsosid.OsidSession
Implemented Byosid.lexicon.batch.TextBatchAdminSession
Used Byosid.lexicon.LexiconManager
osid.lexicon.LexiconProxyManager
Description

This session creates, updates, and deletes Texts. 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 Text, a TextForm is requested using getTextFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned TextForm 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 TextForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each TextForm corresponds to an attempted transidiom.

For updates, TextForms are requested to the Text Id that is to be updated using getTextFormForUpdate(). Similarly, the TextForm has metadata about the data that can be updated and it can perform validation before submitting the update. The TextForm can only be used once for a successful update and cannot be reused.

The delete operations delete Texts. To unmap a Text from the current Press, the TextPressAssignmentSession should be used. These delete operations attempt to remove the Text 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.

MethodgetPressId
Description

Gets the Press Id associated with this session.

Returnosid.id.Id the Press Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetPress
Description

Gets the Press associated with this session.

Returnosid.lexicon.Press the press
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateTexts
Description

Tests if this user can create Texts. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Text will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Text creation is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateTextWithRecordTypes
Description

Tests if this user can create a single Text using the desired record types. While LexiconManager.getTextRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Text. Providing an empty array tests if a Text can be created with no records.

Parametersosid.type.Type[]textRecordTypes array of text record types
Returnboolean true if Text creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT textRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetTextFormForCreate
Description

Gets the text form for creating new texts. A new form should be requested for each create transidiom.

Parametersosid.type.Type[]textRecordTypes array of text record types
Returnosid.lexicon.TextForm the text form
ErrorsNULL_ARGUMENT textRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateText
Description

Creates a new Text.

Parametersosid.lexicon.TextFormtextForm the form for this Text
Returnosid.lexicon.Text the new Text
ErrorsILLEGAL_STATE textForm already used in a create transidiom
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT textForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED textForm did not originate from getTextFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateTexts
Description

Tests if this user can update Texts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Text will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Text modification is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetTextFormForUpdate
Description

Gets the text form for updating an existing text. A new text form should be requested for each update transidiom.

Parametersosid.id.IdtextId the Id of the Text
Returnosid.lexicon.TextForm the text form
ErrorsNOT_FOUND textId is not found
NULL_ARGUMENT textId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateText
Description

Updates an existing text.

Parametersosid.lexicon.TextFormtextForm the form containing the elements to be updated
ErrorsILLEGAL_STATE textForm already used in an update transatcion
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT textForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED textForm did not originate from getTextFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteTexts
Description

Tests if this user can delete Texts. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Text will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Text deletion is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethoddeleteText
Description

Deletes a Text.

Parametersosid.id.IdtextId the Id of the Text to remove
ErrorsNOT_FOUND textId not found
NULL_ARGUMENT textId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageTextAliases
Description

Tests if this user can manage Id aliases for Texts. 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.

Returnboolean false if Text aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasText
Description

Adds an Id to a Text for the purpose of creating compatibility. The primary Id of the Text is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another text, it is reassigned to the given text Id.

Parametersosid.id.IdtextId the Id of a Text
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND textId not found
NULL_ARGUMENT textId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.