Package org.ametys.web.repository.page
Class ZoneDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.repository.page.ZoneDAO
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_checkZoneItem
(ModifiableSitemapElement page, String zoneName, ZoneItem zoneItem, UserIdentity user) Check if the zone item can be moved to the given zone of the given page.protected ZoneItem
addContentReference
(ModifiableZone zone, Content content, String viewName) Add the given content as a zone item in the given zone.addSharedContent
(String pageId, String zoneName, String contentId, String viewName) Insert a shared content into a zoneprotected ZoneItem
createSharedContent
(ModifiableZone zone, DefaultContent originalContent, String viewName) Create a shared content referencing the given content and add the shared one to the zone.getContent
(ZoneItem zoneItem) Get the content of a zone item.getService
(ZoneItem zoneItem) Get the service of a zone item.boolean
moveZoneItemTo
(String zoneItemId, String zoneName, boolean beforeOrAfter, String beforeOrAfterItemId, String pageId) Move a zone item of a page before/after another zone item of the same pagevoid
removeZoneItem
(String zoneItemId) Remove a zone item from pagevoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon Role
-
-
Constructor Details
-
ZoneDAO
public ZoneDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
addContentReference
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.viewName
- the view name.- Returns:
- the added zone item
-
removeZoneItem
Remove a zone item from page- Parameters:
zoneItemId
- The id of zone item to delete
-
getZoneItemElementInfo
- Parameters:
id
- The id of page or zone item- Returns:
- The list of unreferenced contents
-
getContent
Get the content of a zone item. Can be null if zone item is a service zone item.- Parameters:
zoneItem
- The zone item- Returns:
- The content or null if zone item is a service zone item.
-
getService
Get the service of a zone item. Can be null if zone item is not a service zone item.- Parameters:
zoneItem
- The zone item- Returns:
- The service or null if zone item is not a service zone item.
-
moveZoneItemTo
public boolean moveZoneItemTo(String zoneItemId, String zoneName, boolean beforeOrAfter, String beforeOrAfterItemId, String pageId) throws UnknownAmetysObjectException, AmetysRepositoryException, javax.jcr.RepositoryException Move a zone item of a page before/after another zone item of the same page- Parameters:
zoneItemId
- The identifier of the zone item to movezoneName
- The destination zone namebeforeOrAfter
- true if before or false afterbeforeOrAfterItemId
- The target zone item can be nullpageId
- The concerned page id- Returns:
- true when success
- Throws:
UnknownAmetysObjectException
- If an error occurredAmetysRepositoryException
- If an error occurredjavax.jcr.RepositoryException
- If an error occurred
-
_checkZoneItem
protected void _checkZoneItem(ModifiableSitemapElement page, String zoneName, ZoneItem zoneItem, UserIdentity user) Check if the zone item can be moved to the given zone of the given page.- Parameters:
page
- the page.zoneName
- the zone name.zoneItem
- the zone item to move.user
- the user
-