Class ResourceHelper

  • All Implemented Interfaces:
    JPropertiesListener

    public class ResourceHelper
    extends java.lang.Object
    implements JPropertiesListener
    Helper class used to retrieve relative paths of jsp/servlet or icons used for various features of JCMS.
    Since:
    jcms-5.7.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ADMIN_TOPBAR
      Property used to retrieve the path to the admin topbar.
      static java.lang.String CHANNEL_NON_TRANSACTIONAL_PATH_PREFIX
      Property prefix used to declare non transactional path, i.e.
      static java.lang.String CHANNEL_PUBLIC_PATH_PREFIX
      Property prefix used to declare a public path when site is private.
      static java.lang.String DEFAULT_SKIN_PROP
      Property used to retrieve the path to the default Portlet Wrapper.
      static java.lang.String DEFAULT_TEMPLATE_PROP
      Property used to retrieve the path to the default template usage.
      static java.lang.String FIREBASE_ACCOUNT_PATH
      Property used to retrieve the firebase account informations
      static java.lang.String FIREBASE_WEB_ACCOUNT_PATH
      Property used to retrieve the firebase web account informations
      static java.lang.String FORBIDDEN_PROP
      Property used to retrieve the path of the forbidden jsp/servlet.
      static java.lang.String ICON_DBMEMBER_DEFAULT
      Property used to retrieve the path of the default DBmembers' icon.
      static java.lang.String ICON_DBMEMBER_LDAP_DEFAULT
      Property used to retrieve the path of the default ldap DBmembers' icon.
      static java.lang.String ICON_GROUP_DEFAULT
      Property used to retrieve the path of groups' icon.
      static java.lang.String ICON_GROUP_LDAP_DEFAULT
      Property used to retrieve the path of ldap groups' icon.
      static java.lang.String ICON_GROUP_LDAP_PARENT
      Property used to retrieve the path of ldap parent groups' icon.
      static java.lang.String ICON_GROUP_PARENT
      Property used to retrieve the path of parent groups' icon.
      static java.lang.String ICON_LOGBACK
      Property used to retrieve the path of the logback icon.
      static java.lang.String ICON_LOGIN
      Property used to retrieve the path of the login icon.
      static java.lang.String ICON_LOGOUT
      Property used to retrieve the path of the logout icon.
      static java.lang.String ICON_MEMBER_ADMIN
      Property used to retrieve the path of admins' member icon.
      static java.lang.String ICON_MEMBER_CONTACT
      Property used to retrieve the path of the contacts' icon.
      static java.lang.String ICON_MEMBER_DEFAULT
      Property used to retrieve the path of the default members' icon.
      static java.lang.String ICON_MEMBER_LDAP_ADMIN
      Property used to retrieve the path of admins' ldap member icon.
      static java.lang.String ICON_MEMBER_LDAP_DEFAULT
      Property used to retrieve the path of the default ldap members' icon.
      static java.lang.String ICON_MEMBER_LDAP_WRITER
      Property used to retrieve the path of ldap writers' member icon.
      static java.lang.String ICON_MEMBER_LDAP_WSADMIN
      Property used to retrieve the path of ldap workspace admins' ldap member icon.
      static java.lang.String ICON_MEMBER_WRITER
      Property used to retrieve the path of writers' icon.
      static java.lang.String ICON_MEMBER_WSADMIN
      Property used to retrieve the path of workspace admins' member icon.
      static java.lang.String ICON_TOOLTIP
      Property used to retrieve the path of the tooltip icon.
      static java.lang.String JSP_OVERRIDE_CANCELLED
      Request attribute that can be set as boolean true to indicate the JSP override that was just run is cancelled and original JSP can process normally.
      static java.lang.String JSP_OVERRIDE_PREFIX
      Property prefix used to declare override of JSP.
      protected static java.util.Map<java.lang.String,​java.lang.String> jspOverrideMap  
      static java.lang.String LOGIN_PROP
      Property used to retrieve the path of the login jsp/servlet.
      static java.lang.String LOGOUT_PROP
      Property used to retrieve the path of the loggout jsp/servlet.
      static java.lang.String MAIL_PASSWORD_PROP
      Property used to retrieve path of the mail password jsp/servlet.
      protected java.util.Map<java.lang.String,​java.lang.String> mapCSSHeader  
      protected java.util.Map<java.lang.String,​java.lang.String> mapHTTPEquiv  
      protected java.util.Map<java.lang.String,​java.lang.String> mapHTTPName  
      protected java.util.Map<java.lang.String,​java.lang.String> mapJSHeader  
      protected java.util.Map<java.lang.String,​java.lang.String> mapLESS  
      static java.lang.String MEMBER_DISPLAY_PROP
      Property used to retrieve the path of jsp/servlet to display a member.
      static java.lang.String MEMBER_PHOTO
      Property used to retrieve the path of the JSP to display the Member photo.
      static java.lang.String MEMBER_PROFILE_EDITOR_PROP
      Property used to retrieve the path of jsp/servlet to display a member profile.
      static java.lang.String MEMBER_PROFILE_PROP
      Property used to retrieve the path of jsp/servlet to display a member profile.
      static java.lang.String NOTIFICATION_EMAIL_HTML_JSP
      Property used to retrieve the jsp sent as a notification
      static java.lang.String PREVENT_ACCESS_TO_OVERRIDEN_JSP
      Property name of the option enabing some JSP access check.
      static java.lang.String PRIVATE_LOGIN_PROP
      Property used to retrieve the path of the private login jsp/servlet.
      static java.lang.String PRIVATE_MAIL_PASSWORD_PROP
      Property used to retrieve path of the private mail password jsp/servlet.
      static java.lang.String PUBLICATION_ACTION
      Property used to retrieve the path to the publication actions wrapper.
      static java.lang.String QUERY_PROP
      Property used to retrieve the path of the query jsp/servlet.
      static java.lang.String QUERYCSV_PROP
      Property used to retrieve the path of the query jsp/servlet returning csv content.
      static java.lang.String QUERYWORK_PROP
      Property used to retrieve the path of the query jsp/servlet returning csv content.
      static java.lang.String QUERYXML_PROP
      Property used to retrieve the path of the query jsp/servlet return xml content.
      static java.lang.String REFINE_PROP
      Property used to retrieve the path of the refine jsp/servlet.
      static java.lang.String REVISION  
      static java.lang.String SEARCH_PROP
      Property used to retrieve the path of the advanced search jsp/servlet.
      static java.lang.String SEARCHWORK_PROP
      Property used to retrieve the path of the advanced search jsp/servlet.
      static java.lang.String SIDEBAR
      Property used to retrieve the path to sidebar.
      static java.lang.String SIGNUP_PROP
      Property used to retrieve the path of the signup jsp/servlet.
      static java.lang.String SIGNUPV_PROP
      Property used to retrieve the path of the signup jsp/servlet.
      static java.lang.String SITE_TOPBAR
      Property used to retrieve the path to the site topbar.
      static java.lang.String TOPBAR
      Property used to retrieve the path to the topbar.
      static java.lang.String WORK_TOPBAR
      Property used to retrieve the path to the work topbar.
      static java.lang.String WORKSPACE_WIZARD_PROP
      Property used to retrieve the path to the workspace wizard jsp/servlet.
      static java.lang.String WORKSPACES_LIST_PROP
      Property used to retrieve the path to the workspaces list jsp/servlet.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canBeAccessed​(java.lang.String jspRelativePath, JcmsJspContext jcmsContext)
      Check if the specified JSP is authorized to be accessed (either directly or through dynamic include).
      void compileLESS​(boolean force)
      Request compilation of LESS file declare in current webapp.
      static java.lang.String getAdminTopbar()  
      static java.lang.String getDBMemberDefaultIcon()
      Retrieve the path of the default DB members' icon.
      static java.lang.String getDBMemberLdapDefaultIcon()
      Retrieve the path of the default ldap DBMembers' icon.
      static java.lang.String getDefaultSkin()
      Retrieve the relative path of the "default skin" jsp/servlet .
      static java.lang.String getDefaultTemplate​(java.lang.String usage)
      Retrieve the relative path of the "default template" jsp/servlet .
      static java.lang.String getFirebaseAccount()
      Retrieve the path of firebase account json file informations.
      static java.lang.String getFirebaseWebAccount()
      Retrieve the path of firebase web account json file informations.
      static java.lang.String getForbidden()
      Retrieve the relative path of the "forbidden" jsp/servlet that should be used when accessing a site.
      static java.lang.String getGroupDefaultIcon()
      Retrieve the path of groups' icon.
      static java.lang.String getGroupLdapDefaultIcon()
      Retrieve the path of ldap groups icon.
      static java.lang.String getGroupLdapParentIcon()
      Retrieve the path of ldap parent groups' icon.
      static java.lang.String getGroupParentIcon()
      Retrieve the path of parent groups' icon.
      java.util.Map<java.lang.String,​java.lang.String> getHTTPCSSHeaderMap()  
      java.util.Map<java.lang.String,​java.lang.String> getHTTPEquivHeaderMap()  
      java.util.Map<java.lang.String,​java.lang.String> getHTTPJSHeaderMap()  
      java.util.Map<java.lang.String,​java.lang.String> getHTTPNameHeaderMap()  
      static ResourceHelper getInstance()
      Returns the singleton.
      static java.lang.String getJspOverride​(java.lang.String jspPath)
      Retrieve the path of the JSP to use instead of the specified JSP, if any.
      java.util.Map<java.lang.String,​java.lang.String> getLESSMap()  
      static java.lang.String getLogbackIcon()
      Retrieve the path of the logback icon.
      static java.lang.String getLogin()
      Retrieve the relative path of the "login" jsp/servlet that should be used when accessing a site.
      static java.lang.String getLoginIcon()
      Retrieve the path of the login icon.
      static java.lang.String getLogout()
      Retrieve the relative path of the "logout" jsp/servlet that should be used when quitting a site.
      static java.lang.String getLogoutIcon()
      Retrieve the path of the logout icon.
      static java.lang.String getMailPassword()
      Retrieve the relative path of the "mail password" jsp/servlet that should be used when providing a way for a user to retrieve its password.
      static java.lang.String getMemberAdminIcon()
      Retrieve the path of admins' member icon.
      static java.lang.String getMemberContactIcon()
      Retrieve the path of the contact members' icon.
      static java.lang.String getMemberDefaultIcon()
      Retrieve the path of the default members' icon.
      static java.lang.String getMemberDisplay()
      Retrieve the relative path of the "member display" jsp/servlet that should be used to display a member's information.
      static java.lang.String getMemberLdapAdminIcon()
      Retrieve the path of admins' ldap member icon.
      static java.lang.String getMemberLdapDefaultIcon()
      Retrieve the path of the default ldap members' icon.
      static java.lang.String getMemberLdapWriterIcon()
      Retrieve the path of ldap writers' member icon.
      static java.lang.String getMemberLdapWsAdminIcon()
      Retrieve the path of ldap workspace admins' ldap member icon.
      static java.lang.String getMemberProfile()
      Retrieve the relative path of the "member profile" jsp/servlet that should be used to display a member's profile.
      static java.lang.String getMemberProfileEditor()
      Retrieve the relative path of the "member profile editor" jsp/servlet that should be used to display a member's profile.
      static java.lang.String getMemberWriterIcon()
      Retrieve the path of the default members' icon.
      static java.lang.String getMemberWsAdminIcon()
      Retrieve the path of workspace admins' member icon.
      protected static java.util.Set<java.lang.String> getNonTransactionalPaths()  
      static java.lang.String getNotificationEmailHtml()
      Retrieve the path to the jsp which produce the notification mail
      static java.lang.String getPrivateLogin()
      Retrieve the relative path of the "private login" jsp/servlet that should be used when accessing a private site (where authentication is required).
      static java.lang.String getPrivateMailPassword()
      Retrieve the relative path of the "private mail password" jsp/servlet that should be used when providing a way for a user to retrieve its password when the site is private (where authentication is required).
      static java.lang.String getPublicationAction()  
      protected static java.util.Collection<java.lang.String> getPublicPaths()  
      static java.lang.String getQuery()
      Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results.
      static java.lang.String getQueryCsv()
      Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results as CSV content.
      static java.lang.String getQueryWork()
      Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results in BO.
      static java.lang.String getQueryXml()
      Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results as XML content.
      static java.lang.String getRefine()
      Retrieve the relative path of the "search" jsp/servlet that should be used to provide the refine search form.
      static java.lang.String getSearch()
      Retrieve the relative path of the "search" jsp/servlet that should be used to provide the advanced search form.
      static java.lang.String getSearchWork()
      Retrieve the relative path of the BO "search" jsp/servlet that should be used to provide the advanced search form.
      static java.lang.String getSidebar()  
      static java.lang.String getSignUp()  
      static java.lang.String getSignUpV()  
      static java.lang.String getSiteTopbar()  
      static java.lang.String getSpecificEdit​(Data data)
      Gives the JSP really used when a call to edit.jsp is done.
      static java.lang.String getSpecificEdit​(java.lang.Class<?> clazz)
      Gives the JSP really used when a call to edit.jsp is done.
      static java.lang.String getTooltipIcon()
      Retrieve the path of tooltip icon.
      static java.lang.String getTopbar()  
      static java.lang.String getWorkspacesList()
      Retrieve the relative path of the "workspacesList" jsp/servlet .
      static java.lang.String getWorkspaceWizard()
      Retrieve the relative path of the "workspaceWizard" jsp/servlet.
      static java.lang.String getWorkTopbar()  
      static boolean isNonTransactionalPath​(java.lang.String path)
      Check if the specified path requires or not an Hibernate transaction when accessed.
      static boolean isPublicPath​(java.lang.String path)
      Check if the specified path is allowed to be accessed without authentication when the site is private.
      void propertiesChange​(JProperties properties)
      Invoked after properties have been modified in JCMS and save on disk.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGIN_PROP

        public static final java.lang.String LOGIN_PROP
        Property used to retrieve the path of the login jsp/servlet. getLogin()
        See Also:
        Constant Field Values
      • FORBIDDEN_PROP

        public static final java.lang.String FORBIDDEN_PROP
        Property used to retrieve the path of the forbidden jsp/servlet. getForbidden()
        See Also:
        Constant Field Values
      • MAIL_PASSWORD_PROP

        public static final java.lang.String MAIL_PASSWORD_PROP
        Property used to retrieve path of the mail password jsp/servlet. getMailPassword()
        See Also:
        Constant Field Values
      • PRIVATE_LOGIN_PROP

        public static final java.lang.String PRIVATE_LOGIN_PROP
        Property used to retrieve the path of the private login jsp/servlet. getPrivateLogin()
        See Also:
        Constant Field Values
      • LOGOUT_PROP

        public static final java.lang.String LOGOUT_PROP
        Property used to retrieve the path of the loggout jsp/servlet. getLogout()
        See Also:
        Constant Field Values
      • WORKSPACE_WIZARD_PROP

        public static final java.lang.String WORKSPACE_WIZARD_PROP
        Property used to retrieve the path to the workspace wizard jsp/servlet. getWorkspaceWizard()
        See Also:
        Constant Field Values
      • WORKSPACES_LIST_PROP

        public static final java.lang.String WORKSPACES_LIST_PROP
        Property used to retrieve the path to the workspaces list jsp/servlet. getWorkspacesList()
        See Also:
        Constant Field Values
      • DEFAULT_SKIN_PROP

        public static final java.lang.String DEFAULT_SKIN_PROP
        Property used to retrieve the path to the default Portlet Wrapper. getDefaultSkin()
        See Also:
        Constant Field Values
      • SIGNUP_PROP

        public static final java.lang.String SIGNUP_PROP
        Property used to retrieve the path of the signup jsp/servlet. getSignUp()
        See Also:
        Constant Field Values
      • SIGNUPV_PROP

        public static final java.lang.String SIGNUPV_PROP
        Property used to retrieve the path of the signup jsp/servlet. getSignUpV()
        See Also:
        Constant Field Values
      • SEARCH_PROP

        public static final java.lang.String SEARCH_PROP
        Property used to retrieve the path of the advanced search jsp/servlet. getSearch()
        See Also:
        Constant Field Values
      • SEARCHWORK_PROP

        public static final java.lang.String SEARCHWORK_PROP
        Property used to retrieve the path of the advanced search jsp/servlet. getSearchWork()
        See Also:
        Constant Field Values
      • REFINE_PROP

        public static final java.lang.String REFINE_PROP
        Property used to retrieve the path of the refine jsp/servlet. getRefine()
        See Also:
        Constant Field Values
      • QUERY_PROP

        public static final java.lang.String QUERY_PROP
        Property used to retrieve the path of the query jsp/servlet. getQuery()
        See Also:
        Constant Field Values
      • QUERYXML_PROP

        public static final java.lang.String QUERYXML_PROP
        Property used to retrieve the path of the query jsp/servlet return xml content. getQueryXml()
        See Also:
        Constant Field Values
      • QUERYCSV_PROP

        public static final java.lang.String QUERYCSV_PROP
        Property used to retrieve the path of the query jsp/servlet returning csv content. getQueryCsv()
        See Also:
        Constant Field Values
      • QUERYWORK_PROP

        public static final java.lang.String QUERYWORK_PROP
        Property used to retrieve the path of the query jsp/servlet returning csv content. getQueryWork()
        See Also:
        Constant Field Values
      • MEMBER_DISPLAY_PROP

        public static final java.lang.String MEMBER_DISPLAY_PROP
        Property used to retrieve the path of jsp/servlet to display a member. getMemberDisplay()
        See Also:
        Constant Field Values
      • MEMBER_PROFILE_PROP

        public static final java.lang.String MEMBER_PROFILE_PROP
        Property used to retrieve the path of jsp/servlet to display a member profile. getMemberProfile()
        See Also:
        Constant Field Values
      • MEMBER_PROFILE_EDITOR_PROP

        public static final java.lang.String MEMBER_PROFILE_EDITOR_PROP
        Property used to retrieve the path of jsp/servlet to display a member profile. getMemberProfileEditor()
        See Also:
        Constant Field Values
      • ICON_MEMBER_ADMIN

        public static final java.lang.String ICON_MEMBER_ADMIN
        Property used to retrieve the path of admins' member icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_WSADMIN

        public static final java.lang.String ICON_MEMBER_WSADMIN
        Property used to retrieve the path of workspace admins' member icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_WRITER

        public static final java.lang.String ICON_MEMBER_WRITER
        Property used to retrieve the path of writers' icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_DEFAULT

        public static final java.lang.String ICON_MEMBER_DEFAULT
        Property used to retrieve the path of the default members' icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_LDAP_ADMIN

        public static final java.lang.String ICON_MEMBER_LDAP_ADMIN
        Property used to retrieve the path of admins' ldap member icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_LDAP_WSADMIN

        public static final java.lang.String ICON_MEMBER_LDAP_WSADMIN
        Property used to retrieve the path of ldap workspace admins' ldap member icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_LDAP_WRITER

        public static final java.lang.String ICON_MEMBER_LDAP_WRITER
        Property used to retrieve the path of ldap writers' member icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_LDAP_DEFAULT

        public static final java.lang.String ICON_MEMBER_LDAP_DEFAULT
        Property used to retrieve the path of the default ldap members' icon.
        See Also:
        Constant Field Values
      • ICON_LOGIN

        public static final java.lang.String ICON_LOGIN
        Property used to retrieve the path of the login icon.
        See Also:
        Constant Field Values
      • ICON_LOGOUT

        public static final java.lang.String ICON_LOGOUT
        Property used to retrieve the path of the logout icon.
        See Also:
        Constant Field Values
      • ICON_LOGBACK

        public static final java.lang.String ICON_LOGBACK
        Property used to retrieve the path of the logback icon.
        See Also:
        Constant Field Values
      • ICON_DBMEMBER_DEFAULT

        public static final java.lang.String ICON_DBMEMBER_DEFAULT
        Property used to retrieve the path of the default DBmembers' icon.
        See Also:
        Constant Field Values
      • ICON_DBMEMBER_LDAP_DEFAULT

        public static final java.lang.String ICON_DBMEMBER_LDAP_DEFAULT
        Property used to retrieve the path of the default ldap DBmembers' icon.
        See Also:
        Constant Field Values
      • ICON_MEMBER_CONTACT

        public static final java.lang.String ICON_MEMBER_CONTACT
        Property used to retrieve the path of the contacts' icon.
        See Also:
        Constant Field Values
      • ICON_GROUP_DEFAULT

        public static final java.lang.String ICON_GROUP_DEFAULT
        Property used to retrieve the path of groups' icon.
        See Also:
        Constant Field Values
      • ICON_GROUP_PARENT

        public static final java.lang.String ICON_GROUP_PARENT
        Property used to retrieve the path of parent groups' icon.
        See Also:
        Constant Field Values
      • ICON_GROUP_LDAP_DEFAULT

        public static final java.lang.String ICON_GROUP_LDAP_DEFAULT
        Property used to retrieve the path of ldap groups' icon.
        See Also:
        Constant Field Values
      • ICON_GROUP_LDAP_PARENT

        public static final java.lang.String ICON_GROUP_LDAP_PARENT
        Property used to retrieve the path of ldap parent groups' icon.
        See Also:
        Constant Field Values
      • NOTIFICATION_EMAIL_HTML_JSP

        public static final java.lang.String NOTIFICATION_EMAIL_HTML_JSP
        Property used to retrieve the jsp sent as a notification
        See Also:
        Constant Field Values
      • ICON_TOOLTIP

        public static final java.lang.String ICON_TOOLTIP
        Property used to retrieve the path of the tooltip icon.
        See Also:
        Constant Field Values
      • MEMBER_PHOTO

        public static final java.lang.String MEMBER_PHOTO
        Property used to retrieve the path of the JSP to display the Member photo.
        See Also:
        Constant Field Values
      • CHANNEL_PUBLIC_PATH_PREFIX

        public static final java.lang.String CHANNEL_PUBLIC_PATH_PREFIX
        Property prefix used to declare a public path when site is private.
        See Also:
        Constant Field Values
      • FIREBASE_ACCOUNT_PATH

        public static final java.lang.String FIREBASE_ACCOUNT_PATH
        Property used to retrieve the firebase account informations
        See Also:
        Constant Field Values
      • FIREBASE_WEB_ACCOUNT_PATH

        public static final java.lang.String FIREBASE_WEB_ACCOUNT_PATH
        Property used to retrieve the firebase web account informations
        See Also:
        Constant Field Values
      • CHANNEL_NON_TRANSACTIONAL_PATH_PREFIX

        public static final java.lang.String CHANNEL_NON_TRANSACTIONAL_PATH_PREFIX
        Property prefix used to declare non transactional path, i.e. path for which hibernate transaction is NOT started.
        Since:
        jcms-10.0.2 / JCMS-7125
        See Also:
        Constant Field Values
      • JSP_OVERRIDE_PREFIX

        public static final java.lang.String JSP_OVERRIDE_PREFIX
        Property prefix used to declare override of JSP.
        Since:
        jcms-10.0.5 / JCMS-8486
        See Also:
        Constant Field Values
      • JSP_OVERRIDE_CANCELLED

        public static final java.lang.String JSP_OVERRIDE_CANCELLED
        Request attribute that can be set as boolean true to indicate the JSP override that was just run is cancelled and original JSP can process normally.
        Since:
        jcms-10.0.5 / JCMS-8486
        See Also:
        Constant Field Values
      • mapHTTPEquiv

        protected java.util.Map<java.lang.String,​java.lang.String> mapHTTPEquiv
      • mapHTTPName

        protected java.util.Map<java.lang.String,​java.lang.String> mapHTTPName
      • mapCSSHeader

        protected java.util.Map<java.lang.String,​java.lang.String> mapCSSHeader
      • mapJSHeader

        protected java.util.Map<java.lang.String,​java.lang.String> mapJSHeader
      • mapLESS

        protected java.util.Map<java.lang.String,​java.lang.String> mapLESS
      • jspOverrideMap

        protected static java.util.Map<java.lang.String,​java.lang.String> jspOverrideMap
    • Method Detail

      • canBeAccessed

        public static boolean canBeAccessed​(java.lang.String jspRelativePath,
                                            JcmsJspContext jcmsContext)
        Check if the specified JSP is authorized to be accessed (either directly or through dynamic include).

        This check is performed only if enabled through following property :
        jcms.resource.prevent-access-to-overriden-jsp: true

        As of current version, this method enforce the following rules :

        • access to JSP that can be modified though ResourceHelper and that were overriden by in properties are forbidden.
          Unless a property {original-resource-property-name}.authorize-original-jsp-access: true is declared to exclude the JSP from this behavior, (see front/logout.jsp in the example below)
        • All other JSP can be accessed (which does not mean that each JSP will not apply other specific verification regarding authorization).

        Example :
        jcms.prop contains the following properties :

         jcms.resource.prevent-access-to-overriden-jsp: true
         
         jcms.resource.login:  front/login.jsp
         jcms.resource.logout: front/logout.jsp
         jcms.resource.logout.authorize-original-jsp-access: true
         
        And a plugin overrides some of them as follow :
         jcms.resource.login:  plugins/MyPlugin/jsp/login.jsp
         jcms.resource.logout: plugins/MyPlugin/jsp/logout.jsp
         
        In such case, access to front/login.jsp is forbidden, while front/logout.jsp is still authorized.
        Parameters:
        jspRelativePath - the relative path of the JSP being accessed, path may or may not start with a slash, e.g : "/front/login.jsp" or "front/login.jsp"
        jcmsContext - current JcmsJspContext (optional)
        Returns:
        true if JSP can be acccessed, false otherwise
        Since:
        jcms-8.0.2, jcms-9.0 (JCMS-3288)
      • getLogin

        public static java.lang.String getLogin()
        Retrieve the relative path of the "login" jsp/servlet that should be used when accessing a site.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getForbidden

        public static java.lang.String getForbidden()
        Retrieve the relative path of the "forbidden" jsp/servlet that should be used when accessing a site.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-10.0.3
      • getMailPassword

        public static java.lang.String getMailPassword()
        Retrieve the relative path of the "mail password" jsp/servlet that should be used when providing a way for a user to retrieve its password.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getPrivateLogin

        public static java.lang.String getPrivateLogin()
        Retrieve the relative path of the "private login" jsp/servlet that should be used when accessing a private site (where authentication is required).
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getPrivateMailPassword

        public static java.lang.String getPrivateMailPassword()
        Retrieve the relative path of the "private mail password" jsp/servlet that should be used when providing a way for a user to retrieve its password when the site is private (where authentication is required).
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getLogout

        public static java.lang.String getLogout()
        Retrieve the relative path of the "logout" jsp/servlet that should be used when quitting a site.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getWorkspaceWizard

        public static java.lang.String getWorkspaceWizard()
        Retrieve the relative path of the "workspaceWizard" jsp/servlet.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.3
      • getWorkspacesList

        public static java.lang.String getWorkspacesList()
        Retrieve the relative path of the "workspacesList" jsp/servlet .
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.3
      • getDefaultSkin

        public static java.lang.String getDefaultSkin()
        Retrieve the relative path of the "default skin" jsp/servlet .
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.3
      • getDefaultTemplate

        public static java.lang.String getDefaultTemplate​(java.lang.String usage)
        Retrieve the relative path of the "default template" jsp/servlet .
        Parameters:
        usage - the usage or null
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-6.0.0
      • getTopbar

        public static java.lang.String getTopbar()
      • getSiteTopbar

        public static java.lang.String getSiteTopbar()
      • getWorkTopbar

        public static java.lang.String getWorkTopbar()
      • getAdminTopbar

        public static java.lang.String getAdminTopbar()
      • getPublicationAction

        public static java.lang.String getPublicationAction()
      • getSidebar

        public static java.lang.String getSidebar()
      • getSignUp

        public static java.lang.String getSignUp()
      • getSignUpV

        public static java.lang.String getSignUpV()
      • getSearch

        public static java.lang.String getSearch()
        Retrieve the relative path of the "search" jsp/servlet that should be used to provide the advanced search form.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getSearchWork

        public static java.lang.String getSearchWork()
        Retrieve the relative path of the BO "search" jsp/servlet that should be used to provide the advanced search form.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-9.0.1
      • getRefine

        public static java.lang.String getRefine()
        Retrieve the relative path of the "search" jsp/servlet that should be used to provide the refine search form.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getQuery

        public static java.lang.String getQuery()
        Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.0
      • getQueryXml

        public static java.lang.String getQueryXml()
        Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results as XML content.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-6.0.1
      • getQueryCsv

        public static java.lang.String getQueryCsv()
        Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results as CSV content.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-6.0.1
      • getQueryWork

        public static java.lang.String getQueryWork()
        Retrieve the relative path of the "query" jsp/servlet that should be used to perform a search and display the results in BO.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-9.0.1
      • getMemberDisplay

        public static java.lang.String getMemberDisplay()
        Retrieve the relative path of the "member display" jsp/servlet that should be used to display a member's information.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.2
      • getMemberProfile

        public static java.lang.String getMemberProfile()
        Retrieve the relative path of the "member profile" jsp/servlet that should be used to display a member's profile.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-5.7.2
      • getMemberProfileEditor

        public static java.lang.String getMemberProfileEditor()
        Retrieve the relative path of the "member profile editor" jsp/servlet that should be used to display a member's profile.
        Returns:
        a path relative to the webapp (no starting slash).
        Since:
        jcms-9.0.3
      • getMemberAdminIcon

        public static java.lang.String getMemberAdminIcon()
        Retrieve the path of admins' member icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberWsAdminIcon

        public static java.lang.String getMemberWsAdminIcon()
        Retrieve the path of workspace admins' member icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberWriterIcon

        public static java.lang.String getMemberWriterIcon()
        Retrieve the path of the default members' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberDefaultIcon

        public static java.lang.String getMemberDefaultIcon()
        Retrieve the path of the default members' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberLdapAdminIcon

        public static java.lang.String getMemberLdapAdminIcon()
        Retrieve the path of admins' ldap member icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberLdapWsAdminIcon

        public static java.lang.String getMemberLdapWsAdminIcon()
        Retrieve the path of ldap workspace admins' ldap member icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberLdapWriterIcon

        public static java.lang.String getMemberLdapWriterIcon()
        Retrieve the path of ldap writers' member icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getMemberLdapDefaultIcon

        public static java.lang.String getMemberLdapDefaultIcon()
        Retrieve the path of the default ldap members' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getLoginIcon

        public static java.lang.String getLoginIcon()
        Retrieve the path of the login icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.1.1
      • getLogoutIcon

        public static java.lang.String getLogoutIcon()
        Retrieve the path of the logout icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.1.1
      • getLogbackIcon

        public static java.lang.String getLogbackIcon()
        Retrieve the path of the logback icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.1.1
      • getMemberContactIcon

        public static java.lang.String getMemberContactIcon()
        Retrieve the path of the contact members' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.1.0
      • getDBMemberDefaultIcon

        public static java.lang.String getDBMemberDefaultIcon()
        Retrieve the path of the default DB members' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.1
      • getDBMemberLdapDefaultIcon

        public static java.lang.String getDBMemberLdapDefaultIcon()
        Retrieve the path of the default ldap DBMembers' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-10.0.1 JCMS-6340
      • getGroupDefaultIcon

        public static java.lang.String getGroupDefaultIcon()
        Retrieve the path of groups' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getGroupParentIcon

        public static java.lang.String getGroupParentIcon()
        Retrieve the path of parent groups' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getGroupLdapDefaultIcon

        public static java.lang.String getGroupLdapDefaultIcon()
        Retrieve the path of ldap groups icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getGroupLdapParentIcon

        public static java.lang.String getGroupLdapParentIcon()
        Retrieve the path of ldap parent groups' icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-5.7.0
      • getNotificationEmailHtml

        public static java.lang.String getNotificationEmailHtml()
        Retrieve the path to the jsp which produce the notification mail
        Returns:
        the path to the jsp which produce the notification mail
        Since:
        jcms-8.0.0
      • getTooltipIcon

        public static java.lang.String getTooltipIcon()
        Retrieve the path of tooltip icon.
        Returns:
        an image path relative to the webapp (no starting slash), e.g. "images/something.gif" .
        Since:
        jcms-6.0.0
      • getFirebaseAccount

        public static java.lang.String getFirebaseAccount()
        Retrieve the path of firebase account json file informations.
        Returns:
        an the path to the firebase account json file
        Since:
        jcms-10.0.4
      • getFirebaseWebAccount

        public static java.lang.String getFirebaseWebAccount()
        Retrieve the path of firebase web account json file informations.
        Returns:
        an the path to the firebase account json file
        Since:
        jcms-10.0.4
      • getSpecificEdit

        public static java.lang.String getSpecificEdit​(java.lang.Class<?> clazz)
        Gives the JSP really used when a call to edit.jsp is done.
        Parameters:
        clazz - the Java sub class of Data for which a specific edit JSP is mandatory
        Returns:
        the specific Edit JSP
      • getSpecificEdit

        public static java.lang.String getSpecificEdit​(Data data)
        Gives the JSP really used when a call to edit.jsp is done.
        Parameters:
        data - the Data for which a specific edit JSP is mandatory
        Returns:
        the specific Edit JSP
      • getInstance

        public static ResourceHelper getInstance()
        Returns the singleton. Caution: This method is not thread-safe.
        Returns:
        the singleton.
        Since:
        jcms-7.1.0
      • propertiesChange

        public void propertiesChange​(JProperties properties)
        Description copied from interface: JPropertiesListener
        Invoked after properties have been modified in JCMS and save on disk.

        You cannot alter the value received in parameters.

        Note that properties parameter may be null, a limited set of site properties, or all site properties.

        To check that a property has been modified, reload the "current" property instead using channel.getProperties or channel.getProperty.

        Specified by:
        propertiesChange in interface JPropertiesListener
        Parameters:
        properties - the properties which have been submitted to change
      • getHTTPEquivHeaderMap

        public java.util.Map<java.lang.String,​java.lang.String> getHTTPEquivHeaderMap()
      • getHTTPNameHeaderMap

        public java.util.Map<java.lang.String,​java.lang.String> getHTTPNameHeaderMap()
      • getHTTPCSSHeaderMap

        public java.util.Map<java.lang.String,​java.lang.String> getHTTPCSSHeaderMap()
      • getHTTPJSHeaderMap

        public java.util.Map<java.lang.String,​java.lang.String> getHTTPJSHeaderMap()
      • getLESSMap

        public java.util.Map<java.lang.String,​java.lang.String> getLESSMap()
      • compileLESS

        public void compileLESS​(boolean force)
        Request compilation of LESS file declare in current webapp.
        Parameters:
        force - set true to force compilation of less file, even when there is an existing generated file more recent than the sources. set to false to compile only if source is more recent than generated file.
      • getPublicPaths

        protected static java.util.Collection<java.lang.String> getPublicPaths()
      • isPublicPath

        public static boolean isPublicPath​(java.lang.String path)
        Check if the specified path is allowed to be accessed without authentication when the site is private.
        Parameters:
        path - the resource path
        Returns:
        true if the specified path can always be accessed, false if an authentication is required.
      • getNonTransactionalPaths

        protected static java.util.Set<java.lang.String> getNonTransactionalPaths()
      • isNonTransactionalPath

        public static boolean isNonTransactionalPath​(java.lang.String path)
        Check if the specified path requires or not an Hibernate transaction when accessed.
        Parameters:
        path - the resource path
        Returns:
        true if path can be accessed without hibernate transaction. false if an hibernate transaction is required.
        Since:
        jcms-10.0.2 / JCMS-7125
      • getJspOverride

        public static java.lang.String getJspOverride​(java.lang.String jspPath)
        Retrieve the path of the JSP to use instead of the specified JSP, if any.

        You can override a JSP by declaring it in property :

         jsp.override./path/to/overriden.jsp: /path/of/overriding.jsp
         
        Parameters:
        jspPath - the JSP being run for which override is being verified, for example path/of/some.jsp
        Returns:
        a JSP path if specified JSP has been overriden in property, or null or JSP is not overriden
        Since:
        jcms-10.0.5 / JCMS-8486