Class AddSharedContentAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.core.util.cocoon.AbstractCurrentUserProviderServiceableAction
-
- org.ametys.core.observation.AbstractNotifierAction
-
- org.ametys.web.repository.page.actions.AddSharedContentAction
-
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,ThreadSafe,Action
public class AddSharedContentAction extends AbstractNotifierAction
This action add an existing content to a zone of a page
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypesAssignmentHandler_cTypesAssignmentHandlerThe content types assignment handler.protected AmetysObjectResolver_resolverAmetys object resolverprotected SharedContentManager_sharedContentManagerThe shared content manager.-
Fields inherited from class org.ametys.core.observation.AbstractNotifierAction
_observationManager
-
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 AddSharedContentAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)protected ContentaddContentReference(ModifiableZone zone, Content content, String metadataSetName)Add the given content as a zone item in the given zone.protected ContentcreateSharedContent(ModifiableZone zone, DefaultContent originalContent, String metadataSetName)Create a shared content referencing the given content and add the shared one to the zone.voidservice(ServiceManager serviceManager)-
Methods inherited from class org.ametys.core.util.cocoon.AbstractCurrentUserProviderServiceableAction
_getCurrentUser
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_sharedContentManager
protected SharedContentManager _sharedContentManager
The shared content manager.
-
_cTypesAssignmentHandler
protected ContentTypesAssignmentHandler _cTypesAssignmentHandler
The content types assignment handler.
-
_resolver
protected AmetysObjectResolver _resolver
Ametys object resolver
-
-
Constructor Detail
-
AddSharedContentAction
public AddSharedContentAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractNotifierAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
addContentReference
protected Content addContentReference(ModifiableZone zone, Content content, String metadataSetName)
Add the given content as a zone item in the given zone.- Parameters:
zone- the zone to add the content in.content- the content to add.metadataSetName- the metadata set name.- Returns:
- the same content.
-
createSharedContent
protected Content createSharedContent(ModifiableZone zone, DefaultContent originalContent, String metadataSetName)
Create a shared content referencing the given content and add the shared one to the zone.- Parameters:
zone- the zone to create the shared content in.originalContent- the original content.metadataSetName- the metadata set name.- Returns:
- the created shared content.
-
-