Class PortalElement

All Implemented Interfaces:
EditableData, JcmsConstants, ImportConstants, MashupConstants, Searchable, Storable, JaliosConstants, LangPropertyArgument, TreeNode, Cloneable, Comparable<BasicStorable>
Direct Known Subclasses:
AbstractJPortal, Portal, PortalRedirect, Portlet

public abstract class PortalElement extends Publication implements TreeNode
  • Field Details

  • Constructor Details

    • PortalElement

      public PortalElement()
    • PortalElement

      public PortalElement(Publication other)
    • PortalElement

      public PortalElement(PortalElement other)
  • Method Details

    • getContentTitle

      public String getContentTitle(String lang)
    • getAbstract

      public 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 String getAbstract(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 HashMap<String,String> getDescriptionML()
    • getDescription

      public abstract String getDescription(String lang)
    • getDescription

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

      public abstract void setDescription(String s)
    • setDescriptionML

      public abstract void setDescriptionML(HashMap<String,String> s)
    • getPortletImageML

      public abstract HashMap<String,String> getPortletImageML()
    • getPortletImage

      public abstract String getPortletImage(String lang)
    • getPortletImage

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

      public abstract void setPortletImage(String s)
    • setPortletImageML

      public abstract void setPortletImageML(HashMap<String,String> s)
    • getPreview

      public String getPreview(JcmsJspContext ctxt, int width, int height, 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 String getCssId()
    • setCssId

      public abstract void setCssId(String v)
    • getCssClasses

      public abstract String getCssClasses()
    • setCssClasses

      public abstract void setCssClasses(String v)
    • getDefaultTemplateUsage

      public String getDefaultTemplateUsage()
      Returns the default template usage used to display the publication. This default tempalte may change between Content and Portlets
      Overrides:
      getDefaultTemplateUsage in class Publication
      Returns:
      String the default usage
      See Also:
    • getSkinPath

      public String getSkinPath(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 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(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 String getCacheType()
    • setCacheType

      public abstract void setCacheType(String v)
    • getCacheSensibility

      public abstract String getCacheSensibility()
    • setCacheSensibility

      public abstract void setCacheSensibility(String v)
    • getInvalidClass

      public abstract String[] getInvalidClass()
    • setInvalidClass

      public abstract void setInvalidClass(String[] v)
    • getInvalidTime

      public abstract long getInvalidTime()
    • setInvalidTime

      public abstract void setInvalidTime(long v)
    • getResolvedInvalidClass

      public 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 String getBehaviorCopy()
    • setBehaviorCopy

      public abstract void setBehaviorCopy(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(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(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(String prefix, Member author, boolean deep, Workspace wkspc, Map catMap, 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, String prefix, Member author, Workspace wkspc, Map catMap, 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 String[] getAbilities()
    • getAbilities

      public String[] getAbilities(String lang)
    • getAbilities

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

      public void setAbilities(String[] v)
    • hasAbility

      public boolean hasAbility(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(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

      @Deprecated public static 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

      @Deprecated public static Map<String,List<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

      @Deprecated public static 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

      @Deprecated public static String[] getAllAbilities(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

      @Deprecated public String getAbilityLabel(String userLang, String ability)
      Returns the label of a given ability
      Parameters:
      userLang - the user language
      ability - the ability
      Returns:
      String the I18N ability
    • getDataIcon

      public 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:
    • getIcon

      public String getIcon()
    • getTreeChildren

      public Collection<? extends TreeNode> getTreeChildren()
      Description copied from interface: TreeNode
      Returns a Collection of TreeNode children of the current node
      Specified by:
      getTreeChildren in interface TreeNode
      Overrides:
      getTreeChildren in class Publication
      Returns:
      Collection of TreeNode
      See Also:
    • isTreeLeaf

      public boolean isTreeLeaf()
      Description copied from interface: TreeNode
      Returns boolean true if the TreeNode is a leaf
      Specified by:
      isTreeLeaf in interface TreeNode
      Overrides:
      isTreeLeaf in class Publication
      Returns:
      boolean indicating if node is leaf or node
      See Also:
    • isTreeNode

      public boolean isTreeNode()
      Description copied from interface: TreeNode
      Returns boolean true if the TreeNode is a node
      Specified by:
      isTreeNode in interface TreeNode
      Overrides:
      isTreeNode in class Publication
      Returns:
      boolean indicating if node is leaf or node
      See Also:
    • getTreeParent

      public TreeNode getTreeParent()
      Description copied from interface: TreeNode
      Returns parent of the current node
      Specified by:
      getTreeParent in interface TreeNode
      Overrides:
      getTreeParent in class Publication
      Returns:
      TreeNode parent Node
      See Also:
    • getTreeParent

      public TreeNode getTreeParent(TreeNode node)
    • isChildTreeNode

      public boolean isChildTreeNode(TreeNode child)
    • getAllTreeChildren

      public 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
    • getAbilitySelector

      public static PortalElement.AbilitySelector getAbilitySelector(String ability)
      Retrieves a new instance of PortalElement.AbilitySelector using the specified ability String.
      Parameters:
      ability - an ability choosen from values returned by getAllAbilities(), or "noabilities" for portlet without any ability, or "hasabilities" for portlet with any ability.
      Returns:
      a new instance of PortalElement.AbilitySelector using the given ability String.
      Since:
      jcms-5.7.1
    • isVotable

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