public class Item
extends java.lang.Object
RecordItem
and CategoryItem
which represent
records of the Cumulus.TABLE_NAME_ASSET_RECORDS
table and Cumulus.TABLE_NAME_CATEGORIES
table respectively. When getting an item of the
Cumulus.TABLE_NAME_ASSET_RECORDS
table you always get a RecordItem
object. When getting an item of the Cumulus.TABLE_NAME_CATEGORIES
table you always get a CategoryItem
object. For all other tables (sub-tables of the above two tables) you get a plain Item object.Modifier and Type | Method and Description |
---|---|
void |
applyPermissionTemplate(java.lang.String permissionTemplateID)
Sets the permissions stored in the permission template.
|
java.util.Set<java.lang.Integer> |
checkin(java.lang.String assetHandlingSet,
Asset assetLocal,
java.lang.String comment,
boolean keepCheckedOut,
boolean keepLocalAsset,
boolean removeDeletedSubAssetItems)
Check in a new version of the asset of this item from the given local asset.
|
java.util.Set<java.lang.Integer> |
checkin(java.lang.String assetHandlingSet,
java.lang.String comment,
boolean keepCheckedOut,
boolean keepLocalAsset,
boolean removeDeletedSubAssetItems)
Check in a new version of the asset of this item from the checkout location store din this item.
|
Asset |
checkout(Asset checkoutLocation)
Check out the asset referenced by this item (Specific Permissions Required).
|
void |
clearModifiedValue(GUID fieldUID)
Clear the changed value of the given field in this item reverting to the previous value.
|
void |
clearValue(GUID fieldUID)
Clear the value of the given field in this item.
|
Asset |
convertAsset(Asset destinationContainer,
GUID converterModuleUID,
java.lang.String converterParams)
Convert the asset of this item using a given asset processor module and parameter string.
|
java.util.List<Asset> |
copyAsset(Asset destinationContainer)
Copy the asset of this item to a different location.
|
void |
deleteItem()
Delete this item in the catalog.
|
void |
deleteItem(boolean deleteAsset)
Delete this item and optionally also the asset that is referenced by this item.
|
void |
deleteItem(boolean deleteAsset,
boolean deleteContainedItems)
Delete this item and optionally all contained items and optionally also the asset that is referenced by this item.
|
AssetCollection |
doAssetAction(Asset destinationAssetContainer,
java.lang.String assetAction)
Perform an asset action on the asset of this item.
|
AssetCollection |
doAssetAction(Asset destinationAssetContainer,
java.lang.String assetAction,
boolean returnCreatedAssets)
Perform an asset action on the asset of this item.
|
AssetCollection |
doAssetAction(Asset destinationAssetContainer,
java.lang.String assetAction,
boolean returnCreatedAssets,
java.util.Map<GUID,JPack> customParameters)
Perform an asset action on the asset of this item.
|
boolean |
equals(java.lang.Object o) |
AssetReference |
getAssetReferenceValue(GUID fieldUID)
Return the asset reference value for the given field.
|
AssetXRefFieldValue |
getAssetXRefValue(GUID fieldUID)
Return the asset reference value for the given field.
|
byte[] |
getBinaryValue(GUID fieldUID)
Return the binary value for the given field.
|
boolean |
getBooleanValue(GUID fieldUID)
Return the boolean value for the given field.
|
int |
getCatalogID()
Return the ID of the catalog of this item.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
DataSizeFieldValue |
getDataSizeValue(GUID fieldUID)
Return the data size value for the given field.
|
DateOnlyFieldValue |
getDateOnlyValue(GUID fieldUID)
Return the date only value for the given field.
|
java.util.Date |
getDateValue(GUID fieldUID)
Return the date value for the given field.
|
java.lang.String |
getDisplayString()
Return a string representation of this item using the current locale.
|
java.lang.String |
getDisplayString(int languageID)
Returns a string representation of this item for the given language.
|
java.lang.String |
getDisplayString(java.util.Locale locale)
Returns a string representation of this item for the given locale.
|
double |
getDoubleValue(GUID fieldUID)
Return the double value for the given field.
|
int |
getID()
Return the ID of this item.
|
int |
getIntValue(GUID fieldUID)
Return the integer value for the given field.
|
ItemCollection |
getItemCollection()
The item collection that this item is from.
|
ItemIdentifier |
getItemIdentifier()
Returns the
ItemIdentifier for this instance. |
LabelFieldValue |
getLabelValue(GUID fieldUID)
Return the label value for the given field.
|
LengthInInchFieldValue |
getLengthInInchValue(GUID fieldUID)
Return the length value for the given field.
|
long |
getLongValue(GUID fieldUID)
Return the long value for the given field.
|
Pixmap |
getPictureValue(GUID fieldUID)
Returns the pixmap instance for the specified field of type
FieldTypes.FieldTypePicture . |
RatingFieldValue |
getRatingValue(GUID fieldUID)
Return the rating value for the given field.
|
ResolutionFieldValue |
getResolutionValue(GUID fieldUID)
Return the resolution value for the given field.
|
StringEnumFieldValue |
getStringEnumValue(GUID fieldUID)
Return the string list value for the given field.
|
java.lang.String |
getStringValue(GUID fieldUID)
Return the string value for the given field.
|
java.lang.String |
getStringValue(GUID fieldUID,
int preferredLanguageID)
Return the string value for the given field.
|
ItemCollection |
getTableValue(GUID fieldUID)
Get the contents of a field of type "Table" which is an ItemCollection that contains all items of the sub-table belonging to this item.
|
TimeOnlyFieldValue |
getTimeOnlyValue(GUID fieldUID)
Return the time only value for the given field.
|
UserUIDFieldValue |
getUserUIDValue(GUID fieldUID)
Return the user unique ID value for the given field.
|
VocabularyFieldValue |
getVocabularyValue(GUID fieldUID)
Return the vocabulary value for the given field.
|
int |
hashCode() |
boolean |
hasValue(GUID fieldUID)
Return whether the given field has a value in this item.
|
boolean |
isCheckedOut()
Return whether the asset of this item is current checked out.
|
void |
logUsage(AssetUsage usage,
java.lang.String additionalInformation)
Log the given asset usage with this item.
|
boolean |
matchesQuery(java.lang.String query,
java.util.EnumSet<FindFlag> flags,
java.util.Locale locale)
Returns whether the this item matches the given query.
|
java.util.List<Asset> |
moveAsset(Asset destinationContainer)
Move the asset of this item to a different location.
|
java.lang.String |
renameAsset(java.lang.String newName,
boolean addNumberIfFileExists)
Rename the asset referenced by this item.
|
void |
rollback(int toVersion)
Revert this item's asset to an older version.
|
void |
save()
Save this item back to the catalog.
|
void |
save(java.lang.String assetHandlingSet)
Save this item back to the catalog.
|
void |
setAssetReferenceValue(GUID fieldUID,
AssetReference assetReference)
Modify the value of a asset reference field in this item.
|
void |
setAssetXRefValue(GUID fieldUID,
AssetXRefFieldValue assetXRefValue)
Modify the value of a asset cross references field in this item.
|
void |
setBinaryValue(GUID fieldUID,
byte[] value)
Modify the value of a binary, asset reference, asset cross references, picture, or audio field in this item.
|
void |
setBooleanValue(GUID fieldUID,
boolean value)
Modify the value of a boolean field in this item.
|
void |
setDataSizeValue(GUID fieldUID,
DataSizeFieldValue dataSizeFieldValue)
Modify the value of a data size field in this item.
|
void |
setDateOnlyValue(GUID fieldUID,
DateOnlyFieldValue dateOnlyFieldValue)
Modify the value of a date only field in this item.
|
void |
setDateValue(GUID fieldUID,
java.util.Date date)
Modify the value of a date field in this item.
|
void |
setDoubleValue(GUID fieldUID,
double value)
Modify the value of a double field in this item.
|
void |
setIntValue(GUID fieldUID,
int value)
Modify the value of a integer field in this item.
|
void |
setLabelValue(GUID fieldUID,
LabelFieldValue labelFieldValue)
Modify the value of a label field in this item.
|
void |
setLengthInInchValue(GUID fieldUID,
LengthInInchFieldValue lengthInInchFieldValue)
Modify the value of a length field in this item.
|
void |
setLongValue(GUID fieldUID,
long value)
Modify the value of a long field in this item.
|
void |
setPictureValue(GUID fieldUID,
Pixmap pixmap)
Modify the value of a picture field in this item.
|
void |
setRatingValue(GUID fieldUID,
RatingFieldValue ratingFieldValue)
Modify the value of a rating field in this item.
|
void |
setResolutionValue(GUID fieldUID,
ResolutionFieldValue resolutionFieldValue)
Modify the value of a resolution field in this item.
|
void |
setStringEnumValue(GUID fieldUID,
StringEnumFieldValue stringEnumFieldValue)
Modify the value of a string list field in this item.
|
void |
setStringValue(GUID fieldUID,
java.lang.String value)
Modify the value of a string field in this item.
|
void |
setTimeOnlyValue(GUID fieldUID,
TimeOnlyFieldValue timeOnlyFieldValue)
Modify the value of a time only field in this item.
|
void |
setVocabularyValue(GUID fieldUID,
VocabularyFieldValue vocabularyFieldValue)
Modify the value of a vocabulary field in this item.
|
java.lang.String |
toString()
Return a string representation of this item.
|
void |
undoCheckout(boolean keepLocalAsset)
Reverts a previously done "check in" operation (Specific Permissions Required).
|
java.util.Set<java.lang.Integer> |
update(java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
boolean always,
boolean includingSubAssets,
boolean removeDeletedSubAssetItems,
CatalogingListener<ItemCollection> catalogingListener)
Update this item according to changes made to the referenced asset.
|
java.util.Set<java.lang.Integer> |
update(java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
boolean always,
boolean includingSubAssets,
boolean removeDeletedSubAssetItems,
java.util.Set<GUID> fieldsToUpdate,
CatalogingListener<ItemCollection> catalogingListener)
Update this item according to changes made to the referenced asset.
|
void |
updateAsset(java.lang.String assetHandlingSet,
java.util.Set<GUID> fieldsToUpdate)
Update this item's asset with the current metadata of the item.
|
void |
updateAssetReference()
Update the asset reference to the asset for this item using the default asset handling set for this user.
|
void |
updateAssetReference(java.lang.String assetHandlingSet)
Update the asset reference to the asset for this item.
|
void |
updateFormulaFields(java.util.Set<GUID> fieldsToUpdate,
boolean updateRecordModificationDate)
Update the specified formula fields.
|
java.util.Map<GUID,java.lang.String> |
validate(java.util.Set<GUID> fieldsToCheck,
java.util.Locale locale)
Validates the current item content against the validators configured for this catalog.
|
public ItemCollection getItemCollection()
public CumulusSession getCumulusSession()
CumulusSession
object.CumulusSession
object.public int getID()
-1
.public int getCatalogID()
public ItemIdentifier getItemIdentifier()
ItemIdentifier
for this instance.ItemIdentifier
for this instancepublic void save() throws PermissionDeniedException, CumulusException
PermissionDeniedException
- If you do not have the necessary permission to perform this operation.CumulusException
- on other errors.public void save(java.lang.String assetHandlingSet) throws PermissionDeniedException, CumulusException
assetHandlingSet
- The name of the asset handling to use for saving. Pass null
or an empty string to let Cumulus use the default asset
handling set.PermissionDeniedException
- If you do not have the necessary permission to perform this operation.CumulusException
- on other errors.public void deleteItem() throws PermissionDeniedException, CumulusException
deleteItem(boolean)
.PermissionDeniedException
- If you do not have the necessary permission to perform this operation.CumulusException
- on other errors.deleteItem(boolean)
public void deleteItem(boolean deleteAsset) throws PermissionDeniedException, CumulusException, UnresolvableAssetReferenceException
deleteAsset
- Pass true
if you want to delete the asset as well.PermissionDeniedException
- If you do not have the necessary permission to perform this operation.UnresolvableAssetReferenceException
- is you specified to delete the asset too but the asset reference cannot be resolved.CumulusException
- on other errors.public void deleteItem(boolean deleteAsset, boolean deleteContainedItems) throws PermissionDeniedException, CumulusException, UnresolvableAssetReferenceException
deleteAsset
- Pass true
if you want to delete the asset as well.deleteContainedItems
- Pass true
if you want to delete the contained items as well.PermissionDeniedException
- If you do not have the necessary permission to perform this operation.UnresolvableAssetReferenceException
- is you specified to delete the asset too but the asset reference cannot be resolved.CumulusException
- on other errors.public boolean hasValue(GUID fieldUID)
fieldUID
- The unique ID of the field to check.true
if the given field has a value, false
otherwise.public void clearValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
save()
after all field changes to save the new item to the catalog.fieldUID
- The unique ID of the field to clearFieldNotFoundException
- if the field ID is not valid.CumulusException
- on other errors.public void clearModifiedValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to clear the changed valueFieldNotFoundException
- if the field ID is not valid.CumulusException
- on other errors.public boolean getBooleanValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setBooleanValue(GUID, boolean)
to modify the boolean field value.fieldUID
- The unique ID of the field to get the boolean value for.FieldNotFoundException
- if the field ID does not specify an existing boolean field.CumulusException
- on other errors.public java.util.Date getDateValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setDateValue(GUID,
java.util.Date)
to modify the date field value.fieldUID
- The unique ID of the field to get the date value for.FieldNotFoundException
- if the field ID does not specify an existing date field.CumulusException
- on other errors.public int getIntValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setIntValue(GUID, int)
to modify the integer field value.fieldUID
- The unique ID of the field to get the integer value for.FieldNotFoundException
- if the field ID does not specify an existing integer field.CumulusException
- on other errors.public long getLongValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setLongValue(GUID,
long)
to modify the long field value.fieldUID
- The unique ID of the field to get the long value for.FieldNotFoundException
- if the field ID does not specify an existing long field.CumulusException
- on other errors.public double getDoubleValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setDoubleValue(GUID, double)
to modify the double field value.fieldUID
- The unique ID of the field to get the double value for.FieldNotFoundException
- if the field ID does not specify an existing double field.CumulusException
- on other errors.public java.lang.String getStringValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setStringValue(GUID, String)
to modify the string field value.fieldUID
- The unique ID of the field to get the string value for.FieldNotFoundException
- if the field ID does not specify an existing string field.CumulusException
- on other errors.public java.lang.String getStringValue(GUID fieldUID, int preferredLanguageID) throws FieldNotFoundException, CumulusException
MultipleLanguagesFieldType.BASE_FIELD
, then the value of the given preferred language will be returned. If this value does not exist the value of the
given field will be returned getStringValue(GUID)
.fieldUID
- The unique ID of the field to get the string value for.preferredLanguageID
- The preferred language ID to get the string value for.FieldNotFoundException
- if the field ID does not specify an existing string field.CumulusException
- on other errors.public byte[] getBinaryValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
. Call setBinaryValue(GUID, byte[])
to modify the binary field value.fieldUID
- The unique ID of the field to get the binary value for.FieldNotFoundException
- if the field ID does not specify an existing binary, asset reference, asset cross references, picture, or audio field.CumulusException
- on other errors.public StringEnumFieldValue getStringEnumValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling StringEnumFieldValue.hasValue()
. The return value can be used to set the value of a different item of the same catalog
only. Call setStringEnumValue(GUID, com.canto.cumulus.fieldvalue.StringEnumFieldValue)
to modify the string list field value.fieldUID
- The unique ID of the field to get the string list value for.FieldNotFoundException
- if the field ID does not specify an existing string list field.CumulusException
- on other errors.public LabelFieldValue getLabelValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling LabelFieldValue.hasValue()
. Call setLabelValue(GUID, com.canto.cumulus.fieldvalue.LabelFieldValue)
to modify the
label field value. The return value can be used to set the value of a different item of the same catalog only.fieldUID
- The unique ID of the field to get the label value for.FieldNotFoundException
- if the field ID does not specify an existing label field.CumulusException
- on other errors.public RatingFieldValue getRatingValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling RatingFieldValue.hasValue()
. Call setRatingValue(GUID, com.canto.cumulus.fieldvalue.RatingFieldValue)
to modify
the rating field value. The return value can be used to set the value of a different item of the same catalog only.fieldUID
- The unique ID of the field to get the rating value for.FieldNotFoundException
- if the field ID does not specify an existing rating field.CumulusException
- on other errors.public DataSizeFieldValue getDataSizeValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling DataSizeFieldValue.hasValue()
. Call setDataSizeValue(GUID, com.canto.cumulus.fieldvalue.DataSizeFieldValue)
to
modify the data size field value.fieldUID
- The unique ID of the field to get the data size value for.FieldNotFoundException
- if the field ID does not specify an existing data size field.CumulusException
- on other errors.public DateOnlyFieldValue getDateOnlyValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling DateOnlyFieldValue.hasValue()
. Call setDateOnlyValue(GUID, com.canto.cumulus.fieldvalue.DateOnlyFieldValue)
to
modify the date only field value.fieldUID
- The unique ID of the field to get the date only value for.FieldNotFoundException
- if the field ID does not specify an existing date only field.CumulusException
- on other errors.public TimeOnlyFieldValue getTimeOnlyValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling DateOnlyFieldValue.hasValue()
. Call setTimeOnlyValue(GUID, com.canto.cumulus.fieldvalue.TimeOnlyFieldValue)
to
modify the time only field value.fieldUID
- The unique ID of the field to get the time only value for.FieldNotFoundException
- if the field ID does not specify an existing time only field.CumulusException
- on other errors.public ResolutionFieldValue getResolutionValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling ResolutionFieldValue.hasValue()
. Call setResolutionValue(GUID, com.canto.cumulus.fieldvalue.ResolutionFieldValue)
to modify the resolution field value.fieldUID
- The unique ID of the field to get the resolution value for.FieldNotFoundException
- if the field ID does not specify an existing resolution field.CumulusException
- on other errors.public LengthInInchFieldValue getLengthInInchValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling LengthInInchFieldValue.hasValue()
. Call setLengthInInchValue(GUID,
com.canto.cumulus.fieldvalue.LengthInInchFieldValue)
to modify the length field value.fieldUID
- The unique ID of the field to get the length value for.FieldNotFoundException
- if the field ID does not specify an existing length field.CumulusException
- on other errors.public AssetReference getAssetReferenceValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling AssetReference.hasValue()
. Call setAssetReferenceValue(GUID, com.canto.cumulus.fieldvalue.AssetReference)
to
modify the asset reference field value.fieldUID
- The unique ID of the field to get the asset reference value for.FieldNotFoundException
- if the field ID does not specify an existing asset reference field.CumulusException
- on other errors.public ItemCollection getTableValue(GUID fieldUID) throws InvalidArgumentException, FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to get the table value for.FieldNotFoundException
- if the field ID does not specify an existing table field.InvalidArgumentException
- if the item itself is newly created and has not been saved yet.CumulusException
- on other errorspublic AssetXRefFieldValue getAssetXRefValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling AssetXRefFieldValue.hasValue()
. Call setAssetXRefValue(GUID, com.canto.cumulus.fieldvalue.AssetXRefFieldValue)
to
modify the asset cross references field value.fieldUID
- The unique ID of the field to get the asset cross references value for.FieldNotFoundException
- if the field ID does not specify an existing asset cross references field.CumulusException
- on other errors.public UserUIDFieldValue getUserUIDValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling UserUIDFieldValue.hasValue()
. Call setStringValue(GUID, String)
passing a correct user unique ID to modify the
user unique ID field value.fieldUID
- The unique ID of the field to get the user unique ID value for.FieldNotFoundException
- if the field ID does not specify an existing user unique ID field.CumulusException
- on other errors.public VocabularyFieldValue getVocabularyValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
hasValue(GUID)
or calling VocabularyFieldValue.hasValue()
. The return value can be used to set the value of a different item of the same catalog
only. Call setVocabularyValue(GUID, com.canto.cumulus.fieldvalue.VocabularyFieldValue)
to modify the vocabulary field value.fieldUID
- The unique ID of the field to get the string list value for.FieldNotFoundException
- if the field ID does not specify an existing vocabulary field.CumulusException
- on other errors.public void setBooleanValue(GUID fieldUID, boolean value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing boolean field.CumulusException
- on other errors.public void setDateValue(GUID fieldUID, java.util.Date date) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.date
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing date field.CumulusException
- on other errors.public void setIntValue(GUID fieldUID, int value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing integer field.CumulusException
- on other errors.public void setLongValue(GUID fieldUID, long value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing long field.CumulusException
- on other errors.public void setDoubleValue(GUID fieldUID, double value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing double field.CumulusException
- on other errors.public void setStringValue(GUID fieldUID, java.lang.String value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing string field.CumulusException
- on other errors.public void setBinaryValue(GUID fieldUID, byte[] value) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.value
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing binary, asset reference, asset cross references, picture, or audio field.CumulusException
- on other errors.public void setStringEnumValue(GUID fieldUID, StringEnumFieldValue stringEnumFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.stringEnumFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing string list field.CumulusException
- on other errors.public void setLabelValue(GUID fieldUID, LabelFieldValue labelFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.labelFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing label field.CumulusException
- on other errors.public void setRatingValue(GUID fieldUID, RatingFieldValue ratingFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.ratingFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing rating field.CumulusException
- on other errors.public void setDataSizeValue(GUID fieldUID, DataSizeFieldValue dataSizeFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.dataSizeFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing data size field.CumulusException
- on other errors.public void setDateOnlyValue(GUID fieldUID, DateOnlyFieldValue dateOnlyFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.dateOnlyFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing date only field.CumulusException
- on other errors.public void setTimeOnlyValue(GUID fieldUID, TimeOnlyFieldValue timeOnlyFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.timeOnlyFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing time only field.CumulusException
- on other errors.public void setResolutionValue(GUID fieldUID, ResolutionFieldValue resolutionFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.resolutionFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing resolution field.CumulusException
- on other errors.public void setLengthInInchValue(GUID fieldUID, LengthInInchFieldValue lengthInInchFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.lengthInInchFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing length field.CumulusException
- on other errors.public Pixmap getPictureValue(GUID fieldUID) throws FieldNotFoundException, CumulusException
FieldTypes.FieldTypePicture
.fieldUID
- field of type FieldTypes.FieldTypePicture
FieldNotFoundException
- in case the given field cannot be foundCumulusException
- on other errors.public void setPictureValue(GUID fieldUID, Pixmap pixmap) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.pixmap
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing picture field.CumulusException
- on other errors.public void setAssetXRefValue(GUID fieldUID, AssetXRefFieldValue assetXRefValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.assetXRefValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing asset cross references field.CumulusException
- on other errors.public void setAssetReferenceValue(GUID fieldUID, AssetReference assetReference) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.assetReference
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing asset reference field.CumulusException
- on other errors.public void setVocabularyValue(GUID fieldUID, VocabularyFieldValue vocabularyFieldValue) throws FieldNotFoundException, CumulusException
fieldUID
- The unique ID of the field to modify.vocabularyFieldValue
- The new field valueFieldNotFoundException
- if the field ID does not specify an existing vocabulary field.CumulusException
- on other errors.public Asset convertAsset(Asset destinationContainer, GUID converterModuleUID, java.lang.String converterParams) throws CumulusException
doAssetAction(Asset, String)
instead.destinationContainer
- The destination container asset to store the resulting asset.converterModuleUID
- The module UID to use for the conversion. Possible values are: converterParams
- The conversion parameters specific to the conversion module (see Conversion Parameters).CumulusException
- on errorpublic AssetCollection doAssetAction(Asset destinationAssetContainer, java.lang.String assetAction) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting asset.assetAction
- The name of the asset action to perform.CumulusException
- on errors.public AssetCollection doAssetAction(Asset destinationAssetContainer, java.lang.String assetAction, boolean returnCreatedAssets) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting assetsassetAction
- The name of the asset action to perform.returnCreatedAssets
- Specify true to return the created assets, otherwise falsereturnCreatedAssets
is true
, otherwise null
CumulusException
- on errors.public AssetCollection doAssetAction(Asset destinationAssetContainer, java.lang.String assetAction, boolean returnCreatedAssets, java.util.Map<GUID,JPack> customParameters) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting assetsassetAction
- The name of the asset action to perform.returnCreatedAssets
- Specify true to return the created assets, otherwise falsecustomParameters
- Custom parameters for each module configured in the asset action. The actual parameter data is provided as a package.returnCreatedAssets
is true
, otherwise null
CumulusException
- on errors.public void logUsage(AssetUsage usage, java.lang.String additionalInformation)
usage
- The kind of usage that was performed.additionalInformation
- An optional string containing additional information. Depending on the usage kind this may help the user identifying the
actual action.public java.util.Set<java.lang.Integer> update(java.lang.String assetHandlingSet, java.lang.String permissionTemplate, boolean always, boolean includingSubAssets, boolean removeDeletedSubAssetItems, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
assetHandlingSet
- The name of the asset handling to use for updating. Pass null
or an empty string to let Cumulus use the default
asset handling set.permissionTemplate
- The permission template to apply to newly created items in case updating results in adding new items to the catalog.
Pass null
if you do not want to assign a permission template.always
- Pass true
if you want to always update regardless whether this item looks up-to-date with the asset. Pass
false
if you want Cumulus to check whether an update is really necessary.includingSubAssets
- Pass <false
to only update this item, pass true
if you want Cumulus to also update sub-assets. This may
include creating new items or deleting existing items according to the state of their assets.removeDeletedSubAssetItems
- Pass true
to let Cumulus automatically delete items for sub-asset that no longer exist. Pass false
to
retain such items.catalogingListener
- If specified this listener is called for every asset processed. Pass null
if you are not interested in this
information.true
.InvalidArgumentException
- if one of the arguments is wrong (e.g. the permission template does not exist).CumulusException
- on other errors.public java.util.Set<java.lang.Integer> update(java.lang.String assetHandlingSet, java.lang.String permissionTemplate, boolean always, boolean includingSubAssets, boolean removeDeletedSubAssetItems, java.util.Set<GUID> fieldsToUpdate, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
assetHandlingSet
- The name of the asset handling to use for updating. Pass null
or an empty string to let Cumulus use the default
asset handling set.permissionTemplate
- The permission template to apply to newly created items in case updating results in adding new items to the catalog.
Pass null
if you do not want to assign a permission template.always
- Pass true
if you want to always update regardless whether this item looks up-to-date with the asset. Pass
false
if you want Cumulus to check whether an update is really necessary.includingSubAssets
- Pass <false
to only update this item, pass true
if you want Cumulus to also update sub-assets. This may
include creating new items or deleting existing items according to the state of their assets.removeDeletedSubAssetItems
- Pass true
to let Cumulus automatically delete items for sub-asset that no longer exist. Pass false
to
retain such items.fieldsToUpdate
- set of fields to update or null to update all fields of the catalogcatalogingListener
- If specified this listener is called for every asset processed. Pass null
if you are not interested in this
information.true
.InvalidArgumentException
- if one of the arguments is wrong (e.g. the permission template does not exist).CumulusException
- on other errors.public void updateAssetReference() throws CumulusException
CumulusException
- on error.public void updateAssetReference(java.lang.String assetHandlingSet) throws CumulusException
assetHandlingSet
- The name of the asset handling to use for updating. Pass null
or an empty string to let Cumulus use the default asset
handling set.CumulusException
- on error.public void updateAsset(java.lang.String assetHandlingSet, java.util.Set<GUID> fieldsToUpdate) throws InvalidArgumentException, CumulusException
assetHandlingSet
- The name of the asset handling to use for updating. Pass null
or an empty string to let Cumulus use the default asset
handling set.fieldsToUpdate
- set of fields to update or null to update all fieldsInvalidArgumentException
- if one of the arguments is wrong (e.g. the asset handling set does not exist).CumulusException
- on other errors.public java.lang.String renameAsset(java.lang.String newName, boolean addNumberIfFileExists) throws InvalidArgumentException, CumulusException
newName
- The desired new name for the asset.addNumberIfFileExists
- Pass true
if you want Cumulus to automatically adjust the name to make it unique in the asset's container. If you
pass false
this method with throw an exception if an asset of the given name already exists at that location.InvalidArgumentException
- If an asset of the given name already exists and the parameter "addNumberIfFileExists" is false
.CumulusException
- on other errors.public java.util.List<Asset> copyAsset(Asset destinationContainer) throws CumulusException
destinationContainer
- The destination location to copy the asset to.CumulusException
- on errors.public java.util.List<Asset> moveAsset(Asset destinationContainer) throws CumulusException
destinationContainer
- The destination location to move the asset to.CumulusException
- on errors.public Asset checkout(Asset checkoutLocation) throws CumulusException
"Checkout User"
, "Checkout Date"
, and "Checkout Location"
. The AssetStorage
module of the asset must support versioning.checkoutLocation
- the destination container asset to which the asset is copied.CumulusException
- if the asset cannot be checked out.public void undoCheckout(boolean keepLocalAsset) throws CumulusException
keepLocalAsset
- Pass true
if you wat Cumulus to keep the asset at the checkout location.CumulusException
- on errors.public java.util.Set<java.lang.Integer> checkin(java.lang.String assetHandlingSet, java.lang.String comment, boolean keepCheckedOut, boolean keepLocalAsset, boolean removeDeletedSubAssetItems) throws InvalidArgumentException, CumulusException
assetHandlingSet
- The name of the asset handling to use for checking in. Pass null
or an empty string to let Cumulus use the
default asset handling set.comment
- The comment to add to the new version. This comment can be seen in the version history of the asset.keepCheckedOut
- Pass true
if you want Cumulus to immediately check the asset out after the checkin is complete.keepLocalAsset
- Pass true
if you want Cumulus to keep the asset at the checkout location after successfully checking it in.removeDeletedSubAssetItems
- Pass true
if you want Cumulus to also delete any items of sub-assets in case the new version of the asset no
longer contains them.true
.InvalidArgumentException
- if one of the arguments is wrong (e.g. the assetHandlingSet does not exist).CumulusException
- on other errors.public java.util.Set<java.lang.Integer> checkin(java.lang.String assetHandlingSet, Asset assetLocal, java.lang.String comment, boolean keepCheckedOut, boolean keepLocalAsset, boolean removeDeletedSubAssetItems) throws InvalidArgumentException, CumulusException
assetHandlingSet
- The name of the asset handling to use for checking in. Pass null
or an empty string to let Cumulus use the
default asset handling set.assetLocal
- The asset to be taken as the new version of this item's asset.comment
- The comment to add to the new version. This comment can be seen in the version history of the asset.keepCheckedOut
- Pass true
if you want Cumulus to immediately check the asset out after the checkin is complete.keepLocalAsset
- Pass true
if you want Cumulus to keep the asset at the checkout location after successfully checking it in.removeDeletedSubAssetItems
- Pass true
if you want Cumulus to also delete any items of sub-assets in case the new version of the asset no
longer contains them.true
.InvalidArgumentException
- if one of the arguments is wrong (e.g. the assetHandlingSet does not exist).CumulusException
- on other errors.public boolean isCheckedOut()
true
if this item's asset is currently checked out. false
otherwise.public void rollback(int toVersion) throws CumulusException
toVersion
- The older version of the asset to rollback to.CumulusException
- on errors.public java.util.Map<GUID,java.lang.String> validate(java.util.Set<GUID> fieldsToCheck, java.util.Locale locale)
fieldsToCheck
- fields to check or null to check all fields of the layoutlocale
- locale to use for the error messagepublic boolean matchesQuery(java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale)
query
- query to check this item againstflags
- flags for parsing the querylocale
- locale to use for parsing the querytrue
if this item matches the given query, false
otherwisepublic void applyPermissionTemplate(java.lang.String permissionTemplateID) throws PermissionDeniedException, CumulusException
permissionTemplateID
- the ID of the permission templatePermissionDeniedException
CumulusException
public void updateFormulaFields(java.util.Set<GUID> fieldsToUpdate, boolean updateRecordModificationDate)
fieldsToUpdate
- fields to update or null to update all formula fieldsupdateRecordModificationDate
- when set to true the Record Modification Date is also updatedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDisplayString()
getDisplayString(java.util.Locale)
public java.lang.String getDisplayString(java.util.Locale locale)
locale
- the locale to use for the item name. If that language is not available the field value for the field "Record Name", "Asset Name" or
"Category Name" is used instead.public java.lang.String getDisplayString(int languageID)
languageID
- the language to use for the item name. If that language is not available the field value for the field "Record Name", "Asset Name" or
"Category Name" is used instead.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
www.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.