public class GetMetadataSetDefAction extends ServiceableAction implements Initializable
Modifier and Type | Field and Description |
---|---|
protected ContentHelper |
_contentHelper
The content helper
|
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 HelpManager |
_helpManager
The help manager to get url for each property
|
protected Logger |
_logger
The logger
|
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.
|
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,
List<String> languages) |
protected Map<String,Object> |
content2Json(Content content,
String metadataSetName,
boolean isEditionMetadataSet,
List<String> languages)
Convert content to JSON object
|
protected Map<String,Object> |
content2Json(Content content,
String metadataSetName,
List<String> metadataNames,
boolean isEditionMetadataSet,
List<String> languages)
Convert content to JSON object
|
protected List<String> |
getLanguages(Request request)
list all languages requested by the client in the request
|
void |
initialize() |
protected Map<String,Object> |
metadataDefinition2JsonObject(Content content,
AbstractMetadataSetElement metadataSetElement,
MetadataDefinition metaDef,
String metadataPath,
Set<String> externalAndLocalMetadata,
List<String> languages)
Convert a metadata to JSON object
|
protected Map<String,Object> |
metadataSetElement2JsonObject(Content content,
MetadataDefinition metadataDefinition,
AbstractMetadataSetElement metadataSetElement,
Set<String> externalAndLocalMetadata,
List<String> languages)
Convert
AbstractMetadataSetElement to JSON object |
void |
service(ServiceManager serviceManager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
protected ContentTypesHelper _contentTypesHelper
protected ContentHelper _contentHelper
protected RightManager _rightManager
protected CurrentUserProvider _currentUserProvider
protected ExternalizableMetadataProviderExtensionPoint _externalizableMetaProvider
protected HelpManager _helpManager
public GetMetadataSetDefAction()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
protected List<String> getLanguages(Request request)
request
- the requestprotected Map<String,Object> content2Json(Content content, String metadataSetName, boolean isEditionMetadataSet, List<String> languages) throws ProcessingException
content
- The contentmetadataSetName
- The metadata set nameisEditionMetadataSet
- true if it is metadataset for editionlanguages
- the current languages requested by the client (an ordonned list)ProcessingException
- if an error occurredprotected Map<String,Object> content2Json(Content content, String metadataSetName, List<String> metadataNames, boolean isEditionMetadataSet, List<String> languages) 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 editionlanguages
- the current languages requested by the client (an ordonned list)ProcessingException
- if an error occurredprivate void _addMetadataDefRef(AbstractMetadataSetElement metadataSetElement, String metadataName)
protected Map<String,Object> metadataSetElement2JsonObject(Content content, MetadataDefinition metadataDefinition, AbstractMetadataSetElement metadataSetElement, Set<String> externalAndLocalMetadata, List<String> languages) throws ProcessingException
AbstractMetadataSetElement
to JSON objectcontent
- The contentmetadataDefinition
- The metadata definitionmetadataSetElement
- The metadataset elementexternalAndLocalMetadata
- The paths of externalizable metadata (with local and external value)languages
- the current languages requested by the client (an ordonned list)ProcessingException
- if an error occurredprotected Map<String,Object> metadataDefinition2JsonObject(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef, String metadataPath, Set<String> externalAndLocalMetadata, List<String> languages) 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)languages
- the current languages requested by the client (an ordonned list)ProcessingException
- if an error occuredprivate Map<String,Object> compositeDefinition2JsonObject(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef, Set<String> externalAndLocalMetadata, List<String> languages) 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.