|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.TypeTemplateEntry
public class TypeTemplateEntry
This class contains info about Type's template.
Nested Class Summary | |
---|---|
static class |
TypeTemplateEntry.LabelComparator
|
Field Summary | |
---|---|
protected Map<String,String> |
descriptionMap
|
protected boolean |
isInternal
|
protected boolean |
isPlugged
|
protected Map<String,String> |
labelMap
|
protected String |
name
|
protected String |
path
|
static String |
REVISION
|
protected String |
usage
|
static String |
USAGE_DISPLAY_BOX
|
static String |
USAGE_DISPLAY_FULL
|
static String |
USAGE_DISPLAY_FULL_PDA
|
static String |
USAGE_DISPLAY_MODAL
|
static String |
USAGE_DISPLAY_QUERY
|
static String |
USAGE_DISPLAY_QUERY_PDA
|
static String |
USAGE_EDIT
|
static String |
USAGE_EDIT_FRONT
|
static String |
USAGE_EDIT_MODAL
|
static String |
USAGE_EDIT_POPUP
|
Fields inherited from interface com.jalios.jcms.TypeConstants |
---|
CHANGE_LEVEL_CLASS, CHANGE_LEVEL_JSP, CHANGE_LEVEL_NONE, DISPLAY_TPLT_TAG, EXTENSIONS_XML, FIELD_ELT, FIELD_NEW_MARK, FIELD_UPDATED_MARK, FIELDS_ELT, FILE_INDEX_LISTENER, LINK_INDEX_LISTENER, OLD_TYPES_DIR, PACKAGE_NAME, QUERY_TPLT_TAG, TAB_ELT, TABS_ELT, TEMPLATE_TAG, TEMPLATES_SUFFIX, TEMPLATES_TAG, TITLE_ELT, TYPE_ELT, TYPE_FORCE_UPDATE_MARK, TYPE_NEW_MARK, TYPE_UPDATED_MARK, TYPES_DIR, TYPES_XML |
Constructor Summary | |
---|---|
TypeTemplateEntry()
Default Constructor |
Method Summary | |
---|---|
String[] |
checkIntegrity()
Check the integrity of the template fields |
int |
compareTo(Object obj)
|
static void |
convertTemplate(org.jdom.Element elm,
boolean isPortlet)
Convert the given JDOM Element representing a template declaration from JCMS 5.7.x to JCMS 6.0.x |
static void |
convertTemplate(File tmplFile)
Convert the given File representing type's templates from JCMS 5.7.x to JCMS 6.0.x |
static TypeTemplateEntry |
decodeTemplate(org.jdom.Element itElm,
String folderPath)
Build a TypeTemplateEntry from the given JDom Element |
static org.jdom.Element |
encodeTemplate(TypeTemplateEntry tte)
Build a JDom Element from the given TypeTemplateEntry |
boolean |
equals(Object obj)
|
String |
getDescription(String userLang)
Returns the description of the template for given user language |
Map<String,String> |
getDescriptionMap()
Returns the map of descriptions. |
String |
getInternalName()
Returns the full name of the template that will be stored in the store.xml |
String |
getLabel(String userLang)
Returns the label of the template for given user language |
Map<String,String> |
getLabelMap()
Returns the map of labels. |
String |
getName()
Returns the name of the template this name must be unique for the type declaration. |
String |
getPath()
Returns the path (e.g. |
String |
getThumbnailPath()
Returns the path to the thumbnail of this template or s.gif if it could not be found. |
String |
getThumbnailPath(int width,
int height,
String defaultImagePath)
Retrieve the path to the thumbnail of this template in the specified dimension. |
String |
getUsage()
Returns the usage of the template (e.g. |
boolean |
isInternal()
Returns true if the template entry has been generated by JCMS without parsing an existing TypeElement. |
boolean |
isPlugged()
Returns true if the template entry has been added by pluggin mechanism. |
static TypeTemplateEntry |
resolveDefaultTemplateEntry(Set<TypeTemplateEntry> tmplSet,
String defaultUsage,
String defaultPath)
Returns a default TypeTemplateEntry in the given Set otherwise return a dummy template with the defaultUsage. |
void |
setDescription(String userLang,
String value)
Set the description for the given user language |
void |
setDescriptionMap(Map<String,String> descriptionMap)
Set the descriptions for the given template. |
void |
setInternalName(String name)
Set the name of the template this name must be unique for the type declaration. |
void |
setLabel(String userLang,
String value)
Set the label for the given user language |
void |
setLabelMap(Map<String,String> labelMap)
Set the labels for the given template. |
void |
setPath(String path)
Set the path of the template. |
void |
setPlugged(boolean plugged)
Returns true if the template entry has been added by pluggin mechanism. |
void |
setUsage(String usage)
Set the usage of the template (e.g. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final String USAGE_DISPLAY_BOX
public static final String USAGE_DISPLAY_FULL
public static final String USAGE_DISPLAY_QUERY
public static final String USAGE_DISPLAY_MODAL
public static final String USAGE_DISPLAY_FULL_PDA
public static final String USAGE_DISPLAY_QUERY_PDA
public static final String USAGE_EDIT
public static final String USAGE_EDIT_FRONT
public static final String USAGE_EDIT_MODAL
public static final String USAGE_EDIT_POPUP
protected String name
protected String usage
protected String path
protected Map<String,String> labelMap
protected Map<String,String> descriptionMap
protected boolean isInternal
protected boolean isPlugged
Constructor Detail |
---|
public TypeTemplateEntry()
Method Detail |
---|
public String getName()
public String getInternalName()
public void setInternalName(String name)
public String getPath()
public void setPath(String path)
public String getUsage()
public void setUsage(String usage)
public String getLabel(String userLang)
userLang
- the user language
public void setLabel(String userLang, String value)
userLang
- the user languagevalue
- the labelpublic Map<String,String> getLabelMap()
public void setLabelMap(Map<String,String> labelMap)
labelMap
- the Map of labelpublic String getDescription(String userLang)
userLang
- the user language
public void setDescription(String userLang, String value)
userLang
- the user languagevalue
- the descriptionpublic Map<String,String> getDescriptionMap()
public void setDescriptionMap(Map<String,String> descriptionMap)
descriptionMap
- the map of descriptionpublic boolean isInternal()
public boolean isPlugged()
public void setPlugged(boolean plugged)
public String getThumbnailPath()
public String getThumbnailPath(int width, int height, String defaultImagePath)
If the thumbnail could not be created (no preview available for this template), the defaultImagePath is returned instead.
Warning : This method create a thumbnail when it does not exists, this process can be a little time consumming, make sure you do not need immediate response time when using it.
width
- the width of the thumbnail to create/reuseheight
- the height of the thumbnail to create/reusedefaultImagePath
- the default image path used if the thumbnail could not be created
public String[] checkIntegrity()
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object obj)
compareTo
in interface Comparable
public static TypeTemplateEntry resolveDefaultTemplateEntry(Set<TypeTemplateEntry> tmplSet, String defaultUsage, String defaultPath)
tmplSet
- a Set of TypeTemplateEntry (that may already refined on usage or null)defaultUsage
- the template usagedefaultPath
- null or override the path of the dummy tte
public static void convertTemplate(File tmplFile) throws org.jdom.JDOMException, IOException
tmplFile
- the type's template file Type-template.xml
org.jdom.JDOMException
IOException
public static void convertTemplate(org.jdom.Element elm, boolean isPortlet)
elm
- JDOM Element with qname "template"public static TypeTemplateEntry decodeTemplate(org.jdom.Element itElm, String folderPath)
itElm
- a JDom ElementfolderPath
- path to the template filepublic static org.jdom.Element encodeTemplate(TypeTemplateEntry tte)
tte
- TypeTemplateEntry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |