OSID Logo
OSID Specifications
lexicon package
Version 3.0.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.Idthe Press Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetPress
Description

Gets the Press associated with this session.

Returnosid.lexicon.Pressthe press
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Text creation is not authorized, true otherwise
CompliancemandatoryThis 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[]textRecordTypesarray of text record types
Returnbooleantrue if Text creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTtextRecordTypes is null
CompliancemandatoryThis 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[]textRecordTypesarray of text record types
Returnosid.lexicon.TextFormthe text form
ErrorsNULL_ARGUMENTtextRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateText
Description

Creates a new Text .

Parametersosid.lexicon.TextFormtextFormthe form for this Text
Returnosid.lexicon.Textthe new Text
ErrorsILLEGAL_STATEtextForm already used in a create transidiom
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTtextForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDtextForm did not originate from getTextFormForCreate()
CompliancemandatoryThis 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.

Returnbooleanfalse if Text modification is not authorized, true otherwise
CompliancemandatoryThis 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.IdtextIdthe Id of the Text
Returnosid.lexicon.TextFormthe text form
ErrorsNOT_FOUNDtextId is not found
NULL_ARGUMENTtextId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateText
Description

Updates an existing text.

Parametersosid.lexicon.TextFormtextFormthe form containing the elements to be updated
ErrorsILLEGAL_STATEtextForm already used in an update transatcion
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENTtextForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDtextForm did not originate from getTextFormForUpdate()
CompliancemandatoryThis 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.

Returnbooleanfalse if Text deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteText
Description

Deletes a Text .

Parametersosid.id.IdtextIdthe Id of the Text to remove
ErrorsNOT_FOUNDtextId not found
NULL_ARGUMENTtextId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Text aliasing is not authorized, true otherwise
CompliancemandatoryThis 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.IdtextIdthe Id of a Text
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTSaliasId is already assigned
NOT_FOUNDtextId not found
NULL_ARGUMENTtextId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.