Class ODFRootClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.plugins.odfweb.clientside.ODFRootClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class ODFRootClientSideElement extends StaticClientSideElement
This element creates an action button to set the ODF 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 CatalogsManager
_catalogsManager
Catalog managerprotected ObservationManager
_observationManager
Observation managerprotected OdfPageHandler
_odfPageHandler
Odf page handlerprotected AmetysObjectResolver
_resolver
Ametys resolver-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description ODFRootClientSideElement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_addOdfRootProperty(Page page, String catalog, String firstLevel, String secondLevel)
private Property
_getVirtualProperty(JCRAmetysObject jcrPage)
private void
_notifyOdfRootPageChange(Page page)
private void
_setVirtualProperty(JCRAmetysObject jcrPage, Value[] values)
private boolean
_updateOdfRootProperty(Page page, String catalog, String firstLevel, String secondLevel)
boolean
addOrUpdateOdfRootProperty(String pageId, String catalog, String firstLevel, String secondLevel)
Add or update the odf root page property on a pageMap<String,Object>
getOdfRootPageInfo(String pageId)
Retrieves odf root page propertiesMap<String,Object>
getStatus(String pageId)
Get odf root page status for the current pageprivate static boolean
isVirtualPageFactoryValue(Value value)
Tests if a JCR Value represents the virtual page propertyboolean
removeOdfRootPage(String pageId)
Remove the odf root page property on a pagevoid
service(ServiceManager smanager)
-
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
Ametys resolver
-
_catalogsManager
protected CatalogsManager _catalogsManager
Catalog manager
-
_odfPageHandler
protected OdfPageHandler _odfPageHandler
Odf page handler
-
_observationManager
protected ObservationManager _observationManager
Observation manager
-
-
Constructor Detail
-
ODFRootClientSideElement
public ODFRootClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
getStatus
public Map<String,Object> getStatus(String pageId)
Get odf root page status for the current page- Parameters:
pageId
- the page identifier- Returns:
- A map representing its status
-
getOdfRootPageInfo
public Map<String,Object> getOdfRootPageInfo(String pageId)
Retrieves odf root page properties- Parameters:
pageId
- page identifier- Returns:
- the map of properties
-
addOrUpdateOdfRootProperty
public boolean addOrUpdateOdfRootProperty(String pageId, String catalog, String firstLevel, String secondLevel) throws RepositoryException
Add or update the odf root page property on a page- Parameters:
pageId
- the page identifiercatalog
- the catalog to setfirstLevel
- the first level to setsecondLevel
- the second level to set- Returns:
- true if the page has actually been modified
- Throws:
RepositoryException
- if a repository error occurs
-
_addOdfRootProperty
private boolean _addOdfRootProperty(Page page, String catalog, String firstLevel, String secondLevel) throws RepositoryException
- Throws:
RepositoryException
-
_updateOdfRootProperty
private boolean _updateOdfRootProperty(Page page, String catalog, String firstLevel, String secondLevel)
-
removeOdfRootPage
public boolean removeOdfRootPage(String pageId) throws RepositoryException
Remove the odf root page property on a page- Parameters:
pageId
- the page identifier- Returns:
- true if the property has actually been removed
- Throws:
RepositoryException
- if a repository error occurs
-
_notifyOdfRootPageChange
private void _notifyOdfRootPageChange(Page page)
-
_getVirtualProperty
private Property _getVirtualProperty(JCRAmetysObject jcrPage) throws RepositoryException
- Throws:
RepositoryException
-
_setVirtualProperty
private void _setVirtualProperty(JCRAmetysObject jcrPage, Value[] values) throws RepositoryException
- Throws:
RepositoryException
-
isVirtualPageFactoryValue
private static boolean isVirtualPageFactoryValue(Value value) throws RepositoryException
Tests if a JCR Value represents the virtual page property- Parameters:
value
- the value to test- Returns:
- true if it is the case
- Throws:
RepositoryException
- if a repository error occurs
-
-