Class SetUserDirectoryRootClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.web.clientsideelement.AbstractPageClientSideElement
-
- org.ametys.plugins.userdirectory.clientsideelement.SetUserDirectoryRootClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class SetUserDirectoryRootClientSideElement extends AbstractPageClientSideElement
Client side element for a controller wich set/remove the root page of a user directory.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeEP
The extension point for content typesprotected ObservationManager
_observationManager
Observer manager.protected UserDirectoryPageHandler
_userDirectoryPageHandler
The User Directory page handler-
Fields inherited from class org.ametys.web.clientsideelement.AbstractPageClientSideElement
_resolver, _synchronizeComponent
-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description SetUserDirectoryRootClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_addUserDirectoryRootProperty(Page page, String contentType, String metadata, int depth)
private boolean
_isUserDirectoryRootPage(JCRAmetysObject jcrPage)
private void
_notifyPageUpdated(Page page)
private void
_removeUserDirectoryRootProperty(Page page)
private void
_updateUserDirectoryRootProperty(Page page, String contentType, String metadata, int depth)
Map<String,Object>
getRootPageInfo(String pageId)
Gets information about user directory root status on the given.Map<String,Object>
getStatus(String pageId)
Gets the status of the given pageList<Map<String,Object>>
getSupportedContentTypes(String pageId)
Gets the content types which can build a user directoryMap<String,Object>
removeUserDirectoryRoot(String pageId)
Remove the user directory root status to the given pagevoid
service(ServiceManager smanager)
Map<String,Object>
setUserDirectoryRoot(String pageId, String contentType, String metadata, int depth)
Sets the given page as the root of a user directory-
Methods inherited from class org.ametys.web.clientsideelement.AbstractPageClientSideElement
getAllRightPageDescription, getNoModifiablePageDescription, getNoRightPageDescription, getPageDefaultParameters, hasRight
-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_observationManager
protected ObservationManager _observationManager
Observer manager.
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The extension point for content types
-
_userDirectoryPageHandler
protected UserDirectoryPageHandler _userDirectoryPageHandler
The User Directory page handler
-
-
Constructor Detail
-
SetUserDirectoryRootClientSideElement
public SetUserDirectoryRootClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractPageClientSideElement
- Throws:
ServiceException
-
getStatus
public Map<String,Object> getStatus(String pageId)
Gets the status of the given page- Parameters:
pageId
- The page id- Returns:
- the status of the given page
-
_isUserDirectoryRootPage
private boolean _isUserDirectoryRootPage(JCRAmetysObject jcrPage)
-
getSupportedContentTypes
public List<Map<String,Object>> getSupportedContentTypes(String pageId)
Gets the content types which can build a user directory- Parameters:
pageId
- The id of the page being edited- Returns:
- the content types which can build a user directory
-
setUserDirectoryRoot
public Map<String,Object> setUserDirectoryRoot(String pageId, String contentType, String metadata, int depth) throws RepositoryException
Sets the given page as the root of a user directory- Parameters:
pageId
- The id of the pagecontentType
- The id of the content typemetadata
- Thedepth
- The depth of the tree structure- Returns:
- A result map
- Throws:
RepositoryException
- if a repository error occured
-
removeUserDirectoryRoot
public Map<String,Object> removeUserDirectoryRoot(String pageId) throws RepositoryException
Remove the user directory root status to the given page- Parameters:
pageId
- The id of the page- Returns:
- A result map
- Throws:
RepositoryException
- if a repository error occured
-
getRootPageInfo
public Map<String,Object> getRootPageInfo(String pageId)
Gets information about user directory root status on the given.- Parameters:
pageId
- The id of the page- Returns:
- information about user directory root status on the given.
-
_addUserDirectoryRootProperty
private void _addUserDirectoryRootProperty(Page page, String contentType, String metadata, int depth) throws RepositoryException
- Throws:
RepositoryException
-
_updateUserDirectoryRootProperty
private void _updateUserDirectoryRootProperty(Page page, String contentType, String metadata, int depth)
-
_removeUserDirectoryRootProperty
private void _removeUserDirectoryRootProperty(Page page) throws RepositoryException
- Throws:
RepositoryException
-
_notifyPageUpdated
private void _notifyPageUpdated(Page page)
-
-