public class MultiItemCollection extends java.lang.Object implements java.lang.Iterable<Item>, java.lang.AutoCloseable
ItemCollection
objects of different catalogs. You can create a new instance using Server.newMultiItemCollection(String)
.Modifier and Type | Method and Description |
---|---|
void |
addCollectionListener(CollectionListener<MultiItemCollection> 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.util.List<? extends FieldData> dataList)
Add a user live filter to this collection.
|
void |
addFilter(java.lang.String filterID,
java.util.List<? extends FieldData> dataList,
boolean doesNotMatch)
Add a user live filter to this collection.
|
void |
addFilter(java.lang.String filterID,
QueryConditionBase queryConditionBase,
java.util.Locale locale,
FieldDefinition fieldDefinition)
Add a user live filter to this collection.
|
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 |
addGlobalCollectionListener(CollectionListener<MultiItemCollection> 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.
|
int |
addItem(int catalogID,
int itemID)
Add an existing item to this collection
|
int |
addItem(ItemIdentifier itemIdentifier)
Add an existing item to this collection
|
void |
addItemCollection(ItemCollection itemCollection)
Add an ItemCollection to this MultiItemCollection.
|
void |
addItems(java.util.List<ItemIdentifier> itemIDs)
Add a whole list of items to this collection.
|
MultiItemCollection |
clone(boolean createEmptyClone)
Create a clone of this collection.
|
MultiItemCollection |
clone(boolean createEmptyClone,
boolean createNewCollection)
Create a clone of this collection.
|
void |
close()
Close this collection and release all native resources that it occupies.
|
AssetCollection |
doAssetAction(java.lang.String assetAction,
Asset destinationAssetContainer)
Perform an asset action on the assets of the items of this collection.
|
AssetCollection |
doAssetAction(java.lang.String assetAction,
Asset destinationAssetContainer,
boolean returnCreatedAssets)
Perform an asset action on the assets of the items of this collection.
|
AssetCollection |
doAssetAction(java.lang.String assetAction,
Asset destinationAssetContainer,
boolean returnCreatedAssets,
java.util.Map<ItemIdentifier,java.util.Map<GUID,JPack>> customParameters)
Perform an asset action on the assets of the items of this collection.
|
boolean |
equals(java.lang.Object o) |
void |
find(java.util.List<FieldData> dataList,
CombineMode combine)
Perform a search based on the return value of
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData) to search for items that have
field values in a given range. |
void |
find(java.util.List<FieldData> dataList,
CombineMode combine,
boolean logSearchStatistic)
Perform a search based on the return value of
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData) to search for items that have
field values in a given range. |
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 |
find(java.lang.String sourceTableName,
java.util.List<ItemIdentifier> sourceItemIDs,
GUID relationID,
int direction,
int scope,
int restrictionMode,
java.util.Set<GUID> restrictionTypes,
java.lang.String additionalQuery)
Find items in the collection that are the result of applying a record filter to the given items of the given table.
|
void |
find(java.lang.String sourceTableName,
java.util.List<ItemIdentifier> sourceItemIDs,
GUID relationID,
int direction,
int scope,
int restrictionMode,
java.util.Set<GUID> restrictionTypes,
java.lang.String additionalQuery,
boolean logSearchStatistic)
Find items in the collection that are the result of applying a record filter to the given items of the given table.
|
void |
find(java.lang.String sourceTableName,
java.util.List<ItemIdentifier> sourceItemIDs,
java.lang.String filterName)
Find items in the collection that are the result of applying a record filter to the given items of the given table.
|
void |
find(java.lang.String sourceTableName,
java.util.List<ItemIdentifier> sourceItemIDs,
java.lang.String filterName,
boolean logSearchStatistic)
Find items in the collection that are the result of applying a record filter to the given items of the given table.
|
void |
findAll()
Find all available items in this collection.
|
void |
findAll(boolean logSearchStatistic)
Find all available items in this collection.
|
java.util.List<java.lang.Integer> |
getCatalogIDs()
Return the catalog ID of all ItemCollections that are contained in this MultiItemCollection.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
int[] |
getDailyStatistics(GUID fieldUID,
java.util.Date startDate,
int numberOfDays)
Get statistics on how many items have date field values that fall into days of the range specified.
|
int[] |
getDailyStatistics(GUID fieldUID,
DateOnlyFieldValue startDate,
int numberOfDays)
Get statistics on how many items have DateOnly field values that fall into days of the range specified.
|
Item |
getItemByID(int catalogID,
int itemID)
Return an item specified by catalog ID and item ID.
|
Item |
getItemByID(ItemIdentifier itemIdentifier)
Return an item specified by identifier.
|
ItemCollection |
getItemCollection(int catalogID)
Return the contained ItemCollection for the given catalog ID.
|
int |
getItemCount()
Return the number of items in this collection.
|
<T extends FieldData> |
getItemFieldStatistics(T fieldRangeData)
Get statistics on the number of items that have field values in the given value range.
|
java.util.List<FieldDefinitionData> |
getItemFieldsWithStatistics(boolean currentCollection,
java.util.Set<GUID> requestedFields,
java.util.Locale locale)
Return a list of fields that support getting field value statistics.
|
java.util.List<FieldDefinitionData> |
getItemFieldsWithStatistics(java.util.Locale locale)
Return a list of fields that support getting field value statistics.
|
java.util.List<FieldDefinitionData> |
getItemFieldsWithStatistics(java.util.Set<GUID> requestedFields,
java.util.Locale locale)
Return a list of fields that support getting field value statistics.
|
java.util.List<RecordData> |
getItemFieldValues(java.util.Collection<ItemIdentifier> identifiers,
java.util.Set<GUID> fieldGUIDs)
Get field values for the given set of items.
|
java.util.List<ItemIdentifier> |
getItemIDs(int startIndex,
int numIDs)
Get the Identifier of some or all items of the collection.
|
int |
getItemPosition(int catalogID,
int itemID)
Return the zero-based index of the given item inside this collection.
|
int |
getItemPosition(ItemIdentifier itemIdentifier)
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 catalogs of the collections contained in this MultiItemCollection.
|
MultiLayout |
getMultiLayout()
Returns the
MultiLayout for this collection which makes it easier to work with FieldDefinition instances from multiple catalogs. |
java.util.List<SortFieldDescriptor> |
getMultiSorting()
Return the list of fields that this collection is sorted by.
|
Server |
getServer()
Return the server object that this collection was created from.
|
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 MultiItemCollection.
|
int |
hashCode() |
boolean |
hasItem(int catalogID,
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<ItemIdentifier> |
matchIDs(java.lang.String query,
java.util.EnumSet<FindFlag> flags,
java.util.Locale locale,
java.util.Set<ItemIdentifier> 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 |
quickSearch(java.lang.String searchString,
CombineMode combine)
Performs a search for items on the configured QuickSearch fields.
|
void |
removeAllItems()
Remove all items from this collection making it empty.
|
void |
removeCollectionListener(CollectionListener<MultiItemCollection> 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) or addFilter(String, java.util.List) . |
static void |
removeGlobalCollectionListener(CollectionListener<MultiItemCollection> listener)
Remove a listener previously added using
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener) . |
int |
removeItem(int catalogID,
int itemID)
Remove an item from this collection.
|
int |
removeItem(ItemIdentifier itemIdentifier)
Remove an item from this collection.
|
void |
removeItemCollection(int catalogID)
Remove the ItemCollection of the given catalog from this collection.
|
void |
removeItems(java.util.Collection<ItemIdentifier> 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.
|
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 java.lang.String getTableName()
public void close()
close
in interface java.lang.AutoCloseable
public MultiItemCollection clone(boolean createEmptyClone)
createEmptyClone
- Pass true
if you want the new collection to be empty. Pass false
if it should contain the same items as this
collection.public MultiItemCollection clone(boolean createEmptyClone, boolean createNewCollection)
createEmptyClone
- Pass true
if you want the new collection to be empty. Pass false
if it should contain the same items as this
collection.createNewCollection
- Pass true
if you want the new collection has no specific filters and sorting settings. Pass false
if you want
the new collection to have the same filters and sorting settings as this collection.public java.util.List<java.lang.Integer> getCatalogIDs()
addItemCollection(ItemCollection)
public ItemCollection getItemCollection(int catalogID)
catalogID
- The catalog ID of the collection to be returned.addItemCollection(ItemCollection)
public void addItemCollection(ItemCollection itemCollection)
itemCollection
- The ItemCollection to add to this collection.removeItemCollection(int)
public void removeItemCollection(int catalogID) throws InvalidArgumentException
catalogID
- The ID of the collection to remove.InvalidArgumentException
- if the catalog ID does not specify an ItemCollection inside this MultiItemCollection.public int getItemCount()
getItemIDs(int, int)
public boolean hasItem(int catalogID, int itemID)
catalogID
- catalog ID of the item to checkitemID
- The ID of the item to checktrue
if the given item is contained in the collection. Return false
otherwise.public int getItemTotalCount()
public java.util.List<ItemIdentifier> getItemIDs(int startIndex, int numIDs)
startIndex
- The zero-based index of the first item to returnnumIDs
- The number of item Identifiers 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 int getItemPosition(ItemIdentifier itemIdentifier)
itemIdentifier
- The Identifier of the itemCumulusException
- on errorpublic int getItemPosition(int catalogID, int itemID)
catalogID
- The catalog ID of the itemitemID
- The item ID of the item inside it's catalogCumulusException
- on errorpublic Item getItemByID(int catalogID, int itemID) throws ItemNotFoundException, CumulusException
catalogID
- The ID of the item's catalog to be returned.itemID
- The ID of the item to be returned.ItemNotFoundException
- if the collection does not contain the given item.CumulusException
- on other errors.public Item getItemByID(ItemIdentifier itemIdentifier) throws ItemNotFoundException, CumulusException
itemIdentifier
- The identifier of the item to be returned.ItemNotFoundException
- if the collection does not contain the given item.CumulusException
- on other errors.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.public int addItem(ItemIdentifier itemIdentifier)
itemIdentifier
- The identifier of the item to add.public int addItem(int catalogID, int itemID)
catalogID
- The ID of the item's catalog to be added.itemID
- The ID of the item to be added.public void addItems(java.util.List<ItemIdentifier> itemIDs)
itemIDs
- The list identifiers of the items to add.public int removeItem(int catalogID, int itemID)
catalogID
- The ID of the item's catalog to be removed.itemID
- The ID of the item to be removed.removeItem(ItemIdentifier)
public int removeItem(ItemIdentifier itemIdentifier)
itemIdentifier
- The identifier of the item to be removed.removeItem(int, int)
public void removeItems(java.util.Collection<ItemIdentifier> itemIDs)
itemIDs
- The list of identifiers for the items to be removed.public void removeAllItems()
public void find(java.lang.String sourceTableName, java.util.List<ItemIdentifier> sourceItemIDs, java.lang.String filterName) throws java.lang.IllegalArgumentException, CumulusException
sourceTableName
- The name of the table that the given "sourceItemIDs" items are coming from.sourceItemIDs
- The input items for the filter to apply. The items are taken from the given table.filterName
- The name of a record filter to be used for filtering the resulting item.java.lang.IllegalArgumentException
- if a parameter is wrong (e.g. the filter name is invalid)CumulusException
- on other error.public void find(java.lang.String sourceTableName, java.util.List<ItemIdentifier> sourceItemIDs, java.lang.String filterName, boolean logSearchStatistic) throws java.lang.IllegalArgumentException, CumulusException
sourceTableName
- The name of the table that the given "sourceItemIDs" items are coming from.sourceItemIDs
- The input items for the filter to apply. The items are taken from the given table.filterName
- The name of a record filter to be used for filtering the resulting item.logSearchStatistic
- specifies whether the query result has to be logged in the search statisticjava.lang.IllegalArgumentException
- if a parameter is wrong (e.g. the filter name is invalid)CumulusException
- on other error.public void find(java.lang.String sourceTableName, java.util.List<ItemIdentifier> sourceItemIDs, GUID relationID, int direction, int scope, int restrictionMode, java.util.Set<GUID> restrictionTypes, java.lang.String additionalQuery)
sourceTableName
- The name of the table that the given "sourceItemIDs" items are coming from.sourceItemIDs
- The input items for the filter to apply. The items are taken from the given table.relationID
- The ID of the relation to the items found. This is one of the following values: GUID.UID_ASSET_RELATION_CONTAINS
, GUID.UID_ASSET_RELATION_REFERENCES
, GUID.UID_ASSET_RELATION_IS_ALTERNATE
, GUID.UID_ASSET_RELATION_IS_VARIATION
,
GUID.UID_ASSET_RELATION_IS_SELECTED
, GUID.UID_ASSET_RELATION_RELATED_IN_TABLE
, GUID.UID_ASSET_RELATION_MATCHES_ALL_ASSIGNED_CATEGORIES
, GUID.UID_ASSET_RELATION_MATCHES_ONE_ASSIGNED_CATEGORY
direction
- The direction of the relation to follow. Possible values are RecordFilter.DIRECTION_FORWARD
,
RecordFilter.DIRECTION_BACKWARD
.scope
- The scope of the found related items. This is one of the following: RecordFilter.SCOPE_OPTION_FIRST_LEVEL
,
RecordFilter.SCOPE_OPTION_LAST_LEVEL
, RecordFilter.SCOPE_OPTION_ALL_LEVELS
restrictionMode
- The way the restriction types are evaluated. Possible values are RecordFilter.RESTRICTION_MODE_OPTION_ALL_TYPES
,
RecordFilter.RESTRICTION_MODE_OPTION_INCLUDE
, RecordFilter.RESTRICTION_MODE_OPTION_EXCLUDE
restrictionTypes
- The asset types to restrict the result to. This is a set of one or more of the following GUIDs: GUID.UID_ASSET_TYPE_PAGE
,
GUID.UID_ASSET_TYPE_IMAGE
, GUID.UID_ASSET_TYPE_VIDEO_SHOT
If this set is empty or the parameter is null
then no restriction by type is applied.additionalQuery
- The additional query to be applied to the items found by the options above. If this query is null
then no additional
query is applied.public void find(java.lang.String sourceTableName, java.util.List<ItemIdentifier> sourceItemIDs, GUID relationID, int direction, int scope, int restrictionMode, java.util.Set<GUID> restrictionTypes, java.lang.String additionalQuery, boolean logSearchStatistic)
sourceTableName
- The name of the table that the given "sourceItemIDs" items are coming from.sourceItemIDs
- The input items for the filter to apply. The items are taken from the given table.relationID
- The ID of the relation to the items found. This is one of the following values: GUID.UID_ASSET_RELATION_CONTAINS
, GUID.UID_ASSET_RELATION_REFERENCES
, GUID.UID_ASSET_RELATION_IS_ALTERNATE
, GUID.UID_ASSET_RELATION_IS_VARIATION
,
GUID.UID_ASSET_RELATION_IS_SELECTED
, GUID.UID_ASSET_RELATION_RELATED_IN_TABLE
, GUID.UID_ASSET_RELATION_MATCHES_ALL_ASSIGNED_CATEGORIES
, GUID.UID_ASSET_RELATION_MATCHES_ONE_ASSIGNED_CATEGORY
direction
- The direction of the relation to follow. Possible values are RecordFilter.DIRECTION_FORWARD
,
RecordFilter.DIRECTION_BACKWARD
.scope
- The scope of the found related items. This is one of the following: RecordFilter.SCOPE_OPTION_FIRST_LEVEL
,
RecordFilter.SCOPE_OPTION_LAST_LEVEL
, RecordFilter.SCOPE_OPTION_ALL_LEVELS
restrictionMode
- The way the restriction types are evaluated. Possible values are RecordFilter.RESTRICTION_MODE_OPTION_ALL_TYPES
,
RecordFilter.RESTRICTION_MODE_OPTION_INCLUDE
, RecordFilter.RESTRICTION_MODE_OPTION_EXCLUDE
restrictionTypes
- The asset types to restrict the result to. This is a set of one or more of the following GUIDs: GUID.UID_ASSET_TYPE_PAGE
,
GUID.UID_ASSET_TYPE_IMAGE
, GUID.UID_ASSET_TYPE_VIDEO_SHOT
If this set is empty or the parameter is null
then no restriction by type is applied.additionalQuery
- The additional query to be applied to the items found by the options above. If this query is null
then no additional
query is applied.logSearchStatistic
- specifies whether the query result has to be logged in the search statisticpublic java.util.Set<ItemIdentifier> matchIDs(java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale, java.util.Set<ItemIdentifier> 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 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 findAll()
public void findAll(boolean logSearchStatistic)
logSearchStatistic
- specifies whether the query result has to be logged in the search statisticpublic void find(java.lang.String query, java.util.EnumSet<FindFlag> flags, CombineMode combine, java.util.Locale locale)
query
- the query string in this format. If the given query string is empty, nothing will
be found.flags
- The set of find flags to use for searching, see FindFlag
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 localeCumulusException
- in case of an error // * @throws com.canto.cumulus.exceptions.QueryParserException in case of an invalid query stringpublic void find(java.lang.String query, java.util.EnumSet<FindFlag> flags, CombineMode combine, java.util.Locale locale, boolean logSearchStatistic)
query
- the query string in this format. If the given query string is empty, nothing will
be found.flags
- The set of find flags to use for searching, see FindFlag
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 statisticCumulusException
- in case of an error // * @throws com.canto.cumulus.exceptions.QueryParserException in case of an invalid query stringpublic void quickSearch(java.lang.String searchString, CombineMode combine)
searchString
- the string to search forCumulusException
- in case of an error // * @throws com.canto.cumulus.exceptions.QueryParserException in case of an invalid query stringpublic java.util.List<RecordData> getItemFieldValues(java.util.Collection<ItemIdentifier> identifiers, java.util.Set<GUID> fieldGUIDs)
identifiers
- The identifiers of the items whose field values to get.fieldGUIDs
- The unique IDs of the fields to get the values for.public int[] getDailyStatistics(GUID fieldUID, java.util.Date startDate, int numberOfDays) throws CumulusException
fieldUID
- The unique ID of the field to examine.startDate
- The start date and time in UTC. The statistics will start at the given second and add 24 hours for each day to build the ranges for
each day.numberOfDays
- The number of 24-hor days to examine starting at the given second.CumulusException
- on error (e.g. the field does not exist)public int[] getDailyStatistics(GUID fieldUID, DateOnlyFieldValue startDate, int numberOfDays) throws CumulusException
fieldUID
- The unique ID of the field to examine.startDate
- The start date. The statistics will start at the given second and add 24 hours for each day to build the ranges for each day.numberOfDays
- The number of 24-hor days to examine starting at the given second.CumulusException
- on error (e.g. the field does not exist)public java.util.List<FieldDefinitionData> getItemFieldsWithStatistics(java.util.Locale locale)
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
to get field value statistics for value ranges of a given field. You can pass each
returned FieldDefinitionData object to a call to getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
.locale
- The locale to use for field value display string later in the process.getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
,
find(java.util.List, com.canto.cumulus.constants.CombineMode)
public java.util.List<FieldDefinitionData> getItemFieldsWithStatistics(java.util.Set<GUID> requestedFields, java.util.Locale locale)
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
to get field value statistics for value ranges of a given field. You can pass each
returned FieldDefinitionData object to a call to getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
.requestedFields
- set of field UIDs to evaluate for the result of this call. It's recommended to only request statistics for the fields you are
really interested inlocale
- The locale to use for field value display string later in the process.getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
,
find(java.util.List, com.canto.cumulus.constants.CombineMode)
public java.util.List<FieldDefinitionData> getItemFieldsWithStatistics(boolean currentCollection, java.util.Set<GUID> requestedFields, java.util.Locale locale)
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
to get field value statistics for value ranges of a given field. You can pass each
returned FieldDefinitionData object to a call to getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
.currentCollection
- specifies whether the result should only contain values that are valid for the current collection content.requestedFields
- set of field UIDs to evaluate for the result of this call. It's recommended to only request statistics for the fields you are
really interested inlocale
- The locale to use for field value display string later in the process.getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
,
find(java.util.List, com.canto.cumulus.constants.CombineMode)
public <T extends FieldData> java.util.List<FieldData> getItemFieldStatistics(T fieldRangeData)
fieldRangeData
- The value range to get the statistics for. typically this parameter is the result of a call to getItemFieldsWithStatistics(java.util.Locale)
or getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
.getItemFieldsWithStatistics(java.util.Locale)
,
find(java.util.List, com.canto.cumulus.constants.CombineMode)
public void find(java.util.List<FieldData> dataList, CombineMode combine)
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
to search for items that have
field values in a given range.dataList
- The list of field value ranges to search for.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.public void find(java.util.List<FieldData> dataList, CombineMode combine, boolean logSearchStatistic)
getItemFieldStatistics(com.canto.cumulus.db.statistics.FieldData)
to search for items that have
field values in a given range.dataList
- The list of field value ranges to search for.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.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 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 queryCumulusException
- on other error.addFilter(String, java.util.List)
,
removeFilter(String)
public void addFilter(java.lang.String filterID, java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale) throws 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
- The set of find flags to use for filtering, see FindFlag
locale
- The locale object to use for parsing the queryCumulusException
- on other error.addFilter(String, java.util.List)
,
removeFilter(String)
public void addFilter(java.lang.String filterID, java.util.List<? extends FieldData> dataList) throws 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.dataList
- The list of field value ranges to search for.CumulusException
- on other error.addFilter(String, String, java.util.Locale)
,
removeFilter(String)
public void addFilter(java.lang.String filterID, java.util.List<? extends FieldData> dataList, boolean doesNotMatch) throws 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.dataList
- The list of field value ranges to search for.doesNotMatch
- add the filter to find all items that do not match the given field data.CumulusException
- on other error.addFilter(String, String, java.util.Locale)
,
removeFilter(String)
public void addFilter(java.lang.String filterID, QueryConditionBase queryConditionBase, java.util.Locale locale, FieldDefinition fieldDefinition) throws 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.queryConditionBase
- The condition to filter forlocale
- Locale to be used for parsing the conditionfieldDefinition
- the field definition of the field to use as a filterCumulusException
- on other error.addFilter(String, String, java.util.Locale)
,
removeFilter(String)
public void removeFilter(java.lang.String filterID)
addFilter(String, String, java.util.Locale)
or addFilter(String, java.util.List)
.filterID
- The ID string of the filter.addFilter(String, String, java.util.Locale)
,
addFilter(String, java.util.List)
public AssetCollection doAssetAction(java.lang.String assetAction, Asset destinationAssetContainer) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting assets.assetAction
- The name of the asset action to perform.CumulusException
- on errors.public AssetCollection doAssetAction(java.lang.String assetAction, Asset destinationAssetContainer, boolean returnCreatedAssets) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting assets.assetAction
- The name of the asset action to perform.returnCreatedAssets
- Specify true to return the created assets, otherwise false.returnCreatedAssets
is true
, otherwise null
CumulusException
- on errors.public AssetCollection doAssetAction(java.lang.String assetAction, Asset destinationAssetContainer, boolean returnCreatedAssets, java.util.Map<ItemIdentifier,java.util.Map<GUID,JPack>> customParameters) throws CumulusException
destinationAssetContainer
- The destination container asset to store the resulting assets.assetAction
- The name of the asset action to perform.returnCreatedAssets
- Specify true to return the created assets, otherwise false.customParameters
- Custom parameters for each item and 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 Server getServer()
null
.null
if it was created by a CumulusSession.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 MultiLayout getMultiLayout()
MultiLayout
for this collection which makes it easier to work with FieldDefinition
instances from multiple catalogs.MultiLayout
for this collectionpublic 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 void addCollectionListener(CollectionListener<MultiItemCollection> 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<MultiItemCollection> listener)
addCollectionListener(com.canto.cumulus.events.CollectionListener)
listener
- The listener to remove.addCollectionListener(com.canto.cumulus.events.CollectionListener)
public static void addGlobalCollectionListener(CollectionListener<MultiItemCollection> listener)
addCollectionListener(com.canto.cumulus.events.CollectionListener)
instead. Call removeGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
to remove this global listener from the MultiItemCollection class.listener
- The listener to add globally.public static void removeGlobalCollectionListener(CollectionListener<MultiItemCollection> listener)
addGlobalCollectionListener(com.canto.cumulus.events.CollectionListener)
.listener
- The listener to remove.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.