Class PortalElement

    • Field Detail

      • abilities

        protected java.lang.String[] abilities
      • allAbilities

        protected static transient java.lang.String[] allAbilities
      • allAbilityMap

        protected static transient java.util.Map allAbilityMap
      • allAbilityMapUI

        protected static transient java.util.Map<java.lang.String,​java.util.List<java.lang.String>> allAbilityMapUI
      • cachedAbilities

        protected transient java.util.List cachedAbilities
    • Constructor Detail

      • PortalElement

        public PortalElement()
      • PortalElement

        public PortalElement​(Publication other)
    • Method Detail

      • getContentTitle

        public java.lang.String getContentTitle​(java.lang.String lang)
      • getAbstract

        public java.lang.String getAbstract()
        Description copied from class: Publication
        Returns the abstract of this publication in the channel's main language.
        Overrides:
        getAbstract in class Publication
        Returns:
        the abstract of this publication in the channel's main language.
      • getAbstract

        public java.lang.String getAbstract​(java.lang.String lang,
                                            boolean useDefault)
        Description copied from class: Publication
        Returns the abstract of this publication.
        Overrides:
        getAbstract in class Publication
        Parameters:
        lang - the user language (ISO-639 language code)
        useDefault - should the default language be used
        Returns:
        the abstract of this publication.
      • getDescriptionML

        public abstract java.util.HashMap<java.lang.String,​java.lang.String> getDescriptionML()
      • getDescription

        public abstract java.lang.String getDescription​(java.lang.String lang)
      • getDescription

        public abstract java.lang.String getDescription​(java.lang.String lang,
                                                        boolean b)
      • setDescription

        public abstract void setDescription​(java.lang.String s)
      • setDescriptionML

        public abstract void setDescriptionML​(java.util.HashMap<java.lang.String,​java.lang.String> s)
      • getPortletImageML

        public abstract java.util.HashMap<java.lang.String,​java.lang.String> getPortletImageML()
      • getPortletImage

        public abstract java.lang.String getPortletImage​(java.lang.String lang)
      • getPortletImage

        public abstract java.lang.String getPortletImage​(java.lang.String lang,
                                                         boolean b)
      • setPortletImage

        public abstract void setPortletImage​(java.lang.String s)
      • setPortletImageML

        public abstract void setPortletImageML​(java.util.HashMap<java.lang.String,​java.lang.String> s)
      • getPreview

        public java.lang.String getPreview​(JcmsJspContext ctxt,
                                           int width,
                                           int height,
                                           java.lang.String defaultImagePath)
        Retrieve the preview image of this Portlet in the specified context and dimensions.

        Current implementation is as follow :
        If the portlet image of this portlet has been defined, it is used as the source image for the preview. Otherwise the preview of the template being use for the specified context is used.

        Then, the thumbnail tag is used to create the image in the appropriate dimension, from this source, if the source image file could no be found, the default image specified in parameters is used.

        Warning : This method create a thumbnail when it does not exists, this process can be a little time consumming, make sure you do not need immediate response time when using it, as it might slow down your jsp access time (on first call only).

        Parameters:
        ctxt - the current JcmsJspContext
        width - target max width (if a value of 0 or less is specified, 200 will be used)
        height - target max height (if a value of 0 or less is specified, 150 will be used)
        defaultImagePath - the default image to use if thumbnail do not exists
        Returns:
        a path relative to the webapp root (e.g. "types/PortletRSS/th-60x45-doPortletRSSFullDisplay.jpg.jpg").
      • getCssId

        public abstract java.lang.String getCssId()
      • setCssId

        public abstract void setCssId​(java.lang.String v)
      • getCssClasses

        public abstract java.lang.String getCssClasses()
      • setCssClasses

        public abstract void setCssClasses​(java.lang.String v)
      • getSkinPath

        public java.lang.String getSkinPath​(java.lang.String usage,
                                            boolean devModeChecks)
        Returns the template skin path for the given usage
        Parameters:
        usage - the template usage
        devModeChecks - perform developement checks on template
        Returns:
        String the path of the template used
      • getSkinPath

        public java.lang.String getSkinPath​(JcmsJspContext ctxt)
        Returns the template skin path for the given usage
        Parameters:
        ctxt - the JcmsJspContext
        Returns:
        String the path of the template used
      • getSkinTemplateEntry

        public TypeTemplateEntry getSkinTemplateEntry​(java.lang.String usage,
                                                      boolean devModeChecks)
        Returns the TypeTemplateEntry Skin matching the given parameters. It returns a default template if the given one does work.
        Parameters:
        usage - the template usage
        devModeChecks - perform developement checks on template
        Returns:
        TypeTemplateEntry the matching templates
      • getCacheType

        public abstract java.lang.String getCacheType()
      • setCacheType

        public abstract void setCacheType​(java.lang.String v)
      • getCacheSensibility

        public abstract java.lang.String getCacheSensibility()
      • setCacheSensibility

        public abstract void setCacheSensibility​(java.lang.String v)
      • getInvalidClass

        public abstract java.lang.String[] getInvalidClass()
      • setInvalidClass

        public abstract void setInvalidClass​(java.lang.String[] v)
      • getInvalidTime

        public abstract long getInvalidTime()
      • setInvalidTime

        public abstract void setInvalidTime​(long v)
      • getResolvedInvalidClass

        public java.lang.Class[] getResolvedInvalidClass()
      • hasNoCacheSensibility

        public boolean hasNoCacheSensibility()
      • hasPortalCategoryCacheSensibility

        public boolean hasPortalCategoryCacheSensibility()
      • hasCurrentCategoryCacheSensibility

        public boolean hasCurrentCategoryCacheSensibility()
      • getCacheTypeInt

        public int getCacheTypeInt()
      • hasNoCache

        public boolean hasNoCache()
      • hasCacheSession

        public boolean hasCacheSession()
      • hasCacheServer

        public boolean hasCacheServer()
      • hasCacheGroups

        public boolean hasCacheGroups()
      • hasCacheMembers

        public boolean hasCacheMembers()
      • hasCacheSessionAndVisitors

        public boolean hasCacheSessionAndVisitors()
      • hasCacheVisitorsOnly

        public boolean hasCacheVisitorsOnly()
      • getBehaviorCopy

        public abstract java.lang.String getBehaviorCopy()
      • setBehaviorCopy

        public abstract void setBehaviorCopy​(java.lang.String b)
      • isCopy

        public boolean isCopy()
      • isReference

        public boolean isReference()
      • isWorkspaceReference

        public boolean isWorkspaceReference()
      • duplicate

        public PortalElement duplicate​(Member author)
        Duplicate a PortalElement using one of its default constructor, and create it in the store. If an exception append then return null.
        Parameters:
        author - the Member to be used for store operation (create).
        Returns:
        a newly created PortalElement instance, duplicate of this
        Since:
        jcms-4.0
      • duplicate

        public PortalElement duplicate​(java.lang.String prefix,
                                       Member author)
        Duplicates a PortalElement and add a Prefix to the title.
        Parameters:
        prefix - the title prefix
        author - the Member to be used for store operation (create).
        Returns:
        a newly created PortalElement instance, duplicate of this
        Since:
        jcms-4.0
      • duplicate

        public PortalElement duplicate​(java.lang.String prefix,
                                       Member author,
                                       boolean deep)
        Performs a deep duplicate.
        Parameters:
        prefix - the title prefix
        author - the Member to be used for store operation (create).
        deep - boolean indicating if it is a deep copy
        Returns:
        a newly created PortalElement instance, duplicate of this
        Since:
        jcms-4.0
      • duplicate

        @Deprecated
        public PortalElement duplicate​(java.lang.String prefix,
                                       Member author,
                                       boolean deep,
                                       Workspace wkspc,
                                       java.util.Map catMap,
                                       java.util.Map groupMap)
        Deprecated.
        Performs a deep duplicate.
        Parameters:
        prefix - the title prefix
        author - the author who perform the action
        deep - boolean indicate if it is a deep copy
        wkspc - the workspace to set
        catMap - the binding map of old/new categories
        groupMap - the binding map of old/new groups
        Returns:
        a newly created PortalElement instance, duplicate of this
        Since:
        jcms-4.1
      • duplicate

        public PortalElement duplicate​(WizardContext context,
                                       boolean deep)
        Performs a deep duplicate.
        Parameters:
        context - WizardContext describe the dupliate context
        deep - boolean indicating if it is a deep copy
        Returns:
        a newly created PortalElement instance, duplicate of this
        Since:
        jcms-5.7.3
      • duplicateDeep

        @Deprecated
        protected void duplicateDeep​(PortalElement parent,
                                     java.lang.String prefix,
                                     Member author,
                                     Workspace wkspc,
                                     java.util.Map catMap,
                                     java.util.Map groupMap)
        Performs a deep duplicate of the PortalElement in a WizardContext. Update prefix, workspace, category, groups, ...
        Parameters:
        parent - the duplicated parent (Not already created in JCMS)
        prefix - the title prefix
        author - the author who perform the action
        wkspc - the workspace to set
        catMap - the binding map of old/new categories
        groupMap - the binding map of old/new groups
        Since:
        jcms-4.1
      • duplicateDeep

        protected void duplicateDeep​(WizardContext context,
                                     PortalElement parent)
        Performs a deep duplicate of the PortalElement in a WizardContext. Update prefix, workspace, category, groups, ...
        Parameters:
        context - WizardContext describe the dupliate context
        parent - PortalElement parent of portlets to deeply duplicate
        Since:
        jcms-5.7.3
      • getAbilities

        public java.lang.String[] getAbilities()
      • getAbilities

        public java.lang.String[] getAbilities​(java.lang.String lang)
      • getAbilities

        public java.lang.String[] getAbilities​(java.lang.String lang,
                                               boolean useDefault)
      • setAbilities

        public void setAbilities​(java.lang.String[] v)
      • hasAbility

        public boolean hasAbility​(java.lang.String ability)
        Returns true if the portlet have the given ability Or if the ability is empty and the portlet have no ability
        Parameters:
        ability - Strign representing the ability
        Returns:
        boolean true if the portlet has the ability
      • addAbility

        public void addAbility​(java.lang.String ability)
        Add the given ability to this portal abilities
        Parameters:
        ability - the ability to be added.
        Since:
        jcms-7.0
      • hasAbility

        public boolean hasAbility()
        Returns true if the portlet has an ability
        Returns:
        boolean true if the portlet has an ability
      • getAllAbilityMap

        public static java.util.Map getAllAbilityMap()
        Returns a Map (key1/key2) of all available abilities declared.

        This method uses a cached Map of abilities.

        Return a map like this one :

          {
            "portlet.ability.virtualdesktop" : { 
              "service" : "PortletSkinable"
            },
            "portlet.ability.internal" : {
              "analytics" : "AbstractPortletAnalytics AbstractPortletAnalytics"
            },
            "portlet.ability.jcmsplugin" : {
               "foobar" : "Portlet"
               "collaborativespace.application" : "Portlet"
               "collaborativespace.dashboard" : "Portlet"
            } 
          }
          
        Returns:
        Map of abilities
      • getAllAbilityMapUI

        public static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAllAbilityMapUI()
        Retrieve all abilities in map easy to use for User Interface listing of abilities.

        Help fix bug JCMS-2653 - Bad optgroup label in ability list.

        The map computed by getAllAbilityMap() matches a complex structure not suitable for presentation purpose.

        In order to properly and easily list abilities without losing backward compatibility, this method converts the map returned by getAllAbilityMap() into a simpler representation like this one :

         
          {
            "portlet.ability.virtualdesktop" : [ "service" ],
            "portlet.ability.internal" : [ "stat" ],
            "portlet.ability.jcmsplugin" : [ "foobar" ],
            "portlet.ability.jcmsplugin.collaborativespace" : [ "application", "dashboard" ]
          }
          
        The key match a "parent ability" suitable for use in a optgroup label.
        The values match the suffix to add to the key in order to get a full and valid ability.
        Returns:
        a Map
        Since:
        jcms-7.0.3 jcms-7.1
      • getAllAbilities

        public static java.lang.String[] getAllAbilities()
        Returns an Array of all available abilities declared for the given class. This methode use cached abilities.
        Returns:
        String[] an array of abilities
      • getAllAbilities

        public static java.lang.String[] getAllAbilities​(java.lang.Class clazz)
        Returns an Array of all available abilities declared for the given class
        Parameters:
        clazz - the class used to filter abilities
        Returns:
        String[] an array of abilities
      • getAbilityLabel

        public java.lang.String getAbilityLabel​(java.lang.String userLang,
                                                java.lang.String ability)
        Returns the label of a given ability
        Parameters:
        userLang - the user language
        ability - the ability
        Returns:
        String the I18N ability
      • getDataIcon

        public java.lang.String getDataIcon()
        Description copied from class: Data
        Returns source information for the icon associated to this Data, either a relative path or sprite classes name.

        If this method behavior has not been overriden by subclass, the default icon can be declared using property types.{Type}.icon, where {Type} is the short class name of the type concerned.

        • Either by specifying a relative image path :
          types.Article.icon: images/jalios/icon/abstract.gif 
        • or else by using a sprite icon :
          types.Article.icon: ss_sprite ss_date
        Overrides:
        getDataIcon in class Publication
        Returns:
        a relative path (eg images/jalios/icon/abstract.gif) or sprite classes name (eg ss_sprite ss_date).
        See Also:
        Data.getDataIconHtml(String)
      • getIcon

        public java.lang.String getIcon()
      • isChildTreeNode

        public boolean isChildTreeNode​(TreeNode child)
      • getAllTreeChildren

        public java.util.Collection<PortalElement> getAllTreeChildren()
        Retrieve a new collection containing all PortalElement children of this PortalElement
        Returns:
        a new Collection of PortalElement.
      • containsTreeDescendant

        public boolean containsTreeDescendant​(TreeNode tn)
        Same as getAllTreeChildren() but stop when there is a match. This method can be use to detect cycles
        Parameters:
        tn - the treenode
        Returns:
        true if there is a match
      • isVotable

        public boolean isVotable()
        Overrides:
        isVotable in class Publication
        Returns:
        true if this Publication is votable