Package org.ametys.cms.contenttype
Class GetCommonViewsAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.cms.contenttype.GetCommonViewsAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
Get the common views between given content types and/or among given contents
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The content type EPprotected ContentTypesHelper
The content types Helperprotected AmetysObjectResolver
The ametys object resolverFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) getAllAvailablesContentTypes
(Request request, boolean publicOnly) Get all the available content typesprotected Collection<Map<String,
Object>> getCommonViewsInfo
(Map<String, Set<String>> contentTypesByContent, Collection<String> contentTypeIds, boolean includeInternals) Retrieves the common views info by namegetContentTypes
(Request request) Get the content types id to search forgetContentTypesFromContents
(Request request) Get the content types id to search for (by content id)void
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_contentTypeEP
The content type EP -
_contentTypesHelper
The content types Helper -
_resolver
The ametys object resolver
-
-
Constructor Details
-
GetCommonViewsAction
public GetCommonViewsAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
getCommonViewsInfo
protected Collection<Map<String,Object>> getCommonViewsInfo(Map<String, Set<String>> contentTypesByContent, Collection<String> contentTypeIds, boolean includeInternals) Retrieves the common views info by name- Parameters:
contentTypesByContent
- the content type ids by contentcontentTypeIds
- the content type ids (not coming from contents)includeInternals
-true
to include internal views,false
otherwise- Returns:
- The map of views' info
-
getContentTypes
Get the content types id to search for- Parameters:
request
- the request- Returns:
- the content types
-
getContentTypesFromContents
Get the content types id to search for (by content id)- Parameters:
request
- the request- Returns:
- the content types by content
-
getAllAvailablesContentTypes
Get all the available content types- Parameters:
request
- the requestpublicOnly
- Only the non private content types will be returned- Returns:
- all the available content types
-