public final class Catalog
extends java.lang.Object
Catalog
object allows you to access the properties of an open Cumulus catalog.Modifier and Type | Class and Description |
---|---|
static class |
Catalog.CatalogInfo
This class hold the information for a
Catalog . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STATISTICS_CATALOG_NAME
Name of the statistics catalog.
|
static java.lang.String |
USERS_CATALOG_NAME
Name of the users catalog.
|
static java.lang.String |
VOCABULARIES_CATALOG_NAME
Name of the vocabularies catalog.
|
Modifier and Type | Method and Description |
---|---|
void |
addCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
Add a listener that is called whenever the properties of a catalog have changed.
|
static void |
addGlobalCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
Add a listener that is called whenever the properties of a catalog have changed.
|
void |
backup(java.lang.String pathName)
Stores a backup copy of the catalog in the given file (Specific Permissions Required).
|
void |
backup(java.lang.String pathName,
ProgressListener progressListener)
Stores a backup copy of the catalog in the given file (Specific Permissions Required).
|
void |
compress()
Compresses the catalog (Administrator only).
|
void |
compress(ProgressListener progressListener)
Compresses the catalog (Administrator only).
|
boolean |
equals(java.lang.Object o) |
AllCategoriesItemCollection |
getAllCategoriesItemCollection()
Returns a collection that always contains all categories that the current user is allowed to see.
|
ItemCollection |
getAllVocabulariesItemCollection()
Returns an
ItemCollection containing all items of the $Vocabulary catalog. |
Catalog.CatalogInfo |
getCatalogInfo()
Get information about this catalog.
|
JPack |
getCatalogReference()
Returns the catalog reference package for this catalog.
|
CentralAssetLocationMode |
getCentralAssetLocationMode()
Returns the current central asset location mode.
|
AssetReference |
getCentralAssetLocationReference() |
java.lang.String |
getCentralAssetLocationXML()
Returns the central asset location reference as XML.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
java.lang.String |
getDescription()
Returns the catalog's description or null if not configured.
|
java.lang.String |
getDescription(int languageID)
Returns the catalog's description or null if not configured.
|
java.lang.String |
getDisplayName()
Returns the catalog's display name or the catalogs name if not configured.
|
java.lang.String |
getDisplayName(int languageID)
Returns the catalog's display name or the catalogs name if not configured.
|
int |
getID()
Returns the catalog's unique ID.
|
boolean |
getIsReadOnly()
Returns whether the catalog is physically read-only.
|
boolean |
getIsRemoteCatalog()
Returns if the catalog is opened as a client.
|
Layout |
getLayout(java.lang.String tableName)
Get the layout for a given table.
|
java.lang.String |
getLocation()
Returns the catalog's location.
|
java.lang.String |
getName()
Returns the catalog's name.
|
java.lang.Object |
getParent()
Returns the parent object of this catalog.
|
CatalogSettingsRoot |
getProperties()
Returns the catalog properties.
|
Server |
getServer()
Get the
Server object that created this catalog object. |
JPack |
getStatistics()
Returns a pack that contains some statistics about this catalog.
|
CatalogWorkflowList |
getWorkflows()
Returns the configured workflows for this catalog.
|
int |
hashCode() |
boolean |
hasTable(java.lang.String tableName)
Returns whether this catalog offers the table with the given name.
|
boolean |
keepCategoryNamesUnique()
Returns whether the catalog keep category names unique.
|
void |
migrate()
Migrates the catalog to the latest catalog format.
|
static void |
migrate(java.io.File srcCatalogFile,
java.io.File migratedCatalogFile)
Migrated the given local catalog file to the latest version.
|
static void |
migrate(java.io.File srcCatalogFile,
java.io.File migratedCatalogFile,
ProgressListener progressListener)
Migrated the given local catalog file to the latest version.
|
void |
migrate(ProgressListener progressListener)
Migrates the catalog to the latest catalog format.
|
CategoryItemCollection |
newCategoryItemCollection()
Create a new
CategoryItemCollection and containing all categories that are accessible to the current user. |
CategoryItemCollection |
newCategoryItemCollection(java.lang.String masterCategory)
Create a new
CategoryItemCollection and containing all categories of the given master category that are accessible to the current user. |
CategoryItemCollection |
newCategoryItemCollection(java.lang.String masterCategory,
java.lang.String query,
java.util.Locale locale)
Create a new
CategoryItemCollection and containing all categories of the given master category that match a given query and are accessible to the
current user. |
ItemCollection |
newItemCollection(java.lang.String tableName,
boolean findAllItems)
Create a new
ItemCollection for the given table and optionally fill in all items that are accessible to the current user. |
ItemCollection |
newItemCollection(java.lang.String tableName,
java.lang.String query,
java.util.EnumSet<FindFlag> flags,
java.util.Locale locale)
Returns a newly created collection that is filled by executing the given query.
|
RecordItemCollection |
newRecordItemCollection(boolean findAll)
Create a new
RecordItemCollection and optionally fill in all items that are accessible to the current user. |
RecordItemCollection |
newRecordItemCollection(java.lang.String query,
java.util.Locale locale)
Create a new
RecordItemCollection and fill it with the record items found by the given query. |
void |
rebuild()
Repairs the catalog and rebuilds the indices (Administrator only).
|
void |
rebuild(boolean useMirroringConfiguration)
Rebuilds the catalog.
|
void |
rebuild(boolean useMirroringConfiguration,
ProgressListener progressListener)
Rebuilds the catalog.
|
void |
removeCatalogProperties(CatalogPropertiesListener<Catalog> listener)
Remove a listener previously added with the call to
addCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener) |
static void |
removeGlobalCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
Remove a listener previously added using
addGlobalCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener) . |
byte[] |
sendMessage(java.lang.String module,
byte[] inData)
Sends a message with parameters to a server plug-in module.
|
java.lang.String |
sendMessage(java.lang.String module,
java.lang.String msg)
Sends a message to a server plug-in module (Administrator only).
|
java.lang.String |
sendMessage(java.lang.String module,
java.lang.String msg,
java.lang.String params)
Sends a message with parameters to a server plug-in module (Administrator only).
|
java.lang.String |
toString()
Returns the catalog's name.
|
java.lang.String |
validateTable(java.lang.String tableName)
Validates the given table data and returns an error message.
|
public static final java.lang.String USERS_CATALOG_NAME
public static final java.lang.String STATISTICS_CATALOG_NAME
public static final java.lang.String VOCABULARIES_CATALOG_NAME
public CumulusSession getCumulusSession()
CumulusSession
object.CumulusSession
object.public boolean getIsRemoteCatalog()
true
if the catalog is a remote catalog; false
otherwise.public Server getServer()
Server
object that created this catalog object.public int getID()
public java.lang.String getName()
public java.lang.String getDisplayName()
public java.lang.String getDisplayName(int languageID)
languageID
- language to get the display name forpublic java.lang.String getDescription()
public java.lang.String getDescription(int languageID)
languageID
- language to get the description forpublic java.lang.String getLocation()
public JPack getCatalogReference()
Server.findCatalogID(com.canto.cumulus.utils.JPack)
public ItemCollection newItemCollection(java.lang.String tableName, boolean findAllItems) throws CumulusException
ItemCollection
for the given table and optionally fill in all items that are accessible to the current user.tableName
- The name of the table in the catalog. You can pass one the predefined table names Cumulus.TABLE_NAME_ASSET_RECORDS
or Cumulus.TABLE_NAME_CATEGORIES
or the name of the table for a table field in one of these tables. In case this method is called for
the Cumulus.TABLE_NAME_ASSET_RECORDS
table it returns an instance of the sub-class RecordItemCollection
. In case this method is called for the Cumulus.TABLE_NAME_ASSET_RECORDS
table it
returns an instance of the sub-class CategoryItemCollection
.findAllItems
- A boolean specifying whether to fill in all accessible items.ItemCollection
CumulusException
- on error (e.g. wrong table name)newRecordItemCollection(boolean)
,
newCategoryItemCollection()
,
newCategoryItemCollection(String)
public RecordItemCollection newRecordItemCollection(java.lang.String query, java.util.Locale locale) throws QueryParserException, InvalidArgumentException, CumulusException
RecordItemCollection
and fill it with the record items found by the given query.query
- The query string to execute to fill in the collection. An empty or null
string returns an empty collection.locale
- The locale to use for parsing the query stringRecordItemCollection
InvalidArgumentException
- on error finding values specified in the query stringCumulusException
- on other errorsQueryParserException
- on errors parsing the query stringnewRecordItemCollection(boolean)
public RecordItemCollection newRecordItemCollection(boolean findAll)
RecordItemCollection
and optionally fill in all items that are accessible to the current user.findAll
- A boolean specifying whether to fill in all accessible items.RecordItemCollection
public CategoryItemCollection newCategoryItemCollection()
CategoryItemCollection
and containing all categories that are accessible to the current user.CategoryItemCollection
public CategoryItemCollection newCategoryItemCollection(java.lang.String masterCategory) throws InvalidArgumentException, CumulusException
CategoryItemCollection
and containing all categories of the given master category that are accessible to the current user.masterCategory
- The name of the master category for limiting the categories returned in the collection. The master category name is the name of one
of the available categories of type CategoryType.MASTER
e.g. "$Source"
.CategoryItemCollection
InvalidArgumentException
- in case the master category does not existCumulusException
- on other errorspublic CategoryItemCollection newCategoryItemCollection(java.lang.String masterCategory, java.lang.String query, java.util.Locale locale) throws InvalidArgumentException, CumulusException
CategoryItemCollection
and containing all categories of the given master category that match a given query and are accessible to the
current user.masterCategory
- The name of the master category for limiting the categories returned in the collection. The master category name is the name of one
of the available categories of type CategoryType.MASTER
e.g. "$Source"
.query
- The query string to execute to fill in the collection. An empty or null
string returns an empty collection.locale
- The locale to use for parsing the query stringCategoryItemCollection
InvalidArgumentException
- in case the master category does not existCumulusException
- on other errorspublic CatalogSettingsRoot getProperties()
public JPack getStatistics()
public CatalogWorkflowList getWorkflows()
public java.lang.Object getParent()
Server
to which this catalog belongs for remote catalogs or the CumulusSession
for local
catalogs.public boolean getIsReadOnly()
true
if the catalog is physically read-only; false
otherwise.public AssetReference getCentralAssetLocationReference()
AssetReference
object holding the reference to the central asset location if defined for this catalog.
Before accessing this asset reference you should check that it is used by calling getCentralAssetLocationMode()
.public java.lang.String getCentralAssetLocationXML() throws CumulusException
CumulusException
- if no central asset location is defined.public CentralAssetLocationMode getCentralAssetLocationMode()
CentralAssetLocationMode
public Layout getLayout(java.lang.String tableName) throws CumulusException
tableName
- The name of the table in the catalog. You can pass one the predefined table names Cumulus.TABLE_NAME_ASSET_RECORDS
or Cumulus.TABLE_NAME_CATEGORIES
or the name of the table for a table field in one of these tables. To get the table name of a specific
field you can call FieldDefinition.getValueTableName()
or CatalogField.getTableName()
.CumulusException
- on error (e.g. table name is invalid)public boolean hasTable(java.lang.String tableName)
tableName
- table name to check forpublic java.lang.String sendMessage(java.lang.String module, java.lang.String msg) throws CumulusException
module
- the name or unique ID of the server module.msg
- the message string.CumulusException
- is the message cannot be sent.public java.lang.String sendMessage(java.lang.String module, java.lang.String msg, java.lang.String params) throws CumulusException
module
- the name or unique ID of the server module.msg
- the message string.params
- the parameters.CumulusException
- is the message cannot be sent.public byte[] sendMessage(java.lang.String module, byte[] inData) throws CumulusException
module
- the name or unique ID of the server module.inData
- the message data to send to the module.CumulusException
- if the message cannot be sent.public Catalog.CatalogInfo getCatalogInfo()
public void rebuild() throws CumulusException
CumulusException
- if the catalog cannot be repaired.public void rebuild(boolean useMirroringConfiguration) throws CumulusException
useMirroringConfiguration
- if this is true the server tries to use the mirroring information which might fail if that information cannot be read
otherwise always tries a local rebuild.CumulusException
- in case of an error while rebuildingpublic void rebuild(boolean useMirroringConfiguration, ProgressListener progressListener) throws CumulusException
useMirroringConfiguration
- if this is true the server tries to use the mirroring information which might fail if that information cannot be read
otherwise always tries a local rebuild.progressListener
- a listener which gets some progress informationCumulusException
- in case of an error while rebuildingpublic void migrate() throws CumulusException
CumulusException
- in case of an error while migratingpublic void migrate(ProgressListener progressListener) throws CumulusException
progressListener
- a listener which gets some progress informationCumulusException
- in case of an error while migratingpublic static void migrate(java.io.File srcCatalogFile, java.io.File migratedCatalogFile) throws CumulusException, java.io.IOException
srcCatalogFile
- catalog file to migratemigratedCatalogFile
- contains resulting catalog and must not exist when calling this methodjava.io.IOException
- in case the given input file cannot be resolved or accessedCumulusException
- in case of an errorpublic static void migrate(java.io.File srcCatalogFile, java.io.File migratedCatalogFile, ProgressListener progressListener) throws CumulusException, java.io.IOException
srcCatalogFile
- catalog file to migratemigratedCatalogFile
- contains resulting catalog and must not exist when calling this methodprogressListener
- a listener which gets some progress informationjava.io.IOException
- in case the given input file cannot be resolved or accessedCumulusException
- in case of an errorpublic void compress(ProgressListener progressListener) throws CumulusException
progressListener
- a listener which gets some progress informationCumulusException
- on errorpublic void compress() throws CumulusException
CumulusException
- on errorpublic void backup(java.lang.String pathName) throws CumulusException
pathName
- the backup copy's path name.CumulusException
- if the catalog cannot be saved.public void backup(java.lang.String pathName, ProgressListener progressListener) throws CumulusException
pathName
- the backup copy's path name.progressListener
- a listener which gets some progress informationCumulusException
- if the catalog cannot be saved.public java.lang.String validateTable(java.lang.String tableName)
tableName
- name of the table to validatepublic java.lang.String toString()
toString
in class java.lang.Object
getName()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public AllCategoriesItemCollection getAllCategoriesItemCollection()
newCategoryItemCollection()
public ItemCollection getAllVocabulariesItemCollection()
ItemCollection
containing all items of the $Vocabulary catalog. This collection can't be used to search for items. Instead it can be
used to access all vocabulary items.public boolean keepCategoryNamesUnique()
true
if category names should be unique; false
otherwisepublic ItemCollection newItemCollection(java.lang.String tableName, java.lang.String query, java.util.EnumSet<FindFlag> flags, java.util.Locale locale) throws QueryParserException, CumulusException
tableName
- the name of the table to create a collection for. This is either Cumulus.TABLE_NAME_ASSET_RECORDS
, Cumulus.TABLE_NAME_CATEGORIES
or a name of a table field's sub-table that is returned by FieldDefinition.getValueTableName()
.query
- the query to execute to fill the collection with items. A null
or empty query will create an empty collection.flags
- query parsing flags, see FindFlag
.locale
- The locale to use for parsing the query stringQueryParserException
- on errors parsing the query stringCumulusException
- on other errorsItemCollection.find(String, java.util.EnumSet, com.canto.cumulus.constants.CombineMode, java.util.Locale)
,
newItemCollection(String, boolean)
public void addCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
addGlobalCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
instead.
Call removeCatalogProperties(com.canto.cumulus.events.CatalogPropertiesListener)
to remove this listener from the collection.listener
- The listener to add.removeCatalogProperties(com.canto.cumulus.events.CatalogPropertiesListener)
,
addGlobalCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
public void removeCatalogProperties(CatalogPropertiesListener<Catalog> listener)
addCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
listener
- The listener to remove.addCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
public static void addGlobalCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
addCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
instead. Call removeGlobalCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
to remove this global listener from the Catalog class.listener
- The listener to add globally.public static void removeGlobalCatalogPropertiesListener(CatalogPropertiesListener<Catalog> listener)
addGlobalCatalogPropertiesListener(com.canto.cumulus.events.CatalogPropertiesListener)
.listener
- The listener to remove.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.