com.jalios.jcms
Class TypeEntry

java.lang.Object
  extended by com.jalios.jcms.TypeEntry

public class TypeEntry
extends Object

This class contains info about a Type.

Since:
jcms-3.0
Version:
$Revision: 27753 $
Author:
Olivier Dedieu , Olivier Jaquemet

Field Summary
protected  String[] categories
           
protected  String className
           
protected  boolean containsHiddenFields
           
protected  boolean containsHiddenFieldsComputed
           
protected  Map<String,String> descriptionMap
           
protected  String[] groups
           
protected  boolean isAbstract
           
protected  boolean isAdvancedTab
           
protected  boolean isAudienced
           
protected  boolean isCategoryTab
           
protected  boolean isDebatable
           
protected  boolean isReadRightTab
           
protected  boolean isReviewable
           
protected  boolean isTemplateTab
           
protected  boolean isTitleML
           
protected  boolean isTitleSearchable
           
protected  boolean isUnitFieldEdition
           
protected  boolean isUpdateRightTab
           
protected  boolean isWorkflowTab
           
protected  Map<String,String> labelMap
           
static String REVISION
           
protected  Map<String,Map<String,String>> tabMap
           
protected  Map<String,TypeTemplateEntry> templateMap
           
protected  Map<String,String> titleDescriptionMap
           
protected  Map<String,String> titleLabelMap
           
protected  String typeDir
           
protected  Map<String,Set<TypeTemplateEntry>> usageMap
           
protected  org.jdom.Element xmlElt
           
 
Constructor Summary
TypeEntry(org.jdom.Element typeElt, String typeDir)
          Constructor XML Element, to be used for every JCMS types having an XML file.
