OSID Logo
OSID Specifications
osid package
Version 3.1.0
Interfaceosid.OsidForm
Implementsosid.Identifiable
osid.Suppliable
Implemented Byosid.OsidIdentifiableForm
osid.OsidExtensibleForm
osid.OsidBrowsableForm
osid.OsidTemporalForm
osid.OsidSubjugateableForm
osid.OsidAggregateableForm
osid.OsidContainableForm
osid.OsidSourceableForm
osid.OsidFederateableForm
osid.OsidOperableForm
osid.OsidCapsuleForm
osid.id.batch.IdBatchForm
osid.type.TypeForm
osid.rules.RuleForm
osid.id.IdForm
Description

The OsidForm is the vehicle used to create and update objects. The form is a container for data to be sent to an update or create method of a session. Applications should persist their own data until a form is successfully submitted in an update or create transaction.

The form may provide some feedback as to the validity of certain data updates before the update transaction is issued to the correspodning session but a successful modification of the form is not a guarantee of success for the update transaction. A consumer may elect to perform all updates within a single update transaction or break up a large update intio smaller units. The tradeoff is the granularity of error feedback vs. the performance gain of a single transaction.

OsidForms are Identifiable. The Id of the OsidForm is used to uniquely identify the update or create transaction and not that of the object being updated. Currently, it is not necessary to have these Ids persisted.

As with all aspects of the OSIDs, nulls cannot be used. Methods to clear values are also defined in the form.

A new OsidForm should be acquired for each transaction upon an OsidObject. Forms should not be reused from one object to another even if the supplied data is the same as the forms may encapsulate data specific to the object requested. Example of changing a display name and a color defined in a color interface extension:

ObjectForm form = session.getObjectFormForUpdate(objectId);
form.setDisplayName("new name");
ColorForm recordForm = form.getFormRecord(colorRecordType);
recordForm.setColor("green");
session.updateObject(objectId, form);
                
MethodisForUpdate
Description

Tests if this form is for an update operation.

Returnboolean true if this form is for an update operation, false if for a create operation
Compliancemandatory This method must be implemented.
MethodgetDefaultLocale
Description

Gets a default locale for the form.

Returnosid.locale.Locale the default locale
Compliancemandatory This method must be implemented.
MethodgetLocales
Description

Gets the locales available for this form.

Returnosid.locale.LocaleList list of available locales
Compliancemandatory This method must be implemented.
MethodsetLocale
Description

Specifies a language and script type for the form.

Parametersosid.type.TypelanguageType the language type
osid.type.TypescriptType the script type
ErrorsNULL_ARGUMENT languageType or scriptType is null
Compliancemandatory This method must be implemented.
MethodgetJournalCommentMetadata
Description

Gets the metadata for the comment corresponding to this form submission. The comment is used for describing the nature of the change to the corresponding object for the purposes of logging and auditing.

Returnosid.Metadata metadata for the comment
Compliancemandatory This method must be implemented.
MethodsetJournalComment
Description

Sets a comment.

Parametersstringcomment the new comment
ErrorsINVALID_ARGUMENT comment is invalid
NO_ACCESS Metadata.isReadonly() is true
NULL_ARGUMENT comment is null
Compliancemandatory This method must be implemented.
MethodisValid
Description

Tests if this form is in a valid state for submission. A form is valid if all required data has been supplied compliant with any constraints.

Returnboolean false if there is a known error in this form, true otherwise
ErrorsOPERATION_FAILED attempt to perform validation failed
Compliancemandatory This method must be implemented.
MethodgetValidationMessages
Description

Gets text messages corresponding to additional instructions to pass form validation.

Returnosid.locale.DisplayText[] a list of messages
Compliancemandatory This method must be implemented.
MethodgetInvalidMetadata
Description

Gets a list of metadata for the elements in this form which are not valid.

Returnosid.Metadata[] invalid metadata
Compliancemandatory This method must be implemented.