Package com.jalios.jcms
Class TypeProcessor
java.lang.Object
com.jalios.jcms.TypeProcessor
- All Implemented Interfaces:
JcmsConstants,TypeConstants,JaliosConstants
This class generates all the resources (Java classes and JSPs) used
by the Custom Publication Types and Custom Extension
Types.
This class replaces TypeGenerator class. It uses now a template mechanism to produces all the source code (Java and JSP)
- Since:
- jcms-3.0
- Author:
- Olivier Dedieu
-
Field Summary
FieldsFields inherited from interface com.jalios.util.JaliosConstants
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_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, 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, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, TYPES_UNKNOWN_CLASS_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XMLFields 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, PACKAGE_NAME_SUFFIX, 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAllTypeFieldEntries(Class<?> clazz) Return an array ofTypeFieldEntrybound to givenClass.getAllTypeFieldEntries(String clazzName) Return an array ofTypeFieldEntrybound to givenClassrepresented by its class name.org.jdom.DocumentReturns the list of class an HBM has been generated.static TypeProcessorReturns the TypeProcessor singleton instance.org.jdom.DocumentgetNewTypeDocument(boolean create) intgetTypeDescription(Class<?> clazz, String lang) Returns the description of a given type (class) localized for the given language.org.jdom.DocumentgetTypeEntry(Class<?> clazz) Return the TypeEntry class associated to the given Class.getTypeEntry(String clazzName) Return the TypeEntry class associated to the given Class name.getTypeFieldEntries(Class<?> clazz) Return an array ofTypeFieldEntrybound to givenClass.getTypeFieldEntries(String clazzName) Return an array ofTypeFieldEntrybound to givenClassrepresented by its class name.getTypeLabel(Class<?> clazz) Deprecated.since jcms-5.7.0getTypeLabel(Class<?> clazz, String lang) Returns the label of a given type (class) localized for the given language.booleanbooleanisInGeneratedDir(File file) Looks if the file is under a generation files (classes/generated and types).static voidmarkTypeAsUpdated(org.jdom.Element typeElt, boolean markSubTypes, boolean forceUpdate) Mark the given type as updated and also its sub-types (and their "super" field)voidGenerate 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)voidRevert the currently edited TypeDocument.voidSaves the currently edited TypeDocument.
-
Field Details
-
EMPTY_TYPEFIELDENTRY_ARRAY
-
compilerCmdLineTemplate
-
compileSet
-
hbmList
-
-
Method Details
-
getInstance
Returns the TypeProcessor singleton instance.
Initialize it if it was not already done. Channel must be available!- Returns:
- the TypeProcessor singleton instance
-
getCurrentTypeDocument
public org.jdom.Document getCurrentTypeDocument()- Returns:
- the jdom Document instance of the current type
- Since:
- jcms-3.0
-
getTypeDocument
public org.jdom.Document getTypeDocument()- Returns:
- the jdom Document containing all Types Element
- Since:
- jcms-3.0
-
getNewTypeDocument
public org.jdom.Document getNewTypeDocument(boolean create) - Parameters:
create- whether a new one should be created if it has not been created yet- Returns:
- the Document (copy of
getTypeDocument()being edited) - Since:
- jcms-3.0
-
revertTypeDocument
public void revertTypeDocument()Revert the currently edited TypeDocument.- Since:
- jcms-3.0
-
getCustomTypeList
- Returns:
- a list of Class
- Since:
- jcms-3.0
-
getHbmList
Returns the list of class an HBM has been generated.- Returns:
- the list of class an HBM has been generated.
- Since:
- jcms-6.0.0
-
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)- Throws:
Exception- if an error occurs- Since:
- jcms-3.0
-
isInGeneratedDir
Looks if the file is under a generation files (classes/generated and types).- Parameters:
file- A possibly generated file- Returns:
- true if the file is in under generated directory
- Since:
- JCMS-6.0.2
-
saveNewTypeDocument
Saves the currently edited TypeDocument. Once saved, the newTypeDocument object is reset to null.- Throws:
IOException- if an error occurs during saving
-
applyTypeChange
- Throws:
Exception- if an error occurs- Since:
- jcms-3.0
-
getTypeChangeLevel
public int getTypeChangeLevel()- Returns:
- the kind of type changed occured (none/jsp/class)
- Since:
- jcms-3.0
-
getTypeEntry
Return the TypeEntry class associated to the given Class. Return null if no TypeEntry is bound toclazz.- Parameters:
clazz- theClassof which to find theTypeEntry- Returns:
- the
TypeEntryassociated to the given class or null if not available.
-
getTypeEntry
Return the TypeEntry class associated to the given Class name. Return null if no TypeEntry is bound toclazzName.- Parameters:
clazzName- theStringrepresenting the name the Class of which to find theTypeEntry- Returns:
- the
TypeEntryassociated to the given class or null if not available.
-
getTypeFieldEntries
Return an array ofTypeFieldEntrybound to givenClass.
This array does not contain inherited TypeFieldEntry from super classes of givenClass.- Parameters:
clazz- theClassof which to find theTypeFieldEntry.- Returns:
- an array of
TypeFieldEntrycontaining all Field used byClassor an empty array (never return null) - Since:
- jcms-5.5
-
getTypeFieldEntries
Return an array ofTypeFieldEntrybound to givenClassrepresented by its class name.
This array does not contain inherited TypeFieldEntry from super classes of givenClass.- Parameters:
clazzName- theStringrepresenting the name the Class of which to find theTypeFieldEntry- Returns:
- an array of
TypeFieldEntrycontaining all Field used byClassor an empty array (never return null) - Since:
- jcms-5.5
-
getAllTypeFieldEntries
Return an array ofTypeFieldEntrybound to givenClass.
This array does contain inherited TypeFieldEntry from super classes of givenClass.- Parameters:
clazz- theClassof which to find theTypeFieldEntry.- Returns:
- an array of
TypeFieldEntrycontaining all Field used byClassor an empty array (never return null) - Since:
- jcms-5.5
-
getAllTypeFieldEntries
Return an array ofTypeFieldEntrybound to givenClassrepresented by its class name.
This array does contain inherited TypeFieldEntry from super classes of givenClass.- Parameters:
clazzName- theStringrepresenting the name the Class of which to find theTypeFieldEntry- Returns:
- an array of
TypeFieldEntrycontaining all Field used byClassor an empty array (never return null) - Since:
- jcms-5.5
-
getTypeLabel
Deprecated.since jcms-5.7.0Returns the label of a given type (if TypeEntry is not null use it, otherwise return the short class name)- Parameters:
clazz- the class to get the label- Returns:
- the type label
- Since:
- jcms-5.0.0
- See Also:
-
getTypeLabel
Returns the label of a given type (class) localized for the given language.- Parameters:
clazz- the classlang- the language- Returns:
- the type label
- Since:
- jcms-5.7.0
-
getTypeDescription
Returns the description of a given type (class) localized for the given language.- Parameters:
clazz- the classlang- the language- Returns:
- the Type description
- Since:
- jcms-5.0.0
-
markTypeAsUpdated
public 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)- Parameters:
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)- Since:
- jcms-4.0
-
isCompilationDone
public boolean isCompilationDone()
-