OSID Logo
OSID Specifications
osid package
Version 3.0.0
Release Candidate Preview
Interfaceosid.OsidObjectForm
Implementsosid.OsidIdentifiableForm
osid.OsidExtensibleForm
osid.OsidBrowsableForm
Description

The OsidObjectForm is used to create and update OsidObjects. The form is not an OsidObject but merely a container for data to be sent to an update or create method of a session. A provider may or may not combine the OsidObject and OsidObjectForm interfaces into a single object.

Generally, a set method parallels each get method of an OsidObject. Additionally, Metadata may be examined for each data element to assist in understanding particular rules concerning acceptable data.

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.

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);
                     
                                 
                     
                
MethodgetDisplayNameMetadata
Description

Gets the metadata for a display name.

Returnosid.Metadatametadata for the display name
CompliancemandatoryThis method must be implemented.
MethodsetDisplayName
Description

Sets a display name. A display name is required and if not set, will be set by the provider.

ParametersstringdisplayNamethe new display name
ErrorsINVALID_ARGUMENT displayName is invalid
NO_ACCESS Metadata.isReadonly() is true
NULL_ARGUMENT displayName is null
CompliancemandatoryThis method must be implemented.
MethodclearDisplayName
Description

Clears the display name.

ErrorsNO_ACCESS Metadata.isRequired() or Metadata.isReadOnly() is true
CompliancemandatoryThis method must be implemented.
MethodgetDescriptionMetadata
Description

Gets the metadata for a description.

Returnosid.Metadatametadata for the description
CompliancemandatoryThis method must be implemented.
MethodsetDescription
Description

Sets a description.

Parametersstringdescriptionthe new description
ErrorsINVALID_ARGUMENT description is invalid
NO_ACCESS Metadata.isReadonly() is true
NULL_ARGUMENT description is null
CompliancemandatoryThis method must be implemented.
MethodclearDescription
Description

Clears the description.

ErrorsNO_ACCESS Metadata.isRequired() or Metadata.isReadOnly() is true
CompliancemandatoryThis method must be implemented.
MethodgetGenusTypeMetadata
Description

Gets the metadata for a genus type.

Returnosid.Metadatametadata for the genus
CompliancemandatoryThis method must be implemented.
MethodsetGenusType
Description

Sets a genus. A genus cannot be cleared because all objects have at minimum a root genus.

Parametersosid.type.TypegenusTypethe new genus
ErrorsINVALID_ARGUMENT genusType is invalid
NO_ACCESS Metadata.isReadonly() is true
NULL_ARGUMENT genusType is null
CompliancemandatoryThis method must be implemented.
MethodclearGenusType
Description

Clears the genus type.

ErrorsNO_ACCESS Metadata.isRequired() or Metadata.isReadOnly() is true
CompliancemandatoryThis method must be implemented.