public class PreferencesImpl extends java.lang.Object implements Preferences
Modifier and Type | Class and Description |
---|---|
static interface |
PreferencesImpl.ItemIDProvider |
static class |
PreferencesImpl.NopPackListener |
static class |
PreferencesImpl.SaverAdapter |
Constructor and Description |
---|
PreferencesImpl(CumulusSession session) |
Modifier and Type | Method and Description |
---|---|
void |
addPreferencesChangeListener(PreferencesChangeListener preferencesChangeListener,
java.lang.String listenerPath)
Add a listener for preferences changes for the specified path.
|
AssetAction |
getAssetAction(java.lang.String name)
Returns the asset action with the specified name.
|
java.util.Collection<java.lang.String> |
getAssetActionNames()
Returns a collection of all asset action names available.
|
java.util.Collection<AssetAction> |
getAssetActions()
Returns a collection of all asset actions available.
|
AssetHandlingSet |
getAssetHandlingSet(java.lang.String name)
Returns the asset handling set with the specified name.
|
java.util.Collection<java.lang.String> |
getAssetHandlingSetNames()
Returns a collection of all asset handling set names available.
|
java.util.Collection<AssetHandlingSet> |
getAssetHandlingSets()
Returns a collection of all asset handling sets available.
|
CatalogTemplate |
getCatalogTemplate(java.lang.String name)
Returns the catalog template with the specified name.
|
java.util.Collection<java.lang.String> |
getCatalogTemplateNames()
Returns a collection of all catalog template names available.
|
java.util.Collection<Query> |
getCategoryQueries()
Returns a collection of all category queries available.
|
Query |
getCategoryQuery(java.lang.String name)
Returns the category query with the specified name.
|
java.util.Collection<java.lang.String> |
getCategoryQueryNames()
Returns a collection of all category query names available.
|
CategoryViewSet |
getCategoryViewSet(java.lang.String name)
Returns the category view set with the specified name.
|
java.util.Collection<java.lang.String> |
getCategoryViewSetNames()
Returns a collection of all category view set names available.
|
CollectionSet |
getCollectionSet(java.lang.String name)
Returns the collection set with the specified name.
|
java.util.Collection<java.lang.String> |
getCollectionSetNames()
Returns a collection of all collection names available.
|
java.util.Collection<CollectionSet> |
getCollectionSets()
Returns all collection sets.
|
CropTemplate |
getCropTemplate(java.lang.String name)
Returns the crop template with the specified name.
|
java.util.Collection<java.lang.String> |
getCropTemplateNames()
Returns a collection of all crop template names available.
|
java.util.Collection<CropTemplate> |
getCropTemplates()
Returns a collection of all crop templates available.
|
CumulusApplicationDisplayPrefs |
getCumulusApplicationDisplayPrefs()
Returns a read-only instance of the Cumulus application display preferences.
|
CumulusApplicationGeneralPrefs |
getCumulusApplicationGeneralPrefs()
Returns a read-only instance of the Cumulus application general preferences.
|
CumulusApplicationSearchPrefs |
getCumulusApplicationSearchPrefs()
Returns a read-only instance of the Cumulus application search preferences.
|
CumulusSession |
getCumulusSession()
Returns the current CumulusSession object.
|
java.lang.String |
getDefaultAssetAction()
Returns the default asset action name.
|
java.lang.String |
getDefaultAssetHandlingSet()
Returns the default asset handling set name.
|
java.lang.String |
getDefaultAssetHandlingSet(java.lang.String catalogName,
boolean forCataloging)
Returns the name of the currently chosen Asset Handling Set for the given catalog.
|
java.lang.String |
getDefaultCropTemplate()
Returns the name of the default crop template name.
|
java.lang.String |
getDefaultMetadataTemplate()
Returns the default metadata template name.
|
java.lang.String |
getDefaultPermissionTemplate()
Returns the default permission template name.
|
java.lang.String |
getDefaultPermissionTemplate(java.lang.String catalogName)
Returns the name of the currently chosen Permission Template for the given catalog.
|
java.lang.String |
getDefaultPrintSet()
Returns the name of the default print set name.
|
java.lang.String |
getDefaultRecordViewSet()
Returns the default record view set name.
|
MetadataTemplate |
getMetadataTemplate(java.lang.String name)
Returns the metadata template with the specified name.
|
java.util.Collection<java.lang.String> |
getMetadataTemplateNames()
Returns a collection of all metadata template names available.
|
java.util.Collection<MetadataTemplate> |
getMetadataTemplates()
Returns all available metadata templates.
|
JPack |
getModulePreferences(java.lang.String moduleUID,
boolean sharedSettings)
Return the general preferences for the given module.
|
PermissionTemplate |
getPermissionTemplate(java.lang.String name)
Returns the permission template with the specified name.
|
java.util.Collection<java.lang.String> |
getPermissionTemplateNames()
Returns a collection of all permission template names available.
|
java.util.Collection<PermissionTemplate> |
getPermissionTemplates()
Returns all available permission templates.
|
java.lang.Object |
getPreferences(java.lang.String path)
Returns the managing instance for the specified part of the preferences.
|
PrintSet |
getPrintSet(java.lang.String name)
Returns the print set with the specified name.
|
java.util.Collection<java.lang.String> |
getPrintSetNames()
Returns a collection of all print set names available.
|
java.util.Collection<PrintSet> |
getPrintSets()
Returns a collection of all print sets available.
|
Query |
getQuery(java.lang.String name)
Returns the record query with the specified name.
|
RecordFilter |
getRecordFilter(java.lang.String name)
Returns the record filter with the specified name.
|
java.util.Collection<java.lang.String> |
getRecordFilterNames()
Returns a collection of all record filter names available.
|
java.util.Collection<Query> |
getRecordQueries()
Returns a collection of all record queries available.
|
Query |
getRecordQuery(java.lang.String name)
Returns the record query with the specified name.
|
java.util.Collection<java.lang.String> |
getRecordQueryNames()
Returns a collection of all record query names available.
|
RecordViewSet |
getRecordViewSet(java.lang.String name)
Returns the record view set with the specified name.
|
java.util.Collection<java.lang.String> |
getRecordViewSetNames()
Returns a collection of all record view set names available.
|
ReportSet |
getReportSet(java.lang.String name)
Returns the report set with the specified name.
|
java.util.Collection<java.lang.String> |
getReportSetNames()
Returns a collection of all report set names available.
|
User |
getUserSettings()
Returns the user settings for the current user.
|
Workspace |
getWorkspace(java.lang.String name)
Returns the workspace with the specified name.
|
java.util.Collection<java.lang.String> |
getWorkspaceNames()
Returns a collection of all workspaces names available.
|
void |
removePreferencesChangeListener(PreferencesChangeListener preferencesChangeListener,
java.lang.String listenerPath)
Removes a listener for preferences changes for the specified path.
|
static <T extends Item> |
restrictItemsToCatalog(java.util.Collection<T> items,
MultiItemCollection multiItemCollection,
PreferencesImpl.ItemIDProvider itemIDProvider) |
void |
setItemSharing(Item item,
ItemManager itemManagerOld,
ItemManager itemManagerNew)
Set the sharing flag for the given item.
|
void |
setItemSharing(java.lang.String itemID,
ItemManager itemManagerOld,
ItemManager itemManagerNew)
Set the sharing flag for the item with the given id.
|
void |
setModulePreferences(java.lang.String moduleUID,
boolean sharedSettings,
JPack preferencesPack)
Sets the general preferences for the given module.
|
void |
writePreferencesForLocalUser()
Writes all available preferences to the local preferences store.
|
public PreferencesImpl(CumulusSession session)
public CumulusSession getCumulusSession()
getCumulusSession
in interface Preferences
public java.lang.Object getPreferences(java.lang.String path)
Preferences
getPreferences
in interface Preferences
path
- the path to get the preferences for.public java.lang.String getDefaultPermissionTemplate(java.lang.String catalogName)
Preferences
getDefaultPermissionTemplate
in interface Preferences
catalogName
- name of the catalog to find the corresponding permission templatepublic java.lang.String getDefaultAssetHandlingSet(java.lang.String catalogName, boolean forCataloging)
Preferences
getDefaultAssetHandlingSet
in interface Preferences
catalogName
- name of the catalog to find the corresponding asset handling setforCataloging
- if true the asset handling set for cataloging will be returned otherwise the asset handling set for asset accesspublic CumulusApplicationGeneralPrefs getCumulusApplicationGeneralPrefs()
Preferences
getCumulusApplicationGeneralPrefs
in interface Preferences
public CumulusApplicationDisplayPrefs getCumulusApplicationDisplayPrefs()
Preferences
getCumulusApplicationDisplayPrefs
in interface Preferences
public CumulusApplicationSearchPrefs getCumulusApplicationSearchPrefs()
Preferences
getCumulusApplicationSearchPrefs
in interface Preferences
public java.lang.String getDefaultAssetHandlingSet()
Preferences
getDefaultAssetHandlingSet
in interface Preferences
public java.util.Collection<java.lang.String> getAssetHandlingSetNames()
Preferences
getAssetHandlingSetNames
in interface Preferences
public java.util.Collection<AssetHandlingSet> getAssetHandlingSets()
Preferences
getAssetHandlingSets
in interface Preferences
public AssetHandlingSet getAssetHandlingSet(java.lang.String name)
Preferences
getAssetHandlingSet
in interface Preferences
name
- the name of the set to getpublic java.lang.String getDefaultRecordViewSet()
Preferences
getDefaultRecordViewSet
in interface Preferences
public java.util.Collection<java.lang.String> getRecordViewSetNames()
Preferences
getRecordViewSetNames
in interface Preferences
public RecordViewSet getRecordViewSet(java.lang.String name)
Preferences
getRecordViewSet
in interface Preferences
name
- the name of the set to getpublic RecordFilter getRecordFilter(java.lang.String name)
Preferences
getRecordFilter
in interface Preferences
name
- the name of the filter to getpublic CategoryViewSet getCategoryViewSet(java.lang.String name)
Preferences
getCategoryViewSet
in interface Preferences
name
- the name of the set to getpublic java.util.Collection<java.lang.String> getCategoryViewSetNames()
Preferences
getCategoryViewSetNames
in interface Preferences
public java.lang.String getDefaultAssetAction()
Preferences
getDefaultAssetAction
in interface Preferences
public java.util.Collection<java.lang.String> getAssetActionNames()
Preferences
getAssetActionNames
in interface Preferences
public java.util.Collection<AssetAction> getAssetActions()
Preferences
getAssetActions
in interface Preferences
public AssetAction getAssetAction(java.lang.String name)
Preferences
getAssetAction
in interface Preferences
name
- the name of the action to getpublic java.lang.String getDefaultMetadataTemplate()
Preferences
getDefaultMetadataTemplate
in interface Preferences
public java.lang.String getDefaultPermissionTemplate()
Preferences
getDefaultPermissionTemplate
in interface Preferences
public java.util.Collection<java.lang.String> getMetadataTemplateNames()
Preferences
getMetadataTemplateNames
in interface Preferences
public java.util.Collection<MetadataTemplate> getMetadataTemplates()
Preferences
getMetadataTemplates
in interface Preferences
public java.util.Collection<java.lang.String> getCatalogTemplateNames()
Preferences
getCatalogTemplateNames
in interface Preferences
public CatalogTemplate getCatalogTemplate(java.lang.String name)
Preferences
getCatalogTemplate
in interface Preferences
name
- the name of the template to getpublic CollectionSet getCollectionSet(java.lang.String name)
Preferences
getCollectionSet
in interface Preferences
name
- the name of the set to getpublic java.util.Collection<CollectionSet> getCollectionSets()
Preferences
getCollectionSets
in interface Preferences
public java.util.Collection<java.lang.String> getCollectionSetNames()
Preferences
getCollectionSetNames
in interface Preferences
public Query getRecordQuery(java.lang.String name)
Preferences
getRecordQuery
in interface Preferences
name
- the name of the query to getpublic java.util.Collection<Query> getRecordQueries()
Preferences
getRecordQueries
in interface Preferences
public java.util.Collection<Query> getCategoryQueries()
Preferences
getCategoryQueries
in interface Preferences
public java.util.Collection<java.lang.String> getRecordQueryNames()
Preferences
getRecordQueryNames
in interface Preferences
public java.util.Collection<java.lang.String> getCategoryQueryNames()
Preferences
getCategoryQueryNames
in interface Preferences
public java.lang.String getDefaultPrintSet()
Preferences
getDefaultPrintSet
in interface Preferences
public java.util.Collection<java.lang.String> getPrintSetNames()
Preferences
getPrintSetNames
in interface Preferences
public PrintSet getPrintSet(java.lang.String name)
Preferences
getPrintSet
in interface Preferences
name
- the name of the set to getpublic java.util.Collection<PrintSet> getPrintSets()
Preferences
getPrintSets
in interface Preferences
public java.lang.String getDefaultCropTemplate()
Preferences
getDefaultCropTemplate
in interface Preferences
public java.util.Collection<java.lang.String> getCropTemplateNames()
Preferences
getCropTemplateNames
in interface Preferences
public CropTemplate getCropTemplate(java.lang.String name)
Preferences
getCropTemplate
in interface Preferences
name
- the name of the crop template to getpublic java.util.Collection<CropTemplate> getCropTemplates()
Preferences
getCropTemplates
in interface Preferences
public java.util.Collection<java.lang.String> getRecordFilterNames()
Preferences
getRecordFilterNames
in interface Preferences
public java.util.Collection<java.lang.String> getPermissionTemplateNames()
Preferences
getPermissionTemplateNames
in interface Preferences
public java.util.Collection<PermissionTemplate> getPermissionTemplates()
Preferences
getPermissionTemplates
in interface Preferences
public PermissionTemplate getPermissionTemplate(java.lang.String name)
Preferences
getPermissionTemplate
in interface Preferences
name
- the name of the template to getpublic java.util.Collection<java.lang.String> getWorkspaceNames()
Preferences
getWorkspaceNames
in interface Preferences
public java.util.Collection<java.lang.String> getReportSetNames()
Preferences
getReportSetNames
in interface Preferences
public ReportSet getReportSet(java.lang.String name)
Preferences
getReportSet
in interface Preferences
name
- the name of the set to getpublic Workspace getWorkspace(java.lang.String name)
Preferences
getWorkspace
in interface Preferences
name
- the name of the workspace to getpublic Query getQuery(java.lang.String name)
Preferences
getQuery
in interface Preferences
name
- the name of the record query to getpublic Query getCategoryQuery(java.lang.String name)
Preferences
getCategoryQuery
in interface Preferences
name
- the name of the category query to getpublic MetadataTemplate getMetadataTemplate(java.lang.String name)
Preferences
getMetadataTemplate
in interface Preferences
name
- the name of the template to getpublic User getUserSettings()
Preferences
getUserSettings
in interface Preferences
public JPack getModulePreferences(java.lang.String moduleUID, boolean sharedSettings)
Preferences
getModulePreferences
in interface Preferences
moduleUID
- uid of the module to get the preferences forsharedSettings
- true for shared settings and false for user settingspublic void setModulePreferences(java.lang.String moduleUID, boolean sharedSettings, JPack preferencesPack)
Preferences
setModulePreferences
in interface Preferences
moduleUID
- uid of the module to set the preferences forsharedSettings
- true for shared settings and false for user settingspreferencesPack
- the preferences to storepublic void addPreferencesChangeListener(PreferencesChangeListener preferencesChangeListener, java.lang.String listenerPath)
Preferences
addPreferencesChangeListener
in interface Preferences
preferencesChangeListener
- the listener instance to be notified of changeslistenerPath
- the path to listen for changespublic void removePreferencesChangeListener(PreferencesChangeListener preferencesChangeListener, java.lang.String listenerPath)
Preferences
removePreferencesChangeListener
in interface Preferences
preferencesChangeListener
- the listener instance to removelistenerPath
- the path the listener to remove forpublic void writePreferencesForLocalUser() throws CumulusException
Cross Client
. This function is only available for Cross Clients
.CumulusException
- will be thrown in case of an error.public void setItemSharing(java.lang.String itemID, ItemManager itemManagerOld, ItemManager itemManagerNew)
itemID
- id of the item to changeitemManagerOld
- manager for the current sharingitemManagerNew
- manager for the new sharingpublic void setItemSharing(Item item, ItemManager itemManagerOld, ItemManager itemManagerNew)
item
- item to changeitemManagerOld
- manager for the current sharingitemManagerNew
- manager for the new sharingpublic static <T extends Item> java.util.List<T> restrictItemsToCatalog(java.util.Collection<T> items, MultiItemCollection multiItemCollection, PreferencesImpl.ItemIDProvider itemIDProvider)
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.