Class ODFPilotageContentTypeMetadataManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.odf.contenttype.ODFContentTypeMetadataManager
-
- org.ametys.plugins.odfpilotage.manager.ODFPilotageContentTypeMetadataManager
-
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
,Contextualizable
,Serviceable
public class ODFPilotageContentTypeMetadataManager extends ODFContentTypeMetadataManager implements Configurable, Contextualizable, Serviceable
The odf content type metadata manager for pilotage
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_cocoonContext
The Cocoon contextprotected Map<String,Map<PilotageStatusHelper.PilotageStatus,List<String>>>
_disabledMetadata
The map of disabled metadatas for each content type and each pilotage statusprivate static String
_METADATA_FILE_PATH
private static String
_METADATA_FILE_PATH_TO_OVERRIDE
protected PilotageStatusHelper
_pilotageStatusHelper
The pilotage status helper-
Fields inherited from class org.ametys.odf.contenttype.ODFContentTypeMetadataManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description ODFPilotageContentTypeMetadataManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private boolean
_canWrite(Content content, boolean canWrite, String attributePath)
protected void
_fillDisableMetadataMap(Configuration cfg)
Fill the disabled metadata from the configurationprotected List<PilotageStatusHelper.PilotageStatus>
_getStatusToCheck(PilotageStatusHelper.PilotageStatus pilotageStatus)
Get the list of pilotage status to checkboolean
canWrite(Content content, AttributeDefinition definition)
Determine whether an attribute can be written at this time.boolean
canWrite(Content content, MetadataDefinition metadataDef)
Deprecated.void
configure(Configuration configuration)
void
contextualize(Context context)
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.odf.contenttype.ODFContentTypeMetadataManager
canRead, canRead
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_METADATA_FILE_PATH
private static String _METADATA_FILE_PATH
-
_METADATA_FILE_PATH_TO_OVERRIDE
private static String _METADATA_FILE_PATH_TO_OVERRIDE
-
_cocoonContext
protected Context _cocoonContext
The Cocoon context
-
_pilotageStatusHelper
protected PilotageStatusHelper _pilotageStatusHelper
The pilotage status helper
-
_disabledMetadata
protected Map<String,Map<PilotageStatusHelper.PilotageStatus,List<String>>> _disabledMetadata
The map of disabled metadatas for each content type and each pilotage status
-
-
Constructor Detail
-
ODFPilotageContentTypeMetadataManager
public ODFPilotageContentTypeMetadataManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_fillDisableMetadataMap
protected void _fillDisableMetadataMap(Configuration cfg) throws ConfigurationException
Fill the disabled metadata from the configuration- Parameters:
cfg
- the configuration- Throws:
ConfigurationException
- if an error occurred
-
canWrite
public boolean canWrite(Content content, AttributeDefinition definition) throws AmetysRepositoryException
Description copied from class:ODFContentTypeMetadataManager
Determine whether an attribute can be written at this time. Method called byAttributeDefinition.canWrite(Content)
to do some other checks, depending on the content type- Overrides:
canWrite
in classODFContentTypeMetadataManager
- Parameters:
content
- The content where attribute is to be written on. Can be null, on content creation.definition
- the attribute definition- Returns:
true
if the current user is allowed to write the attribute of this content.- Throws:
AmetysRepositoryException
- if an error occurs while accessing the content.
-
canWrite
@Deprecated public boolean canWrite(Content content, MetadataDefinition metadataDef) throws AmetysRepositoryException
Deprecated.Description copied from class:ODFContentTypeMetadataManager
Determine whether a metadata can be written at this time.- Overrides:
canWrite
in classODFContentTypeMetadataManager
- Parameters:
content
- The content where metadata is to be written on. Can be null, on content creation.metadataDef
- the metadata definition- Returns:
true
if the current user is allowed to write the metadata of this content.- Throws:
AmetysRepositoryException
- if an error occurs while accessing the content.
-
_getStatusToCheck
protected List<PilotageStatusHelper.PilotageStatus> _getStatusToCheck(PilotageStatusHelper.PilotageStatus pilotageStatus)
Get the list of pilotage status to check- Parameters:
pilotageStatus
- the pilotage status of the content- Returns:
- the list of pilotage status to check
-
-