Class HierarchicalReferenceTableClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.cms.content.referencetable.HierarchicalReferenceTableClientSideElement
-
- All Implemented Interfaces:
ClientSideElement,LogEnabled,PluginAware,Configurable,Serviceable
public class HierarchicalReferenceTableClientSideElement extends StaticClientSideElement
This element creates a button enabling to do operation on reference table contents which can have a child.
-
-
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 ContentHelper_contentHelperThe content helperprotected ContentTypeExtensionPoint_contentTypeEPThe extension point for content typesprotected ContentTypesHelper_cTypeHelperThe content types helperprotected HierarchicalReferenceTablesHelper_hierarchicalReferenceTableContentsHelperThe helper component for hierarchical reference tablesprotected AmetysObjectResolver_resolverThe 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 HierarchicalReferenceTableClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHaveChild(String contentId)Returns true if the given content can have a child, according to its hierarchy.StringgetContentTypeForRoot(String leafContentTypeId)Gets the content type id and the default title for a child of the root node of the hierarchy of reference table contents, defined by the given leaf content typeList<String>getContentTypesForChild(String parentContentId)Gets the content types ids for a child of the given content (must be non-leaf in a hierarchy of reference tables contents)Map<String,Object>getLeafContentType(String contentTypeId, String contentId)Return the leafContentTypeStringgetParentAttributePath(String contentId)Get the path of attribute holding the parentStringgetParentAttributePathForRoot(String leafContentTypeId)Get the path of attribute when root is selectedMap<String,Object>getReferenceTableProperties(String leafContentTypeId)Get the hierarchy properties of the content types treeMap<String,Object>getTitleForEdition(String contentId)Get the title's properties for editionvoidservice(ServiceManager smanager)Map<String,Object>validateCandidate(String contentId, int actionId)Validate the candidate by removing the mixin from the content-
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
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The extension point for content types
-
_hierarchicalReferenceTableContentsHelper
protected HierarchicalReferenceTablesHelper _hierarchicalReferenceTableContentsHelper
The helper component for hierarchical reference tables
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys Object resolver
-
_cTypeHelper
protected ContentTypesHelper _cTypeHelper
The content types helper
-
_contentHelper
protected ContentHelper _contentHelper
The content helper
-
-
Constructor Detail
-
HierarchicalReferenceTableClientSideElement
public HierarchicalReferenceTableClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classStaticFileImportsClientSideElement- Throws:
ServiceException
-
canHaveChild
public boolean canHaveChild(String contentId)
Returns true if the given content can have a child, according to its hierarchy. SeeContentType.getParentAttributeDefinition()- Parameters:
contentId- The id of the content- Returns:
- true if the given content can have a child, according to its hierarchy
-
getReferenceTableProperties
public Map<String,Object> getReferenceTableProperties(String leafContentTypeId)
Get the hierarchy properties of the content types tree- Parameters:
leafContentTypeId- The id of the leaf content type, which defines the hierarchy.- Returns:
- the hierarchy properties
-
getContentTypesForChild
public List<String> getContentTypesForChild(String parentContentId)
Gets the content types ids for a child of the given content (must be non-leaf in a hierarchy of reference tables contents)- Parameters:
parentContentId- The id of the parent content- Returns:
- the content types ids
-
getContentTypeForRoot
public String getContentTypeForRoot(String leafContentTypeId)
Gets the content type id and the default title for a child of the root node of the hierarchy of reference table contents, defined by the given leaf content type- Parameters:
leafContentTypeId- The id of the leaf content type, which defines the hierarchy.- Returns:
- the content type id for the root node of the hierarchy of reference table contents
-
getLeafContentType
public Map<String,Object> getLeafContentType(String contentTypeId, String contentId)
Return the leafContentType- Parameters:
contentTypeId- the content type idcontentId- the content id to get the leaf content type from- Returns:
- the map containing the properties of the leaf content type
-
getParentAttributePath
public String getParentAttributePath(String contentId)
Get the path of attribute holding the parent- Parameters:
contentId- The id of content- Returns:
- the path of parent attribute or null if not found
-
getParentAttributePathForRoot
public String getParentAttributePathForRoot(String leafContentTypeId)
Get the path of attribute when root is selected- Parameters:
leafContentTypeId- The id of content- Returns:
- the path of parent attribute or null if not found
-
validateCandidate
public Map<String,Object> validateCandidate(String contentId, int actionId) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowException
Validate the candidate by removing the mixin from the content- Parameters:
contentId- The id of the contentactionId- the id of the workflow action- Returns:
- The result in a Map
- Throws:
com.opensymphony.workflow.WorkflowException- The Workflow ExceptionAmetysRepositoryException- The Ametys Repository Exception
-
getTitleForEdition
public Map<String,Object> getTitleForEdition(String contentId)
Get the title's properties for edition- Parameters:
contentId- The id of content being renamed- Returns:
- the title's properties
-
-