public class GetCommonMetadataAction extends ServiceableAction
Modifier and Type | Field and Description |
---|---|
protected static MetadataType[] |
__NOT_SORTABLE_TYPE
Not sortable metadata types
|
protected ContentTypesHelper |
_contentTypesHelper
The content types Helper
|
protected ContentTypeExtensionPoint |
_cTypeEP
The content type EP
|
protected I18nUtils |
_i18nUtils
I18n utils
|
manager
EMPTY_MAP
Constructor and Description |
---|
GetCommonMetadataAction() |
Modifier and Type | Method and Description |
---|---|
private List<String> |
_getRepeaterChildrenNames(Map<String,MetadataDefinition> metadataDefinitions) |
protected boolean |
_metadataPassesCondition(MetadataDefinition metadataDefinition,
List<String> acceptedTypes,
boolean onlySortable,
boolean includeComposite,
boolean includeSubRepeaters,
List<String> subRepeaterMetadataNames)
Indicates if the metadata should be retrieved or filtered out given the options
|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected Set<String> |
getAllAvailablesContentTypes(Request request,
boolean publicOnly,
boolean withResources)
Get all the available content types
|
protected List<Map<String,Object>> |
getCommonMetadatasInfo(Collection<String> cTypeIds,
String metadataSetName,
boolean isEdition,
List<String> acceptedTypes,
boolean onlySortable,
boolean includeComposite,
boolean withFullLabel,
boolean hasResources,
boolean includeSubRepeaters)
Retrieve metadata information for a list of content types
|
protected Set<String> |
getContentTypes(Request request,
boolean withResources)
Get the content types id to search for
|
protected String |
getMetadataFullLabel(Map<String,MetadataDefinition> metadataDefinitions,
String name)
Get the user friendly full label for the metadata definition with the given name
|
protected Map<String,Object> |
getMetadataInfo(String name,
MetadataDefinition metadataDefinition,
boolean withFullLabel,
Map<String,MetadataDefinition> metadataDefinitions)
Get the metadata info
|
protected void |
handleSpecificInfo(List<Map<String,Object>> commonMetadatasInfo,
boolean withLastModified,
boolean withLastValidation,
boolean hasResources,
boolean withFullLabel)
Handle specific info, such as adding system metadata into the metadata list
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected static final MetadataType[] __NOT_SORTABLE_TYPE
protected ContentTypeExtensionPoint _cTypeEP
protected ContentTypesHelper _contentTypesHelper
protected I18nUtils _i18nUtils
public GetCommonMetadataAction()
public void service(ServiceManager smanager) 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 List<Map<String,Object>> getCommonMetadatasInfo(Collection<String> cTypeIds, String metadataSetName, boolean isEdition, List<String> acceptedTypes, boolean onlySortable, boolean includeComposite, boolean withFullLabel, boolean hasResources, boolean includeSubRepeaters)
cTypeIds
- the ids of the content typesmetadataSetName
- The metadata set name to list metadataisEdition
- Is the metadata set for edition ?acceptedTypes
- The types to accept. All types accepted if null or empty.onlySortable
- true to only accept sortable metadata.includeComposite
- true to include the composite metadata as wellwithFullLabel
- true to use the full label of the metadata, false otherwisehasResources
- true if there is at least one content type that is a resource, false otherwise.includeSubRepeaters
- true to include the sub metadata of repeater metadata as wellprivate List<String> _getRepeaterChildrenNames(Map<String,MetadataDefinition> metadataDefinitions)
protected Map<String,Object> getMetadataInfo(String name, MetadataDefinition metadataDefinition, boolean withFullLabel, Map<String,MetadataDefinition> metadataDefinitions)
name
- the name of the metadatametadataDefinition
- the metadata definitionwithFullLabel
- true to use the full label of the metadata, false otherwisemetadataDefinitions
- the mapping of metadata definitionsprotected boolean _metadataPassesCondition(MetadataDefinition metadataDefinition, List<String> acceptedTypes, boolean onlySortable, boolean includeComposite, boolean includeSubRepeaters, List<String> subRepeaterMetadataNames)
metadataDefinition
- the metadata definitionacceptedTypes
- The types to accept. All types accepted if null or empty.onlySortable
- true to only accept sortable metadata.includeComposite
- true to include the composite metadata as wellincludeSubRepeaters
- true to include the sub metadata of repeater metadata as wellsubRepeaterMetadataNames
- The list of metadata names which are children of repeaterprotected String getMetadataFullLabel(Map<String,MetadataDefinition> metadataDefinitions, String name)
metadataDefinitions
- the mapping of metadata definitionsname
- the name of the metadataprotected void handleSpecificInfo(List<Map<String,Object>> commonMetadatasInfo, boolean withLastModified, boolean withLastValidation, boolean hasResources, boolean withFullLabel)
commonMetadatasInfo
- the mapping of metadata propertieswithLastModified
- true to add the last modification date to the metadata infowithLastValidation
- true to add the last validation date to the metadata infohasResources
- true if there is at least one content type that is a resource, false otherwise.withFullLabel
- true to use the full label of the metadata, false otherwiseprotected Set<String> getContentTypes(Request request, boolean withResources)
request
- the requestwithResources
- is there at least one resource ?protected Set<String> getAllAvailablesContentTypes(Request request, boolean publicOnly, boolean withResources)
request
- the requestpublicOnly
- Only the non private content types will be returnedwithResources
- True to add the resources to the list (which is not a content type)