public class MetadataTemplate extends BaseManager implements Item, java.lang.Iterable<MetadataTemplateEntry>
Modifier and Type | Class and Description |
---|---|
static interface |
MetadataTemplate.ChangeCallback |
BaseManager.PackEntryChangeListener, BaseManager.RegistryEntry
TYPE_EJP, TYPE_NATIVE
Modifier and Type | Method and Description |
---|---|
JPack |
exportSet()
Exports this set into a
JPack . |
void |
fill(Item item)
Fill this template with the field values of the given item.
|
java.lang.String |
getDescription(int languageID)
Returns the description for the given language id.
|
java.lang.String |
getDisplayName(int languageID,
boolean fallbackToDefaultName)
Returns the display name for the given language id.
|
java.lang.String |
getID()
Returns the UID of the item in the items namespace.
|
boolean |
getIsDefault()
Returns whether this is the default template.
|
MetadataTemplateEntryList |
getMetadataTemplateEntryList()
Returns the manager for the specific metadata template entries.
|
MetadataTemplateEntryList |
getMetadataTemplateEntryList(java.lang.String tableName)
Returns the manager for the specific metadata template entries for the given table.
|
MetadataTemplateTableList |
getMetadataTemplateTableList()
Returns the list if entries for tables other than the
Cumulus.TABLE_NAME_ASSET_RECORDS . |
java.lang.String |
getName()
Returns the name of this metadata template.
|
RestrictionsList |
getRestrictionsList()
Returns the list of roles and users that are allowed to view this set.
|
boolean |
isDefault()
Returns whether this item is the default item.
|
boolean |
isSharingRestricted()
Returns whether the set visibility is restricted to a group of users or roles.
|
java.util.Iterator<MetadataTemplateEntry> |
iterator() |
void |
processItem(Item item,
java.util.Set<GUID> restrictedFieldList,
boolean saveItem,
MetadataTemplate.ChangeCallback changeCallback)
Applies this template on the given item.
|
void |
setDescription(int languageID,
java.lang.String description)
Sets the description for the given language.
|
void |
setDisplayName(int languageID,
java.lang.String displayName)
Sets the display name for the given language.
|
void |
setSharingRestricted(boolean value)
Sets whether the set visibility is restricted to a group of users or roles.
|
java.lang.String |
toString()
Returns a XML representation of this class.
|
addChangeListener, addChangeListener, addGlobalChangeListener, addPackListener, forgetPush, getPack, isShared, popPack, pushPack, removeChangeListener, removeChangeListener, removeGlobalChangeListener, removePackListener, save, save, writeAsXML
public java.lang.String getName()
public boolean getIsDefault()
public java.lang.String getID()
Item
public boolean isDefault()
Item
public java.lang.String getDescription(int languageID)
getDescription
in interface Item
languageID
- specifying the language for the descriptionpublic void setDescription(int languageID, java.lang.String description)
setDescription
in interface Item
languageID
- the language to set the description fordescription
- the new descriptionpublic java.lang.String getDisplayName(int languageID, boolean fallbackToDefaultName)
getDisplayName
in interface Item
languageID
- specifying the language for the display namefallbackToDefaultName
- when set to true this method returns the default name when now localized display name is available otherwise nullpublic void setDisplayName(int languageID, java.lang.String displayName)
setDisplayName
in interface Item
languageID
- the language to set the display name fordisplayName
- the new display namepublic MetadataTemplateEntryList getMetadataTemplateEntryList(java.lang.String tableName)
public MetadataTemplateEntryList getMetadataTemplateEntryList()
public MetadataTemplateTableList getMetadataTemplateTableList()
Cumulus.TABLE_NAME_ASSET_RECORDS
.Cumulus.TABLE_NAME_ASSET_RECORDS
getMetadataTemplateEntryList()
public JPack exportSet()
JPack
.exportSet
in interface Item
JPack
MetadataTemplatesList.importSet(com.canto.cumulus.utils.JPack, SetImportDuplicatesMode)
public boolean isSharingRestricted()
isSharingRestricted
in interface Item
public void setSharingRestricted(boolean value)
setSharingRestricted
in interface Item
value
- set to true if the set visibility should be restricted to a group of users or rolespublic RestrictionsList getRestrictionsList()
isSharingRestricted()
returns
true.getRestrictionsList
in interface Item
public java.util.Iterator<MetadataTemplateEntry> iterator()
iterator
in interface java.lang.Iterable<MetadataTemplateEntry>
public java.lang.String toString()
BaseManager
toString
in class BaseManager
public void processItem(Item item, java.util.Set<GUID> restrictedFieldList, boolean saveItem, MetadataTemplate.ChangeCallback changeCallback) throws CumulusException
item
- item to changerestrictedFieldList
- list of fields, which are only allowed to be changed, or null
if all fields of this template should be processedsaveItem
- true
if the given item should be automatically be saved, false
otherwisechangeCallback
- optional callback to get notifications about changed field values, can be null
CumulusException
- in case of an unexpected errorpublic void fill(Item item)
item
- item providing the field values to use for this templatewww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.