|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentType
Describes a type of document in the repository.
A document type has some general properties like a name (which must
be unique), and a locale-sensitive label and description. Next to these,
a DocumentType is associated with a number of FieldType
s
and PartType
s.
The PartTypes and FieldTypes belonging to a DocumentType are ordered collections: the order in which you add them matters. To reorder them, first remove them all and re-add them.
A DocumentType object can be read-only, in which case all state-modifying methods (i.e. all setters and the save method) will throw a RuntimeException. Whether a DocumentType object is read-only or not depends on where you retrieved it from. The purpose of read-only DocumentType objects is for caching, i.e. the same object can be used by multiple users who only which to consult the DocumentType information, but not modify it.
Method Summary | |
---|---|
void |
addFieldType(FieldType type,
boolean required)
The suplied FieldType should already exist in the repository, i.e. |
void |
addPartType(PartType partType,
boolean required)
Adds a new PartType to this DocumentType. |
void |
clearDescriptions()
|
void |
clearFieldTypeUses()
|
void |
clearLabels()
|
void |
clearPartTypeUses()
Removes all PartTypes. |
java.lang.String |
getDescription(java.util.Locale locale)
|
java.lang.String |
getDescriptionExact(java.util.Locale locale)
|
java.util.Locale[] |
getDescriptionLocales()
Returns the locales for which a description is set. |
org.outerx.daisy.x10.DocumentTypeDocument |
getExtendedXml()
Same as getXml() but includes the XML description of the used
Part Types and Field Types in the generated XML. |
FieldTypeUse |
getFieldTypeUse(long id)
|
FieldTypeUse[] |
getFieldTypeUses()
|
long |
getId()
|
java.lang.String |
getLabel(java.util.Locale locale)
Gets the label in the given locale, using the usual locale fallback mechanisms if not found in the exactly specified locale, and finally returning the documenttype's name if no label is available. |
java.lang.String |
getLabelExact(java.util.Locale locale)
|
java.util.Locale[] |
getLabelLocales()
|
java.util.Date |
getLastModified()
When was this DocumentType last changed (persistently). |
long |
getLastModifier()
Who (which user) last changed this DocumentType (persistently). |
java.lang.String |
getName()
|
PartTypeUse |
getPartTypeUse(long id)
|
PartTypeUse[] |
getPartTypeUses()
Returns the PartTypes contained by this DocumentType. |
long |
getUpdateCount()
|
org.outerx.daisy.x10.DocumentTypeDocument |
getXml()
|
boolean |
hasFieldType(long id)
|
boolean |
hasPartType(long id)
Checks if this DocumentType contains the PartType with the given ID. |
boolean |
isDeprecated()
|
void |
save()
|
void |
setAllFromXml(org.outerx.daisy.x10.DocumentTypeDocument.DocumentType documentTypeXml)
|
void |
setDeprecated(boolean deprecated)
|
void |
setDescription(java.util.Locale locale,
java.lang.String description)
|
void |
setLabel(java.util.Locale locale,
java.lang.String label)
|
void |
setName(java.lang.String name)
|
Method Detail |
---|
long getId()
PartTypeUse[] getPartTypeUses()
void addPartType(PartType partType, boolean required)
The supplied PartType should already exist in the repository, i.e. it should have an id != -1.
The same PartType can be added only once.
A PartType is always added to the end, after the already existing PartTypes.
java.lang.IllegalArgumentException
- if the partType's id is -1, or if
it is already contained by this DocumentType.void clearPartTypeUses()
boolean hasPartType(long id)
PartTypeUse getPartTypeUse(long id)
FieldTypeUse[] getFieldTypeUses()
boolean hasFieldType(long id)
FieldTypeUse getFieldTypeUse(long id)
void addFieldType(FieldType type, boolean required)
A FieldType is always added to the end, after the already existing FieldTypes.
The same PartType can only be added once.
void clearFieldTypeUses()
java.lang.String getName()
void setName(java.lang.String name)
java.lang.String getDescription(java.util.Locale locale)
java.lang.String getDescriptionExact(java.util.Locale locale)
void setDescription(java.util.Locale locale, java.lang.String description)
description
- if null, the description for this locale will be removed.void clearDescriptions()
java.util.Locale[] getDescriptionLocales()
void setLabel(java.util.Locale locale, java.lang.String label)
label
- if null, the label for this locale will be removed.java.lang.String getLabel(java.util.Locale locale)
java.lang.String getLabelExact(java.util.Locale locale)
void clearLabels()
java.util.Locale[] getLabelLocales()
boolean isDeprecated()
void setDeprecated(boolean deprecated)
java.util.Date getLastModified()
long getLastModifier()
org.outerx.daisy.x10.DocumentTypeDocument getXml()
org.outerx.daisy.x10.DocumentTypeDocument getExtendedXml()
getXml()
but includes the XML description of the used
Part Types and Field Types in the generated XML.
void setAllFromXml(org.outerx.daisy.x10.DocumentTypeDocument.DocumentType documentTypeXml)
void save() throws RepositoryException
RepositoryException
long getUpdateCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |