com.jalios.jcms
Class Channel

java.lang.Object
  extended by com.jalios.jcms.Channel
All Implemented Interfaces:
JcmsConstants, JaliosConstants, JPropertiesListener

public class Channel
extends Object
implements JcmsConstants, JPropertiesListener

The Channel singleton is the main access point of the JCMS API.
This singleton is initialized automatically on startup by the servlet ChannelInitServlet declared in web.xml.

The following methods of Channel may be useful for your developments in JCMS.

  • Retrieving data from JCMS

  • Listeners, Data Controllers RightPolicyFilter, Query Filters and Authentication Handlers

  • Accessing Properties and Language Properties

    The JCMS API provides simple methods to read properties from configuration files and from languages files.
    As of version 5.5.0 JCMS does not yet differentiate configuration properties from languages properties.
  • Updating and saving properties methods

    Should you need to change any of your custom properties, you can use some methods listed below. We do not support the use of the following methods to change any JCMS property at runtime, behaviour of JCMS maybe incorrect if you do not use the user interface for such task.
  • Converting relative path to File

    Use the following methods to easely convert relative path into Files and vice-versa. Useful for configuration files, uploaded files, file manipulations, etc.
        File confFile = new File(channel.getDataPath("conf.xml"));
        ...
      
  • Communicating by email

    Use those method to retrieve the correct sender to use when sending an email from your java code.
        String sender = channel.getSenderFullEmail();
        Strint recipient = newMbr.getFullEmail();
        String subject = "[" + channel.getName() + "] " + "Welcome!"; // TO DO: I18N
        String content = "Welcome " + newMbr.getFriendlyName() + "\nEnjoy our new site!"; // TO DO: I18N
        MailUtil.sendMail(sender, recipient, subject, content);
      
  • Store Manipulation

    WARNING: Modifying the Store can be very dangerous!!! Only use the following methods if you fully understand their behaviour and their consequences.

  • Others methods of the Channel should be used wisely even though they are public.

    Version:
    $Revision: 59254 $

    Nested Class Summary
     class Channel.TypeLabelComparator
              Sort type according their label in a given language.
     
    Field Summary
    protected  boolean adminIpNoPattern
               
    protected  org.apache.oro.text.regex.Pattern adminIpPattern
               
    protected  Set<Category> advRefineRootSet
               
    protected  Map<String,AlarmManager> alarmManagerMap
               
    protected  HashMap<Class<?>,Map<String,TypeFieldEntry>> allTypeFieldEntriesCacheMap
               
    protected  AppServerInfo appServerInfo
               
    protected  AuthenticationManager authMgr
               
    protected  CacheManager cacheManager
               
    protected static Channel channel
               
    protected  TreeSet<ChannelListener> channelListenerSet
               
    protected  Map<Class<? extends Data>,Set<Data>> class2dataSet
               
    protected  ClassLoader classLoader
               
    protected  List<CustomCleanFilter> cleanFilterList
               
    protected  javax.servlet.ServletContext context
               
    protected  ArrayList<Class<? extends Publication>> coreTypeList
               
    protected  String country
               
    protected  ThreadLocal<javax.servlet.http.HttpServletRequest> currentServletRequest
               
    protected  ThreadLocal<javax.servlet.http.HttpServletResponse> currentServletResponse
               
    protected  String customPropFilePath
               
    protected  HashMap<Class<?>,Set<DataController>> dataControllerMap
               
    protected  TreeMap<Data,ControllerStatus> dataIntegrityReport
               
    protected  Date dataIntegrityReportDate
               
    protected  DataListener dataListener
               
    protected  SimpleDateFormat dateFormat
               
    protected  HashMap<String,SimpleDateFormat> dateFormatMap
               
    protected  SimpleDateFormat dateTimeFormat
               
    protected  HashMap<String,SimpleDateFormat> dateTimeFormatMap
               
    protected  Member defaultAdmin
               
    protected  String defaultEmail
               
    protected  Group defaultGroup
               
    protected  String[] defaultQueryTypes
               
    protected  String[] defaultQueryTypesOff
               
    protected  Workspace defaultWorkspace
               
    protected  HashMap<Class<?>,Map<String,TypeFieldEntry>> exactTypeFieldEntriesCacheMap
               
    protected  ObjectLongTreeMap fileSizeMap
               
    protected  FileIndexManager fim
               
    protected  HashMap<String,String> ipToReverseProxyConfNameMap
               
    protected  boolean isAvailable
               
    protected  boolean isDataWriteEnabled
               
    protected  boolean isDataWriteEnabledComputed
               
    protected  boolean isDeployManagerEnabled
               
    protected  boolean isGzipCompressionEnabled
               
    protected  boolean isNotificationEnabled
               
    protected  boolean isReverseProxyEnabled
               
    protected static boolean isSSLenabled
               
    protected  boolean isUsingAdvancedI18N
               
    protected  boolean isWebdavEnable
               
    protected  boolean isWebdavEnableComputed
               
    protected  JcmsInfo jcmsInfo
               
    protected  ArrayList<String> jcmsLangList
               
    protected  boolean jsyncAutoUpdate
               
    protected  long jsyncDownloadInterval
               
    protected  boolean jsyncEnabled
               
    protected  String jsyncExplicitReplicaList
               
    protected  boolean jsyncHasLeader
               
    protected  org.apache.oro.text.regex.Pattern jsyncIpPattern
               
    protected  String jsyncLeaderUrl
               
    protected  JSyncPreviousReplicaManager jsyncPreviousReplicaManager
               
    protected  JSyncReplica jsyncReplica
               
    protected  String jsyncReplicaUrl
               
    protected  long jsyncStabDelay
               
    protected  boolean jsyncSuggestJoin
               
    protected  boolean jsyncSyncFiles
               
    protected  String jsyncUpdateMode
               
    protected  ArrayList<String> langList
               
    protected  ArrayList<String> langListOrdered
               
    protected  String language
               
    protected  LDAPConfiguration ldapConf
               
    protected  LinkIndexManager lim
               
    protected  LimitController limitController
               
    protected  Locale locale
               
    protected  ArrayList<String> localizedLangList
               
    protected  String logFilePath
               
    protected  LuceneMemberSearchEngine mbrSearchEngine
               
    protected  String name
               
    protected  AlarmEntry nlAlarmEntry
               
    protected  CategoryRight noCategoryRight
               
    protected  NotificationManager notificationManager
               
    protected  ArrayList<String> otherLangList
               
    protected  PolicyManager policyManager
               
    protected  LangProperties properties
               
    protected  Class<?>[] publicationSuperTypes
               
    protected  Map<String,List<Class<? extends Publication>>> publicationTypeMap
               
    protected  PublicationListener pubListener
               
    protected  Set<Publication> pubWithoutCategories
               
    protected  QueryManager queryMgr
               
    protected  int realPathLength
               
    protected  Set<Category> refineRootSet
               
    protected  HashMap<String,String> reverseProxyBaseURL
               
    protected  HashMap<String,String> reverseProxyContextPath
               
    protected  HashMap<String,String> reverseProxySSLBaseURL
               
    static String REVISION
               
    protected  HashSet<String> rightToLeftLanguageSet
               
    protected  Category rootCategory
               
    protected  Set<Category> rootCategoryAsSet
               
    protected  CategoryRight rootCategoryRight
               
    protected  Set<Category> searchRootSet
               
    protected  String securedUrl
               
    protected static int SSLport
               
    protected  StatReportListener statReportListener
               
    protected  Store store
               
    protected  File storeBackupDir
               
    protected  int storeBackupMax
               
    protected  Category tagRoot
               
    protected  TypeProcessor typeProcessor
               
    protected  String uri
               
    protected  String urid
               
    protected  String url
               
    protected  HashMap<Storable,String> virtualIDMap
               
    protected  int[] visiblePstatus
               
    protected  File webappDir
               
    protected  String webappPropFilePath
               
    protected  String webdavEncoding
               
    protected  boolean workspacesIpNoPattern
               
    protected  org.apache.oro.text.regex.Pattern workspacesIpPattern
               
     
    Fields inherited from interface com.jalios.jcms.JcmsConstants
    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_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, 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, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
     
    Fields 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_YEAR
     
    Method Summary
     void addAuthenticationHandler(AuthenticationHandler authHandler)
              Add the specified AuthenticationHandler to the list of AuthenticationHandlers used by the AuthenticationManager to process users' authentication.
     void addChannelListener(ChannelListener listener)
              Adds a ChannelListener.
     void addCleanFilter(CustomCleanFilter filter)
              Adds a custom clean filter.
     void addDataController(DataController dc, Class<?> clazz)
              Add the given DataController
     void addDBListener(DBListener listener)
              Add a DBListener to listen to all the Data.
     void addDBListener(DBListener listener, Class<?> clazz)
              Add a DBListener to listen to the given class of data.
     void addPolicyFilter(PolicyFilter pf)
              Add the given PolicyFilter to the list of RightPolicyFilter used by the PolicyManager (getPolicyManager()).
     void addPropertiesListener(JPropertiesListener listener)
              Adds a properties listener.
     void addQueryFilter(QueryFilter qf)
              Add the given QueryFilter to the list of QueryFilters used by the QueryManager (getQueryManager()).
     void addStoreListener(StoreListener listener, boolean repeat)
              Adds a StoreListener for all storable classes.
     void addStoreListener(StoreListener listener, Class<?> clazz, boolean repeat)
              Adds a StoreListener associated to a given class.
     void appendMilestone(String text)
              Appends a milestone in the store.
     boolean canMemberAccessFile(String filename, Member member)
              Check if the given member can access the given file (dangling documents are checked, see checkMemberAccessFile()).
     boolean checkCrypt(String candidate_plaintext, String stored_hash)
              Check a plain text string against an encrypted string previoulsy stored in JCMS.
     int checkMemberAccessFile(String filename, Member member, Set<String> authorizedFilenames)
              Check the access mode the given member has for the given file
     void cleanStore(CleanFilter filter, JcmsContext context)
              Cleans the store.
     void clearCurrentServletRequest()
              Removes the current servlet request of the thread.
     void clearCurrentServletResponse()
              Removes the current servlet response of the thread.
     boolean containsProperty(String name)
              Tests if this JProperties contains the given property key/name.
     void createData(Data data, Member opAuthor)
              Creates a data in the store.
     String crypt(String str)
              Hash the specified string with the BCrypt encryption algorithm.
     void deleteData(Data data, Member opAuthor)
              Delete a data in the store.
    protected static void destroy()
              Singleton Method to finaliez and destroy the channel.
     void disableDataWrite(String msg)
              Disable data write.
     void enableDataWrite()
              Enable data wirte.
    protected  void finalize()
              Handles the finalize invocation
     void fireChannelFinalize()
              Call method ChannelListener.handleFinalize() of every registered ChannelListener.

    This methods is called when the site is restarted or shutdown.
     void generateLogFromMemory()
              Generates a cleaned version of the store.
    CAUTION: All operations on deleted data are removed. All update operations are integrated in a new creation operation (except cycling data references which are resolved in a second update step). The previous store is backuped with the extension .bak
     Set<Category> getAdvRefineRootSet()
              Returns the categories to used as roots for the advanced refinement.
     AlarmManager getAlarmManager(String name)
              Returns the AlarmManager associated to the given name.
     Map<String,AlarmManager> getAllAlarmManager()
              Returns All alarmManager present in the channel
     TreeSet<Data> getAllDataSet()
              Returns all the data of this site in a new TreeSet.
    <T> TreeSet<T>
    getAllDataSet(Class<T> clazz)
              Returns all instances of a given class and it's subclass.
    <T extends Publication>
    TreeSet<T>
    getAllPublicationSet(Class<T> clazz, Member member)
              Returns all publications of a given class AND subclasses that can be accessed by a given member and that are in a visible state.
    <T extends Publication>
    TreeSet<T>
    getAllPublicationSet(Class<T> clazz, Member member, boolean checkPstatus)
              Returns all publications of a given class AND subclasses that can be accessed by a given member.
     TypeFieldEntry[] getAllTypeFieldEntries(Class<?> clazz)
              Return an array of TypeFieldEntry bound to given Class.
     TypeFieldEntry[] getAllTypeFieldEntries(String className)
              Return an array of TypeFieldEntry bound to given Class name.
     AppServerInfo getAppServerInfo()
              Return the AppServerInfo instance (a singleton) which describe the underlying application server.
     AuthenticationManager getAuthMgr()
              Returns the current AuthenticationManager instance used by JCMS to authenticate members into JCMS.
     boolean getBooleanProperty(String name, boolean defaultValue)
              Gets the value of a property as a boolean given its key/name.
     CacheManager getCacheManager()
               
     Category getCategory(String id)
              Returns a category from its id
     CategoryRight getCategoryRight(HashSet<Category> roots, int mode, boolean create)
              Returns the CategoryRight matching the given criteria
    static Channel getChannel()
              Singleton Method to get the channel
     JProperties getChannelProperties()
              Returns the internal properties used by channel.
     Class getClass(String className)
              Load and return a class
     Class[] getClass(String[] clazzStr)
              Load and return classes
     ClassLoader getClassLoader()
              Returns the classLoader
     String getCleanFilename(String filename)
              Clean the given filename.
     List<CustomCleanFilter> getCleanFilterList()
              Returns the list of custom clean filters.
     AlarmManager getCommonAlarmManager()
              Returns the common AlarmManager.
     Set<Group> getCommonGroupSet()
              Return all the global groups
     ArrayList<Class<? extends Publication>> getCoreTypeList()
              Returns all the available core publication types (Review, FileDocument, ArchivedPublication...)
     String getCountry()
              Retrieve the default country of the site
     Member getCurrentDelegateMember()
              Returns the original Member of the current session if he has connected to another account since then (using JCMS_sulogin feature).
    Uses DelegationAuthenticationHandler.getSuHistory(HttpServletRequest).
    Used by internal method during data creation/update/delete to correctly set the opDelegate field of any Data.

    This method must be called during a user request to work otherwise it returns null.
     JcmsContext getCurrentJcmsContext()
              Returns the JcmsContext of the current servlet request of the current thread.
     Member getCurrentLoggedMember()
              Returns the Member currently loggued in for the current request.
     javax.servlet.http.HttpServletRequest getCurrentServletRequest()
              Returns the current servlet request.
     javax.servlet.http.HttpServletResponse getCurrentServletResponse()
              Returns the current servlet response.
     String getCurrentUserLang()
              Returns the user language if it is available (i.e.
     Locale getCurrentUserLocale()
              Returns the user Locale if it is available (i.e.
     Collection<Class<?>> getCustomExtensionCollection()
              Returns all the DataExtension classes.
     Map<String,Class<?>> getCustomExtensionMap()
              Returns the map of String (Class) to data extension (Class).
     List getCustomTypeList()
              Return the list of custom publication types Class, that is all the Publication Class of package "generated.".
    <T extends Data>
    T
    getData(Class<T> clazz, String id)
              Returns a data from its id.
     Data getData(String id)
              Returns a data from its id
    <T> Iterator<T>
    getDataAndDBDataIterator(Class<T> clazz)
              Returns an iterator on an hybrid list of data stored in the database and JStore.
     Map<Class<?>,Set<DataController>> getDataControllerMap()
              Returns the internal map class/DataController.
     Set<DataController> getDataControllerSet(Class<?> clazz)
               
     long getDataCount(Class<? extends Data> clazz)
              Returns the number of data available for the given class.
     Map<Data,ControllerStatus> getDataIntegrityReport(boolean refresh)
              Checks the integrity constraints of all the data in the store.
     Date getDataIntegrityReportDate()
              Returns the date of the last report generation.
     ArrayList<Data> getDataList(String[] ids)
              Returns the instances associated to an array of ids.
    <T extends Data>
    ArrayList<T>
    getDataList(String[] ids, boolean ignoreNull, Class<T> clazz)
              Returns the data corresponding to the given array of data ids.
     String getDataPath(String uri)
              Retrieves the file system path of the specified uri relative to the directory /WEB-INF/data/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     DataRight getDataRight(boolean canPublish, boolean canUpdateOther, boolean canDeleteOther, boolean create)
              Returns a DataRight matching the given criteria.
    <T> TreeSet<T>
    getDataSet(Class<T> clazz)
              Returns all instances of a given class and it's subclass.
     TreeSet<?> getDataSet(String[] ids)
              Returns the instances associated to an array of ids.
    <T> TreeSet<T>
    getDataSet(String[] ids, Class<? extends T> clazz, boolean neverNull)
              Returns a set of data from an array of idenfiers.
     String getDataSourceLabel(String dataSource, String userLang)
              Returns the label for the given data source.
     SimpleDateFormat getDateFormat(String lang)
              Retrieve a Date formated suitable for parsing and formatting of date input of JCMS forms.
     SimpleDateFormat getDateTimeFormat(String lang)
              Retrieve a Date formated suitable for parsing and formatting of date & time input of JCMS forms.
     DBData getDBData(Class<?> clazz, Long rowId)
              Returns a given DBData according its class and it row id.
    <T> Iterator<T>
    getDBDataIterator(Class<T> clazz)
              Returns an iterator on the list of instance for the given class stored in the database.
    <T> List<T>
    getDBDataList(Class<T> clazz)
              Returns all the instance for the given class stored in the database.
    <T> List<T>
    getDBDataList(Class<T> clazz, int firstResult, int maxResults)
              Returns all the instance for the given class stored in the database.
     List<Class<? extends Publication>> getDBPublicationClassList()
              Returns the list of Publication subclasses managed by Hibernate.
     PageResult<Publication> getDBPublicationList(PublicationCriteria pubCriteria)
              Returns a list of publications in the database matching the given criteria.
     Member getDefaultAdmin()
              Returns the default admin.
     String getDefaultEmail()
              Returns the default email of the channel get from the property channel.default-email
     Group getDefaultGroup()
              Returns the default group.
     String[] getDefaultQueryTypes()
              Returns the default 'types' attribute to use for query (get from the property query.default.types)
     String[] getDefaultQueryTypesOff()
              Returns the default 'typesOff' attribute to use for query (get from the property query.default.types-off)
     Workspace getDefaultWorkspace()
              Returns the default workspace.
     TreeSet<? extends Storable> getDeletedSet(Class<? extends Storable> clazz)
              Get the latest version of the deleted Data for a given class.
     double getDoubleProperty(String name, double defaultValue)
              Gets the value of a property as a double value given its key/name.
     TreeSet<Data> getFileIndexedDataSet(String filename)
              Returns the set of data bound to the given filename.
     FileIndexManager getFileIndexManager()
              Return the FileIndexManager singleton instance which manages Data's links to filename.
     ObjectLongTreeMap getFileSizeMap(boolean refresh)
              Deprecated. since jcms-7.1.0, use getGlobalFileAnalyzer method to have more information about satellites files
     Publication getFirstPublicationFromTitle(String title)
              Returns the first publication with the title in default site language matching the given title.
    <T> T
    getFirstPublicationSetFromTitle(Class<T> clazz, String title)
              Returns the first publications of the given class with title in default site language matching the given title.
     float getFloatProperty(String name, float defaultValue)
              Gets the value of a property as a float value given its key/name.
     Group getGroup(String id)
              Returns a group from its id
     Group getGroupFromDN(String dn)
              Returns a LDAP group from its distinguish name.
     int getHierarchicalWorkspaceLimit()
              Returns the hierarchical workspace limit define by property "hierarchical-ws.menu-limit".
     int[] getIntArrayProperty(String name, int[] defaultValue)
              Gets the value of a property as a int array.
     int getIntegerProperty(String name, int defaultValue)
              Gets the value of a property as an int value given its key/name.
     String getJaliosPath(String uri)
              Retrieves the file system path of the specified uri relative to the directory /WEB-INF/jalios/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     JcmsInfo getJcmsInfo()
              Return a JcmsInfo instance (a singleton) which describe the JCMS version of this channel.
     List<String> getJcmsLanguageList()
              Retrieves all the languages in which JCMS is localized.
     String getJcmsWorkPath(String uri)
              Retrieves the file system path of the specified uri relative to the directory /WEB-INF/jcmswork/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     org.apache.oro.text.regex.Pattern getJSyncIpPattern()
               
     String getJSyncLeaderUrl()
               
     JSyncPreviousReplicaManager getJSyncPreviousReplicaManager()
               
     JSyncReplica getJSyncReplica()
               
     String getJSyncReplicaUrl()
               
     long getJSyncStabDelay()
               
     String getLanguage()
               
     String getLanguageDirection(String lang)
              Retrieves the text/table direction to use for the given language.
     List<String> getLanguageList()
              Retrieve all the languages of this channel with the main language as the first one of the list.
     List<String> getLanguageListOrdered()
              Retrieve all the languages of this channel in the exact ordered in which they were specified in the properties.
     LangProperties getLanguageProperties()
              Gets the internal language properties used by channel.
    As of version 5.5 those properties are the same as getChannelProperties() but may differ in a future revision.
     Object[] getLangValue(String lang, boolean useDefault, Object[] value, HashMap valueML)
              Return a value bound to the given language
     Object[] getLangValue(String lang, boolean useDefault, Object[] value, HashMap valueML, String mainLanguage)
              Return a value bound to the given language
     Object getLangValue(String lang, boolean useDefault, Object value, HashMap valueML)
              Return a value bound to the given language
     Object getLangValue(String lang, boolean useDefault, Object value, HashMap valueML, String mainLanguage)
              Return a value bound to the given language
     String[] getLangValue(String lang, boolean useDefault, String[] value, HashMap valueML)
              Return a value bound to the given language
     String[] getLangValue(String lang, boolean useDefault, String[] value, HashMap valueML, String mainLanguage)
              Return a value bound to the given language
     String getLangValue(String lang, boolean useDefault, String value, HashMap valueML)
              Return a value bound to the given language
     String getLangValue(String lang, boolean useDefault, String value, HashMap valueML, String mainLanguage)
              Return a value bound to the given language
     LDAPConfiguration getLDAPConfiguration()
              Returns the LDAPConfiguration used by JCMS which you can give to LDAPMapper.LDAPMapper(LDAPConfiguration) to connect to your LDAP server.
     LimitController getLimitController()
              Returns the LimitController which is in charge to validate license limitations of JCMS.
     int getLinkCount(Data data)
              Returns the number of instances of Data referring the given Data
    <T> TreeSet<T>
    getLinkIndexedDataSet(Data data, Class<T> clazz)
              Returns the Set of Data of the given Class, referring the given data.
    <T> TreeSet<T>
    getLinkIndexedDataSet(Data data, Class<T> clazz, String field)
              Returns the Set of Data of the given Class, referring the given data with the given field.
     LinkIndexManager getLinkIndexManager()
              Return the LinkIndexManager singleton instance which manages Data's links on each other.
     Locale getLocale()
              Return the locale of the channel
     List<String> getLocalizedLanguageList()
              Retrieves all the languages specified in the properties in which JCMS is localized.
     long getLockTimeout()
              Return the lock timeout in milliseconds.
     long getLongProperty(String name, long defaultValue)
              Gets the value of a property as a long value given its key/name.
     String getLucenePath(String uri)
              Retrieves the file system path of the specified uri relative to the directory /WEB-INF/data/lucene/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     Member getMember(String id)
              Returns a member from its id
     Member getMemberFromEmail(String email)
              Returns the member with the given email.
     Member getMemberFromLogin(String login)
              Returns the member with the given login.
     Member getMemberFromLogin(String login, boolean checkDisabled)
              Returns the member with the given login.
     LuceneMemberSearchEngine getMemberSearchEngine()
              Retrieve the singleton instance of the MemberSearchEngine used by JCMS.
     MetaDataExtractor getMetaDataExtractor(String contentType)
              Returns a metadata extractor bound to the given contentType
     String getName()
              Returns the name of the channel
     CategoryRight getNoCategoryRight()
              Returns the CategoryRight which sets edition of cateogry forbidden
     NotificationManager getNotificationManager()
               
     PageResult<Publication> getNotVisibleDBPublicationList(PublicationCriteria pubCriteria)
              Returns a list publications in the database matching the given criteria and not in a visible state.
     List<File> getOrphanFiles()
              Returns the files which are not referenced by any JCMS publication.
     List<File> getOrphanFiles(boolean searchInDB)
              Returns the files which are not referenced by any JCMS publication.
     List<File> getOrphanFiles(FileFilter filter)
              Returns the files which are not referenced by any JCMS publication.
     List<File> getOrphanFiles(FileFilter filter, boolean searchInDB)
              Returns the files which are not referenced by any JCMS publication.
     List<String> getOtherLanguageList()
              Retrieve all the languages of this channel excepted the main language.
     PolicyManager getPolicyManager()
              Retrieve the singleton instance of the PolicyManager used by JCMS.
     LangProperties getProperties(String prefix)
              Gets a new LangProperties instance containg all the properties whose name starts with the given prefix.
     String getProperty(String name)
              Gets value of a property.
     String getProperty(String name, String defaultValue)
              Gets the value of a property given its key/name.
     Publication getPublication(String id)
              Returns a publication from its id
    <T extends Publication>
    TreeSet<T>
    getPublicationSet(Class<T> clazz, Member member)
              Returns all publications of a given class that can be accessed by a given member and that are in a visible state.
    <T extends Publication>
    TreeSet<T>
    getPublicationSet(Class<T> clazz, Member member, boolean checkPstatus)
              Returns all publications of a given class that can be accessed by a given member.
    <T extends Publication>
    TreeSet<T>
    getPublicationSet(Class<T> clazz, Member member, boolean checkPstatus, Workspace workspace)
              Returns all publications of a given class that can be accessed by a given member.
    <T extends Publication>
    TreeSet<T>
    getPublicationSet(Class<T> clazz, Member member, boolean checkPstatus, Workspace workspace, boolean searchDB)
               
     Set<Publication> getPublicationSet(Set<Publication> publicationSet, Workflow wf)
              Return a SubSet of all publication using the given workflow
    <T extends Publication>
    Set<T>
    getPublicationSet(Set<T> publicationSet, boolean specialState)
              Return a SubSet of publication in or not in special state.
    <T> Set<T>
    getPublicationSetFromTitle(Class<T> clazz, String title)
              Returns all publications of the given class with title in default site language matching the given title.
     Set<Publication> getPublicationSetFromTitle(String title)
              Returns all publications with title in default site language matching the given title.
     Set<Publication> getPublicationSetFromTitle(String title, boolean searchInDB)
               
     Class<?>[] getPublicationSuperTypes()
              Returns the super publication types (i.e.
     List<Class<? extends Publication>> getPublicationTypeList()
              Returns all the available publication types (sorted on the main language).
     List<Class<? extends Publication>> getPublicationTypeList(String lang)
              Retrieves all the available publication types sorted on the given language.
     HashSet<Publication> getPublicationWithoutCategories()
              Returns all the publications without categories in a new HashSet.
    <T> ArrayList<Class<? extends T>>
    getPublishableSubTypeList(Class<T> clazz, Member member)
              Returns all the publication types which extends the giving one and that the given member is allowed to publish and that are not abstract.
     QueryManager getQueryManager()
              Retrieve the singleton instance of the QueryManager used by JCMS.
     String getRealPath(String uri)
              Retrieves the file system path of the specified uri relative to the webapp root folder.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     Set<Category> getRefineRootSet()
              Returns the categories to used as roots for the refinement.
     String getRelativePath(File file)
              Retrieves a path relative to the webapp root, from a File instance.
    Example: given a File pointing the folder "C:\tomcat\webapps\ROOT\AnyFolder\MyFileOrFolder" returns "AnyFolder/MyFileOrFolder".
     Category getRootCategory()
              Returns the root category using the id specified in the property channel.root-category default to j_3.
     Set<Category> getRootCategoryAsSet()
              A convenient method which returns a set containing the root category
     CategoryRight getRootCategoryRight()
              Returns the CategoryRight allowing edition of all the cateogry
     Set<Category> getSearchRootSet()
              Returns the categories to used as root for the search.
     String getSecuredBaseUrl(javax.servlet.http.HttpServletRequest request)
              Returns the base URL of the given request, modifying it according to the fact that SSL is enabled or not.
     String getSenderFullEmail()
              Retrieves the full email that can be used to send message from JCMS
     String getSenderFullEmail(Publication pub, String lang)
              Retrieves the full email that can be used to send message from JCMS given a workspace and a language
     String getSenderFullEmail(Workspace ws, Publication pub, String lang)
              Retrieves a full email (something ) given some information to retrieve it We try: - first the given workspace email, "WorkspaceName " - the publication's workspace email, "Pub's WorkspaceName " - the channel default email, "Channel Name " - last the default admin email, "Default Admin "
     String getSenderFullEmail(Workspace ws, String lang)
              Retrieves the full email that can be used to send message from JCMS given a workspace and a language
     javax.servlet.ServletContext getServletContext()
              Returns the ServletContext used for this site.
     Map<String,String> getSortedProperties(String prefix)
              Returns a Map containing all the properties whose name starts with the given prefix sorted by key.
     Map<String,String> getSortedProperties(String prefix, boolean trim)
              Returns a Map containing all the properties whose name starts with the given prefix sorted by key.
     int getSSLport()
               
     StatReportListener getStatReportListener()
              Return the StoreListener used to listen to StatReport object modification to update schedule of Statistics.
     Storable getStorable(String id)
              Returns a storable from its id.
     Store getStore()
              Returns the store.
    Internal, DO NOT use.
     int getStoreCreateCount()
              Returns the count of create operations recorded in the store.
     int getStoreDeleteCount()
              Returns the count of delete operations recorded in the store.
     Map<Class<?>,Set<StoreListener>> getStoreListenerClassMap()
              Returns the map class/StoreListener.
     Set<StoreListener> getStoreListenerSet()
              Returns the set of StoreListener listening for all data.
     LoadReport getStoreLoadReport()
              Returns the store load report
     int getStoreSize()
              Returns the size of the store (ie the data count) in bytes.
     int getStoreUpdateCount()
              Returns the count of update operations recorded in the store.
     String[] getStringArrayProperty(String name, String[] defaultValue)
              Gets the value of a property as a String array.
     Map<String,Object> getSubProperties(String prefix)
               
    <T> List<Class<? extends T>>
    getSubTypeList(Class<T> clazz)
              Returns a list of the publication types which extends the giving one.
    <T> List<Class<? extends T>>
    getSubTypeList(Class<T> clazz, String lang)
              Returns a list of the publication types which extends the giving one.
     Category getTagRoot()
              Returns the common tag root.
     Category getTagRoot(Workspace ws)
              Returns the tag root for the given workspace if it exists ; otherwise return the common tag root.
     TypeFieldEntry getTypeAbstractFieldEntry(Class<?> clazz)
              Returns the TypeFieldEntry associated to the abstract (summary) field of the specified type.
     String getTypeDescription(Class clazz, String lang)
              Returns the description of the given type (class) in the given language.
     String getTypeDescription(Class clazz, Workspace workspace, String lang)
              Returns the description of the given type for the given workspace in the given language.
     TypeEntry getTypeEntry(Class<?> clazz)
              Return the TypeEntry bound to given Class.
     TypeEntry getTypeEntry(String className)
              Return the TypeEntry bound to given className.
     TypeFieldEntry[] getTypeFieldEntries(Class<?> clazz)
              Return an array of TypeFieldEntry bound to given Class.
     TypeFieldEntry[] getTypeFieldEntries(String className)
              Return an array of TypeFieldEntry bound to given Class.
     TypeFieldEntry getTypeFieldEntry(Class<?> clazz, String fieldName)
              Returns the TypeFieldEntry bound to the given field of the given class.
     TypeFieldEntry getTypeFieldEntry(Class<?> clazz, String fieldName, boolean checkAll)
              Return the TypeFieldEntry associated to the given Class and fieldName.
     String getTypeFieldLabel(Class<?> clazz, String fieldName)
              Returns the localized label of the given field of the given class.
     String getTypeFieldLabel(Class<?> clazz, String fieldName, String lang)
              Returns the localized label of the given field of the given class.
     String getTypeFieldLabel(Data data, String fieldName)
              Returns the localized label of the given field of the given data.
     String getTypeFieldLabel(Data data, String fieldName, String lang)
              Returns the localized label of the given field of the given data.
     String getTypeLabel(Class<?> clazz, String lang)
              Returns the label of the given type (class) in the given language.
     String getTypeLabel(Class<?> clazz, Workspace workspace, String lang)
              Returns the label of the given type (class) in the given workspace in the given language.
     Channel.TypeLabelComparator getTypeLabelComparator(String lang)
              Retrieves a new instance of a TypeLabelComparator which sorts Class using their TypeProcessor label.
     String getUploadParentPath()
              Returns the path of the directoy that contains the upload directory.
     String getUploadPath(String uri)
              Retrieves the file system path of the specified uri relative to the upload directory of the webapp (/upload/).
    The returned file path will be in native path format, suitable for use with new File() constructor.
     String getUrid()
              Returns the urid of the channel
     String getUrl()
              Returns the Url of the channel.
     String getUsedLanguage(Data data, String fieldName, String lang)
              Retrieve the language code really used if the field of the given publication is requested in the given language.
     List<? extends Storable> getVersionList(Data data)
              Get all the version of a given Data.
     List<? extends Storable> getVersionList(String id)
              Get all the version of a Data, given its id.
     String getVirtualID(Data data)
              Returns the virtual ID bound to the given data (or null if it does not exist).
     PageResult<Publication> getVisibleDBPublicationList(PublicationCriteria pubCriteria)
              Returns a list publications in the database matching the given criteria and in a visible state.
     int[] getVisiblePstatus()
              Returns the default (aka visible) pstatus attribute to use for query (get from the property query.default.pstatus)
     String getWebappPath()
              Retrieves the file system path of the webapp root.
     String getWebInfPath(String uri)
              Retrieves the file system path of the specified uri relative to the directory /WEB-INF/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
     Workspace getWorkspace(String id)
              Return a Workspace from its id
     Set<Workspace> getWorkspaceSet(Workflow wf)
              Return a Set of Workspace that use the given Workflow
     WSTypeEntry getWSTypeEntry(Class clazz, Workspace workspace)
              This method is a substitute of old getTypeEntry(Class) or getTypeEntry(String).
     WSTypeEntry getWSTypeEntry(String className, Workspace workspace)
              This method is a substitute of old getTypeEntry(Class) or getTypeEntry(String).
     void handleDataWriteState(boolean disable, String msg, boolean updateProperty)
              Handle the given data write state and perform the update in properties if needed.
     void handleFinalize()
              This method is called when the site is restarted or shutdown.
     void handleJcmsDBError(String msg, Throwable th)
              This method is called when a fatal error occurs on the JcmsDB.
     void handleStoreError(String msg, Throwable th)
              This method is called when a fatal error occurs on the store.
    protected  void initAfterLoad()
              Perform all the initalizations after the store has been loaded (called byte ChannelInitServlet)
    protected  void initBeforeLoad()
              Perform all the initalizations before the store has been loaded (called byte ChannelInitServlet)
    protected  void initHibernate()
               
    protected static void initialize(javax.servlet.ServletContext context, String logFile, String webappPropFile, String customPropFile, ClassLoader classLoader)
              Singleton method to Instanciate the channel.
     void initVirtualIDMap()
              Init the virtual ID map (data, virtual ID).
     void invalidateSearchAndRefineRootSet()
              Invalidate search and refine root set (they will be computed at the next call).
     boolean isAuthenticationRequired()
              Returns true if the authentication is required in this site (use the value of channel.is-authentication-required property)
     boolean isAvailable()
              Check if the site is started and ready.
     boolean isDataWriteEnabled()
              Checks if data write are enabled (see channel.data-write.enabled property)
     boolean isDeployManagerEnabled()
              Returns true if the DeployManager is enabled.
     boolean isFailSafeMode()
               
     boolean isGzipCompressionEnabled()
               
     boolean isJSyncAutoUpdate()
               
     boolean isJSyncEnabled()
               
     boolean isLdapEnabled()
               
     boolean isLoginCaseSensitive()
               
     boolean isMailEnabled()
               
     boolean isMainLanguage(String lang)
               
     boolean isMainLeader()
              Return leadership status of JCMS when using in cluster.
     boolean isMultilingual()
               
     boolean isNotificationEnabled()
               
     boolean isRegistered(Data data)
              Checks if the given data is still registered in the Store.
     boolean isRegistered(String id)
              Checks if the given data is still registered in the Store.
     boolean isReverseProxyEnabled()
              Checks if the reverse proxy is enabled.
     boolean isSSLenabled()
               
     boolean isUsingAdvancedI18N()
              Indicates whether JCMS is in advanced internationalization mode.
     boolean isValidAdminIP(javax.servlet.ServletRequest request)
              Checks if the specified request is authorized to access admin area.
     boolean isValidWorkspacesIP(javax.servlet.ServletRequest request)
              Checks if the specified request is authorized to access workspace area.
     boolean isVisiblePstatus(int pstatus)
              Check if a pstatus is a default (aka visible) query pstatus (replace previous method isDefaultQueryPstatus).
     boolean isWebdavEnabled()
              Check if Webdav is enable
    protected  void loadStore()
              Load the JCMS store file.
     void performStoreBackup()
              Perform a backup of the store.
     String processReverseProxyRedirect(javax.servlet.ServletRequest request, String url)
              Check if the given request comes from one of the reverse proxies specified in the configuration (channel.reverse-proxy.conf*).
     boolean processReverseProxyRequest(javax.servlet.ServletRequest request)
              Check if the given request comes from one of the reverse proxies specified in the configuration (channel.reverse-proxy.conf*).
     void propertiesChange(JProperties p)
              This methods triggers re-initialization of all the managers/parameters of this JCMS site, only those that can be reinitialized without a restart.
    It is the method to support implementation of the JPropertiesListener and is called after a change of the properties.
     QueryResultSet query(QueryHandler qh, javax.servlet.ServletRequest request, Set<? extends Publication> proposedDataSet)
              Perform a query using parameters specified in the given QueryHandler.
     void reloadLanguageProperties()
              Reload languages properties of JCMS (WEB-INF/jalios/languages/{lang}.prop).
     void removeAuthenticationHandler(AuthenticationHandler authHandler)
              Remove the specified AuthenticationHandler from the list of AuthenticationHandlers used by the AuthenticationManager to process users' authentication.
     void removeChannelListener(ChannelListener listener)
              Removes a ChannelListener.
     void removeCleanFilter(CustomCleanFilter filter)
              Removes a custom clean filter.
     void removeDataController(DataController dc, Class<?> clazz)
              Remove the given DataController
     void removeDBListener(DBListener listener)
              Remove a DBListener.
     void removeDBListener(DBListener listener, Class<?> clazz)
              Remove a DBListener.
     void removePolicyFilter(PolicyFilter pf)
              Remove the given PolicyFilter to the list of RightPolicyFilter used by the PolicyManager (getPolicyManager()).
     void removePropertiesListener(JPropertiesListener listener)
              Removes a properties listener.
     void removeQueryFilter(QueryFilter qf)
              Remove the given QueryFilter from the list of QueryFilters used by the QueryManager (getQueryManager()).
     void removeStoreListener(StoreListener listener)
              Removes a StoreListener for all storable classes.
     void removeStoreListener(StoreListener listener, Class<?> clazz)
              Removes a StoreListener associated to a given class.
     void restart()
              Restarts the channel.
    <T> TreeSet<T>
    select(Collection<? extends T> dataColl, DataSelector selector, Comparator comparator)
              Perform a selection on a Collection of Data using the given DataSelector, and return a TreeSet sorted using the given Comparator.
     void setAvailable(boolean isAvailable)
              Enable or disable the site.
     void setCurrentServletRequest(javax.servlet.http.HttpServletRequest request)
              Assigns the current servlet request.
     void setCurrentServletResponse(javax.servlet.http.HttpServletResponse response)
              Assigns the current servlet response.
     void setProperty(String name, String value)
              Modify an internal property with the given value.
    Do not change any JCMS property at runtime, behaviour of JCMS maybe incorrect if you do so, use the user interface for such task.
     String toString()
               
     void updateAndSaveProperties(JProperties prop)
              Updates and save specified properties.
    protected  void updateClass2DataSet(Data data, boolean add)
              This methods is called by a DataListener when a Data is updated or created to update the map which link Class to Set of Data.
     void updateData(Data updated, Member opAuthor)
              Updates a data in the store.
     
    Methods inherited from class java.lang.Object
    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    REVISION

    public static final String REVISION
    See Also:
    Constant Field Values

    context

    protected javax.servlet.ServletContext context

    logFilePath

    protected String logFilePath

    webappPropFilePath

    protected String webappPropFilePath

    customPropFilePath

    protected String customPropFilePath

    classLoader

    protected ClassLoader classLoader

    jcmsInfo

    protected JcmsInfo jcmsInfo

    name

    protected String name

    appServerInfo

    protected AppServerInfo appServerInfo

    isAvailable

    protected boolean isAvailable

    urid

    protected String urid

    url

    protected String url

    securedUrl

    protected String securedUrl

    uri

    protected String uri

    store

    protected Store store

    language

    protected String language

    country

    protected String country

    locale

    protected Locale locale

    dateTimeFormat

    protected SimpleDateFormat dateTimeFormat

    dateFormat

    protected SimpleDateFormat dateFormat

    dateTimeFormatMap

    protected HashMap<String,SimpleDateFormat> dateTimeFormatMap

    dateFormatMap

    protected HashMap<String,SimpleDateFormat> dateFormatMap

    defaultGroup

    protected Group defaultGroup

    defaultAdmin

    protected Member defaultAdmin

    defaultWorkspace

    protected Workspace defaultWorkspace

    defaultEmail

    protected String defaultEmail

    realPathLength

    protected int realPathLength

    webappDir

    protected File webappDir

    properties

    protected LangProperties properties

    alarmManagerMap

    protected Map<String,AlarmManager> alarmManagerMap

    cacheManager

    protected CacheManager cacheManager

    typeProcessor

    protected TypeProcessor typeProcessor

    langList

    protected ArrayList<String> langList

    langListOrdered

    protected ArrayList<String> langListOrdered

    otherLangList

    protected ArrayList<String> otherLangList

    localizedLangList

    protected ArrayList<String> localizedLangList

    jcmsLangList

    protected ArrayList<String> jcmsLangList

    adminIpPattern

    protected org.apache.oro.text.regex.Pattern adminIpPattern

    adminIpNoPattern

    protected boolean adminIpNoPattern

    workspacesIpPattern

    protected org.apache.oro.text.regex.Pattern workspacesIpPattern

    workspacesIpNoPattern

    protected boolean workspacesIpNoPattern

    isDataWriteEnabled

    protected boolean isDataWriteEnabled

    isDataWriteEnabledComputed

    protected boolean isDataWriteEnabledComputed

    isWebdavEnable

    protected boolean isWebdavEnable

    isWebdavEnableComputed

    protected boolean isWebdavEnableComputed

    isGzipCompressionEnabled

    protected boolean isGzipCompressionEnabled

    isDeployManagerEnabled

    protected boolean isDeployManagerEnabled

    webdavEncoding

    protected String webdavEncoding

    currentServletRequest

    protected ThreadLocal<javax.servlet.http.HttpServletRequest> currentServletRequest

    currentServletResponse

    protected ThreadLocal<javax.servlet.http.HttpServletResponse> currentServletResponse

    nlAlarmEntry

    protected AlarmEntry nlAlarmEntry

    storeBackupDir

    protected File storeBackupDir

    storeBackupMax

    protected int storeBackupMax

    isReverseProxyEnabled

    protected boolean isReverseProxyEnabled

    ipToReverseProxyConfNameMap

    protected HashMap<String,String> ipToReverseProxyConfNameMap

    reverseProxyContextPath

    protected HashMap<String,String> reverseProxyContextPath

    reverseProxyBaseURL

    protected HashMap<String,String> reverseProxyBaseURL

    reverseProxySSLBaseURL

    protected HashMap<String,String> reverseProxySSLBaseURL

    ldapConf

    protected LDAPConfiguration ldapConf

    authMgr

    protected AuthenticationManager authMgr

    notificationManager

    protected NotificationManager notificationManager

    isNotificationEnabled

    protected boolean isNotificationEnabled

    isSSLenabled

    protected static boolean isSSLenabled

    SSLport

    protected static int SSLport

    limitController

    protected LimitController limitController

    jsyncReplica

    protected JSyncReplica jsyncReplica

    jsyncEnabled

    protected boolean jsyncEnabled

    jsyncReplicaUrl

    protected String jsyncReplicaUrl

    jsyncLeaderUrl

    protected String jsyncLeaderUrl

    jsyncHasLeader

    protected boolean jsyncHasLeader

    jsyncUpdateMode

    protected String jsyncUpdateMode

    jsyncStabDelay

    protected long jsyncStabDelay

    jsyncAutoUpdate

    protected boolean jsyncAutoUpdate

    jsyncSyncFiles

    protected boolean jsyncSyncFiles

    jsyncDownloadInterval

    protected long jsyncDownloadInterval

    jsyncIpPattern

    protected org.apache.oro.text.regex.Pattern jsyncIpPattern

    jsyncPreviousReplicaManager

    protected JSyncPreviousReplicaManager jsyncPreviousReplicaManager

    jsyncSuggestJoin

    protected boolean jsyncSuggestJoin

    jsyncExplicitReplicaList

    protected String jsyncExplicitReplicaList

    lim

    protected LinkIndexManager lim

    fim

    protected FileIndexManager fim

    dataListener

    protected DataListener dataListener

    pubListener

    protected PublicationListener pubListener

    statReportListener

    protected StatReportListener statReportListener

    channelListenerSet

    protected TreeSet<ChannelListener> channelListenerSet

    policyManager

    protected PolicyManager policyManager

    class2dataSet

    protected Map<Class<? extends Data>,Set<Data>> class2dataSet

    rootCategory

    protected Category rootCategory

    tagRoot

    protected Category tagRoot

    rootCategoryAsSet

    protected Set<Category> rootCategoryAsSet

    searchRootSet

    protected Set<Category> searchRootSet

    refineRootSet

    protected Set<Category> refineRootSet

    advRefineRootSet

    protected Set<Category> advRefineRootSet

    coreTypeList

    protected ArrayList<Class<? extends Publication>> coreTypeList

    publicationTypeMap

    protected Map<String,List<Class<? extends Publication>>> publicationTypeMap

    defaultQueryTypes

    protected String[] defaultQueryTypes

    defaultQueryTypesOff

    protected String[] defaultQueryTypesOff

    visiblePstatus

    protected int[] visiblePstatus

    rootCategoryRight

    protected CategoryRight rootCategoryRight

    noCategoryRight

    protected CategoryRight noCategoryRight

    pubWithoutCategories

    protected Set<Publication> pubWithoutCategories

    virtualIDMap

    protected HashMap<Storable,String> virtualIDMap

    allTypeFieldEntriesCacheMap

    protected HashMap<Class<?>,Map<String,TypeFieldEntry>> allTypeFieldEntriesCacheMap

    exactTypeFieldEntriesCacheMap

    protected HashMap<Class<?>,Map<String,TypeFieldEntry>> exactTypeFieldEntriesCacheMap

    dataControllerMap

    protected HashMap<Class<?>,Set<DataController>> dataControllerMap

    dataIntegrityReport

    protected TreeMap<Data,ControllerStatus> dataIntegrityReport

    dataIntegrityReportDate

    protected Date dataIntegrityReportDate

    queryMgr

    protected QueryManager queryMgr

    mbrSearchEngine

    protected LuceneMemberSearchEngine mbrSearchEngine

    cleanFilterList

    protected List<CustomCleanFilter> cleanFilterList

    publicationSuperTypes

    protected Class<?>[] publicationSuperTypes

    isUsingAdvancedI18N

    protected boolean isUsingAdvancedI18N

    rightToLeftLanguageSet

    protected HashSet<String> rightToLeftLanguageSet

    fileSizeMap

    protected ObjectLongTreeMap fileSizeMap

    channel

    protected static Channel channel
    Method Detail

    reloadLanguageProperties

    public void reloadLanguageProperties()
                                  throws IOException
    Reload languages properties of JCMS (WEB-INF/jalios/languages/{lang}.prop).

    Throws:
    IOException

    getChannel

    public static Channel getChannel()
    Singleton Method to get the channel

    Returns:
    The Channel Singleton

    initialize

    protected static void initialize(javax.servlet.ServletContext context,
                                     String logFile,
                                     String webappPropFile,
                                     String customPropFile,
                                     ClassLoader classLoader)
                              throws Exception
    Singleton method to Instanciate the channel.
    You do not need to call this method which is called automatically on startup by the servlet ChannelInitServlet declared in web.xml.

    Parameters:
    context - the ServletContext
    logFile - the relative file path of the log
    webappPropFile - the relative file path of the webapp.prop properties
    customPropFile - the relative file path of the webapp.prop properties
    classLoader - the web-app ClassLoader
    Throws:
    Exception

    destroy

    protected static void destroy()
    Singleton Method to finaliez and destroy the channel.


    finalize

    protected void finalize()
                     throws Throwable
    Handles the finalize invocation

    Overrides:
    finalize in class Object
    Throws:
    Throwable
    Since:
    jcms-2.1

    fireChannelFinalize

    public void fireChannelFinalize()
    Call method ChannelListener.handleFinalize() of every registered ChannelListener.

    This methods is called when the site is restarted or shutdown. You MUST NOT call this method.

    Since:
    jcms-2.1
    See Also:
    addChannelListener(ChannelListener), removeChannelListener(ChannelListener)

    handleFinalize

    public void handleFinalize()
    This method is called when the site is restarted or shutdown.

    Since:
    jcms-2.1
    See Also:
    ChannelListener

    initHibernate

    protected void initHibernate()
                          throws Exception
    Throws:
    Exception

    initBeforeLoad

    protected void initBeforeLoad()
                           throws Exception
    Perform all the initalizations before the store has been loaded (called byte ChannelInitServlet)

    Throws:
    Exception
    Since:
    jcms-5.0.3

    loadStore

    protected void loadStore()
                      throws LogException
    Load the JCMS store file.

    Throws:
    LogException

    initAfterLoad

    protected void initAfterLoad()
                          throws Exception
    Perform all the initalizations after the store has been loaded (called byte ChannelInitServlet)

    Throws:
    Exception
    Since:
    jcms-2.1

    propertiesChange

    public void propertiesChange(JProperties p)
    This methods triggers re-initialization of all the managers/parameters of this JCMS site, only those that can be reinitialized without a restart.
    It is the method to support implementation of the JPropertiesListener and is called after a change of the properties.

    Specified by:
    propertiesChange in interface JPropertiesListener
    Parameters:
    p - the properties which have been modified (may not contain all JCMS properties)

    getStatReportListener

    public StatReportListener getStatReportListener()
    Return the StoreListener used to listen to StatReport object modification to update schedule of Statistics.

    Returns:
    a StoreListener

    getAppServerInfo

    public AppServerInfo getAppServerInfo()
    Return the AppServerInfo instance (a singleton) which describe the underlying application server.

    Returns:
    a AppServerInfo singleton instance
    Since:
    jcms-4.0

    isReverseProxyEnabled

    public boolean isReverseProxyEnabled()
    Checks if the reverse proxy is enabled.

    Returns:
    true if the reverse proxy is enabled false otherwise.
    Since:
    jcms-5.5.0

    processReverseProxyRequest

    public boolean processReverseProxyRequest(javax.servlet.ServletRequest request)
    Check if the given request comes from one of the reverse proxies specified in the configuration (channel.reverse-proxy.conf*).
    If the request is a proxy request, then the following attributes are added to the request:
  • contextPath
  • baseUrl
  • securedBaseUrl

  • Those attributes are used by ServletUtil methods to properly initialize the corresponding value in doInitPage. (Thus this method must be called early in doInitPage.jsp).

    Parameters:
    request - the current request
    Returns:
    true if the request comes from the reverse proxy and that attributes were added to the request
    Since:
    jcms-5.5.0

    processReverseProxyRedirect

    public String processReverseProxyRedirect(javax.servlet.ServletRequest request,
                                              String url)
    Check if the given request comes from one of the reverse proxies specified in the configuration (channel.reverse-proxy.conf*).
    If the request is a proxy request, then make sure the given url is always an absolute url to prevent rewriting problem in apache when url are relative, such as "/index.jsp", when path is different on the reverse proxy and in tomcat.

    Parameters:
    request - the current request
    url - the URL to be modified with reverse proxy settings
    Returns:
    the modified url.
    Since:
    jcms-5.6.2

    isDeployManagerEnabled

    public boolean isDeployManagerEnabled()
    Returns true if the DeployManager is enabled.

    Returns:
    true if the DeployManager is enabled.
    Since:
    jcms-5.6.2

    getLimitController

    public LimitController getLimitController()
    Returns the LimitController which is in charge to validate license limitations of JCMS.

    Returns:
    the LimitController.
    Since:
    jcms-5.5.0

    isJSyncEnabled

    public boolean isJSyncEnabled()
    Returns:
    true if JSync is enabled
    Since:
    jcms-4.1

    isMainLeader

    public boolean isMainLeader()
    Return leadership status of JCMS when using in cluster. You should use this method in Listener to prevent some actions to be triggered on all replicas (for example, sending mail) but instead only on the main leader.

    Returns:
    true if this instance of JCMS is either: - not in cluster - or a replica super leader
    Since:
    jcms-5.0.1

    getJSyncReplica

    public JSyncReplica getJSyncReplica()
    Returns:
    the JSyncReplica singleton
    Since:
    jcms-4.1

    getJSyncPreviousReplicaManager

    public JSyncPreviousReplicaManager getJSyncPreviousReplicaManager()
    Returns:
    the Unique JSyncPreviousReplicaManager instance
    Since:
    jcms-5.7.4

    getJSyncReplicaUrl

    public String getJSyncReplicaUrl()
    Returns:
    the url of this replica
    Since:
    jcms-4.1

    getJSyncLeaderUrl

    public String getJSyncLeaderUrl()
    Returns:
    the url of the JSync leader
    Since:
    jcms-4.1

    isJSyncAutoUpdate

    public boolean isJSyncAutoUpdate()
    Returns:
    true if JSync update mode is set to auto
    Since:
    jcms-4.1

    getJSyncStabDelay

    public long getJSyncStabDelay()
    Returns:
    the delay of stablization for auto update mode
    Since:
    jcms-4.1

    getJSyncIpPattern

    public org.apache.oro.text.regex.Pattern getJSyncIpPattern()
    Returns:
    the pattern to be used to check remote IP
    Since:
    jcms-4.1

    isGzipCompressionEnabled

    public boolean isGzipCompressionEnabled()
    Returns:
    true if the gzip compression is enabled, false otherwise.
    Since:
    jcms-4.1.1

    isNotificationEnabled

    public boolean isNotificationEnabled()
    Returns:
    true if Notification is enabled, false otherwise

    getNotificationManager

    public NotificationManager getNotificationManager()
    Returns:
    the NotificationManager.

    isMailEnabled

    public boolean isMailEnabled()
    Returns:
    true if Mail is enabled, false otherwise
    Since:
    jcms-5.5.0

    getLinkIndexManager

    public LinkIndexManager getLinkIndexManager()
    Return the LinkIndexManager singleton instance which manages Data's links on each other.

    Returns:
    the LinkIndexManager singleton

    getLinkIndexedDataSet

    public <T> TreeSet<T> getLinkIndexedDataSet(Data data,
                                                Class<T> clazz)
    Returns the Set of Data of the given Class, referring the given data.
    CAUTION: returns all the data whatever their rights and their state. CAUTION: returns an internal Set, DO NOT alter this Set, clone prior modification.

    Type Parameters:
    T - any object type (usually something extending Data)
    Parameters:
    data - the data
    clazz - the class to search the referring instances
    Returns:
    a immutable TreeSet of Data
    Since:
    jcms-3.0

    getLinkIndexedDataSet

    public <T> TreeSet<T> getLinkIndexedDataSet(Data data,
                                                Class<T> clazz,
                                                String field)
    Returns the Set of Data of the given Class, referring the given data with the given field.
    CAUTION: returns all the data whatever their rights and their state. CAUTION: returns an internal Set, DO NOT alter this Set, clone prior modification.

    Type Parameters:
    T - any object type (usually something extending Data)
    Parameters:
    data - the data
    clazz - the class to search the referring instances
    field - the name of the field which contains the reference
    Returns:
    a TreeSet of Data
    Since:
    jcms-4.0.2

    getLinkCount

    public int getLinkCount(Data data)
    Returns the number of instances of Data referring the given Data

    Parameters:
    data - the data for which we want to retrieve link count
    Returns:
    the number of instances of Data referring this data
    Since:
    jcms-3.0

    getFileIndexManager

    public FileIndexManager getFileIndexManager()
    Return the FileIndexManager singleton instance which manages Data's links to filename.
    It is used to check access rights of a given file (using its access filename) when accessing file using

    Returns:
    the FileIndexManager singleton
    Since:
    jcms-3.0

    getCleanFilename

    public String getCleanFilename(String filename)
    Clean the given filename.
    For example: ///upload%2Fmydir///private.%70df -> upload/mydir/private.pdf

    Parameters:
    filename - the URI to be decoded, converted to a valid path relative to the webapp
    Returns:
    the cleaned filename
    Since:
    jcms-4.0

    getFileIndexedDataSet

    public TreeSet<Data> getFileIndexedDataSet(String filename)
    Returns the set of data bound to the given filename.

    Parameters:
    filename - a relative filename ("upload/...").
    Returns:
    a set of Data
    Since:
    jcms-3.0

    canMemberAccessFile

    public boolean canMemberAccessFile(String filename,
                                       Member member)
    Check if the given member can access the given file (dangling documents are checked, see checkMemberAccessFile()).

    Parameters:
    filename - the filename to be checked
    member - the member
    Returns:
    true if member can access to this file
    Since:
    jcms-3.0
    See Also:
    checkMemberAccessFile(String, Member, Set)

    checkMemberAccessFile

    public int checkMemberAccessFile(String filename,
                                     Member member,
                                     Set<String> authorizedFilenames)
    Check the access mode the given member has for the given file

    Parameters:
    filename - the filename to be checked
    member - the member
    authorizedFilenames - Set of filename authorized, placed in session while executing version.jsp
    Returns:
    one of the JcmsConstants PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, FORBIDDEN_FILE_ACCESS
    Since:
    jcms-6.1.0
    See Also:
    canMemberAccessFile(String, com.jalios.jcms.Member)

    getFileSizeMap

    public ObjectLongTreeMap getFileSizeMap(boolean refresh)
    Deprecated. since jcms-7.1.0, use getGlobalFileAnalyzer method to have more information about satellites files

    Returns the map file size for each content-type. To improve the performances, the map is cached unless it is requested to refresh it.

    Parameters:
    refresh - if true refresh the map
    Returns:
    the map file size for each content-type.
    Since:
    jcms-7.0.0

    getOrphanFiles

    public List<File> getOrphanFiles()
    Returns the files which are not referenced by any JCMS publication.

    Returns:
    a list of java.io.File
    Since:
    jcms-6.2.0

    getOrphanFiles

    public List<File> getOrphanFiles(boolean searchInDB)
    Returns the files which are not referenced by any JCMS publication.

    Parameters:
    searchInDB - if true extends the search to the database
    Returns:
    a list of java.io.File
    Since:
    jcms-6.2.0

    getOrphanFiles

    public List<File> getOrphanFiles(FileFilter filter)
    Returns the files which are not referenced by any JCMS publication. Technical files such as thumbnails and PDF generated with JCMS Universal are skipped.

    Parameters:
    filter - the FileFilter to use (may be null)
    Returns:
    a list of java.io.File
    Since:
    jcms-5.5.0

    getOrphanFiles

    public List<File> getOrphanFiles(FileFilter filter,
                                     boolean searchInDB)
    Returns the files which are not referenced by any JCMS publication. Technical files such as thumbnails and PDF generated with JCMS Universal are skipped.

    Parameters:
    filter - the FileFilter to use (may be null)
    searchInDB - true if file search should also be performed for DBFileDocument, false otherwise
    Returns:
    a list of java.io.File
    Since:
    jcms-5.5.0

    isSSLenabled

    public final boolean isSSLenabled()
    Returns:
    true if SSL is enabled, false otherwise
    Since:
    jcms-5.0.0

    getSSLport

    public final int getSSLport()
    Returns:
    the SSL port used for authentication
    Since:
    jcms-5.0.0

    getSecuredBaseUrl

    public final String getSecuredBaseUrl(javax.servlet.http.HttpServletRequest request)
    Returns the base URL of the given request, modifying it according to the fact that SSL is enabled or not. For example, if the request url is http://mysite.com:8080/dir/webapp/subdir/my.jsp?param=value If SSL is enabled with port 8443, it will return: https://mysite.com:8443/dir/webapp/ otherwise: http://mysite.com:8080/dir/webapp/ Note the trailing slash. Similar to ServletUtil.getBaseUrl(). Used by login forms (doPortletLoginFullDisplay.jsp, login jsp, privateLogin jsp, ...)

    Parameters:
    request - the request
    Returns:
    the possibly secured base URL of the request
    Since:
    jcms-5.0.0

    getLDAPConfiguration

    public LDAPConfiguration getLDAPConfiguration()
    Returns the LDAPConfiguration used by JCMS which you can give to LDAPMapper.LDAPMapper(LDAPConfiguration) to connect to your LDAP server.

    Returns:
    the current LDAPConfiguration used by JCMS
    Since:
    jcms-5.5.0

    isLdapEnabled

    public boolean isLdapEnabled()
    Returns:
    true if LDAP directory is enabled, false otherwise
    Since:
    jcms-4.0

    getAuthMgr

    public AuthenticationManager getAuthMgr()
    Returns the current AuthenticationManager instance used by JCMS to authenticate members into JCMS.

    Returns:
    the AuthenticationManager singleton.

    isAuthenticationRequired

    public boolean isAuthenticationRequired()
    Returns true if the authentication is required in this site (use the value of channel.is-authentication-required property)

    Returns:
    true if authentication is required for JCMS acces, false otherwise.

    isLoginCaseSensitive

    public boolean isLoginCaseSensitive()
    Returns:
    true if login is casesensitive
    Since:
    jcms-4.0.2

    getCacheManager

    public CacheManager getCacheManager()
    Returns:
    the CacheManager
    Since:
    jcms-3.0

    getAlarmManager

    public AlarmManager getAlarmManager(String name)
    Returns the AlarmManager associated to the given name. If it does not exist, a new AlarmManager is created. This method should only be used if all the alarms of the alarm manager must be homogeneous so that they can be listed (AlarmManager.getAllAlarms()) or removed (AlarmManager.removeAllAlarms()).

    Parameters:
    name - the name of the AlarmManager.
    Returns:
    an AlarmManager.
    See Also:
    getCommonAlarmManager()

    getCommonAlarmManager

    public AlarmManager getCommonAlarmManager()
    Returns the common AlarmManager. The common AlarmManager should be preferred if the methods (AlarmManager.getAllAlarms()) and (AlarmManager.removeAllAlarms() have not to be called.

    Returns:
    the common AlarmManager.
    Since:
    jcms-5.5.0
    See Also:
    getAlarmManager(String)

    getAllAlarmManager

    public Map<String,AlarmManager> getAllAlarmManager()
    Returns All alarmManager present in the channel

    Returns:
    the Map of AlarmManager with the name as key

    getServletContext

    public javax.servlet.ServletContext getServletContext()
    Returns the ServletContext used for this site.
    This is the ServletContext that was used to initialized this Channel.

    Returns:
    the ServletContext
    Since:
    jcms-3.0

    getRealPath

    public String getRealPath(String uri)
    Retrieves the file system path of the specified uri relative to the webapp root folder.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String realFilePath = channel.getRealPath("/upload/myfile.txt");
       File myFile = new File(realFilePath);
     

    Parameters:
    uri - a path relative to the webapp root (with or without starting slash). e.g "/upload/somefile.txt", "WEB-INF/data/somefolder"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\data\somefolder".

    getWebappPath

    public String getWebappPath()
    Retrieves the file system path of the webapp root.

    Returns:
    the path of the root of the webapp. e.g "C:\tomcat\webapps\jcms\".
    Since:
    jcms-5.7.3

    getWebInfPath

    public String getWebInfPath(String uri)
    Retrieves the file system path of the specified uri relative to the directory /WEB-INF/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String webXmlPath = channel.getWebInfPath("web.xml");
       File webXmlFile = new File(webXmlPath);
     

    Parameters:
    uri - a path relative to the /WEB-INF/ directory (with or without starting slash). e.g "web.xml"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\web.xml".
    See Also:
    getRealPath(String)

    getDataPath

    public String getDataPath(String uri)
    Retrieves the file system path of the specified uri relative to the directory /WEB-INF/data/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String statusPropPath = channel.getDataPath("status.prop");
       File statusPropFile = new File(statusPropPath);
     

    Parameters:
    uri - a path relative to the /WEB-INF/data/ directory (with or without starting slash). e.g "status.prop"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\data\status.prop".
    See Also:
    getRealPath(String)

    getLucenePath

    public String getLucenePath(String uri)
    Retrieves the file system path of the specified uri relative to the directory /WEB-INF/data/lucene/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String fileIndexPath = channel.getLucenePath("FilesIndex");
       File fileIndexFile = new File(fileIndexPath);
     

    Parameters:
    uri - a path relative to the /WEB-INF/data/lucene/ directory (with or without starting slash). e.g "FilesIndex"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\data\lucene\FilesIndex\".
    Since:
    jcms-5.5.0
    See Also:
    getRealPath(String)

    getJaliosPath

    public String getJaliosPath(String uri)
    Retrieves the file system path of the specified uri relative to the directory /WEB-INF/jalios/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String jcmsPropPath = channel.getJaliosPath("jcms.prop");
       File jcmsPropFile = new File(jcmsPropPath);
     

    Parameters:
    uri - a path relative to the /WEB-INF/jalios/ directory (with or without starting slash). e.g "jcms.prop"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\jalios\jcms.prop".
    Since:
    jcms-3.0
    See Also:
    getRealPath(String)

    getJcmsWorkPath

    public String getJcmsWorkPath(String uri)
    Retrieves the file system path of the specified uri relative to the directory /WEB-INF/jcmswork/ of the webapp.
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String myLockFilePath = channel.getJcmsWorkPath("myfile.lock");
       File myLockFile = new File(myLockFilePath);
     

    Parameters:
    uri - a path relative to the /WEB-INF/jcmswork/ directory (with or without starting slash). e.g "myfile.lock"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\WEB-INF\jcmswork\myfile.lock".
    Since:
    jcms-3.0
    See Also:
    getRealPath(String)

    getUploadPath

    public String getUploadPath(String uri)
    Retrieves the file system path of the specified uri relative to the upload directory of the webapp (/upload/).
    The returned file path will be in native path format, suitable for use with new File() constructor.
       String uploadedFilePath = channel.getUploadPath("uploadedfile.txt");
       File uploadedFile = new File(uploadedFilePath);
     

    Parameters:
    uri - a path relative to the /upload/ folder (with or without starting slash). e.g "myfile.lock"
    Returns:
    an absolute file system path, e.g. "C:\tomcat\webapps\jcms\upload\".
    Since:
    jcms-5.0.0
    See Also:
    getRealPath(String)

    getUploadParentPath

    public String getUploadParentPath()
    Returns the path of the directoy that contains the upload directory.

    Returns:
    the path of the directoy that contains the upload directory.
    Since:
    jcms-5.7.3

    getRelativePath

    public String getRelativePath(File file)
    Retrieves a path relative to the webapp root, from a File instance.
    Example: given a File pointing the folder "C:\tomcat\webapps\ROOT\AnyFolder\MyFileOrFolder" returns "AnyFolder/MyFileOrFolder".

    Parameters:
    file - the File to convert into a relative filepath, e.g. new File("C:\\tomcat\\webapps\\jcms\\upload\\myfile.txt")
    Returns:
    a path relative to the webapp root, e.g. "upload/myfile.txt"

    getDataSourceLabel

    public String getDataSourceLabel(String dataSource,
                                     String userLang)
    Returns the label for the given data source. If no label exists for this data source, the name of the data source is returned. Data source label must be declared in webapp.prop with this syntax for the key : <lang>.data-source.<ds-name>. E.g.: en.data-source.jdbc/mydb: My Data Source.

    Parameters:
    dataSource - the name of the DataSource (eg. "jdbc/mydb")
    userLang - the userLang
    Returns:
    the label for the given data source

    crypt

    public String crypt(String str)
    Hash the specified string with the BCrypt encryption algorithm.

    Use checkCrypt(String, String) method to verify the encrypted version against a plain text entry.

    Parameters:
    str - the String to encrypt
    Returns:
    the encrypted string
    Since:
    jcms-4.0
    See Also:
    checkCrypt(String, String)

    checkCrypt

    public boolean checkCrypt(String candidate_plaintext,
                              String stored_hash)
    Check a plain text string against an encrypted string previoulsy stored in JCMS.

    As of current implementation, this method is compatible with the following crypt algorythm :

    Parameters:
    candidate_plaintext - the plain text to be tested (information usually received from the client, eg : a plain text password recevied from a login form)
    stored_hash - the encrypted version stored (information known only on the server side, eg : member.getPassword())
    Returns:
    true if the plain text string match the stored hash, false otherwise
    Since:
    jcms-7.1
    See Also:
    crypt(String)

    getDefaultGroup

    public Group getDefaultGroup()
    Returns the default group. This group is get from the property channel.default-group or from j_36 (if this property is not set)

    Returns:
    the default Group

    getDefaultAdmin

    public Member getDefaultAdmin()
    Returns the default admin. This admin is get from the property channel.default-admin or from j_2 (if this property is not set)

    Returns:
    a member representing the default admin or null if the member associated with the id (property or j_2) is not an admin

    getDefaultWorkspace

    public Workspace getDefaultWorkspace()
    Returns the default workspace. This workspace is get from the property channel.default-workspace or from j_4 (if this property is not set)

    Returns:
    the default Workspace

    getDefaultEmail

    public String getDefaultEmail()
    Returns the default email of the channel get from the property channel.default-email

    Returns:
    a String containing the default email

    getDefaultQueryTypes

    public String[] getDefaultQueryTypes()
    Returns the default 'types' attribute to use for query (get from the property query.default.types)

    Returns:
    an array string containing the types to perform the query on.
    Since:
    jcms-2.1

    getDefaultQueryTypesOff

    public String[] getDefaultQueryTypesOff()
    Returns the default 'typesOff' attribute to use for query (get from the property query.default.types-off)

    Returns:
    a String containing the types to avoid in a query.
    Since:
    jcms-2.1

    getVisiblePstatus

    public int[] getVisiblePstatus()
    Returns the default (aka visible) pstatus attribute to use for query (get from the property query.default.pstatus)

    Returns:
    a String containing the pstatus to use in a query.
    Since:
    jcms-2.1

    isVisiblePstatus

    public boolean isVisiblePstatus(int pstatus)
    Check if a pstatus is a default (aka visible) query pstatus (replace previous method isDefaultQueryPstatus).

    Parameters:
    pstatus - the pstatus to test
    Returns:
    true if the given pstatus is a default query pstatus or if there is no visiblePstatus
    Since:
    jcms-5.0.0

    isValidAdminIP

    public boolean isValidAdminIP(javax.servlet.ServletRequest request)
    Checks if the specified request is authorized to access admin area.

    Parameters:
    request - the ServletRequest to check
    Returns:
    true if the remote IP address is valid according the regexp contains int channel.admin-ip property.
    Since:
    jcms-4.0.2

    isValidWorkspacesIP

    public boolean isValidWorkspacesIP(javax.servlet.ServletRequest request)
    Checks if the specified request is authorized to access workspace area.

    Parameters:
    request - the ServletRequest to check
    Returns:
    true if the remote IP address is valid according the regexp contains int channel.workspaces-ip property.
    Since:
    jcms-7.0.2

    getRootCategory

    public Category getRootCategory()
    Returns the root category using the id specified in the property channel.root-category default to j_3.

    Returns:
    the root category

    getRootCategoryAsSet

    public Set<Category> getRootCategoryAsSet()
    A convenient method which returns a set containing the root category

    Returns:
    the root category
    Since:
    jcms-4.0

    getSearchRootSet

    public Set<Category> getSearchRootSet()
    Returns the categories to used as root for the search. This set of category is build from the category ids contains in property query.search-roots. If no such property exists, it returns the children of the root category.
    Warning: The returned Category TreeSet will NOT be ordered. Therefore make use you always create a new set with a new OrderComparator corresponding to the current user language!!

    Returns:
    a set of category
    See Also:
    getRootCategory(), getRefineRootSet(), getAdvRefineRootSet()

    getRefineRootSet

    public Set<Category> getRefineRootSet()
    Returns the categories to used as roots for the refinement. This set of category is build from the category ids contains in property query.refine-roots. If no such property exists, it returns the results of getSearchRootSet().
    Warning: The returned Category TreeSet will NOT be ordered. Therefore make use you always create a new set with a new OrderComparator corresponding to the current user language!!

    Returns:
    a set of category
    See Also:
    getRootCategory(), getSearchRootSet(), getAdvRefineRootSet()

    getTagRoot

    public Category getTagRoot()
    Returns the common tag root.

    Returns:
    the common tag root.
    Since:
    jcms-7.1.0

    getTagRoot

    public Category getTagRoot(Workspace ws)
    Returns the tag root for the given workspace if it exists ; otherwise return the common tag root.

    Parameters:
    ws - the workspace
    Returns:
    the tag root for the given workspace if it exists ; otherwise return the common tag root.
    Since:
    jcms-7.1.0

    getAdvRefineRootSet

    public Set<Category> getAdvRefineRootSet()
    Returns the categories to used as roots for the advanced refinement. This set of category is build from the category ids contains in property query.adv-refine-roots. If no such property exists, it returns the results of getRefineRootSet().
    Warning: The returned Category TreeSet will NOT be ordered. Therefore make use you always create a new set with a new OrderComparator corresponding to the current user language!!

    Returns:
    a set of category
    See Also:
    getRefineRootSet(), getSearchRootSet(), getRootCategory()

    invalidateSearchAndRefineRootSet

    public void invalidateSearchAndRefineRootSet()
    Invalidate search and refine root set (they will be computed at the next call).

    Since:
    jcms-5.6.0

    getMetaDataExtractor

    public MetaDataExtractor getMetaDataExtractor(String contentType)
    Returns a metadata extractor bound to the given contentType

    Parameters:
    contentType - the content type of the file to extract the metadata
    Returns:
    a MetaDataExtractor
    Since:
    jcms-4.0

    getSenderFullEmail

    public String getSenderFullEmail()
    Retrieves the full email that can be used to send message from JCMS

    Returns:
    an email in the form "name <user@company.com>".
    See Also:
    getSenderFullEmail(Workspace, Publication, String)

    getSenderFullEmail

    public String getSenderFullEmail(Workspace ws,
                                     String lang)
    Retrieves the full email that can be used to send message from JCMS given a workspace and a language

    Parameters:
    ws - workspace from which we will retrieve email
    lang - optionnal paramereter (set to null if not used)
    Returns:
    an email in the form "name <user@company.com>".
    See Also:
    getSenderFullEmail(Workspace, Publication, String)

    getSenderFullEmail

    public String getSenderFullEmail(Publication pub,
                                     String lang)
    Retrieves the full email that can be used to send message from JCMS given a workspace and a language

    Parameters:
    pub - publication from which we will retrieve workspace and its email
    lang - optionnal paramereter (set to null if not used)
    Returns:
    an email in the form "name <user@company.com>".
    See Also:
    getSenderFullEmail(Workspace, Publication, String)

    getSenderFullEmail

    public String getSenderFullEmail(Workspace ws,
                                     Publication pub,
                                     String lang)
    Retrieves a full email (something ) given some information to retrieve it We try: - first the given workspace email, "WorkspaceName " - the publication's workspace email, "Pub's WorkspaceName " - the channel default email, "Channel Name " - last the default admin email, "Default Admin "

    Parameters:
    ws - workspace from which we will retrieve email
    pub - publication from which we will retrieve workspace and its email
    lang - optionnal paramereter (set to null if not used)
    Returns:
    an email in the form "name <user@company.com>".

    isRegistered

    public boolean isRegistered(Data data)
    Checks if the given data is still registered in the Store.

    Parameters:
    data - the data to check
    Returns:
    true if the data is still registered
    Since:
    jcms-5.0.0

    isRegistered

    public boolean isRegistered(String id)
    Checks if the given data is still registered in the Store.

    Parameters:
    id - the id of the data to check
    Returns:
    true if the data is still registered
    Since:
    jcms-5.0.0

    initVirtualIDMap

    public void initVirtualIDMap()
    Init the virtual ID map (data, virtual ID).

    Since:
    jcms-5.5.0

    getVirtualID

    public String getVirtualID(Data data)
    Returns the virtual ID bound to the given data (or null if it does not exist).

    Parameters:
    data - the data to get the virtual ID.
    Returns:
    the virtual ID bound to the given data (or null if it does not exist).
    Since:
    jcms-5.5.0

    getStorable

    public Storable getStorable(String id)
    Returns a storable from its id. If id starts with character '$', it is considered as a virtual id. That is, the real id used is the value of the proprerty bound to this id.

    Parameters:
    id - the id of the storable
    Returns:
    the storable or null if not found
    Since:
    jcms-5.5.0

    getData

    public Data getData(String id)
    Returns a data from its id

    Parameters:
    id - the id of the data
    Returns:
    the data or null if not found

    getData

    public <T extends Data> T getData(Class<T> clazz,
                                      String id)
    Returns a data from its id.

    Type Parameters:
    T - any Data type
    Parameters:
    clazz - the class of the Data
    id - its id.
    Returns:
    the data or null if not found or if the data is not
    Since:
    jcms-6.0.0

    getWorkspace

    public Workspace getWorkspace(String id)
    Return a Workspace from its id

    Parameters:
    id - the id of the workspace
    Returns:
    a workspace

    getCategory

    public Category getCategory(String id)
    Returns a category from its id

    Parameters:
    id - the id of the category
    Returns:
    the category or null if not found

    getPublication

    public Publication getPublication(String id)
    Returns a publication from its id

    Parameters:
    id - the id of the publication
    Returns:
    the publication or null if not found

    getGroup

    public Group getGroup(String id)
    Returns a group from its id

    Parameters:
    id - the id of the group
    Returns:
    the group or null if not found

    getGroupFromDN

    public Group getGroupFromDN(String dn)
    Returns a LDAP group from its distinguish name.

    Parameters:
    dn - the dn of the group
    Returns:
    the group or null if not found
    Since:
    jcms-5.7.0

    getMember

    public Member getMember(String id)
    Returns a member from its id

    Parameters:
    id - the id of the member
    Returns:
    the member or null if not found

    getMemberFromLogin

    public Member getMemberFromLogin(String login)
    Returns the member with the given login.

    This method is only available after JCMS startup (both JStore and JcmsDB access must be fully ready).

    Parameters:
    login - the member's login
    Returns:
    the member or null if no member has this login.

    getMemberFromLogin

    public Member getMemberFromLogin(String login,
                                     boolean checkDisabled)
    Returns the member with the given login.

    This method is only available after JCMS startup (both JStore and JcmsDB access must be fully ready).

    Parameters:
    login - the member's login
    checkDisabled - if true do not return member if account is disabled
    Returns:
    the member or null if no member has this login.

    getMemberFromEmail

    public Member getMemberFromEmail(String email)
    Returns the member with the given email.

    This method is only available after JCMS startup (both JStore and JcmsDB access must be fully ready).

    Parameters:
    email - the member's email
    Returns:
    the member or null if no member has this email.

    getVersionList

    public List<? extends Storable> getVersionList(Data data)
                                            throws LogException
    Get all the version of a given Data. Since jcms-5.5, if this data is deleted, the list contains one more element which represents the deleted version. This element contains the deletion date (getDdate()) and the deletion author (getOpAuthor()). CAUTION: SLOW! this method parses the store to find the version, use with care.

    Parameters:
    data - the data
    Returns:
    a unmodifiable list of Data
    Throws:
    LogException - if an error occured while reading store.xml
    Since:
    jcms-3.0

    getVersionList

    public List<? extends Storable> getVersionList(String id)
                                            throws LogException
    Get all the version of a Data, given its id. Since jcms-5.5, if this data is deleted, the list contains one more element which represents the deleted version. This element contains the deletion date (getDdate()) and the deletion author (getOpAuthor()). CAUTION: SLOW! this method parses the store to find the version, use with care.

    Parameters:
    id - the data id
    Returns:
    a unmodifable List of Data
    Throws:
    LogException - if an error occured while reading store.xml
    Since:
    jcms-3.0

    getDeletedSet

    public TreeSet<? extends Storable> getDeletedSet(Class<? extends Storable> clazz)
                                              throws LogException
    Get the latest version of the deleted Data for a given class. CAUTION: SLOW! this methods re-read the store to find the deleted object of the given Class, use with care.

    Parameters:
    clazz - the searched class
    Returns:
    a Set of Data
    Throws:
    LogException - if an error occured while reading store.xml
    Since:
    jcms-3.0

    getPublicationSuperTypes

    public Class<?>[] getPublicationSuperTypes()
    Returns the super publication types (i.e. Content, UserContent, Portlet and Form).

    Returns:
    the super publication types (i.e. Content, UserContent, Portlet and Form).
    Since:
    jcms-6.0.0

    getPublicationTypeList

    public List<Class<? extends Publication>> getPublicationTypeList()
    Returns all the available publication types (sorted on the main language). That is, the core publication types (Review, FileDocument, ...) and the custom publication types.

    Returns:
    a list of classes (caution: this list is always the same object. Do not modify it.)
    See Also:
    getCustomTypeList(), getCoreTypeList(), getPublicationTypeList(String)

    getPublicationTypeList

    public List<Class<? extends Publication>> getPublicationTypeList(String lang)
    Retrieves all the available publication types sorted on the given language. That is, the core publication types (Review, FileDocument, ...) and the custom publication types.

    Parameters:
    lang - the ISO-639 language code of the language to use for sorting, use default site's language if null.
    Returns:
    a list of classes (caution: this list is always the same object. Do not modify it.)
    See Also:
    getCustomTypeList(), getCoreTypeList(), getPublicationTypeList()

    getTypeLabelComparator

    public Channel.TypeLabelComparator getTypeLabelComparator(String lang)
    Retrieves a new instance of a TypeLabelComparator which sorts Class using their TypeProcessor label.

    Parameters:
    lang - the language in which to sort the label.
    Returns:
    a new instance of Channel.TypeLabelComparator
    Since:
    jcms-5.7.2

    getCoreTypeList

    public ArrayList<Class<? extends Publication>> getCoreTypeList()
    Returns all the available core publication types (Review, FileDocument, ArchivedPublication...)

    Returns:
    a list of classes (caution: this list is always the same object. Do not modify it.)
    See Also:
    getCustomTypeList(), getPublicationTypeList()

    getSubTypeList

    public <T> List<Class<? extends T>> getSubTypeList(Class<T> clazz)
    Returns a list of the publication types which extends the giving one.

    Type Parameters:
    T - any Publication type
    Parameters:
    clazz - the super class
    Returns:
    a list of classes which extends clazz
    Since:
    jcms-4.0
    See Also:
    getCustomTypeList(), getCoreTypeList(), getSubTypeList(Class, String)

    getSubTypeList

    public <T> List<Class<? extends T>> getSubTypeList(Class<T> clazz,
                                                       String lang)
    Returns a list of the publication types which extends the giving one. The list is sorted according the given language.

    Type Parameters:
    T - any Publication type
    Parameters:
    clazz - the super class
    lang - the language
    Returns:
    a list of classes which extends clazz
    Since:
    jcms-5.7.0
    See Also:
    getCustomTypeList(), getCoreTypeList()

    getPublishableSubTypeList

    public <T> ArrayList<Class<? extends T>> getPublishableSubTypeList(Class<T> clazz,
                                                                       Member member)
    Returns all the publication types which extends the giving one and that the given member is allowed to publish and that are not abstract.

    Type Parameters:
    T - any Publication type
    Parameters:
    clazz - the super class
    member - a member
    Returns:
    a list of classes which extends clazz and that can be published by the given member
    Since:
    jcms-4.0.1
    See Also:
    getSubTypeList(Class), getCustomTypeList(), getCoreTypeList()

    getDataRight

    public DataRight getDataRight(boolean canPublish,
                                  boolean canUpdateOther,
                                  boolean canDeleteOther,
                                  boolean create)
    Returns a DataRight matching the given criteria. Can create a new one if none.

    Parameters:
    canPublish - the canPublish value of the DataRight that is looked for.
    canUpdateOther - the canUpdateOther value of the DataRight that is looked for.
    canDeleteOther - the canDeletOther value of the DataRight that is looked for.
    create - if true creates the DataRight if it does not exist.
    Returns:
    the DataRight or null if none.
    Since:
    jcms-2.1

    getNoCategoryRight

    public CategoryRight getNoCategoryRight()
    Returns the CategoryRight which sets edition of cateogry forbidden

    Returns:
    the CategoryRight for none category
    Since:
    jcms-2.1

    getRootCategoryRight

    public CategoryRight getRootCategoryRight()
    Returns the CategoryRight allowing edition of all the cateogry

    Returns:
    the CategoryRight for 'root' category or null if none.
    Since:
    jcms-2.1

    getCategoryRight

    public CategoryRight getCategoryRight(HashSet<Category> roots,
                                          int mode,
                                          boolean create)
    Returns the CategoryRight matching the given criteria

    Parameters:
    roots - the categories to look for
    mode - the mode to look for (GROUP_AND_MEMBER = 0, MEMBER_ONLY = 1, GROUP_ONLY = 2)
    create - if true creates the DataRight if it does not exist.
    Returns:
    the CategoryRight or null if none.
    Since:
    jcms-2.1

    getDataSet

    public <T> TreeSet<T> getDataSet(Class<T> clazz)
    Returns all instances of a given class and it's subclass. If this class is a subclass of DBData, it returns a set of DBData otherwise it returns only JStore data.
    CAUTION: This class does not control the read access nor the pstatus of the publications.
    CAUTION: returns an internal Set, DO NOT alter this Set, clone prior modification. CAUTION: getDataSet(Publication.class) only returns JStore data, it does not returns publications saved in the database.

    Parameters:
    clazz - the class of instances to look for
    Returns:
    the internal set of data instances associated to the given class
    See Also:
    getPublicationSet(Class, Member)

    getDataCount

    public long getDataCount(Class<? extends Data> clazz)
    Returns the number of data available for the given class.

    Parameters:
    clazz - the class.
    Returns:
    the number of data available for the given class.
    Since:
    jcms-6.0.0

    getDBDataList

    public <T> List<T> getDBDataList(Class<T> clazz)
    Returns all the instance for the given class stored in the database.

    Type Parameters:
    T - any DB type
    Parameters:
    clazz - the class
    Returns:
    a List of all the instance for the given class stored in the database (never return null).
    Since:
    jcms-6.0.0
    See Also:
    HibernateUtil.getDBDataList(Class)

    getDBDataList

    public <T> List<T> getDBDataList(Class<T> clazz,
                                     int firstResult,
                                     int maxResults)
    Returns all the instance for the given class stored in the database.

    Type Parameters:
    T - any DB type
    Parameters:
    clazz - the class
    firstResult - set the first data to retrieve. If <= 0, rows will be retrieved beginnning from first data.
    maxResults - set the maximum number of data to retrieve. If <= 0, there is no limit to the number of data retrieved.
    Returns:
    a List of all the instance for the given class stored in the database (never return null).
    Since:
    jcms-6.0.0
    See Also:
    HibernateUtil.getDBDataList(Class)

    getDBData

    public DBData getDBData(Class<?> clazz,
                            Long rowId)
    Returns a given DBData according its class and it row id.

    Parameters:
    clazz - the class
    rowId - the row id
    Returns:
    a given DBData according its class and it row id.
    Since:
    jcms-6.0.0
    See Also:
    HibernateUtil.getObject(Class, Long)

    getDBDataIterator

    public <T> Iterator<T> getDBDataIterator(Class<T> clazz)
    Returns an iterator on the list of instance for the given class stored in the database.

    Type Parameters:
    T - any DB type
    Parameters:
    clazz - the class.
    Returns:
    an iterator on the list of instance for the given class stored in the database.
    Since:
    jcms-6.0.0
    See Also:
    HibernateUtil.getDBDataIterator(Class)

    getDataAndDBDataIterator

    public <T> Iterator<T> getDataAndDBDataIterator(Class<T> clazz)
    Returns an iterator on an hybrid list of data stored in the database and JStore.

    Type Parameters:
    T - any DB type
    Parameters:
    clazz -
    Returns:
    an iterator on an hybrid list of data stored in the database and JStore.
    Since:
    jcms-6.0.0

    getDBPublicationList

    public PageResult<Publication> getDBPublicationList(PublicationCriteria pubCriteria)
    Returns a list of publications in the database matching the given criteria.

    Parameters:
    pubCriteria - the PublicationCriteria
    Returns:
    a list of publications.
    Since:
    jcms-6.0.0
    See Also:
    HibernateUtil.queryPublication(PublicationCriteria)

    getVisibleDBPublicationList

    public PageResult<Publication> getVisibleDBPublicationList(PublicationCriteria pubCriteria)
    Returns a list publications in the database matching the given criteria and in a visible state.

    Parameters:
    pubCriteria - the PublicationCriteria
    Returns:
    a list publications in the database matching the given criteria and in a visible state.
    Since:
    jcms-6.0.0

    getNotVisibleDBPublicationList

    public PageResult<Publication> getNotVisibleDBPublicationList(PublicationCriteria pubCriteria)
    Returns a list publications in the database matching the given criteria and not in a visible state.

    Parameters:
    pubCriteria - the PublicationCriteria
    Returns:
    a list publications in the database matching the given criteria and not in a visible state.
    Since:
    jcms-6.0.0

    getDBPublicationClassList

    public List<Class<? extends Publication>> getDBPublicationClassList()
    Returns the list of Publication subclasses managed by Hibernate.

    Returns:
    the list of Publication subclasses managed by Hibernate.
    Since:
    jcms-6.0.0

    updateClass2DataSet

    protected void updateClass2DataSet(Data data,
                                       boolean add)
    This methods is called by a DataListener when a Data is updated or created to update the map which link Class to Set of Data.

    Since:
    jcms-5.0.1

    getAllDataSet

    public <T> TreeSet<T> getAllDataSet(Class<T> clazz)
    Returns all instances of a given class and it's subclass.
    CAUTION: This class does not control the read access nor the pstatus of the publications.

    Parameters:
    clazz - the class
    Returns:
    all instances of a given class and it's subclass.
    Since:
    jcms-4.0

    getAllDataSet

    public TreeSet<Data> getAllDataSet()
    Returns all the data of this site in a new TreeSet.
    CAUTION: This class does not control the read access of Publication.

    Returns:
    a new TreeSet of Data containing every Data of this site.

    getDataSet

    public <T> TreeSet<T> getDataSet(String[] ids,
                                     Class<? extends T> clazz,
                                     boolean neverNull)
    Returns a set of data from an array of idenfiers.

    Type Parameters:
    T - any data type
    Parameters:
    ids - an array of identifiers.
    clazz - the clazz of the identifiers (may be null, if the array is heterogeneous)
    neverNull - if true and if there is no results, return an empty set instead of null.
    Returns:
    a set of data.
    Since:
    jcms-6.0.0

    getDataSet

    public TreeSet<?> getDataSet(String[] ids)
    Returns the instances associated to an array of ids. Bad ids are ignored (i.e. not added in the return set).
    CAUTION: This class does not control the read access of Publication.

    Parameters:
    ids - an array of ids
    Returns:
    a set of instances

    getDataList

    public ArrayList<Data> getDataList(String[] ids)
    Returns the instances associated to an array of ids. Bad ids are ignored (i.e. not added in the return list). CAUTION: This class does not control the read access of Publication.

    Parameters:
    ids - an array of ids
    Returns:
    a set of instances
    See Also:
    for generic method

    getDataList

    public <T extends Data> ArrayList<T> getDataList(String[] ids,
                                                     boolean ignoreNull,
                                                     Class<T> clazz)
    Returns the data corresponding to the given array of data ids. Bad ids may be ignored (i.e. not added in the return list). The trailing null are systematically skipped. CAUTION: This class does not control the read access of Publication.

    Type Parameters:
    T - any data type
    Parameters:
    ids - an array of ids
    ignoreNull - if true, null are skipped
    clazz - a filter class
    Returns:
    a List of data

    getAllPublicationSet

    public <T extends Publication> TreeSet<T> getAllPublicationSet(Class<T> clazz,
                                                                   Member member)
    Returns all publications of a given class AND subclasses that can be accessed by a given member and that are in a visible state. If the member is null, it returns all the publications that have no read right.

    Type Parameters:
    T - any publication type
    Parameters:
    clazz - the class of instances to look for
    member - the member who access the publication set
    Returns:
    a set of instances (or an emtpy if clazz is not a subclass of Publication or there is no Publication)
    Since:
    jcms-4.1.1

    getAllPublicationSet

    public <T extends Publication> TreeSet<T> getAllPublicationSet(Class<T> clazz,
                                                                   Member member,
                                                                   boolean checkPstatus)
    Returns all publications of a given class AND subclasses that can be accessed by a given member. If the given member is null, it returns all the publications that have no read right.

    Type Parameters:
    T - any publication type
    Parameters:
    clazz - the class of instances to look for
    member - the member who access the publication set
    checkPstatus - if true, select only the publications that are in a visible state.
    Returns:
    a set of instances (or an emtpy if clazz is not a subclass of Publication or there is no Publication)
    Since:
    jcms-5.0.0

    getPublicationSet

    public <T extends Publication> TreeSet<T> getPublicationSet(Class<T> clazz,
                                                                Member member)
    Returns all publications of a given class that can be accessed by a given member and that are in a visible state. If the member is null, it returns all the publications that have no read right.

    Type Parameters:
    T - any publication type
    Parameters:
    clazz - the class of instances to look for
    member - the member who access the publication set
    Returns:
    a set of instances (or an emtpy if clazz is not a subclass of Publication or there is no Publication)
    Since:
    jcms-2.1

    getPublicationSet

    public <T extends Publication> TreeSet<T> getPublicationSet(Class<T> clazz,
                                                                Member member,
                                                                boolean checkPstatus)
    Returns all publications of a given class that can be accessed by a given member. If the member is null, it returns all the publications that have no read right.

    Type Parameters:
    T - any publication type
    Parameters:
    clazz - the class of instances to look for
    member - the member who access the publication set
    checkPstatus - if true, select only the publications that are in a visible state.
    Returns:
    a set of instances (or an emtpy if clazz is not a subclass of Publication or there is no Publication)
    Since:
    jcms-2.1

    getPublicationSet

    public <T extends Publication> TreeSet<T> getPublicationSet(Class<T> clazz,
                                                                Member member,
                                                                boolean checkPstatus,
                                                                Workspace workspace)
    Returns all publications of a given class that can be accessed by a given member. If the member is null, it returns all the publications that have no read right.

    Type Parameters:
    T - any publication type
    Parameters:
    clazz - the class of instances to look for
    member - the member who access the publication set
    checkPstatus - if true, select only the publications that are in a visible state.
    workspace - if not null select only the publications of this workspace
    Returns:
    a set of instances (or an emtpy if clazz is not a subclass of Publication or there is no Publication)
    Since:
    jcms-2.1

    getPublicationSet

    public <T extends Publication> TreeSet<T> getPublicationSet(Class<T> clazz,
                                                                Member member,
                                                                boolean checkPstatus,
                                                                Workspace workspace,
                                                                boolean searchDB)

    getPublicationSet

    public <T extends Publication> Set<T> getPublicationSet(Set<T> publicationSet,
                                                            boolean specialState)
    Return a SubSet of publication in or not in special state.

    Parameters:
    publicationSet -
    specialState -
    Returns:
    a Set of publication

    getPublicationSet

    public Set<Publication> getPublicationSet(Set<Publication> publicationSet,
                                              Workflow wf)
    Return a SubSet of all publication using the given workflow

    Parameters:
    publicationSet -
    wf -
    Returns:
    a Set of publication

    getPublicationSetFromTitle

    public Set<Publication> getPublicationSetFromTitle(String title)
    Returns all publications with title in default site language matching the given title.

    Parameters:
    title - the title to be searched for.
    Returns:
    a set of publications

    getPublicationSetFromTitle

    public Set<Publication> getPublicationSetFromTitle(String title,
                                                       boolean searchInDB)

    getFirstPublicationFromTitle

    public Publication getFirstPublicationFromTitle(String title)
    Returns the first publication with the title in default site language matching the given title.

    Parameters:
    title - the title to be searched for.
    Returns:
    the first publication with the title in default site language matching the given title.
    Since:
    jcms-5.7.2

    getPublicationSetFromTitle

    public <T> Set<T> getPublicationSetFromTitle(Class<T> clazz,
                                                 String title)
    Returns all publications of the given class with title in default site language matching the given title.

    Parameters:
    clazz - the class of the publication
    title - the title to be searched for.
    Returns:
    a set of publications
    Since:
    jcms-6.0.0

    getFirstPublicationSetFromTitle

    public <T> T getFirstPublicationSetFromTitle(Class<T> clazz,
                                                 String title)
    Returns the first publications of the given class with title in default site language matching the given title.

    Parameters:
    clazz - the class of the publication
    title - the title to be searched for.
    Returns:
    a publication
    Since:
    jcms-6.0.0

    getPublicationWithoutCategories

    public HashSet<Publication> getPublicationWithoutCategories()
    Returns all the publications without categories in a new HashSet.

    Returns:
    a set of publications
    Since:
    jcms-5.5.0

    isWebdavEnabled

    public boolean isWebdavEnabled()
    Check if Webdav is enable

    Returns:
    boolean true if webdav is enable
    Since:
    jcms-5.5.0

    disableDataWrite

    public void disableDataWrite(String msg)
    Disable data write.

    Parameters:
    msg - the maintenance message.
    Since:
    jcms-5.5.0
    See Also:
    enableDataWrite(), isDataWriteEnabled()

    enableDataWrite

    public void enableDataWrite()
    Enable data wirte.

    Since:
    jcms-5.5.0
    See Also:
    disableDataWrite(String), isDataWriteEnabled()

    handleDataWriteState

    public void handleDataWriteState(boolean disable,
                                     String msg,
                                     boolean updateProperty)
    Handle the given data write state and perform the update in properties if needed.

    Parameters:
    disable -
    msg -
    updateProperty -
    Since:
    JCMS-6.0

    isDataWriteEnabled

    public boolean isDataWriteEnabled()
    Checks if data write are enabled (see channel.data-write.enabled property)

    Returns:
    true if data write are enabled
    Since:
    jcms-4.0.2

    handleStoreError

    public void handleStoreError(String msg,
                                 Throwable th)
    This method is called when a fatal error occurs on the store.

    Parameters:
    msg - the contextual error message.
    th - the original throwable
    Since:
    jcms-5.5.0

    handleJcmsDBError

    public void handleJcmsDBError(String msg,
                                  Throwable th)
    This method is called when a fatal error occurs on the JcmsDB.

    Parameters:
    msg - the contextual error message.
    th - the original throwable
    Since:
    jcms-6.1.3

    createData

    public void createData(Data data,
                           Member opAuthor)
    Creates a data in the store. This is a low-level method. Since jcms-5.0.0, it is recommanded to use Data.performCreate(Member) method.

    Parameters:
    data - the data to be created
    opAuthor - the member which performs the write operation (can be null)
    See Also:
    Data.performCreate(com.jalios.jcms.Member)

    updateData

    public void updateData(Data updated,
                           Member opAuthor)
    Updates a data in the store. It does not update the given data, but the data bound to id of the given data. This methode should only be called on a temporary object. This is a low-level method. Since jcms-5.0.0, it is recommanded to use Data.performUpdate(Member) method.

    Parameters:
    updated - the data to be updated
    opAuthor - the member which performs the write operation (can be null)
    Since:
    jcms-5.0.0
    See Also:
    Data.performUpdate(com.jalios.jcms.Member)

    deleteData

    public void deleteData(Data data,
                           Member opAuthor)
    Delete a data in the store. This is a low-level method. Since jcms-5.0.0, it is recommanded to use Data.performDelete(Member) method.

    Parameters:
    data - the data to be deleted
    opAuthor - the member which performs the write operation (can be null)
    See Also:
    Data.performDelete(com.jalios.jcms.Member)

    select

    public <T> TreeSet<T> select(Collection<? extends T> dataColl,
                                 DataSelector selector,
                                 Comparator comparator)
    Perform a selection on a Collection of Data using the given DataSelector, and return a TreeSet sorted using the given Comparator.
    If no Comparator is given, CdateComparator is used.

    Parameters:
    dataColl - the Collection of Data to select.
    selector - the DataSelector to use.
    comparator - the Comparator to use.
    Returns:
    a new or cloned TreeSet of Data.
    See Also:
    JcmsUtil.select(Collection, DataSelector, Comparator)

    getQueryManager

    public QueryManager getQueryManager()
    Retrieve the singleton instance of the QueryManager used by JCMS.

    Returns:
    the QueryManager singleton.

    query

    public QueryResultSet query(QueryHandler qh,
                                javax.servlet.ServletRequest request,
                                Set<? extends Publication> proposedDataSet)
    Perform a query using parameters specified in the given QueryHandler.
    Search in the given Collection of Publication or in all Publication if not specified.

    Parameters:
    qh - the QueryHandler from which to retrieve the query parameters, MUST NOT be null.
    request - the ServletHttpRequest used to set some error or warning messages in the attributes, can be null.
    proposedDataSet - the Collection of Publication in which to search and apply query parameters, if null, search is done in all Publication.
    Returns:
    a QueryResultSet containing all results of this query, it is a HashSet and therefore it is NOT sorted. use either getAsSortedSet() or getAsSortedSet(Comparator) to obtain a sorted Set.
    Since:
    jcms-5.0.0

    getMemberSearchEngine

    public LuceneMemberSearchEngine getMemberSearchEngine()
    Retrieve the singleton instance of the MemberSearchEngine used by JCMS.

    Returns:
    the LuceneMemberSearchEngine singleton.
    Since:
    jcms-6.1.0

    getWSTypeEntry

    public WSTypeEntry getWSTypeEntry(Class clazz,
                                      Workspace workspace)
    This method is a substitute of old getTypeEntry(Class) or getTypeEntry(String). It return a WSTypeEntry that encapsulate a TypeEntry adding custom workspace properties. If workspace is null it will have the same behaviour has a TypeEntry but the method WSTypeEntry#getWorkflow() will throw a RuntimeException.

    Parameters:
    clazz - the Class of which to find the WSTypeEntry
    workspace - the workspace to use or null
    Returns:
    WSTypeEntry a wrapper of TypeEntry adding Workspace
    See Also:
    Workspace.getWSTypeEntry(Class)

    getWSTypeEntry

    public WSTypeEntry getWSTypeEntry(String className,
                                      Workspace workspace)
    This method is a substitute of old getTypeEntry(Class) or getTypeEntry(String). It return a WSTypeEntry that encapsulate a TypeEntry adding custom workspace properties. If workspace is null it will have the same behaviour has a TypeEntry but the method WSTypeEntry#getWorkflow() will throw a RuntimeException.

    Parameters:
    className - the String representing the name the Class of which to find the WSTypeEntry
    workspace - the workspace to use or null
    Returns:
    WSTypeEntry a wrapper of TypeEntry adding Workspace

    getTypeEntry

    public TypeEntry getTypeEntry(Class<?> clazz)
    Return the TypeEntry bound to given Class. Since jcms-5.5.0 should call #getTypeEntry(Class,Workspace)

    Parameters:
    clazz - the Class of which to find the TypeEntry
    Returns:
    the TypeEntry associated to the given class or null if not available.
    Since:
    jcms-3.0
    See Also:
    TypeProcessor.getTypeEntry(Class)

    getTypeEntry

    public TypeEntry getTypeEntry(String className)
    Return the TypeEntry bound to given className.

    Parameters:
    className - the name the Class of which to find the TypeEntry
    Returns:
    the TypeEntry associated to the given class or null if not available.
    Since:
    jcms-5.5
    See Also:
    TypeProcessor.getTypeEntry(String)

    getTypeAbstractFieldEntry

    public TypeFieldEntry getTypeAbstractFieldEntry(Class<?> clazz)
    Returns the TypeFieldEntry associated to the abstract (summary) field of the specified type.

    Parameters:
    clazz - the Class of which to find the TypeFieldEntry
    Returns:
    the TypeFieldEntry associated to the specified class or null if not available.
    Since:
    jcms-5.7.0

    getTypeFieldEntry

    public TypeFieldEntry getTypeFieldEntry(Class<?> clazz,
                                            String fieldName,
                                            boolean checkAll)
    Return the TypeFieldEntry associated to the given Class and fieldName.

    Parameters:
    clazz - the Class of which to find the TypeFieldEntry
    fieldName - the field name of which to find the TypeFieldEntry
    checkAll - whether to check in inherited field entry of the class.
    Returns:
    the TypeFieldEntry associated to the given class and fieldName or null if not available.
    Since:
    jcms-5.5.0
    See Also:
    getTypeFieldEntries(Class clazz), getAllTypeFieldEntries(Class clazz)

    getTypeFieldEntry

    public TypeFieldEntry getTypeFieldEntry(Class<?> clazz,
                                            String fieldName)
    Returns the TypeFieldEntry bound to the given field of the given class.

    Parameters:
    clazz - the class
    fieldName - the field name
    Returns:
    the TypeFieldEntry bound to the given field of the given class.
    Since:
    jcms-5.7.0

    getTypeFieldLabel

    public String getTypeFieldLabel(Class<?> clazz,
                                    String fieldName,
                                    String lang)
    Returns the localized label of the given field of the given class.

    Parameters:
    clazz - the class
    fieldName - the field name
    lang - the language in which localized the label
    Returns:
    the localized label of the given field of the given class.
    Since:
    jcms-5.7.0

    getTypeFieldLabel

    public String getTypeFieldLabel(Class<?> clazz,
                                    String fieldName)
    Returns the localized label of the given field of the given class. The localization is based on the current user language.

    Parameters:
    clazz - the class
    fieldName - the field name
    Returns:
    the localized label of the given field of the given class.
    Since:
    jcms-5.7.0
    See Also:
    getCurrentUserLang()

    getTypeFieldLabel

    public String getTypeFieldLabel(Data data,
                                    String fieldName,
                                    String lang)
    Returns the localized label of the given field of the given data. The localization is based on the current user language.

    Parameters:
    data - the data
    fieldName - the field name
    lang - the language in which localized the label
    Returns:
    the localized label of the given field of the given data.
    Since:
    jcms-5.7.0
    See Also:
    getCurrentUserLang()

    getTypeFieldLabel

    public String getTypeFieldLabel(Data data,
                                    String fieldName)
    Returns the localized label of the given field of the given data. The localization is based on the current user language.

    Parameters:
    data - the data
    fieldName - the field name
    Returns:
    the localized label of the given field of the given data.
    Since:
    jcms-5.7.0
    See Also:
    getCurrentUserLang()

    getTypeFieldEntries

    public TypeFieldEntry[] getTypeFieldEntries(Class<?> clazz)
    Return an array of TypeFieldEntry bound to given Class.
    This array does not contain inherited TypeFieldEntry from super classes of given Class.

    Parameters:
    clazz - the Class of which to find the TypeFieldEntry.
    Returns:
    an array of TypeFieldEntry containing all Field used by Class or an empty array (never return null)
    Since:
    jcms-5.5.0
    See Also:
    TypeProcessor.getTypeFieldEntries(Class)

    getTypeFieldEntries

    public TypeFieldEntry[] getTypeFieldEntries(String className)
    Return an array of TypeFieldEntry bound to given Class.
    This array does not contain inherited TypeFieldEntry from super classes of given Class.

    Parameters:
    className - the String representing the name the Class of which to find the TypeFieldEntry
    Returns:
    an array of TypeFieldEntry containing all Field used by Class or an empty array (never return null)
    Since:
    jcms-5.5.0
    See Also:
    TypeProcessor.getTypeFieldEntries(String)

    getAllTypeFieldEntries

    public TypeFieldEntry[] getAllTypeFieldEntries(Class<?> clazz)
    Return an array of TypeFieldEntry bound to given Class.
    This array does contain inherited TypeFieldEntry from super classes of given Class.

    Parameters:
    clazz - the Class of which to find the TypeFieldEntry.
    Returns:
    an array of TypeFieldEntry containing all Field used by Class or an empty array (never return null)
    Since:
    jcms-5.5.0
    See Also:
    TypeProcessor.getAllTypeFieldEntries(Class)

    getAllTypeFieldEntries

    public TypeFieldEntry[] getAllTypeFieldEntries(String className)
    Return an array of TypeFieldEntry bound to given Class name.
    This array does contain inherited TypeFieldEntry from super classes of given Class.

    Parameters:
    className - the String representing the name the Class of which to find the TypeFieldEntry
    Returns:
    an array of TypeFieldEntry containing all Field used by Class or an empty array (never return null)
    Since:
    jcms-5.5.0
    See Also:
    TypeProcessor.getAllTypeFieldEntries(String)

    getTypeLabel

    public String getTypeLabel(Class<?> clazz,
                               String lang)
    Returns the label of the given type (class) in the given language.

    Parameters:
    clazz - the class
    lang - the language
    Returns:
    the label of the given type (class) in the given language.
    Since:
    jcms-5.7.0
    See Also:
    getTypeLabel(Class, Workspace, String)

    getTypeLabel

    public String getTypeLabel(Class<?> clazz,
                               Workspace workspace,
                               String lang)
    Returns the label of the given type (class) in the given workspace in the given language.

    Parameters:
    clazz - the class
    workspace - the Workspace
    lang - the language
    Returns:
    the label of the given type (class) in the given workspace in the given language.
    Since:
    jcms-5.5.0
    See Also:
    getTypeLabel(Class,String), Workspace.getTypeLabel(Class,String)

    getTypeDescription

    public String getTypeDescription(Class clazz,
                                     String lang)
    Returns the description of the given type (class) in the given language.

    Parameters:
    clazz - the class
    lang - the language
    Returns:
    the description of the given type (class) in the given language.
    Since:
    jcms-5.7.0
    See Also:
    getTypeDescription(Class, Workspace, String)

    getTypeDescription

    public String getTypeDescription(Class clazz,
                                     Workspace workspace,
                                     String lang)
    Returns the description of the given type for the given workspace in the given language.

    Parameters:
    clazz - the class
    workspace - the Workspace
    lang - the language
    Returns:
    the description of the given type for the given workspace in the given language.
    Since:
    jcms-5.5.0
    See Also:
    getTypeLabel(Class,String), Workspace.getTypeDescription(Class,String)

    restart

    public void restart()
    Restarts the channel. Updates the restart file of the current application server, usually web.xml, to force a restart.

    See Also:
    getAppServerInfo(), AppServerInfo.getRestartFile()

    isAvailable

    public boolean isAvailable()
    Check if the site is started and ready.

    Returns:
    true if site is available, false otherwise
    Since:
    jcms-5.0.

    setAvailable

    public void setAvailable(boolean isAvailable)
    Enable or disable the site.
    Warning! should be used very carefully.
    This methods can be used to improve speed when generating fake contents in JCMS as it disables some processes (checks and clones) performed to prevent Concurrent Modification Exceptions.

    Parameters:
    isAvailable - true to enable site, false to disable
    Since:
    jcms-5.0.

    getClassLoader

    public ClassLoader getClassLoader()
    Returns the classLoader

    Returns:
    the classLoader
    Since:
    jcms-5.5.0

    getClass

    public Class[] getClass(String[] clazzStr)
    Load and return classes

    Parameters:
    clazzStr - the full qualified name of the classes to load
    Returns:
    the loaded classes

    getClass

    public Class getClass(String className)
                   throws ClassNotFoundException
    Load and return a class

    Parameters:
    className - the full qualified name of the class to load
    Returns:
    the loaded class
    Throws:
    ClassNotFoundException
    IllegalStateException - if className represents a class generated by JCMS and such classes have not yet been generated and compiled. If thrown, the site must not been started.

    getCustomTypeList

    public List getCustomTypeList()
    Return the list of custom publication types Class, that is all the Publication Class of package "generated.". CAUTION: returns an internal List, DO NOT alter this List, clone prior modification.

    Returns:
    an internal List of Class (caution: this list is always the same object. Do not modify it.)
    See Also:
    getCustomTypeList(), getPublicationTypeList()

    getCustomExtensionMap

    public Map<String,Class<?>> getCustomExtensionMap()
    Returns the map of String (Class) to data extension (Class).
    Usually:
  • "CategoryExtension" ==> class generated.CategoryExtension
  • "GroupExtension" ==> class generated.GroupExtension
  • "FileDocumentExtension" ==> class generated.FileDocumentExtension
  • "WorkspaceExtension" ==> class generated.WorkspaceExtension
  • "MemberExtension" ==> class generated.MemberExtension
  • CAUTION: returns an internal Map, DO NOT alter this Map, clone prior modification.

    Returns:
    an internal Map of String to Class

    getCustomExtensionCollection

    public Collection<Class<?>> getCustomExtensionCollection()
    Returns all the DataExtension classes.
    Usually:
  • class generated.CategoryExtension
  • class generated.GroupExtension
  • class generated.FileDocumentExtension
  • class generated.WorkspaceExtension
  • class generated.MemberExtension
  • Returns:
    a Collection of Class.
    Since:
    jcms-5.5.0

    getUrl

    public String getUrl()
    Returns the Url of the channel. This is the url to be used for content to be read outside the site (email, newsletter, etc).

    Returns:
    the base url of the channel

    getName

    public String getName()
    Returns the name of the channel

    Returns:
    the channel's name, e.g "JCMS".

    getUrid

    public String getUrid()
    Returns the urid of the channel

    Returns:
    the channel's urid, e.g "c".
    Since:
    jcms-4.0.2

    toString

    public String toString()
    Overrides:
    toString in class Object
    See Also:
    getName()

    getJcmsInfo

    public JcmsInfo getJcmsInfo()
    Return a JcmsInfo instance (a singleton) which describe the JCMS version of this channel.

    Returns:
    a JcmsInfo instance
    Since:
    jcms-3.0

    getHierarchicalWorkspaceLimit

    public int getHierarchicalWorkspaceLimit()
    Returns the hierarchical workspace limit define by property "hierarchical-ws.menu-limit".

    Returns:
    int

    addChannelListener

    public void addChannelListener(ChannelListener listener)
    Adds a ChannelListener.

    Parameters:
    listener - the ChannelListener to add
    Since:
    jcms-2.1

    removeChannelListener

    public void removeChannelListener(ChannelListener listener)
    Removes a ChannelListener.

    Parameters:
    listener - the ChannelListener to remove
    Since:
    jcms-2.1

    addStoreListener

    public void addStoreListener(StoreListener listener,
                                 Class<?> clazz,
                                 boolean repeat)
    Adds a StoreListener associated to a given class. This listener will be notified each time an instance of this class will be created, updated or deleted.

    Parameters:
    listener - the StoreListener to add
    clazz - the class to listen to.
    repeat - If true, the listener will be called every time an operation is processed on the given class, that is during store load (if listener is added before store load) and for every following operation on every replica. If false, the listener will only be called the very first time the operation takes place, and only on the replica where it is done (also not during store load).

    addStoreListener

    public void addStoreListener(StoreListener listener,
                                 boolean repeat)
    Adds a StoreListener for all storable classes. This listener will be notified each time a storable will be created, updated or deleted.

    Parameters:
    listener - the StoreListener to add
    repeat - true if the listner must notify each time this operation is processed

    removeStoreListener

    public void removeStoreListener(StoreListener listener,
                                    Class<?> clazz)
    Removes a StoreListener associated to a given class.

    Parameters:
    listener - the StoreListener to remove
    clazz - the class to listen to.
    Since:
    jcms-2.1

    removeStoreListener

    public void removeStoreListener(StoreListener listener)
    Removes a StoreListener for all storable classes.

    Parameters:
    listener - the StoreListener to remove
    Since:
    jcms-2.1

    getStoreListenerSet

    public Set<StoreListener> getStoreListenerSet()
    Returns the set of StoreListener listening for all data.

    Returns:
    the set of StoreListener listening for all data.
    Since:
    jcms-5.5.0

    getStoreListenerClassMap

    public Map<Class<?>,Set<StoreListener>> getStoreListenerClassMap()
    Returns the map class/StoreListener.

    Returns:
    the map class/StoreListener.
    Since:
    jcms-5.5.0

    addDBListener

    public void addDBListener(DBListener listener)
    Add a DBListener to listen to all the Data.

    Parameters:
    listener - the listener to be added.
    Since:
    jcms-6.0.0

    addDBListener

    public void addDBListener(DBListener listener,
                              Class<?> clazz)
    Add a DBListener to listen to the given class of data.

    Parameters:
    listener - the listener to be added.
    clazz - the class to listen to.
    Since:
    jcms-6.0.0

    removeDBListener

    public void removeDBListener(DBListener listener)
    Remove a DBListener.

    Parameters:
    listener - the listener to be removed.
    Since:
    jcms-6.0.0

    removeDBListener

    public void removeDBListener(DBListener listener,
                                 Class<?> clazz)
    Remove a DBListener.

    Parameters:
    listener - the listener to be removed.
    clazz - the exact class that was being listened
    Since:
    jcms-6.0.0

    addDataController

    public void addDataController(DataController dc,
                                  Class<?> clazz)
    Add the given DataController

    Parameters:
    dc - the DataController to be added
    clazz - the clazz this DataController must control
    Since:
    jcms-5.0.0

    removeDataController

    public void removeDataController(DataController dc,
                                     Class<?> clazz)
    Remove the given DataController

    Parameters:
    dc - the DataController to be removed
    clazz - the clazz this DataController controls
    Since:
    jcms-5.5.0

    getDataControllerSet

    public Set<DataController> getDataControllerSet(Class<?> clazz)
    Parameters:
    clazz - the class
    Returns:
    all the DataController bound to the given class
    Since:
    jcms-5.0.0

    getDataControllerMap

    public Map<Class<?>,Set<DataController>> getDataControllerMap()
    Returns the internal map class/DataController.
    CAUTION: returns an internal Map, DO NOT alter this Map unless you really know what you do.

    Returns:
    the internal map class/DataController.
    Since:
    jcms-5.5.0

    addPolicyFilter

    public void addPolicyFilter(PolicyFilter pf)
    Add the given PolicyFilter to the list of RightPolicyFilter used by the PolicyManager (getPolicyManager()).

    Parameters:
    pf - the RightPolicyFilter to be added
    Since:
    jcms-5.7.0

    removePolicyFilter

    public void removePolicyFilter(PolicyFilter pf)
    Remove the given PolicyFilter to the list of RightPolicyFilter used by the PolicyManager (getPolicyManager()).

    Parameters:
    pf - the RightPolicyFilter to be added
    Since:
    jcms-5.7.0

    getPolicyManager

    public PolicyManager getPolicyManager()
    Retrieve the singleton instance of the PolicyManager used by JCMS.

    Returns:
    the PolicyManager singleton.
    Since:
    jcms-5.7.0

    addQueryFilter

    public void addQueryFilter(QueryFilter qf)
    Add the given QueryFilter to the list of QueryFilters used by the QueryManager (getQueryManager()).

    Parameters:
    qf - the QueryFilter to be added
    Since:
    jcms-5.6.0

    removeQueryFilter

    public void removeQueryFilter(QueryFilter qf)
    Remove the given QueryFilter from the list of QueryFilters used by the QueryManager (getQueryManager()).

    Parameters:
    qf - the QueryFilter to be removed
    Since:
    jcms-5.6.0

    addAuthenticationHandler

    public void addAuthenticationHandler(AuthenticationHandler authHandler)
    Add the specified AuthenticationHandler to the list of AuthenticationHandlers used by the AuthenticationManager to process users' authentication.

    Parameters:
    authHandler - the AuthenticationHandler to be added
    Since:
    jcms-5.7.0

    removeAuthenticationHandler

    public void removeAuthenticationHandler(AuthenticationHandler authHandler)
    Remove the specified AuthenticationHandler from the list of AuthenticationHandlers used by the AuthenticationManager to process users' authentication.

    Parameters:
    authHandler - the AuthenticationHandler to be removed
    Since:
    jcms-5.7.0

    getDataIntegrityReport

    public Map<Data,ControllerStatus> getDataIntegrityReport(boolean refresh)
    Checks the integrity constraints of all the data in the store.

    Parameters:
    refresh - if true recompute the report
    Returns:
    a map which contains for each data which does not respect integrity contraints, the key is the data and the value is a ControllerStatus
    Since:
    jcms-5.0.0

    getDataIntegrityReportDate

    public Date getDataIntegrityReportDate()
    Returns the date of the last report generation.

    Returns:
    the date of the last report generation.
    Since:
    jcms-5.5.0

    generateLogFromMemory

    public void generateLogFromMemory()
    Generates a cleaned version of the store.
    CAUTION:
  • All operations on deleted data are removed.
  • All update operations are integrated in a new creation operation (except cycling data references which are resolved in a second update step).
  • The previous store is backuped with the extension .bak


    cleanStore

    public void cleanStore(CleanFilter filter,
                           JcmsContext context)
    Cleans the store. Data writes are disabled. The previous store is backuped with the extension .backup-date.

    Parameters:
    filter - the filter to apply
    context - current JcmsContext
    Since:
    jcms-5.5.0

    addCleanFilter

    public void addCleanFilter(CustomCleanFilter filter)
    Adds a custom clean filter.

    Parameters:
    filter - the filter to be added.
    Since:
    jcms-5.5.0

    removeCleanFilter

    public void removeCleanFilter(CustomCleanFilter filter)
    Removes a custom clean filter.

    Parameters:
    filter - the filter to be removed.
    Since:
    jcms-5.5.0

    getCleanFilterList

    public List<CustomCleanFilter> getCleanFilterList()
    Returns the list of custom clean filters.

    Returns:
    the list of custom clean filters.
    Since:
    jcms-5.5.0

    appendMilestone

    public void appendMilestone(String text)
    Appends a milestone in the store.

    Parameters:
    text - the text of the milestone.
    Since:
    jcms-5.5.0
    See Also:
    Store.appendMilestone(String)

    getStoreLoadReport

    public LoadReport getStoreLoadReport()
    Returns the store load report

    Returns:
    the store load report

    getStoreSize

    public int getStoreSize()
    Returns the size of the store (ie the data count) in bytes.

    Returns:
    the size of the store in bytes.

    getStoreCreateCount

    public int getStoreCreateCount()
    Returns the count of create operations recorded in the store.

    Returns:
    the count of create operations.

    getStoreUpdateCount

    public int getStoreUpdateCount()
    Returns the count of update operations recorded in the store.

    Returns:
    the count of update operations.

    getStoreDeleteCount

    public int getStoreDeleteCount()
    Returns the count of delete operations recorded in the store.

    Returns:
    the count of delete operations.

    getStore

    public Store getStore()
    Returns the store.
    Internal, DO NOT use.

    Returns:
    the internal Store object.

    performStoreBackup

    public void performStoreBackup()
    Perform a backup of the store. The backup file is saved in the backup directory (the one defined by property store.backup-dir or, by default, WEB-INF/data/backup). If there are more than maximum of backup files (defined by property store.max-backup) the oldest backup file is removed.

    Since:
    jcms-5.7.0

    getLockTimeout

    public long getLockTimeout()
    Return the lock timeout in milliseconds.

    See property channel.lock-timeout (warning : value must be in minutes!).

    Returns:
    a duration in milliseconds

    getLocale

    public Locale getLocale()
    Return the locale of the channel

    Returns:
    a Locale, never return null

    getDateTimeFormat

    public SimpleDateFormat getDateTimeFormat(String lang)
    Retrieve a Date formated suitable for parsing and formatting of date & time input of JCMS forms.

    Parameters:
    lang - the language in which the Date&Time will be formatted/parsed
    Returns:
    a date formatter based on the property .date-time-format
    Since:
    jcms-5.7.0

    getDateFormat

    public SimpleDateFormat getDateFormat(String lang)
    Retrieve a Date formated suitable for parsing and formatting of date input of JCMS forms.

    Parameters:
    lang - the language in which the Date will be formatted/parsed
    Returns:
    a date formatter based on the property .date-format
    Since:
    jcms-5.7.0

    getLangValue

    public Object getLangValue(String lang,
                               boolean useDefault,
                               Object value,
                               HashMap valueML,
                               String mainLanguage)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    mainLanguage - the main language
    Returns:
    a String bound to the given language
    Since:
    jcms-5.7.0

    getLangValue

    public Object getLangValue(String lang,
                               boolean useDefault,
                               Object value,
                               HashMap valueML)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    Returns:
    a String bound to the given language
    Since:
    jcms-5.7.0

    getLangValue

    public String getLangValue(String lang,
                               boolean useDefault,
                               String value,
                               HashMap valueML,
                               String mainLanguage)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    mainLanguage - the main language
    Returns:
    a String bound to the given language (may be empty but never null)
    Since:
    jcms-5.5.0

    getLangValue

    public String getLangValue(String lang,
                               boolean useDefault,
                               String value,
                               HashMap valueML)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    Returns:
    a String bound to the given language (may be empty but never null)
    Since:
    jcms-4.0

    getLangValue

    public Object[] getLangValue(String lang,
                                 boolean useDefault,
                                 Object[] value,
                                 HashMap valueML,
                                 String mainLanguage)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    mainLanguage - the main language
    Returns:
    a String[] bound to the given language
    Since:
    jcms-5.7.0

    getLangValue

    public Object[] getLangValue(String lang,
                                 boolean useDefault,
                                 Object[] value,
                                 HashMap valueML)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    Returns:
    a String[] bound to the given language
    Since:
    jcms-5.7.0

    getLangValue

    public String[] getLangValue(String lang,
                                 boolean useDefault,
                                 String[] value,
                                 HashMap valueML,
                                 String mainLanguage)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    mainLanguage - the main language
    Returns:
    a String[] bound to the given language
    Since:
    jcms-5.5.0

    getLangValue

    public String[] getLangValue(String lang,
                                 boolean useDefault,
                                 String[] value,
                                 HashMap valueML)
    Return a value bound to the given language

    Parameters:
    lang - the language to use
    useDefault - should the main language use as default
    value - the value in the main language
    valueML - the map of value of the other languages
    Returns:
    a String[] bound to the given language
    Since:
    jcms-4.0

    isMultilingual

    public boolean isMultilingual()
    Returns:
    true if the channel is multilingual i.e. getLanguageList() (channel.languages) contains more than one language.
    Since:
    jcms-4.0
    See Also:
    getLanguageList()

    isMainLanguage

    public boolean isMainLanguage(String lang)
    Parameters:
    lang - the lang to check
    Returns:
    true if the given lang is the main language of the channel
    See Also:
    getLanguage()

    isUsingAdvancedI18N

    public boolean isUsingAdvancedI18N()
    Indicates whether JCMS is in advanced internationalization mode. This mode controls some behavior of JCMS regarding language management:
  • if html 'lang' attribute should be precised when appropriate.
  • if css lang class '{iso639code}-lang' attribute should be precised when appropriate.
  • Otherwise, none of this behavior will occur and the default language of the rendered page will be used.

    Returns:
    true if advances behavior are enable, false otherwise.
    Since:
    jcms-5.5.0

    getLanguageDirection

    public String getLanguageDirection(String lang)
    Retrieves the text/table direction to use for the given language.

    Parameters:
    lang - the ISO-639 code of the language to
    Returns:
    A String representing the text direction, "rtl" or "ltr", to use for a dir attribute inside an html tag as specified in the html spec. This method never returns null. see http://www.w3.org/TR/REC-html40/struct/dirlang.html
    Since:
    jcms-5.5.0

    getUsedLanguage

    public String getUsedLanguage(Data data,
                                  String fieldName,
                                  String lang)
    Retrieve the language code really used if the field of the given publication is requested in the given language.

    Parameters:
    data - the Data or Publication of which to retrieve the field value
    fieldName - the field name to retrieve
    lang - the language in which the field was asked (ISO-639 code).
    Returns:
    an ISO-639 language code.
    Since:
    jcms-5.5.0

    getLanguageList

    public List<String> getLanguageList()
    Retrieve all the languages of this channel with the main language as the first one of the list.

    Returns:
    all the ISO-639 language code available for this channel, as defined with "channel.languages" property, the default language will be first in the list.
    Since:
    jcms-4.0

    getLanguageListOrdered

    public List<String> getLanguageListOrdered()
    Retrieve all the languages of this channel in the exact ordered in which they were specified in the properties.

    Returns:
    all the ISO-639 language code available for this channel, as defined with "channel.languages" property, the list will keep order in which they are specified in the property.
    Since:
    jcms-5.5.0

    getOtherLanguageList

    public List<String> getOtherLanguageList()
    Retrieve all the languages of this channel excepted the main language.

    Returns:
    all ISO-639 language code of this channel, minus the default language (i.e. getLanguageList() - getLanguage())
    Since:
    jcms-4.0

    getLocalizedLanguageList

    public List<String> getLocalizedLanguageList()
    Retrieves all the languages specified in the properties in which JCMS is localized.

    Returns:
    a List of ISO-639 language code.

    getJcmsLanguageList

    public List<String> getJcmsLanguageList()
    Retrieves all the languages in which JCMS is localized.

    Returns:
    a List of ISO-639 language code.

    getLanguage

    public String getLanguage()
    Returns:
    the main language of the site

    getCountry

    public String getCountry()
    Retrieve the default country of the site

    Returns:
    an ISO 3166 country code as used by java Locale
    Since:
    jcms-7.1

    updateAndSaveProperties

    public void updateAndSaveProperties(JProperties prop)
    Updates and save specified properties.

    Parameters:
    prop - the properties to be updated/saved.
    See Also:
    JProperties.updateAndSave(java.io.File)

    containsProperty

    public boolean containsProperty(String name)
    Tests if this JProperties contains the given property key/name.

    Parameters:
    name - the key/name of the property to check
    Returns:
    true if the specified object is a key in this hashtable; false otherwise.
    See Also:
    JProperties.containsProperty(java.lang.String)

    getProperty

    public String getProperty(String name)
    Gets value of a property.

    Parameters:
    name - the key/name of the property to retrieve
    Returns:
    the property value
    See Also:
    JProperties.getProperty(java.lang.String)

    getProperty

    public String getProperty(String name,
                              String defaultValue)
    Gets the value of a property given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null.
    Returns:
    the value of a property given its key/name.
    See Also:
    JProperties.getProperty(java.lang.String, java.lang.String)

    getBooleanProperty

    public boolean getBooleanProperty(String name,
                                      boolean defaultValue)
    Gets the value of a property as a boolean given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or is neither "false" nor "true" (case sensitive).
    Returns:
    the boolean value of the property
    See Also:
    JProperties.getBooleanProperty(java.lang.String, boolean)

    getIntegerProperty

    public int getIntegerProperty(String name,
                                  int defaultValue)
    Gets the value of a property as an int value given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or if Integer.parseInt() throws exception during String to int conversion.
    Returns:
    the int value of the property
    See Also:
    JProperties.getIntegerProperty(java.lang.String, int)

    getLongProperty

    public long getLongProperty(String name,
                                long defaultValue)
    Gets the value of a property as a long value given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or if Long.parseLong() throws exception during String to long conversion.
    Returns:
    the long value of the property
    See Also:
    JProperties.getLongProperty(java.lang.String, long)

    getFloatProperty

    public float getFloatProperty(String name,
                                  float defaultValue)
    Gets the value of a property as a float value given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or if Float.parseFloat() throws exception during String to float conversion.
    Returns:
    the float value of the property
    See Also:
    JProperties.getFloatProperty(java.lang.String, float)

    getDoubleProperty

    public double getDoubleProperty(String name,
                                    double defaultValue)
    Gets the value of a property as a double value given its key/name.

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or if Double.parseDouble() throws exception during String to double conversion.
    Returns:
    the double value of the property
    See Also:
    JProperties.getDoubleProperty(java.lang.String, double)

    getStringArrayProperty

    public String[] getStringArrayProperty(String name,
                                           String[] defaultValue)
    Gets the value of a property as a String array.
    The property value should be in one of the following forms:
  • "@value1value2...", where delim is a one character delimiter.
  • "value1value2...", where delim is a character from " \t\n\r\f".
  • Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or no values could be found in the conversion.
    Returns:
    a String array
    See Also:
    JProperties.getStringArrayProperty(java.lang.String,java.lang.String[])

    getIntArrayProperty

    public int[] getIntArrayProperty(String name,
                                     int[] defaultValue)
    Gets the value of a property as a int array. Uses same format of getStringArrayProperty(String, String[]).

    Parameters:
    name - the key/name of the property to retrieve
    defaultValue - the default value to use if the existing value is null or no values could be found in the conversion.
    Returns:
    an int array
    See Also:
    JProperties.getIntArrayProperty(java.lang.String,int[])

    getChannelProperties

    public JProperties getChannelProperties()
    Returns the internal properties used by channel.
    As of version 5.5 those properties are the same as getLanguageProperties() but may differ in a future revision. Do not change any JCMS property at runtime, behaviour of JCMS maybe incorrect if you do so, use the user interface for such task. However you can modify any of your own properties.

    Returns:
    the internal LangProperties of this channel.

    getLanguageProperties

    public LangProperties getLanguageProperties()
    Gets the internal language properties used by channel.
    As of version 5.5 those properties are the same as getChannelProperties() but may differ in a future revision. Do not change any JCMS property at runtime, behaviour of JCMS maybe incorrect if you do so, use the user interface for such task. However you can modify any of your own properties.

    Returns:
    the internal LangProperties of this channel.
    Since:
    jcms-5.5.0

    getProperties

    public LangProperties getProperties(String prefix)
    Gets a new LangProperties instance containg all the properties whose name starts with the given prefix.

    Parameters:
    prefix - the prefix
    Returns:
    a new instance of LangProperties containing found properties
    See Also:
    LangProperties.getProperties(java.lang.String)

    getSortedProperties

    public Map<String,String> getSortedProperties(String prefix)
    Returns a Map containing all the properties whose name starts with the given prefix sorted by key.

    Parameters:
    prefix - the prefix
    Returns:
    a new instance of Map containing found properties sorted by key
    See Also:
    LangProperties.getProperties(java.lang.String)

    getSortedProperties

    public Map<String,String> getSortedProperties(String prefix,
                                                  boolean trim)
    Returns a Map containing all the properties whose name starts with the given prefix sorted by key. If boolean trim is set to true then remove prefix from key before sorting.

    Parameters:
    prefix - the prefix
    trim - boolean true to remove prefix from key
    Returns:
    a new instance of Map containing found properties with truncated key
    See Also:
    getSortedProperties(java.lang.String)

    getSubProperties

    public Map<String,Object> getSubProperties(String prefix)
    Parameters:
    prefix - the prefix
    Returns:
    a map with string as the key and either String or JProperties as the value.
    See Also:
    JProperties.getSubProperties(java.lang.String)

    setProperty

    public void setProperty(String name,
                            String value)
    Modify an internal property with the given value.
    Do not change any JCMS property at runtime, behaviour of JCMS maybe incorrect if you do so, use the user interface for such task. However you can modify any of your own properties.

    Parameters:
    name - the name/key of the property to change
    value - the new value of this propert
    See Also:
    JProperties.setProperty(String, String)

    addPropertiesListener

    public void addPropertiesListener(JPropertiesListener listener)
    Adds a properties listener.

    Parameters:
    listener - the properties listener
    Since:
    jcms-6.0.0

    removePropertiesListener

    public void removePropertiesListener(JPropertiesListener listener)
    Removes a properties listener.

    Parameters:
    listener - the properties listener
    Since:
    jcms-6.0.0

    getCommonGroupSet

    public Set<Group> getCommonGroupSet()
    Return all the global groups

    Returns:
    Set a set of groups

    getWorkspaceSet

    public Set<Workspace> getWorkspaceSet(Workflow wf)
    Return a Set of Workspace that use the given Workflow

    Parameters:
    wf - the Workflow to look for
    Returns:
    a Set of Workspace

    setCurrentServletRequest

    public void setCurrentServletRequest(javax.servlet.http.HttpServletRequest request)
    Assigns the current servlet request. This method should only be called once by initFilter.

    Parameters:
    request - the ServletRequest
    Since:
    jcms-5.5.0

    clearCurrentServletRequest

    public void clearCurrentServletRequest()
    Removes the current servlet request of the thread. This method should only be called once by initFilter.

    Since:
    jcms-5.5.0

    getCurrentServletRequest

    public javax.servlet.http.HttpServletRequest getCurrentServletRequest()
    Returns the current servlet request. It returns a not null value only if it is called in a servlet/jsp context.

    Returns:
    the current servlet request or null.
    Since:
    jcms-5.5.0
    See Also:
    getCurrentJcmsContext()

    setCurrentServletResponse

    public void setCurrentServletResponse(javax.servlet.http.HttpServletResponse response)
    Assigns the current servlet response. This method should only be called once by initFilter.

    Parameters:
    response - the ServletResponse
    Since:
    jcms-6.0.0.

    clearCurrentServletResponse

    public void clearCurrentServletResponse()
    Removes the current servlet response of the thread. This method should only be called once by initFilter.

    Since:
    jcms-6.0.0

    getCurrentServletResponse

    public javax.servlet.http.HttpServletResponse getCurrentServletResponse()
    Returns the current servlet response. It returns a not null value only if it is called in a servlet/jsp context.

    Returns:
    the current servlet response or null.
    Since:
    jcms-6.0.0
    See Also:
    getCurrentJcmsContext()

    getCurrentJcmsContext

    public JcmsContext getCurrentJcmsContext()
    Returns the JcmsContext of the current servlet request of the current thread.
    It returns a null value if it is not called in a jsp context. It must not be called from Servlet or ServletFilter as the JcmsContext has not yet been initialized (doInitPage.jsp) and will always return null in such case.

    Returns:
    the JcmsContext instance associated with the current servlet request, returns null if the current thread has no Servlet Request or if the JcmsContext instance has not yet been initialized.
    Since:
    jcms-5.5.0
    See Also:
    getCurrentServletRequest()

    getCurrentUserLang

    public String getCurrentUserLang()
    Returns the user language if it is available (i.e. if called during a user request). Otherwise it returns the main language.

    Returns:
    either the user language or the main language.
    Since:
    jcms-5.7.0

    getCurrentUserLocale

    public Locale getCurrentUserLocale()
    Returns the user Locale if it is available (i.e. if called during a user request). Otherwise it returns the Locale of the site's language.

    Returns:
    either the user's Locale or the site's Locale.
    Since:
    jcms-5.7.3

    getCurrentLoggedMember

    public Member getCurrentLoggedMember()
    Returns the Member currently loggued in for the current request.
    This method must be called during a user request to work otherwise it returns null.

    Returns:
    the Member logged for the current request, or null if user is not logged in.
    Since:
    jcms-5.7.2

    getCurrentDelegateMember

    public Member getCurrentDelegateMember()
    Returns the original Member of the current session if he has connected to another account since then (using JCMS_sulogin feature).
    Uses DelegationAuthenticationHandler.getSuHistory(HttpServletRequest).
    Used by internal method during data creation/update/delete to correctly set the opDelegate field of any Data.

    This method must be called during a user request to work otherwise it returns null.

    Returns:
    the original Member who created the current session, or null if there has been no changes.
    Since:
    jcms-5.7.0

    isFailSafeMode

    public boolean isFailSafeMode()


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