public class ItemCollection extends java.lang.Object implements java.lang.Iterable<Item>, java.lang.AutoCloseable
RecordItemCollection
and CategoryItemCollection
which hold items of the Cumulus.TABLE_NAME_ASSET_RECORDS
table and Cumulus.TABLE_NAME_CATEGORIES
table respectively.
When creating an ItemCollection of the Cumulus.TABLE_NAME_ASSET_RECORDS
table you always get a RecordItemCollection
object. When getting an
ItemCollection of the Cumulus.TABLE_NAME_CATEGORIES
table you always get a CategoryItemCollection
object. For all other tables (sub-tables of
the above two tables) you will get a plain ItemCollection instance.Modifier and Type | Method and Description |
---|---|
void |
addCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
Add a listener that is called whenever someone catalogs into this ItemCollection.
|
void |
addCollectionListener(CollectionListener<ItemCollection> listener)
Add a listener that is called whenever a single item is added / updated / deleted, or the whole content has changed, or the sorting has changed for this
ItemCollection.
|
void |
addFilter(java.lang.String filterID,
java.lang.String query,
java.util.EnumSet<FindFlag> flags,
java.util.Locale locale)
Add a user live filter to this collection.
|
void |
addFilter(java.lang.String filterID,
java.lang.String query,
java.util.Locale locale)
Add a user live filter to this collection.
|
static void |
addGlobalCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
Add a listener that is called whenever someone catalogs into any ItemCollection.
|
static void |
addGlobalCollectionListener(CollectionListener<ItemCollection> listener)
Add a listener that is called whenever a single item is added / updated / deleted, or the whole content of has changed, or the sorting has changed for
any ItemCollection.
|
void |
addItemByID(int itemID)
Add an existing item by ID to this collection
|
int |
addItemsByID(java.util.List<java.lang.Integer> itemIDs)
Add a whole list of items to this collection.
|
void |
catalogAsset(Asset asset,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a single asset to this collection.
|
void |
catalogAsset(Asset asset,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
Item additionalFieldValuesItem,
java.util.Map<GUID,MetadataTemplateEntry.ValueFillMode> additionalFieldValuesFillMode,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a single asset to this collection.
|
void |
catalogAsset(Asset asset,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
java.util.Set<java.lang.Integer> assignCategoryIDs,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a single asset to this collection.
|
void |
catalogAssets(AssetCollection assetCollection,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a collection of assets to this collection.
|
void |
catalogAssets(AssetCollection assetCollection,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
Item additionalFieldValuesItem,
java.util.Map<GUID,MetadataTemplateEntry.ValueFillMode> additionalFieldValuesFillMode,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a collection of assets to this collection.
|
void |
catalogAssets(AssetCollection assetCollection,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
java.util.EnumSet<CatalogingFlag> catalogingFlags,
java.util.Set<java.lang.Integer> assignCategoryIDs,
CatalogingListener<ItemCollection> catalogingListener)
Catalog a collection of assets to this collection.
|
ItemCollection |
clone()
Create a clone of this collection.
|
void |
close()
Close this collection and release all native resources that it occupies.
|
Item |
createItem()
Create a new item object.
|
Item |
createItem(java.lang.String permissionTemplate)
Create a new item object.
|
boolean |
equals(java.lang.Object o) |
void |
find(Asset asset)
Find all items referencing the given asset.
|
void |
find(Asset asset,
boolean logSearchStatistic)
Find all items referencing the given asset.
|
void |
find(java.lang.String query,
java.util.EnumSet<FindFlag> flags,
CombineMode combine,
java.util.Locale locale)
Performs a search for items.
|
void |
find(java.lang.String query,
java.util.EnumSet<FindFlag> flags,
CombineMode combine,
java.util.Locale locale,
boolean logSearchStatistic)
Performs a search for items.
|
void |
findAll()
Find all items that are accessible to the current user.
|
Catalog |
getCatalog()
Return the Catalog object that this collection was created from.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
Item |
getItemByID(int itemID)
Return an item specified by ID.
|
int |
getItemCount()
Return the number of items in the collection.
|
java.util.List<java.lang.Integer> |
getItemIDs(int startIndex,
int numIDs)
Get the IDs of some or all items of the collection.
|
int |
getItemPosition(int itemID)
Return the zero-based index of the given item inside this collection.
|
int |
getItemTotalCount()
Return the total number of items that are available in the catalog.
|
Layout |
getLayout()
Get the layout containing all field definitions for this collection.
|
java.util.List<SortFieldDescriptor> |
getMultiSorting()
Return the list of fields that this collection is sorted by.
|
SortDirection |
getSortDirection()
Return the current sort direction of this collection.
|
GUID |
getSorting()
Get the unique ID of the field that this collection is currently sorted by.
|
java.lang.String |
getTableName()
Get the name of the table for this ItemCollection.
|
int |
hashCode() |
boolean |
hasItem(int itemID)
Return whether the collection contains a given item specified by ID.
|
java.util.Iterator<Item> |
iterator()
Return an iterator that iterates over all items in this collection.
|
java.util.Set<java.lang.Integer> |
matchIDs(java.lang.String query,
java.util.EnumSet<FindFlag> flags,
java.util.Locale locale,
java.util.Set<java.lang.Integer> itemIDs)
Filter the given item IDs and return only those matching a given query.
|
void |
moveItem(int fromPosition,
int toPosition)
Move an existing item to a different position inside the collection.
|
void |
moveItemByID(int itemID,
int toPosition)
Move an existing item to s given position inside the collection.
|
void |
removeAllItems()
Make this collection empty.
|
void |
removeCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
Remove a listener previously added using
addCatalogingListener(com.canto.cumulus.events.CatalogingListener) |
void |
removeCollectionListener(CollectionListener<ItemCollection> listener)
Remove a listener previously added with the call to
addCollectionListener(com.canto.cumulus.events.CollectionListener) |
void |
removeFilter(java.lang.String filterID)
Remove a user live filter that was added using
addFilter(String, String, java.util.Locale) . |
static void |
removeGlobalCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
Remove a listener previously added using
addGlobalCatalogingListener(com.canto.cumulus.events.CatalogingListener) . |
static void |
removeGlobalCollectionListener(CollectionListener<ItemCollection> listener)
Remove a listener previously added using
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener) . |
int |
removeItemsByID(java.util.Collection<java.lang.Integer> itemIDs)
Remove a whole list of items from this collection.
|
void |
setFreesorted()
Set this collection to be custom sorted.
|
void |
setMultiSorting(java.util.List<SortFieldDescriptor> sortFields)
Sort this collection by the given list of fields and sorting directions.
|
void |
setSortDirection(SortDirection direction)
Change the sorting direction from ascending to descending or vice-versa.
|
void |
setSorting(GUID fieldUID)
Sort this collection by a given field.
|
java.util.Set<java.lang.Integer> |
updateItems(java.util.Set<java.lang.Integer> itemIDs,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
boolean always,
boolean includingSubAssets,
boolean removeDeletedSubAssetItems,
CatalogingListener<ItemCollection> catalogingListener)
Update a set of items in the collection according to changes made to their referenced asset.
|
java.util.Set<java.lang.Integer> |
updateItems(java.util.Set<java.lang.Integer> itemIDs,
java.lang.String assetHandlingSet,
java.lang.String permissionTemplate,
boolean always,
boolean includingSubAssets,
boolean removeDeletedSubAssetItems,
java.util.Set<GUID> fieldsToUpdate,
CatalogingListener<ItemCollection> catalogingListener)
Update a set of items in the collection according to changes made to their referenced asset.
|
void |
updateWantedFields(GUID... wantedFields)
Add the given fields to the list of preferred fields that this collection should retrieve from the server when getting items.
|
void |
updateWantedFields(java.util.Set<GUID> wantedFields)
Add the given fields to the list of preferred fields that this collection should retrieve from the server when getting items.
|
public CumulusSession getCumulusSession()
CumulusSession
object.CumulusSession
object.public Catalog getCatalog()
public java.lang.String getTableName()
public void close()
close
in interface java.lang.AutoCloseable
public void findAll()
public void find(java.lang.String query, java.util.EnumSet<FindFlag> flags, CombineMode combine, java.util.Locale locale) throws QueryParserException, CumulusException
query
- the query string in this format. If the given query string is empty, nothing will
be found.flags
- Flags that control how the query string is parsed and how the search is performed.combine
- specifies how to combine the result of this search with the existing contents of the collection.: CombineMode.FIND_NEW
: the search replaces the current contents of the collection.CombineMode.FIND_NARROW
: the search result will only leave the items in the collection that match the
query.CombineMode.FIND_BROADEN
: the search result will be added to the current collection
contents.locale
- Locale to use when parsing locale dependent string values or null for the default localeQueryParserException
- on error parsing the query (e.g. field does not exist in the catalog)CumulusException
- on other errorspublic void find(java.lang.String query, java.util.EnumSet<FindFlag> flags, CombineMode combine, java.util.Locale locale, boolean logSearchStatistic) throws QueryParserException, CumulusException
query
- the query string in this format. If the given query string is empty, nothing will
be found.flags
- Flags that control how the query string is parsed and how the search is performed.combine
- specifies how to combine the result of this search with the existing contents of the collection.: CombineMode.FIND_NEW
: the search replaces the current contents of the collection.CombineMode.FIND_NARROW
: the search result will only leave the items in the collection that match the
query.CombineMode.FIND_BROADEN
: the search result will be added to the current collection
contents.locale
- Locale to use when parsing locale dependent string values or null for the default localelogSearchStatistic
- specifies whether the query result has to be logged in the search statisticQueryParserException
- on error parsing the query (e.g. field does not exist in the catalog)CumulusException
- on other errorspublic java.util.Set<java.lang.Integer> matchIDs(java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale, java.util.Set<java.lang.Integer> itemIDs) throws QueryParserException, CumulusException
query
- the query string in this format. If the given query string is empty, nothing will
be returned.flags
- Flags that control how the query string is parsed and how the search is performed.locale
- Locale to use when parsing locale dependent string values or null for the default localeitemIDs
- The item IDs to use as input.QueryParserException
- on error parsing the query (e.g. field does not exist in the catalog)CumulusException
- on other errorspublic void find(Asset asset)
asset
- the asset to search for.public void find(Asset asset, boolean logSearchStatistic)
asset
- the asset to search for.logSearchStatistic
- specifies whether the query result has to be logged in the search statisticpublic void addFilter(java.lang.String filterID, java.lang.String query, java.util.Locale locale) throws QueryParserException, CumulusException
filterID
- The ID for this filter. You can use any string. If you want to be sure that the ID is not used by anyone else you can call new
GUID().toString()
to generate a unique ID.query
- The query for this filter in this format. Only items that can be found by the
query will be left in the collection.locale
- The locale object to use for parsing the queryQueryParserException
- on error parsing the query stringCumulusException
- on other error.removeFilter(String)
public void addFilter(java.lang.String filterID, java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale) throws QueryParserException, CumulusException
filterID
- The ID for this filter. You can use any string. If you want to be sure that the ID is not used by anyone else you can call new
GUID().toString()
to generate a unique ID.query
- The query for this filter in this format. Only items that can be found by the
query will be left in the collection.flags
- Flags that control how the query string is parsed and how the filtering is performed.locale
- The locale object to use for parsing the queryQueryParserException
- on error parsing the query stringCumulusException
- on other error.removeFilter(String)
public void removeFilter(java.lang.String filterID)
addFilter(String, String, java.util.Locale)
.filterID
- The ID string of the filter.public int getItemCount()
public int getItemTotalCount()
getItemCount()
to
the current number of items in the collection. Not all of these items are accessible to the current user.public boolean hasItem(int itemID)
itemID
- The ID of the item to checktrue
if the given item is contained in the collection. Return false
otherwise.public java.util.List<java.lang.Integer> getItemIDs(int startIndex, int numIDs)
startIndex
- The zero-based index of the first item to returnnumIDs
- The number of item IDs to return. You can specify a number that exceeds the total number of available items here. The returned list
will be limited to the available items only.public Item createItem() throws PermissionDeniedException, CumulusException
Item.save()
method to save thePermissionDeniedException
- if the current user does not have the necessary permissions for this operation.CumulusException
- on other errors.Item.save()
public Item createItem(java.lang.String permissionTemplate) throws PermissionDeniedException, CumulusException
Item.save()
method to save thepermissionTemplate
- the permission template to apply to the new itemPermissionDeniedException
- if the current user does not have the necessary permissions for this operation.CumulusException
- on other errors.Item.save()
public Item getItemByID(int itemID) throws ItemNotFoundException, CumulusException
itemID
- The ID of the item to be returned.ItemNotFoundException
- if the collection does not contain the given item.CumulusException
- on other errors.hasItem(int)
,
addItemByID(int)
,
addItemsByID(java.util.List)
public void addItemByID(int itemID)
itemID
- The ID of the item to add.public int addItemsByID(java.util.List<java.lang.Integer> itemIDs)
itemIDs
- The list of IDs of the items to add.public int removeItemsByID(java.util.Collection<java.lang.Integer> itemIDs)
itemIDs
- The list of ID for the items to be removed.public void removeAllItems()
public void moveItem(int fromPosition, int toPosition)
fromPosition
- The zero-based index that the item is currently located.toPosition
- The desired zero-based index that the item should be moved to.moveItemByID(int, int)
public void moveItemByID(int itemID, int toPosition)
itemID
- The ID of the item to move.toPosition
- The new zero-based index where the item should be moved to.moveItem(int, int)
public int getItemPosition(int itemID) throws CumulusException
itemID
- The ID of the itemCumulusException
- on errorpublic void setSorting(GUID fieldUID) throws CumulusException
FieldDefinition.getIndexing()
.fieldUID
- The unique ID of the field to use for sorting.CumulusException
- on errors.public void setMultiSorting(java.util.List<SortFieldDescriptor> sortFields) throws CumulusException
FieldDefinition.getIndexing()
.sortFields
- The fields to sort by including whether to sort ascending or descending.CumulusException
- on errors.public java.util.List<SortFieldDescriptor> getMultiSorting()
public void setSortDirection(SortDirection direction)
direction
- The new sorting direction.public GUID getSorting()
null
if the collection is not sorted by any field.public SortDirection getSortDirection()
public void setFreesorted()
public void updateWantedFields(GUID... wantedFields)
wantedFields
- the unique ID of fields you want to add to the list of preferred fields to get.public void updateWantedFields(java.util.Set<GUID> wantedFields)
wantedFields
- the unique ID of fields you want to add to the list of preferred fields to get.public void catalogAsset(Asset asset, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
asset
- The asset to catalogassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling set that is
configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not apply any
permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf (CatalogingFlag.class)
here to
perform all functions.catalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public void catalogAsset(Asset asset, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, java.util.Set<java.lang.Integer> assignCategoryIDs, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
asset
- The asset to catalogassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling set that is
configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not apply any
permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf (CatalogingFlag.class)
here to
perform all functions.assignCategoryIDs
- The categories to be assigned to each item that is the result of adding an asset to the catalog. The categories are specified
by their ID.catalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public void catalogAsset(Asset asset, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, Item additionalFieldValuesItem, java.util.Map<GUID,MetadataTemplateEntry.ValueFillMode> additionalFieldValuesFillMode, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
asset
- The asset to catalogassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling
set that is configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not
apply any permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf
(CatalogingFlag.class) here to perform all functions.additionalFieldValuesItem
- An item providing additional field values which should be applied on newly created records. Depends on the
additional parameter additionalFieldValuesFillMode that specifies which fields should be applied and combined with
the existing values. Can be null if no other values should be set.additionalFieldValuesFillMode
- Null or the specification how fields provided by the additionalFieldValuesItem parameter are combined with the
records being created by the cataloging process.catalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public void catalogAssets(AssetCollection assetCollection, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
assetCollection
- The collection of assets for catalogingassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling set that is
configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not apply any
permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf (CatalogingFlag.class)
here to
perform all functions.catalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public void catalogAssets(AssetCollection assetCollection, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, java.util.Set<java.lang.Integer> assignCategoryIDs, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
assetCollection
- The collection of assets for catalogingassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling set that is
configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not apply any
permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf (CatalogingFlag.class)
here to
perform all functions.assignCategoryIDs
- The categories to be assigned to each item that is the result of adding an asset to the catalog. The categories are specified
by their ID.catalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public void catalogAssets(AssetCollection assetCollection, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, java.util.EnumSet<CatalogingFlag> catalogingFlags, Item additionalFieldValuesItem, java.util.Map<GUID,MetadataTemplateEntry.ValueFillMode> additionalFieldValuesFillMode, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
assetCollection
- The collection of assets for catalogingassetHandlingSet
- The name of the asset handling set to use for cataloging. An empty or null
string uses the asset handling
set that is configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to be applied after cataloging. Passing an empty or null
string does not
apply any permission template.catalogingFlags
- Flags that allow to skip specific functionality. Typically you pass EnumSet.noneOf (CatalogingFlag.class)
here to perform all functions.additionalFieldValuesItem
- item providing initial field values which will be set by the cataloger for all items to be createdadditionalFieldValuesFillMode
- fill modes to use when applying the values from the additionalFieldValuesItem
parametercatalogingListener
- An optional listener that is called for each asset that is processed.InvalidArgumentException
- in case you specify an asset handling set or permission template that does not exist.CumulusException
- on other errors.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
public java.util.Set<java.lang.Integer> updateItems(java.util.Set<java.lang.Integer> itemIDs, java.lang.String assetHandlingSet, java.lang.String permissionTemplate, boolean always, boolean includingSubAssets, boolean removeDeletedSubAssetItems, CatalogingListener<ItemCollection> catalogingListener) throws InvalidArgumentException, CumulusException
itemIDs
- The IDs of the items to be updatedassetHandlingSet
- The name of the asset handling set to use for updating An empty or null
string uses the asset handling set that
is configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to apply after updating an item.always
- Specify true
to force updating the items. Specify false
to let Cumulus only update items for assets
that have been changed.includingSubAssets
- Include sub-assets with the updating. This allows you to also update items for contained assets.removeDeletedSubAssetItems
- Specify true
to allow Cumulus to delete items of contained assets if the asset no longer contains them. If you
specify false
here Cumulus will keep items even though the asset may no longer exist.catalogingListener
- A listener t be called for each item being processed.InvalidArgumentException
- in case one of the parameters is wrong (e.g. asset handling set does not exist).CumulusException
- on other errorspublic java.util.Set<java.lang.Integer> updateItems(java.util.Set<java.lang.Integer> itemIDs, 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
itemIDs
- The IDs of the items to be updatedassetHandlingSet
- The name of the asset handling set to use for updating An empty or null
string uses the asset handling set that
is configured in the user setting to be used by default.permissionTemplate
- The name of the permission template to apply after updating an item.always
- Specify true
to force updating the items. Specify false
to let Cumulus only update items for assets
that have been changed.includingSubAssets
- Include sub-assets with the updating. This allows you to also update items for contained assets.removeDeletedSubAssetItems
- Specify true
to allow Cumulus to delete items of contained assets if the asset no longer contains them. If you
specify false
here Cumulus will keep items even though the asset may no longer exist.fieldsToUpdate
- set of fields to update or null to update all fields of the catalogcatalogingListener
- A listener t be called for each item being processed.InvalidArgumentException
- in case one of the parameters is wrong (e.g. asset handling set does not exist).CumulusException
- on other errorspublic Layout getLayout()
getCatalog().getLayout(getTableName())
.public ItemCollection clone()
clone
in class java.lang.Object
public void addCollectionListener(CollectionListener<ItemCollection> listener)
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
instead. Call removeCollectionListener(com.canto.cumulus.events.CollectionListener)
to remove this listener from the collection.listener
- The listener to add.removeCollectionListener(com.canto.cumulus.events.CollectionListener)
,
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
public void removeCollectionListener(CollectionListener<ItemCollection> listener)
addCollectionListener(com.canto.cumulus.events.CollectionListener)
listener
- The listener to remove.addCollectionListener(com.canto.cumulus.events.CollectionListener)
public static void addGlobalCollectionListener(CollectionListener<ItemCollection> listener)
addCollectionListener(com.canto.cumulus.events.CollectionListener)
instead. Call removeGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
to remove this global listener from the ItemCollection class.listener
- The listener to add globally.public static void removeGlobalCollectionListener(CollectionListener<ItemCollection> listener)
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
.listener
- The listener to remove.public static void addGlobalCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
removeGlobalCatalogingListener(com.canto.cumulus.events.CatalogingListener)
to remove this global listener from the ItemCollection class.catalogingListener
- The listener to add globally.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
addCatalogingListener(com.canto.cumulus.events.CatalogingListener)
public static void removeGlobalCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
addGlobalCatalogingListener(com.canto.cumulus.events.CatalogingListener)
.catalogingListener
- The listener to remove.public void addCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
addGlobalCatalogingListener(com.canto.cumulus.events.CatalogingListener)
instead. Call
removeCatalogingListener(com.canto.cumulus.events.CatalogingListener)
to remove this listener from the ItemCollection.catalogingListener
- The listener to add.catalogAsset(Asset, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAsset(Asset, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, com.canto.cumulus.events.CatalogingListener)
,
catalogAssets(AssetCollection, String, String, java.util.EnumSet, java.util.Set, com.canto.cumulus.events.CatalogingListener)
,
addGlobalCatalogingListener(com.canto.cumulus.events.CatalogingListener)
,
removeCatalogingListener(com.canto.cumulus.events.CatalogingListener)
public void removeCatalogingListener(CatalogingListener<ItemCollection> catalogingListener)
addCatalogingListener(com.canto.cumulus.events.CatalogingListener)
catalogingListener
- The listener to remove.public java.util.Iterator<Item> iterator()
for (Item item : itemCollection) { // use the item }The iterator returned allows you to remove an item consistently:
Iterator- it = iterator (); while (it.hasNext ()) { Item item = it.next (); if (!item.hasValue (GUID.UID_REC_LABEL)) { it.remove (); } }
iterator
in interface java.lang.Iterable<Item>
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.