public class TypeProcessor extends java.lang.Object implements TypeConstants, JcmsConstants
This class replaces TypeGenerator class. It uses now a template mechanism to produces all the source code (Java and JSP)
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
compileList |
protected java.util.ArrayList<java.lang.String> |
compilerCmdLine |
static TypeFieldEntry[] |
EMPTY_TYPEFIELDENTRY_ARRAY |
protected java.util.List<java.lang.String> |
extendedTypeList |
protected java.util.Map<java.lang.String,java.lang.String> |
extensionsTabsMap |
protected java.util.List<java.lang.Class<?>> |
hbmList |
static java.lang.String |
REVISION |
protected java.lang.Runtime |
rt |
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
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Modifier and Type | Method and Description |
---|---|
void |
applyTypeChange() |
TypeFieldEntry[] |
getAllTypeFieldEntries(java.lang.Class<?> clazz)
Return an array of
TypeFieldEntry bound to given Class . |
TypeFieldEntry[] |
getAllTypeFieldEntries(java.lang.String clazzName)
Return an array of
TypeFieldEntry bound to given Class represented by its class name. |
org.jdom.Document |
getCurrentTypeDocument() |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getCustomExtensionMap()
Retrieves the map of custom extension
|
java.util.List<java.lang.Class<?>> |
getCustomTypeList() |
java.util.List<java.lang.String> |
getExtendedTypeList()
Returns all the classes which have a Data extension.
|
java.util.Map<java.lang.String,java.lang.String> |
getExtensionsTabsMap() |
java.util.List<java.lang.Class<?>> |
getHbmList()
Returns the list of class an HBM has been generated.
|
static TypeProcessor |
getInstance()
Returns the TypeProcessor singleton instance.
|
org.jdom.Document |
getNewTypeDocument(boolean create) |
int |
getTypeChangeLevel() |
java.lang.String |
getTypeDescription(java.lang.Class<?> clazz,
java.lang.String lang)
Returns the description of a given type (class) localized for the given language.
|
org.jdom.Document |
getTypeDocument() |
TypeEntry |
getTypeEntry(java.lang.Class<?> clazz)
Return the TypeEntry class associated to the given Class.
|
TypeEntry |
getTypeEntry(java.lang.String clazzName)
Return the TypeEntry class associated to the given Class name.
|
TypeFieldEntry[] |
getTypeFieldEntries(java.lang.Class<?> clazz)
Return an array of
TypeFieldEntry bound to given Class . |
TypeFieldEntry[] |
getTypeFieldEntries(java.lang.String clazzName)
Return an array of
TypeFieldEntry bound to given Class represented by its class name. |
java.lang.String |
getTypeLabel(java.lang.Class<?> clazz)
Deprecated.
since jcms-5.7.0
|
java.lang.String |
getTypeLabel(java.lang.Class<?> clazz,
java.lang.String lang)
Returns the label of a given type (class) localized for the given language.
|
boolean |
isCompilationDone() |
boolean |
isInGeneratedDir(java.io.File file)
Looks if the file is under a generation files (classes/generated and types).
|
static void |
markTypeAsUpdated(org.jdom.Element typeElt,
boolean markSubTypes,
boolean forceUpdate)
Mark the given type as updated and also its sub-types (and their "super" field)
|
void |
processTypes()
Generate all type's resources from the types/ directory (for old
JCMS data, convert types.xml file, to the new types organization
and extensions.xml file to the new extensions organization)
|
void |
revertTypeDocument()
Revert the currently edited TypeDocument.
|
void |
saveNewTypeDocument(boolean restartChannel)
Saves the currently edited TypeDocument.
|
public static final java.lang.String REVISION
public static final TypeFieldEntry[] EMPTY_TYPEFIELDENTRY_ARRAY
protected java.util.List<java.lang.String> extendedTypeList
protected java.util.Map<java.lang.String,java.lang.String> extensionsTabsMap
protected java.util.ArrayList<java.lang.String> compilerCmdLine
protected java.lang.Runtime rt
protected java.util.List<java.lang.String> compileList
protected java.util.List<java.lang.Class<?>> hbmList
public static TypeProcessor getInstance()
public org.jdom.Document getCurrentTypeDocument()
public org.jdom.Document getTypeDocument()
public org.jdom.Document getNewTypeDocument(boolean create)
create
- whether a new one should be created if it has not been created yetgetTypeDocument()
being edited)public void revertTypeDocument()
public java.util.List<java.lang.Class<?>> getCustomTypeList()
public java.util.Map<java.lang.String,java.lang.Class<?>> getCustomExtensionMap()
public java.util.List<java.lang.String> getExtendedTypeList()
public java.util.Map<java.lang.String,java.lang.String> getExtensionsTabsMap()
public java.util.List<java.lang.Class<?>> getHbmList()
public void processTypes() throws java.lang.Exception
java.lang.Exception
public boolean isInGeneratedDir(java.io.File file)
file
- A possibly generated filepublic void saveNewTypeDocument(boolean restartChannel) throws java.io.IOException
restartChannel
- if true, once the new types was
successfully saved, the channel is restartedjava.io.IOException
- if an error occurs during savingpublic void applyTypeChange() throws java.lang.Exception
java.lang.Exception
public int getTypeChangeLevel()
public TypeEntry getTypeEntry(java.lang.Class<?> clazz)
clazz
.clazz
- the Class
of which to find the TypeEntry
TypeEntry
associated to the given class or null if not available.public TypeEntry getTypeEntry(java.lang.String clazzName)
clazzName
.clazzName
- the String
representing the name the Class of which to find the TypeEntry
TypeEntry
associated to the given class or null if not available.public TypeFieldEntry[] getTypeFieldEntries(java.lang.Class<?> clazz)
TypeFieldEntry
bound to given Class
. Class
. clazz
- the Class
of which to find the TypeFieldEntry
.TypeFieldEntry
containing all Field used by Class
or an empty array (never return null)public TypeFieldEntry[] getTypeFieldEntries(java.lang.String clazzName)
TypeFieldEntry
bound to given Class
represented by its class name. Class
. clazzName
- the String
representing the name the Class of which to find the TypeFieldEntry
TypeFieldEntry
containing all Field used by Class
or an empty array (never return null)public TypeFieldEntry[] getAllTypeFieldEntries(java.lang.Class<?> clazz)
TypeFieldEntry
bound to given Class
. Class
. clazz
- the Class
of which to find the TypeFieldEntry
.TypeFieldEntry
containing all Field used by Class
or an empty array (never return null)public TypeFieldEntry[] getAllTypeFieldEntries(java.lang.String clazzName)
TypeFieldEntry
bound to given Class
represented by its class name. Class
. clazzName
- the String
representing the name the Class of which to find the TypeFieldEntry
TypeFieldEntry
containing all Field used by Class
or an empty array (never return null)@Deprecated public java.lang.String getTypeLabel(java.lang.Class<?> clazz)
clazz
- the class to get the labelgetTypeLabel(Class, String)
public java.lang.String getTypeLabel(java.lang.Class<?> clazz, java.lang.String lang)
clazz
- the classlang
- the languagepublic java.lang.String getTypeDescription(java.lang.Class<?> clazz, java.lang.String lang)
clazz
- the classlang
- the languagepublic static void markTypeAsUpdated(org.jdom.Element typeElt, boolean markSubTypes, boolean forceUpdate)
typeElt
- the type to mark as updatedmarkSubTypes
- if true, marks all its sub-types as updatedforceUpdate
- if true, the type (and sub-types if
'markSubTypes' is true) will be force to be updated
(i.e. regenerated)public boolean isCompilationDone()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.