Package org.ametys.plugins.blog.ui
Class BlogRootClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.plugins.blog.ui.BlogRootClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class BlogRootClientSideElement extends StaticClientSideElement
This element creates an action button to set the blog root page.
-
-
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 BlogPageHandler
_blogRootPageHandler
The blog cache manager.protected AmetysObjectResolver
_resolver
The ametys object resolver.-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description BlogRootClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBlogRootPage(String siteName, String sitemapName)
Get the Blog root page for the specified site and sitemapprotected Map<String,Object>
getPageDefaultParameters(PagesContainer pageCt)
Get the default page's parametersMap<String,Object>
getStatus(String pageId)
Get the privacy status of contentsprotected int
indexOf(Value[] values, String value)
Tests if an array of JCR Value contains a String value.void
removeBlogRootPage(String pageId)
Remove the root page property for the specified pagevoid
service(ServiceManager serviceManager)
Map<String,Object>
setBlogRootPage(String siteName, String sitemapName, String pageId)
Set the root page for the blog-
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
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver.
-
_blogRootPageHandler
protected BlogPageHandler _blogRootPageHandler
The blog cache manager.
-
-
Constructor Detail
-
BlogRootClientSideElement
public BlogRootClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
getStatus
public Map<String,Object> getStatus(String pageId)
Get the privacy status of contents- Parameters:
pageId
- the id of contents- Returns:
- the privacy status
-
getBlogRootPage
public String getBlogRootPage(String siteName, String sitemapName)
Get the Blog root page for the specified site and sitemap- Parameters:
siteName
- The name of the sitesitemapName
- The name of the sitemap- Returns:
- The page id
-
setBlogRootPage
public Map<String,Object> setBlogRootPage(String siteName, String sitemapName, String pageId) throws RepositoryException
Set the root page for the blog- Parameters:
siteName
- The name of the sitesitemapName
- The name of the sitemappageId
- The page id for the new root- Returns:
- the new root id and the old root id if exist
- Throws:
RepositoryException
- if an error occurs
-
removeBlogRootPage
public void removeBlogRootPage(String pageId) throws RepositoryException
Remove the root page property for the specified page- Parameters:
pageId
- The root page id- Throws:
RepositoryException
- if an error occurs
-
indexOf
protected int indexOf(Value[] values, String value) throws RepositoryException
Tests if an array of JCR Value contains a String value.- Parameters:
values
- the JCR Value array.value
- the string value to test.- Returns:
- the index of the Value if present, -1 otherwise.
- Throws:
RepositoryException
- if a repository error occurs.
-
getPageDefaultParameters
protected Map<String,Object> getPageDefaultParameters(PagesContainer pageCt)
Get the default page's parameters- Parameters:
pageCt
- The page container- Returns:
- The default parameters
-
-