Package org.opencms.jlan
Class CmsJlanRepository
- java.lang.Object
-
- org.opencms.jlan.CmsJlanRepository
-
- All Implemented Interfaces:
I_CmsConfigurationParameterHandler
,I_CmsRepository
public class CmsJlanRepository extends java.lang.Object implements I_CmsRepository
Repository class for configuring repositories for Alfresco JLAN.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JLAN_IGNORE_WRITE_ERRORS
Request context attribute to control error handling for write errors.static java.lang.String
PARAM_ADD_BOM
Parameter for controlling whether byte order marks should be added to plaintext files.static java.lang.String
PARAM_IGNORE_WRITE_ERRORS
Parameter that controls whether to ignore file write errors.static java.lang.String
PARAM_PROJECT
The parameter for the project in which this repository should operate.static java.lang.String
PARAM_ROOT
Name of the parameter to configure the root directory.static java.lang.String
PARAM_WRAPPER
Name of the parameter to configure resource wrappers.-
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
-
-
Constructor Summary
Constructors Constructor Description CmsJlanRepository()
Creates a new repository instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.boolean
allowAccess(java.lang.String user)
Checks if a user may access this repository.static org.alfresco.jlan.server.filesys.DiskInterface
createLoggingProxy(org.alfresco.jlan.server.filesys.DiskInterface impl)
Creates a dynamic proxy for a disk interface which logs the method calls and their results.CmsObjectWrapper
getCms(org.alfresco.jlan.server.SrvSession session, org.alfresco.jlan.server.filesys.TreeConnection connection)
Creates a CmsObjectWrapper for the current session.CmsParameterConfiguration
getConfiguration()
Returns the parameters of this configurable class instance, ornull
if the class does not need any parameters.org.alfresco.jlan.server.filesys.DiskDeviceContext
getDeviceContext()
Gets the device context for this repository.org.alfresco.jlan.server.filesys.DiskInterface
getDiskInterface()
Gets the disk interface for this repository.CmsRepositoryFilter
getFilter()
Gets the repository filter.java.lang.String
getName()
Returns the name of the repository.CmsProject
getProject()
Gets the configured project.java.lang.String
getRoot()
Gets the root directory configured for this repository.CmsResourceTranslator
getTranslation()
Gets the repository-specific file translations.java.util.List<I_CmsResourceWrapper>
getWrappers()
Gets the resource wrappers which have been configured for this repository.void
initConfiguration()
Initializes a configuration after all parameters have been added.void
initializeCms(CmsObject cms)
Initializes this repository with an admin CMS object.boolean
isIgnoreWriteFileErrors()
Returns true if file write errors should be ignored.boolean
isTranslationEnabled()
Returns true if the repository specific file translations are enabled (they may also be set without being enabled).void
setFilter(CmsRepositoryFilter filter)
Sets the repository filter.void
setName(java.lang.String name)
Sets the name for this repository.void
setTranslation(CmsResourceTranslator translator, boolean enabled)
Sets the repository-specific file translations
-
-
-
Field Detail
-
JLAN_IGNORE_WRITE_ERRORS
public static final java.lang.String JLAN_IGNORE_WRITE_ERRORS
Request context attribute to control error handling for write errors.- See Also:
- Constant Field Values
-
PARAM_ADD_BOM
public static final java.lang.String PARAM_ADD_BOM
Parameter for controlling whether byte order marks should be added to plaintext files.- See Also:
- Constant Field Values
-
PARAM_IGNORE_WRITE_ERRORS
public static final java.lang.String PARAM_IGNORE_WRITE_ERRORS
Parameter that controls whether to ignore file write errors.- See Also:
- Constant Field Values
-
PARAM_PROJECT
public static final java.lang.String PARAM_PROJECT
The parameter for the project in which this repository should operate.- See Also:
- Constant Field Values
-
PARAM_ROOT
public static final java.lang.String PARAM_ROOT
Name of the parameter to configure the root directory.- See Also:
- Constant Field Values
-
PARAM_WRAPPER
public static final java.lang.String PARAM_WRAPPER
Name of the parameter to configure resource wrappers.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsJlanRepository
public CmsJlanRepository()
Creates a new repository instance.
-
-
Method Detail
-
createLoggingProxy
public static org.alfresco.jlan.server.filesys.DiskInterface createLoggingProxy(org.alfresco.jlan.server.filesys.DiskInterface impl)
Creates a dynamic proxy for a disk interface which logs the method calls and their results.- Parameters:
impl
- the disk interface for which a logging proxy should be created- Returns:
- the dynamic proxy which logs methods calls
-
addConfigurationParameter
public void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Description copied from interface:I_CmsConfigurationParameterHandler
Adds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameter
in interfaceI_CmsConfigurationParameterHandler
- Parameters:
paramName
- the name of the parameterparamValue
- the value for the parameter- See Also:
I_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
-
allowAccess
public boolean allowAccess(java.lang.String user)
Checks if a user may access this repository.- Parameters:
user
- the name of the user- Returns:
- true if the user may access the repository
-
getCms
public CmsObjectWrapper getCms(org.alfresco.jlan.server.SrvSession session, org.alfresco.jlan.server.filesys.TreeConnection connection) throws CmsException
Creates a CmsObjectWrapper for the current session.- Parameters:
session
- the current sessionconnection
- the tree connection- Returns:
- the correctly configured CmsObjectWrapper for this session
- Throws:
CmsException
- if something goes wrong
-
getConfiguration
public CmsParameterConfiguration getConfiguration()
Description copied from interface:I_CmsConfigurationParameterHandler
Returns the parameters of this configurable class instance, ornull
if the class does not need any parameters.- Specified by:
getConfiguration
in interfaceI_CmsConfigurationParameterHandler
- Returns:
- the parameters of this configurable class instance,
or
null
if the class does not need any parameters - See Also:
I_CmsConfigurationParameterHandler.getConfiguration()
-
getDeviceContext
public org.alfresco.jlan.server.filesys.DiskDeviceContext getDeviceContext()
Gets the device context for this repository.- Returns:
- the device context
-
getDiskInterface
public org.alfresco.jlan.server.filesys.DiskInterface getDiskInterface()
Gets the disk interface for this repository.- Returns:
- the disk interface
-
getFilter
public CmsRepositoryFilter getFilter()
Description copied from interface:I_CmsRepository
Gets the repository filter.- Specified by:
getFilter
in interfaceI_CmsRepository
- Returns:
- the repository filter
- See Also:
I_CmsRepository.getFilter()
-
getName
public java.lang.String getName()
Description copied from interface:I_CmsRepository
Returns the name of the repository.- Specified by:
getName
in interfaceI_CmsRepository
- Returns:
- the name of the repository
- See Also:
I_CmsRepository.getName()
-
getProject
public CmsProject getProject()
Gets the configured project.- Returns:
- the configured project
-
getRoot
public java.lang.String getRoot()
Gets the root directory configured for this repository.- Returns:
- the root directory
-
getTranslation
public CmsResourceTranslator getTranslation()
Description copied from interface:I_CmsRepository
Gets the repository-specific file translations.- Specified by:
getTranslation
in interfaceI_CmsRepository
- Returns:
- the repository-specific file translations
- See Also:
I_CmsRepository.getTranslation()
-
getWrappers
public java.util.List<I_CmsResourceWrapper> getWrappers()
Gets the resource wrappers which have been configured for this repository.- Returns:
- the resource wrappers which have been configured
-
initConfiguration
public void initConfiguration() throws CmsConfigurationException
Description copied from interface:I_CmsConfigurationParameterHandler
Initializes a configuration after all parameters have been added.- Specified by:
initConfiguration
in interfaceI_CmsConfigurationParameterHandler
- Throws:
CmsConfigurationException
- if something goes wrong- See Also:
I_CmsConfigurationParameterHandler.initConfiguration()
-
initializeCms
public void initializeCms(CmsObject cms) throws CmsException
Description copied from interface:I_CmsRepository
Initializes this repository with an admin CMS object.- Specified by:
initializeCms
in interfaceI_CmsRepository
- Parameters:
cms
- an admin CMS object- Throws:
CmsException
- if something goes wrong- See Also:
I_CmsRepository.initializeCms(org.opencms.file.CmsObject)
-
isIgnoreWriteFileErrors
public boolean isIgnoreWriteFileErrors()
Returns true if file write errors should be ignored.- Returns:
- true if file write errors should be ignored
-
isTranslationEnabled
public boolean isTranslationEnabled()
Description copied from interface:I_CmsRepository
Returns true if the repository specific file translations are enabled (they may also be set without being enabled).- Specified by:
isTranslationEnabled
in interfaceI_CmsRepository
- Returns:
- true if the file translations are enabled
- See Also:
I_CmsRepository.isTranslationEnabled()
-
setFilter
public void setFilter(CmsRepositoryFilter filter)
Description copied from interface:I_CmsRepository
Sets the repository filter.- Specified by:
setFilter
in interfaceI_CmsRepository
- Parameters:
filter
- the repository filter- See Also:
I_CmsRepository.setFilter(org.opencms.repository.CmsRepositoryFilter)
-
setName
public void setName(java.lang.String name)
Description copied from interface:I_CmsRepository
Sets the name for this repository.- Specified by:
setName
in interfaceI_CmsRepository
- Parameters:
name
- the name to use for the repository- See Also:
I_CmsRepository.setName(java.lang.String)
-
setTranslation
public void setTranslation(CmsResourceTranslator translator, boolean enabled)
Description copied from interface:I_CmsRepository
Sets the repository-specific file translations- Specified by:
setTranslation
in interfaceI_CmsRepository
- Parameters:
translator
- the file translationsenabled
- true if the translations should be enabled- See Also:
I_CmsRepository.setTranslation(org.opencms.util.CmsResourceTranslator, boolean)
-
-