Package com.jalios.jcms
Class TypeEntry
java.lang.Object
com.jalios.jcms.TypeEntry
This class contains info about a Type.
- Since:
- jcms-3.0
- Author:
- Olivier Dedieu, Olivier Jaquemet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected final Stringprotected booleanprotected booleanprotected String[]protected final booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected final Pluginprotected Map<String, TypeTemplateEntry> protected Stringprotected Map<String, Set<TypeTemplateEntry>> protected final org.jdom.Element -
Constructor Summary
ConstructorsConstructorDescriptionTypeEntry(String className, Map<String, String> labelMap, Map<String, String> descriptionMap, Map<String, String> titleLabelMap, Map<String, String> titleDescriptionMap, boolean isTitleML, boolean isTitleSearchable, boolean isCategoryTab, boolean isTemplateTab, boolean isReadRightTab, boolean isUpdateRightTab, boolean isWorkflowTab, boolean isAdvancedTab, boolean isDebatable, boolean isAbstract, String[] categories, String[] groups) Constructor WITHOUT XML Element, to be used for JCMS core types.Constructor XML Element, to be used for every JCMS types having an XML file. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTemplate(org.jdom.Element itElm, String typeDir) Add template to the TypeEntry from a List of XML Elements.voidAdd template to the TypeEntry from a TypeTemplateEntry.voidaddTemplateList(List<org.jdom.Element> templateList, String typeDir) Add templates to the TypeEntry from a List of XML Elements.booleanReturns true if this type contains at least one hidden field.String[]Return default categories for this typeReturns the name of the typegetDefaultTemplateEntry(String usage) Returns a default TypeTemplateEntry matching the given usage for the current workspaceReturns all default template entriesReturns all default template namesstatic Map<String, TypeTemplateEntry> getDefaultTypeTemplateEntryMap(String className, String folderPath) static Map<String, Set<TypeTemplateEntry>> getDefaultTypeTemplateEntryUsageMap(String className, String folderPath) getDescription(String lang) Returns the description of this type in the given language.Returns the description map of this type ({lang, value}).Returns roots folder for the given type Current implementation returns following files: WEB-INF/data/types/Type/ types/Type/ It do not return sub foldersRetrieve the path of the doEditMyTypeModal.jsp providing simple modal fields edition for this type.Retrieve the path of the doEditMyType.jsp providing fields edition for this type.Retrieve the path of the doMyTypeFormHandler.jsp providing instanciation of the Java Bean (subclass of JcmsFormHandler) use to edit this type.Retrieve the path of the editMyTypeModalFull.jsp providing full edition in modal for this type.Retrieve the path of the editMyTypeModal.jsp providing simple edition in modal for this type.Retrieve the path of the editMyType.jsp providing full edition of this type.Returns all files normally used by the current type.getFirstTemplateEntry(String usage, String[] names) Returns the first TypeTemplateEntry from given names matching given usage If names is empty then return default entryString[]Return default groups rights for this typeReturns the label of this type in the given language.Returns the label map of this type ({lang, value}).Returns the plugin providing this type.getTabLabel(String tabId, String lang) Returns the localized label for the given tab identifier.Returns the tab map {tabId, map{lang, label}}getTemplateEntry(String fullname) Returns a TypeTemplateEntry matching the given template nameReturns all template entriesgetTemplateEntrySet(String usage) Returns a new Set of TypeTemplateEntry matching the given usageReturns internal cached Map of usage/Set of TypeTemplateEntry.Returns a Set of all usage used by this type entrygetTitleDescription(String lang) Returns the title description of this type in the given language.Returns the title description map of this type ({lang, value}).getTitleLabel(String lang) Returns the title label of this type in the given language.Returns the title label map of this type ({lang, value}).Class<?> Retrieve the Class of the specified typeorg.jdom.ElementXML Parsing: jdom Element for this type.booleanReturn true if this type is an abstract java Class.booleanisActive()booleanDo we display Advanced tab in the edit form of instance of this type?.booleanReturns true if this type is audienced using Audience Rights (if audience rights are enabled).booleanDo we display category tab in the edit form of instance of this type?.booleanReturn true if a forum can be created on intances of this type.booleanDo we display Read Right tab in the edit form of instance of this type?.booleanDo we display template tab in the edit form of instance of this type?.booleanReturn true if the title of this type is multilingual.booleanReturn true if the title of this type is searchable.booleanReturns true if this type can be edited field by field on the front office.booleanDo we display Update Right tab in the edit form of instance of this type?.booleanDo we display Workflow tab in the edit form of instance of this type?.voidReload all I18N informations for this type.voidRemove the given TypeTemplateEntryvoidsetAdvancedTab(boolean isAdvancedTab) Do we display Advanced tab in the edit form of instance of this type?.voidsetCategories(String[] categories) Set default categoriesvoidsetCategoryTab(boolean isCategoryTab) Do we display category tab in the edit form of instance of this type?.voidsetDebatable(boolean isDebatable) Param true if a forum can be created on instances of this type.voidsetDescription(Map<String, String> descriptionMap) voidSet default groups rightvoidsetLabelMap(Map<String, String> labelMap) voidsetReadRightTab(boolean isReadRightTab) Do we display Read Right tab in the edit form of instance of this type?.voidvoidsetTemplateTab(boolean isTemplateTab) Do we display template tab in the edit form of instance of this type?.voidsetTitleDescriptionMap(Map<String, String> titleDescriptionMap) voidsetTitleLabelMap(Map<String, String> titleLabelMap) voidsetUpdateRightTab(boolean isUpdateRightTab) Do we display Update Right tab in the edit form of instance of this type?.voidsetWorkflowTab(boolean isWorkflowTab) Do we display Workflow tab in the edit form of instance of this type?.static booleansupportsCategories(Class<?> clazz) Checks if Categories are supported for the specified classstatic booleansupportsReadRights(Class<?> clazz) Checks if read rights are supported for the specified classstatic booleansupportsTemplateTab(Class<?> clazz) Checks if template tab is supported for the specified classstatic booleansupportsUpdateRights(Class<?> clazz) Checks if update rights are supported for the specified classtoString()
-
Field Details
-
xmlElt
protected final org.jdom.Element xmlElt -
className
-
isAbstract
protected final boolean isAbstract -
plugin
-
labelMap
-
descriptionMap
-
titleLabelMap
-
titleDescriptionMap
-
tabMap
-
templateMap
-
usageMap
-
isTitleML
protected boolean isTitleML -
isTitleSearchable
protected boolean isTitleSearchable -
isCategoryTab
protected boolean isCategoryTab -
isTemplateTab
protected boolean isTemplateTab -
isReadRightTab
protected boolean isReadRightTab -
isUpdateRightTab
protected boolean isUpdateRightTab -
isWorkflowTab
protected boolean isWorkflowTab -
isAdvancedTab
protected boolean isAdvancedTab -
isDebatable
protected boolean isDebatable -
isUnitFieldEdition
protected boolean isUnitFieldEdition -
isAudienced
protected boolean isAudienced -
categories
-
groups
-
containsHiddenFieldsComputed
protected boolean containsHiddenFieldsComputed -
containsHiddenFields
protected boolean containsHiddenFields -
typeDir
-
isDatabase
protected boolean isDatabase -
isHbm
protected boolean isHbm -
isRevision
protected boolean isRevision
-
-
Constructor Details
-
TypeEntry
public TypeEntry(String className, Map<String, String> labelMap, Map<String, String> descriptionMap, Map<String, String> titleLabelMap, Map<String, String> titleDescriptionMap, boolean isTitleML, boolean isTitleSearchable, boolean isCategoryTab, boolean isTemplateTab, boolean isReadRightTab, boolean isUpdateRightTab, boolean isWorkflowTab, boolean isAdvancedTab, boolean isDebatable, boolean isAbstract, String[] categories, String[] groups) Constructor WITHOUT XML Element, to be used for JCMS core types.- Parameters:
className- the class namelabelMap- the multilingual label mapdescriptionMap- the multilingual description maptitleLabelMap- the multilingual title's label maptitleDescriptionMap- the multilingual title's description mapisTitleML- is the title multilingual ?isTitleSearchable- is the title searchable ?isCategoryTab- is the category tab shown ?isTemplateTab- is the template tab shown ?isReadRightTab- is the read rights tab shown ?isUpdateRightTab- is the update rights tab shown ?isWorkflowTab- is the workflow tab shown ?isAdvancedTab- is the advanced tab shown ?isDebatable- deprecatedisAbstract- is this field used as abstract for this type ?categories- the default categoriesgroups- the default groups for read rights
-
TypeEntry
Constructor XML Element, to be used for every JCMS types having an XML file.- Parameters:
typeElt- the JDOM XML Element corresponding to the "type" elementtypeDir- the path of directory in which the type JSP will be located, relative to webapp root, eg "types/Article/",
-
-
Method Details
-
getTypeClass
Retrieve the Class of the specified type- Since:
- jcms-10.0.4 / JCMS-7831
-
supportsCategories
Checks if Categories are supported for the specified class- Parameters:
clazz- a publication class- Returns:
- true if category are supported, false otherwise
- Since:
- jcms-10.0.4 / JCMS-7831
-
supportsTemplateTab
Checks if template tab is supported for the specified class- Parameters:
clazz- a publication class- Returns:
- true if template tab is supported, false otherwise
- Since:
- jcms-10.0.4 / JCMS-7831
-
supportsReadRights
Checks if read rights are supported for the specified class- Parameters:
clazz- a publication class- Returns:
- true if read rights are supported, false otherwise
- Since:
- jcms-10.0.4 / JCMS-7831
-
supportsUpdateRights
Checks if update rights are supported for the specified class- Parameters:
clazz- a publication class- Returns:
- true if update rights are supported, false otherwise
- Since:
- jcms-10.0.4 / JCMS-7831
-
reloadI18N
public void reloadI18N()Reload all I18N informations for this type. This includes : label, description, title label, title description, tabs and templates.- Since:
- jcms-8.0.2
-
addTemplate
Add template to the TypeEntry from a List of XML Elements. Should only be used internally.- Parameters:
itElm- a JDom ElementstypeDir- path to the template- Since:
- jcms-6.0.0
-
addTemplateList
Add templates to the TypeEntry from a List of XML Elements. Should only be used internally.- Parameters:
templateList- list of JDom ElementstypeDir- path to the template- Since:
- jcms-6.0.0
-
addTemplateEntry
Add template to the TypeEntry from a TypeTemplateEntry. Should only be used internally.- Parameters:
tte- the TypeTemplateEntry- Since:
- jcms-6.0.0
-
removeTemplateEntry
Remove the given TypeTemplateEntry- Parameters:
tte- the TypeTemplateEntry- Since:
- jcms-10.0.0
-
getTemplateEntry
Returns a TypeTemplateEntry matching the given template name- Parameters:
fullname- the template name- Returns:
- TypeTemplateEntry that describe template
- Since:
- jcms-6.0.0
-
getTemplateEntrySet
Returns a new Set of TypeTemplateEntry matching the given usage- Parameters:
usage- the template usage- Returns:
- Set of TypeTemplateEntry
- Since:
- jcms-6.0.0
-
getTemplateEntrySet
Returns all template entries- Returns:
- Set of TypeTemplateEntry
-
getDefaultTemplateEntry
Returns a default TypeTemplateEntry matching the given usage for the current workspace- Parameters:
usage- the template usage- Returns:
- Set of TypeTemplateEntry
- Since:
- jcms-6.0.0
-
getDefaultTemplateEntrySet
Returns all default template entries- Returns:
- Set of TypeTemplateEntry
- Since:
- jcms-6.0.0
-
getDefaultTemplateNameSet
Returns all default template names- Returns:
- Set of template names
- Since:
- jcms-6.0.0
-
getFirstTemplateEntry
Returns the first TypeTemplateEntry from given names matching given usage If names is empty then return default entry- Parameters:
usage- the template usagenames- an array of templates name- Returns:
- TypeTemplateEntry matching
-
getTemplateUsageMap
Returns internal cached Map of usage/Set of TypeTemplateEntry. Do not modify this Map- Returns:
- Map of TypeTemplateEntry
-
getTemplateUsageSet
Returns a Set of all usage used by this type entry- Returns:
- Set of usages
-
getEditTemplatePath
Retrieve the path of the editMyType.jsp providing full edition of this type.- Returns:
- a path such as
types/Article/editArticle.jsp - Since:
- 11.0.0 / JCMS-11634
-
getEditModalSimpleTemplatePath
Retrieve the path of the editMyTypeModal.jsp providing simple edition in modal for this type.- Returns:
- a path such as
types/Article/editArticleModalFull.jsp - Since:
- 11.0.0 / JCMS-11634
-
getEditModalFullTemplatePath
Retrieve the path of the editMyTypeModalFull.jsp providing full edition in modal for this type.- Returns:
- a path such as
types/Article/editArticleModalFull.jsp - Since:
- 11.0.0 / JCMS-11634
-
getEditFormHandlerPath
Retrieve the path of the doMyTypeFormHandler.jsp providing instanciation of the Java Bean (subclass of JcmsFormHandler) use to edit this type.- Returns:
- a path such as
types/Article/doArticleFormHandler.jsp - Since:
- 11.0.0 / JCMS-11634
-
getDoEditTemplatePath
Retrieve the path of the doEditMyType.jsp providing fields edition for this type.- Returns:
- a path such as
types/Article/doEditArticle.jsp - Since:
- 11.0.0 / JCMS-11634
-
getDoEditModalTemplatePath
Retrieve the path of the doEditMyTypeModal.jsp providing simple modal fields edition for this type.- Returns:
- a path such as
types/Article/doEditArticleModal.jsp - Since:
- 11.0.0 / JCMS-11634
-
containsHiddenFields
public boolean containsHiddenFields()Returns true if this type contains at least one hidden field.- Returns:
- true if this type contains at least one hidden field.
- Since:
- jcms-5.7.1
-
toString
-
getXmlElement
public org.jdom.Element getXmlElement()XML Parsing: jdom Element for this type.
Access, but do not modify.- Returns:
- the
Elementof this type.
-
isAbstract
public boolean isAbstract()Return true if this type is an abstract java Class.- Returns:
- true if this type is an abstract java Class.
-
getLabel
Returns the label of this type in the given language.- Parameters:
lang- the language- Returns:
- the label of this type in the given language.
- Since:
- jcms-5.7.0
-
getLabelMap
Returns the label map of this type ({lang, value}).- Returns:
- the label map of this type ({lang, value}).
- Since:
- jcms-5.7.0
-
getDescription
Returns the description of this type in the given language.- Parameters:
lang- the language- Returns:
- the description of this type in the given language.
- Since:
- jcms-5.7.0
-
getDescriptionMap
Returns the description map of this type ({lang, value}).- Returns:
- the description map of this type ({lang, value}).
- Since:
- jcms-5.7.0
-
getTitleLabel
Returns the title label of this type in the given language.- Parameters:
lang- the language- Returns:
- the title label of this type in the given language.
- Since:
- jcms-5.7.0
-
getTitleLabelMap
Returns the title label map of this type ({lang, value}).- Returns:
- the title label map of this type ({lang, value}).
- Since:
- jcms-5.7.0
-
getTitleDescription
Returns the title description of this type in the given language.- Parameters:
lang- the language- Returns:
- the title description of this type in the given language.
- Since:
- jcms-5.7.0
-
getTitleDescriptionMap
Returns the title description map of this type ({lang, value}).- Returns:
- the title description map of this type ({lang, value}).
- Since:
- jcms-5.7.0
-
getTabMap
Returns the tab map {tabId, map{lang, label}}- Returns:
- the tab map {tabId, map{lang, label}}
- Since:
- jcms-5.7.0
-
getTabLabel
Returns the localized label for the given tab identifier.- Parameters:
tabId- the tab identifierlang- the language- Returns:
- the localized label for the given tab identifier.
- Since:
- jcms-5.7.0
-
isTitleML
public boolean isTitleML()Return true if the title of this type is multilingual.- Returns:
- true if the title of this type is multilingual.
-
isTitleSearchable
public boolean isTitleSearchable()Return true if the title of this type is searchable.- Returns:
- true if the title of this type is searchable.
-
isDebatable
public boolean isDebatable()Return true if a forum can be created on intances of this type.- Returns:
- true if instances of this type are debatable.
-
isUnitFieldEdition
public boolean isUnitFieldEdition()Returns true if this type can be edited field by field on the front office.- Returns:
- true if this type can be edited field by field on the front office.
-
isAudienced
public boolean isAudienced()Returns true if this type is audienced using Audience Rights (if audience rights are enabled).- Returns:
- true if this type is audienced using Audience Rights (if audience rights are enabled).
-
isCategoryTab
public boolean isCategoryTab()Do we display category tab in the edit form of instance of this type?.- Returns:
- true if category tab is displayed, false otherwise.
-
isTemplateTab
public boolean isTemplateTab()Do we display template tab in the edit form of instance of this type?.- Returns:
- true if template tab is displayed, false otherwise.
-
isReadRightTab
public boolean isReadRightTab()Do we display Read Right tab in the edit form of instance of this type?.- Returns:
- true if Read Right tab is displayed, false otherwise.
-
isUpdateRightTab
public boolean isUpdateRightTab()Do we display Update Right tab in the edit form of instance of this type?.- Returns:
- true if Update Right tab is displayed, false otherwise.
-
isWorkflowTab
public boolean isWorkflowTab()Do we display Workflow tab in the edit form of instance of this type?.- Returns:
- true if Workflow tab is displayed, false otherwise.
-
isAdvancedTab
public boolean isAdvancedTab()Do we display Advanced tab in the edit form of instance of this type?.- Returns:
- true if Advanced tab is displayed, false otherwise.
-
getCategories
Return default categories for this type- Returns:
- String[] default categories
-
getGroups
Return default groups rights for this type- Returns:
- String[] default groups
-
getClassName
Returns the name of the type- Returns:
- String the name of the type
-
getFilesPathSet
Returns all files normally used by the current type. Current implementation returns following files:- JSP in types/Type/*.jsp
- XML in WEB-INF/data/types/Type/Type.xml
- XML in WEB-INF/data/types/Type/Type-template.xml
- JAVA in WEB-INF/classes/generated/*Type*.java and .class
- Generated HBM
- Generated Revision
- Returns:
- Set a set of relative file path. FIXME: [Template] Should add new template declaration ?
-
getDirectoriesPathSet
Returns roots folder for the given type Current implementation returns following files:- WEB-INF/data/types/Type/
- types/Type/
- Returns:
- Set of path
-
getDefaultTypeTemplateEntryUsageMap
-
getDefaultTypeTemplateEntryMap
public static Map<String,TypeTemplateEntry> getDefaultTypeTemplateEntryMap(String className, String folderPath) -
setLabelMap
-
setDescription
-
setTitleLabelMap
-
setTitleDescriptionMap
-
setTabMap
-
setDebatable
public void setDebatable(boolean isDebatable) Param true if a forum can be created on instances of this type.- Parameters:
isDebatable- true if instances of this type are debatable.
-
setCategoryTab
public void setCategoryTab(boolean isCategoryTab) Do we display category tab in the edit form of instance of this type?.- Parameters:
isCategoryTab- true if category tab is displayed, false otherwise.
-
setTemplateTab
public void setTemplateTab(boolean isTemplateTab) Do we display template tab in the edit form of instance of this type?.- Parameters:
isTemplateTab- true if template tab is displayed, false otherwise.
-
setReadRightTab
public void setReadRightTab(boolean isReadRightTab) Do we display Read Right tab in the edit form of instance of this type?.- Parameters:
isReadRightTab- true if Read Right tab is displayed, false otherwise.
-
setUpdateRightTab
public void setUpdateRightTab(boolean isUpdateRightTab) Do we display Update Right tab in the edit form of instance of this type?.- Parameters:
isUpdateRightTab- true if Update Right tab is displayed, false otherwise.
-
setWorkflowTab
public void setWorkflowTab(boolean isWorkflowTab) Do we display Workflow tab in the edit form of instance of this type?.- Parameters:
isWorkflowTab- true if Workflow tab is displayed, false otherwise.
-
setAdvancedTab
public void setAdvancedTab(boolean isAdvancedTab) Do we display Advanced tab in the edit form of instance of this type?.- Parameters:
isAdvancedTab- true if Advanced tab is displayed, false otherwise.
-
setCategories
Set default categories- Parameters:
categories- String[] of default category ids
-
setGroups
Set default groups right- Parameters:
groups- String[] of default group ids
-
getPlugin
Returns the plugin providing this type.- Returns:
- the plugin providing this type.
- Since:
- jcms-10.0.0
-
isActive
public boolean isActive()
-