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
public class GetCommonViewsAction extends ServiceableAction
Get the common views between given content types and/or among given contents
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeEP
The content type EPprotected ContentTypesHelper
_contentTypesHelper
The content types Helperprotected AmetysObjectResolver
_resolver
The ametys object resolver-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description GetCommonViewsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Map<String,Map<String,Object>>
_viewsIntersection(Map<String,Map<String,Object>> commonViewsInfo, List<Map<String,Object>> viewsInfo)
private List<Map<String,Object>>
_viewsUnion(Set<String> contentTypes, boolean includeInternals)
Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected Set<String>
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 nameprotected Set<String>
getContentTypes(Request request)
Get the content types id to search forprotected Map<String,Set<String>>
getContentTypesFromContents(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 Detail
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The content type EP
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
The content types Helper
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
-
Constructor Detail
-
GetCommonViewsAction
public GetCommonViewsAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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
-
_viewsUnion
private List<Map<String,Object>> _viewsUnion(Set<String> contentTypes, boolean includeInternals)
-
_viewsIntersection
private Map<String,Map<String,Object>> _viewsIntersection(Map<String,Map<String,Object>> commonViewsInfo, List<Map<String,Object>> viewsInfo)
-
getContentTypes
protected Set<String> getContentTypes(Request request)
Get the content types id to search for- Parameters:
request
- the request- Returns:
- the content types
-
getContentTypesFromContents
protected Map<String,Set<String>> getContentTypesFromContents(Request request)
Get the content types id to search for (by content id)- Parameters:
request
- the request- Returns:
- the content types by content
-
getAllAvailablesContentTypes
protected Set<String> getAllAvailablesContentTypes(Request request, boolean publicOnly)
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
-
-