TypeEntry(String className, Map<String,String> labelMap, Map<String,String> descriptionMap, Map<String,String> titleLabelMap, Map<String,String> titleDescriptionMap, boolean isTitleML, boolean isTitleSearchable, boolean isReviewable, 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.
 
Method Summary
 void addTemplate(org.jdom.Element itElm, String typeDir)
          Add template to the TypeEntry from a List of XML Elements.
 void addTemplateEntry(TypeTemplateEntry tte)
          Add template to the TypeEntry from a TypeTemplateEntry.
 void addTemplateList(List<org.jdom.Element> templateList, String typeDir)
          Add templates to the TypeEntry from a List of XML Elements.
 boolean containsHiddenFields()
          Returns true if this type contains at least one hidden field.
 String[] getCategories()
          Return default categories for this type
 String getClassName()
          Returns the name of the type
 TypeTemplateEntry getDefaultTemplateEntry(String usage)
          Returns a default TypeTemplateEntry matching the given usage for the current workspace
 Set<TypeTemplateEntry> getDefaultTemplateEntrySet()
          Returns all default template entries
 Set<String> getDefaultTemplateNameSet()
          Returns all default template names
static Map<String,TypeTemplateEntry> getDefaultTypeTemplateEntryMap(String className, String folderPath)
           
static Map<String,Set<TypeTemplateEntry>> getDefaultTypeTemplateEntryUsageMap(String className, String folderPath)
           
 String getDescription(String lang)
          Returns the description of this type in the given language.
 Map<String,String> getDescriptionMap()
          Returns the description map of this type ({lang, value}).
 Set<String> getDirectoriesPathSet()
          Returns roots folder for the given type Current implementation returns following files: WEB-INF/data/types/Type/ types/Type/ It do not return sub folders
 Set<String> getFilesPathSet()
          Returns all files normally used by the current type.
 TypeTemplateEntry getFirstTemplateEntry(String usage, String[] names)
          Returns the first TypeTemplateEntry from given names matching given usage If names is empty then return default entry
 String[] getGroups()
          Return default groups rights for this type
 String getLabel(String lang)
          Returns the label of this type in the given language.
 Map<String,String> getLabelMap()
          Returns the label map of this type ({lang, value}).
 String getTabLabel(String tabId, String lang)
          Returns the localized label for the given tab identifier.
 Map<String,Map<String,String>> getTabMap()
          Returns the tab map {tabId, map{lang, label}}
 TypeTemplateEntry getTemplateEntry(String fullname)
          Returns a TypeTemplateEntry matching the given template name
 Set<TypeTemplateEntry> getTemplateEntrySet()
          Returns all template entries
 Set<TypeTemplateEntry> getTemplateEntrySet(String usage)
          Returns a new Set of TypeTemplateEntry matching the given usage
 Map<String,Set<TypeTemplateEntry>> getTemplateUsageMap()
          Returns internal cached Map of usage/Set of TypeTemplateEntry.
 Set<String> getTemplateUsageSet()
          Returns a Set of all usage used by this type entry
 String getTitleDescription(String lang)
          Returns the title description of this type in the given language.
 Map<String,String> getTitleDescriptionMap()
          Returns the title description map of this type ({lang, value}).
 String getTitleLabel(String lang)
          Returns the title label of this type in the given language.
 Map<String,String> getTitleLabelMap()
          Returns the title label map of this type ({lang, value}).
 org.jdom.Element getXmlElement()
          XML Parsing: jdom Element for this type.
 boolean isAbstract()
          Return true if this type in an abstract java Class.
 boolean isAdvancedTab()
          Do we display Advanced tab in the edit form of instance of this type?.
 boolean isAudienced()
          Returns true if this type is audienced using Audience Rights (if audience rights are enabled).
 boolean isCategoryTab()
          Do we display category tab in the edit form of instance of this type?.
 boolean isDebatable()
          Return true if a forum can be created on intances of this type.
 boolean isReadRightTab()
          Do we display Read Right tab in the edit form of instance of this type?.
 boolean isReviewable()
          Return true if some reviews can be created on intances of this type.
 boolean isTemplateTab()
          Do we display template tab in the edit form of instance of this type?.
 boolean isTitleML()
          Return true if the title of this type is multilingual.
 boolean isTitleSearchable()
          Return true if the title of this type is searchable.
 boolean isUnitFieldEdition()
          Returns true if this type can be edited field by field on the front office.
 boolean isUpdateRightTab()
          Do we display Update Right tab in the edit form of instance of this type?.
 boolean isWorkflowTab()
          Do we display Workflow tab in the edit form of instance of this type?.
 void setAdvancedTab(boolean isAdvancedTab)
          Do we display Advanced tab in the edit form of instance of this type?.
 void setCategories(String[] categories)
          Set default categories
 void setCategoryTab(boolean isCategoryTab)
          Do we display category tab in the edit form of instance of this type?.
 void setDebatable(boolean isDebatable)
          Param true if a forum can be created on instances of this type.
 void setDescription(Map<String,String> descriptionMap)
           
 void setGroups(String[] groups)
          Set default groups right
 void setLabelMap(Map<String,String> labelMap)
           
 void setReadRightTab(boolean isReadRightTab)
          Do we display Read Right tab in the edit form of instance of this type?.
 void setReviewable(boolean isReviewable)
          Param true if some reviews can be created on instances of this type.
 void setTabMap(Map<String,Map<String,String>> tabMap)
           
 void setTemplateTab(boolean isTemplateTab)
          Do we display template tab in the edit form of instance of this type?.
 void setTitleDescriptionMap(Map<String,String> titleDescriptionMap)
           
 void setTitleLabelMap(Map<String,String> titleLabelMap)
           
 void setUpdateRightTab(boolean isUpdateRightTab)
          Do we display Update Right tab in the edit form of instance of this type?.
 void setWorkflowTab(boolean isWorkflowTab)
          Do we display Workflow tab in the edit form of instance of this type?.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

xmlElt

protected final org.jdom.Element xmlElt

className

protected final String className

isAbstract

protected final boolean isAbstract

labelMap

protected Map<String,String> labelMap

descriptionMap

protected Map<String,String> descriptionMap

titleLabelMap

protected Map<String,String> titleLabelMap

titleDescriptionMap

protected Map<String,String> titleDescriptionMap

tabMap

protected Map<String,Map<String,String>> tabMap

templateMap

protected Map<String,TypeTemplateEntry> templateMap

usageMap

protected Map<String,Set<TypeTemplateEntry>> usageMap

isTitleML

protected boolean isTitleML

isTitleSearchable

protected boolean isTitleSearchable

isReviewable

protected boolean isReviewable

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

protected String[] categories

groups

protected String[] groups

containsHiddenFieldsComputed

protected boolean containsHiddenFieldsComputed

containsHiddenFields

protected boolean containsHiddenFields

typeDir

protected String typeDir
Constructor Detail

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 isReviewable,
                 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.


TypeEntry

public TypeEntry(org.jdom.Element typeElt,
                 String typeDir)
Constructor XML Element, to be used for every JCMS types having an XML file.

Method Detail

addTemplate

public void addTemplate(org.jdom.Element itElm,
                        String typeDir)
Add template to the TypeEntry from a List of XML Elements. Should only be used internally.

Parameters:
itElm - a JDom Elements
typeDir - path to the template
Since:
jcms-6.0.0

addTemplateList

public void addTemplateList(List<org.jdom.Element> templateList,
                            String typeDir)
Add templates to the TypeEntry from a List of XML Elements. Should only be used internally.

Parameters:
templateList - list of JDom Elements
typeDir - path to the template
Since:
jcms-6.0.0

addTemplateEntry

public void addTemplateEntry(TypeTemplateEntry tte)
Add template to the TypeEntry from a TypeTemplateEntry. Should only be used internally.

Parameters:
tte - a JDom Elements
Since:
jcms-6.0.0

getTemplateEntry

public TypeTemplateEntry getTemplateEntry(String fullname)
Returns a TypeTemplateEntry matching the given template name

Parameters:
fullname - the template name
Returns:
TypeTemplateEntry that describe template
Since:
jcms-6.0.0

getTemplateEntrySet

public Set<TypeTemplateEntry> getTemplateEntrySet(String usage)
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

public Set<TypeTemplateEntry> getTemplateEntrySet()
Returns all template entries

Returns:
Set of TypeTemplateEntry

getDefaultTemplateEntry

public TypeTemplateEntry getDefaultTemplateEntry(String usage)
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

public Set<TypeTemplateEntry> getDefaultTemplateEntrySet()
Returns all default template entries

Returns:
Set of TypeTemplateEntry
Since:
jcms-6.0.0

getDefaultTemplateNameSet

public Set<String> getDefaultTemplateNameSet()
Returns all default template names

Returns:
Set of template names
Since:
jcms-6.0.0

getFirstTemplateEntry

public TypeTemplateEntry getFirstTemplateEntry(String usage,
                                               String[] names)
Returns the first TypeTemplateEntry from given names matching given usage If names is empty then return default entry

Parameters:
usage - the template usage
names - an array of templates name
Returns:
TypeTemplateEntry matching

getTemplateUsageMap

public Map<String,Set<TypeTemplateEntry>> getTemplateUsageMap()
Returns internal cached Map of usage/Set of TypeTemplateEntry. Do not modify this Map

Returns:
Map of TypeTemplateEntry

getTemplateUsageSet

public Set<String> getTemplateUsageSet()
Returns a Set of all usage used by this type entry

Returns:
Set of usages

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

public String toString()
Overrides:
toString in class Object

getXmlElement

public org.jdom.Element getXmlElement()
XML Parsing: jdom Element for this type.
Access, but do not modify.

Returns:
the Element of this type.

isAbstract

public boolean isAbstract()
Return true if this type in an abstract java Class.

Returns:
true if this type in an abstract java Class.

getLabel

public String getLabel(String lang)
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

public Map<String,String> 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

public String getDescription(String lang)
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

public Map<String,String> 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

public String getTitleLabel(String lang)
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

public Map<String,String> 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

public String getTitleDescription(String lang)
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

public Map<String,String> 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

public Map<String,Map<String,String>> getTabMap()
Returns the tab map {tabId, map{lang, label}}

Returns:
the tab map {tabId, map{lang, label}}
Since:
jcms-5.7.0

getTabLabel

public String getTabLabel(String tabId,
                          String lang)
Returns the localized label for the given tab identifier.

Parameters:
tabId - the tab identifier
lang - 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.

isReviewable

public boolean isReviewable()
Return true if some reviews can be created on intances of this type.

Returns:
true if instances of this type are reviewable.

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

public String[] getCategories()
Return default categories for this type

Returns:
String[] default categories

getGroups

public String[] getGroups()
Return default groups rights for this type

Returns:
String[] default groups

getClassName

public String getClassName()
Returns the name of the type

Returns:
String the name of the type

getFilesPathSet

public Set<String> getFilesPathSet()
Returns all files normally used by the current type. Current implementation returns following files: It do not retrieve custom template files outside of these scopes. It do not check if file exists on disk

Returns:
Set a set of relative file path. FIXME: [Template] Should add Hibernate .hbm description ? FIXME: [Template] Should add new template declaration ?

getDirectoriesPathSet

public Set<String> getDirectoriesPathSet()
Returns roots folder for the given type Current implementation returns following files: It do not return sub folders

Returns:
Set of path

getDefaultTypeTemplateEntryUsageMap

public static Map<String,Set<TypeTemplateEntry>> getDefaultTypeTemplateEntryUsageMap(String className,
                                                                                     String folderPath)

getDefaultTypeTemplateEntryMap

public static Map<String,TypeTemplateEntry> getDefaultTypeTemplateEntryMap(String className,
                                                                           String folderPath)

setLabelMap

public void setLabelMap(Map<String,String> labelMap)

setDescription

public void setDescription(Map<String,String> descriptionMap)

setTitleLabelMap

public void setTitleLabelMap(Map<String,String> titleLabelMap)

setTitleDescriptionMap

public void setTitleDescriptionMap(Map<String,String> titleDescriptionMap)

setTabMap

public void setTabMap(Map<String,Map<String,String>> tabMap)

setReviewable

public void setReviewable(boolean isReviewable)
Param true if some reviews can be created on instances of this type.

Parameters:
isReviewable - true if instances of this type are reviewable.

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

public void setCategories(String[] categories)
Set default categories

Parameters:
categories - String[] of default category ids

setGroups

public void setGroups(String[] groups)
Set default groups right

Parameters:
groups - String[] of default group ids


Copyright © 2001-2010 Jalios SA. All Rights Reserved.