public class GetMetadataSetDefAction extends ServiceableAction
Modifier and Type | Field and Description |
---|---|
protected ContentTypeExtensionPoint |
_contentTypeExtensionPoint
Content type extension point.
|
protected ContentTypesHelper |
_contentTypesHelper
Helper for content type
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ExternalizableMetadataProviderExtensionPoint |
_externalizableMetaProvider
The component to retrieve externalizable metadata provider
|
protected RightManager |
_rightManager
Rights manager
|
manager
EMPTY_MAP
Constructor and Description |
---|
GetMetadataSetDefAction() |
Modifier and Type | Method and Description |
---|---|
private void |
_addMetadataDefRef(AbstractMetadataSetElement metadataSetElement,
String metadataName) |
protected MetadataDefinition |
_getMetadataDefinition(Content content,
MetadataDefinition parentMetadataDefinition,
String metadataName)
Retrieves a sub metadata definition from a content type or
a parent metadata definition.
|
private void |
_metadataDefinitionEnumerator2JsonObject(MetadataDefinition metaDef,
Map<String,Object> jsonObject) |
private void |
_metadataDefinitionValidator2JsonObject(MetadataDefinition metaDef,
Map<String,Object> jsonObject) |
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
private Map<String,Object> |
annotableDefinition2JsonObject(RichTextMetadataDefinition metaDef) |
private Map<String,Object> |
compositeDefinition2JsonObject(Content content,
AbstractMetadataSetElement metadataSetElement,
MetadataDefinition metaDef,
Set<String> externalAndLocalMetadata) |
protected Map<String,Object> |
content2Json(Content content,
String metadataSetName,
boolean isEditionMetadataSet)
Convert content to JSON object
|
protected Map<String,Object> |
content2Json(Content content,
String metadataSetName,
List<String> metadataNames,
boolean isEditionMetadataSet)
Convert content to JSON object
|
protected Map<String,Object> |
metadataDefinition2JsonObject(Content content,
AbstractMetadataSetElement metadataSetElement,
MetadataDefinition metaDef,
String metadataPath,
Set<String> externalAndLocalMetadata)
Convert a metadata to JSON object
|
protected Map<String,Object> |
metadataSetElement2JsonObject(Content content,
MetadataDefinition metadataDefinition,
AbstractMetadataSetElement metadataSetElement,
Set<String> externalAndLocalMetadata)
Convert
AbstractMetadataSetElement to JSON object |
void |
service(ServiceManager serviceManager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
protected ContentTypesHelper _contentTypesHelper
protected RightManager _rightManager
protected CurrentUserProvider _currentUserProvider
protected ExternalizableMetadataProviderExtensionPoint _externalizableMetaProvider
public GetMetadataSetDefAction()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exception
protected Map<String,Object> content2Json(Content content, String metadataSetName, boolean isEditionMetadataSet) throws ProcessingException
content
- The contentmetadataSetName
- The metadata set nameisEditionMetadataSet
- true if it is metadataset for editionProcessingException
- if an error occurredprotected Map<String,Object> content2Json(Content content, String metadataSetName, List<String> metadataNames, boolean isEditionMetadataSet) throws ProcessingException
content
- The contentmetadataSetName
- The metadata set namemetadataNames
- If metadata name is empty, this is the list of metadatadef to get ('/' separated for composites)isEditionMetadataSet
- true if it is metadataset for editionProcessingException
- if an error occurredprivate void _addMetadataDefRef(AbstractMetadataSetElement metadataSetElement, String metadataName)
protected Map<String,Object> metadataSetElement2JsonObject(Content content, MetadataDefinition metadataDefinition, AbstractMetadataSetElement metadataSetElement, Set<String> externalAndLocalMetadata) throws ProcessingException
AbstractMetadataSetElement
to JSON objectcontent
- The contentmetadataDefinition
- The metadata definitionmetadataSetElement
- The metadataset elementexternalAndLocalMetadata
- The paths of externalizable metadata (with local and external value)ProcessingException
- if an error occurredprotected Map<String,Object> metadataDefinition2JsonObject(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef, String metadataPath, Set<String> externalAndLocalMetadata) throws ProcessingException
content
- The contentmetadataSetElement
- The metadataset elementmetaDef
- The metadata definitionmetadataPath
- The path of metadataexternalAndLocalMetadata
- The path of externalizable metadata (with local and external value)ProcessingException
- if an error occuredprivate void _metadataDefinitionValidator2JsonObject(MetadataDefinition metaDef, Map<String,Object> jsonObject)
private void _metadataDefinitionEnumerator2JsonObject(MetadataDefinition metaDef, Map<String,Object> jsonObject) throws ProcessingException
ProcessingException
private Map<String,Object> compositeDefinition2JsonObject(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef, Set<String> externalAndLocalMetadata) throws ProcessingException
ProcessingException
private Map<String,Object> annotableDefinition2JsonObject(RichTextMetadataDefinition metaDef)
protected MetadataDefinition _getMetadataDefinition(Content content, MetadataDefinition parentMetadataDefinition, String metadataName)
content
- the content.parentMetadataDefinition
- the parent metadata definition.metadataName
- the metadata name.null
otherwise.