public interface ResourceForm extends OsidObjectForm
This is the form for creating and updating Resources.
Like all OsidForm
objects, various data elements may be set
here for use in the create and update methods in the
ResourceAdminSession.
For each data element that may be set,
metadata may be examined to provide display hints or data constraints.
Resources can be designated as a group. The group metadata indicates if it is possible to convert a resource to a group and vice-versa.
Modifier and Type | Method and Description |
---|---|
void |
clearAvatar()
Clears the asset.
|
void |
clearGroup()
Clears the group designation.
|
Metadata |
getAvatarMetadata()
Gets the metadata for an asset.
|
Metadata |
getGroupMetadata()
Gets the metadata for a group.
|
ResourceFormRecord |
getResourceFormRecord(Type resourceRecordType)
Gets the
ResourceFormRecord corresponding to the given
Resource record Type. |
void |
setAvatar(Id assetId)
Sets the avatar asset.
|
void |
setGroup(boolean group)
Sets the resource as a group.
|
clearDescription, clearDisplayName, clearGenusType, getDescriptionMetadata, getDisplayNameMetadata, getGenusTypeMetadata, setDescription, setDisplayName, setGenusType
getRequiredRecordTypes
getRecordTypes, hasRecordType
getDefaultLocale, getInvalidMetadata, getJournalCommentMetadata, getLocales, getValidationMessages, isForUpdate, isValid, setJournalComment, setLocale
getId, isCurrent
Metadata getGroupMetadata()
mandatory
- This method must be implemented. void setGroup(boolean group)
group
- true
if this resource is a group,
false
otherwiseInvalidArgumentException
- group
is
invalidNoAccessException
- Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. void clearGroup()
NoAccessException
- Metadata.isRequired()
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. Metadata getAvatarMetadata()
mandatory
- This method must be implemented. void setAvatar(Id assetId)
assetId
- an asset Id
InvalidArgumentException
- assetId
is
invalidNoAccessException
- Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. void clearAvatar()
NoAccessException
- Metadata.isRequired()
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. ResourceFormRecord getResourceFormRecord(Type resourceRecordType) throws OperationFailedException
ResourceFormRecord
corresponding to the given
Resource
record Type.
resourceRecordType
- the resource record typeNullArgumentException
- resourceRecordType
is null
OperationFailedException
- unable to complete requestUnsupportedException
-
hasRecordType(resourceRecordType)
is false
mandatory
- This method must be implemented.