public interface OsidObjectForm extends OsidIdentifiableForm, OsidExtensibleForm, OsidBrowsableForm
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);
Modifier and Type | Method and Description |
---|---|
void |
clearDescription()
Clears the description.
|
void |
clearDisplayName()
Clears the display name.
|
void |
clearGenusType()
Clears the genus type.
|
Metadata |
getDescriptionMetadata()
Gets the metadata for a description.
|
Metadata |
getDisplayNameMetadata()
Gets the metadata for a display name.
|
Metadata |
getGenusTypeMetadata()
Gets the metadata for a genus type.
|
void |
setDescription(java.lang.String description)
Sets a description.
|
void |
setDisplayName(java.lang.String displayName)
Sets a display name.
|
void |
setGenusType(Type genusType)
Sets a genus.
|
getRequiredRecordTypes
getRecordTypes, hasRecordType
getDefaultLocale, getInvalidMetadata, getJournalCommentMetadata, getLocales, getValidationMessages, isForUpdate, isValid, setJournalComment, setLocale
getId, isCurrent
Metadata getDisplayNameMetadata()
mandatory
- This method must be implemented. void setDisplayName(java.lang.String displayName)
displayName
- the new display nameInvalidArgumentException
- displayName
is invalidNoAccessException
- Metadata.isReadonly()
is true
NullArgumentException
- displayName
is
null
mandatory
- This method must be implemented. void clearDisplayName()
NoAccessException
- Metadata.isRequired()
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. Metadata getDescriptionMetadata()
mandatory
- This method must be implemented. void setDescription(java.lang.String description)
description
- the new descriptionInvalidArgumentException
- description
is invalidNoAccessException
- Metadata.isReadonly()
is true
NullArgumentException
- description
is
null
mandatory
- This method must be implemented. void clearDescription()
NoAccessException
- Metadata.isRequired()
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. Metadata getGenusTypeMetadata()
mandatory
- This method must be implemented. void setGenusType(Type genusType)
genusType
- the new genusInvalidArgumentException
- genusType
is
invalidNoAccessException
- Metadata.isReadonly()
is true
NullArgumentException
- genusType
is
null
mandatory
- This method must be implemented. void clearGenusType()
NoAccessException
- Metadata.isRequired()
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented.