Class PortletCollection

All Implemented Interfaces:
EditableData, JcmsConstants, ImportConstants, MashupConstants, Searchable, Storable, JaliosConstants, LangPropertyArgument, TreeNode, Cloneable, Comparable<BasicStorable>

public abstract class PortletCollection extends Portlet
An abstract PortletCollection representation with fields to implements - PortalElement[] -> Children
  • Field Details

  • Constructor Details

    • PortletCollection

      public PortletCollection()
    • PortletCollection

      public PortletCollection(Publication other)
    • PortletCollection

      public PortletCollection(PortalElement other)
    • PortletCollection

      public PortletCollection(Portlet other)
    • PortletCollection

      public PortletCollection(PortletCollection other)
  • Method Details

    • duplicateDeep

      protected void duplicateDeep(WizardContext context, PortalElement parent)
      Description copied from class: PortalElement
      Performs a deep duplicate of the PortalElement in a WizardContext. Update prefix, workspace, category, groups, ...
      Overrides:
      duplicateDeep in class PortalElement
      Parameters:
      context - WizardContext describe the dupliate context
      parent - PortalElement parent of portlets to deeply duplicate
    • checkWrite

      public ControllerStatus checkWrite(int op, Member mbr, boolean checkIntegrity, Map context)
      Description copied from class: Publication
      Checks if the given write operation can be performed
      Overrides:
      checkWrite in class Publication
      Parameters:
      op - the operation (OP_CREATE, OP_UPDATE, ...)
      mbr - the member which requests the write operation
      checkIntegrity - if true, requires the constraints integrity to be checked
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
    • getChildrenBindings

      public abstract String[] getChildrenBindings()
    • setChildrenBindings

      public abstract void setChildrenBindings(String[] v)
    • getCachedBindingMap

      public LinkedHashMap<String,String> getCachedBindingMap()
      Returns a Map of Keys: String: Labels or PortalElement's ids Values: PortalElement or List of PortalElement WARNING: return internal Index not a copy !
      Returns:
      LinkedHashMap (String/PortalElement)
    • getCachedChildrenMap

      public LinkedHashMap<String,String> getCachedChildrenMap()
      Returns a Map of Keys: String: PortalElement's ids Values: String: Label bind to given PortalElement WARNING: return internal Index not a copy !
      Returns:
      LinkedHashMap (String/String)
    • getBinding

      public String getBinding(PortalElement portlet)
      Returns Label associated to given PortalElement or null if it has not been declared
      Parameters:
      portlet - the portlet to work with
      Returns:
      String label bind to given portlet
    • getChild

      public PortalElement getChild(String bindName)
      Returns the first PortalElement matching the given binding
      Parameters:
      bindName - the binding name
      Returns:
      PortalElement or Null if the binding do not match
    • getChildrenList

      public List<PortalElement> getChildrenList(String bindName)
      Returns a List of PortalElement matching the given binding
      Parameters:
      bindName - the binding name
      Returns:
      List of PortalElement
    • getChildrenList

      public List getChildrenList(String[] bindNames)
      Returns a List of PortalElement matching the given binding
      Parameters:
      bindNames - the binding name
      Returns:
      List of PortalElement
    • getChildren

      public PortalElement[] getChildren(String[] bindNames)
      Returns a List of PortalElement matching the given binding
      Parameters:
      bindNames - the binding name
      Returns:
      List of PortalElement
    • performChildrenBindings

      protected void performChildrenBindings(PortalElement[] children, String[] bindings)
      Update the Children BindingMap.
      Parameters:
      children - the children
      bindings - String[] of bindings or null
    • setChildrenMap

      public void setChildrenMap(Map<String,String> deltaMap)
      Convenient method to Partially update children/bindings arrays with the given Map of Id/Label.
      • Override label declared
      • Preserve labels not declared in the Map
      • Preserve binging not declared in the Map
      No store modification is performed, invoke on a collection copy and save your modification afterward.
      Parameters:
      deltaMap - Map of Id/Label
    • getChildren

      public abstract PortalElement[] getChildren()
    • setChildren

      public abstract void setChildren(PortalElement[] p)
    • getTreeChildren

      public Collection 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 PortalElement
      Returns:
      Collection of TreeNode
      See Also:
    • cut

      public Portlet cut(int index, Member loggedMember)
      Cut a Portlet at the specified index from the current Collection
      Parameters:
      index - the index
      loggedMember - the logged member
      Returns:
      Portlet
      Since:
      jcms-4.0
    • delete

      public boolean delete(int index, Member loggedMember)
      Cut a Portlet at the specified index from the current Collection
      Parameters:
      index - the index
      loggedMember - the loggedMember
      Returns:
      Portlet
      Since:
      jcms-4.0
    • past

      public boolean past(Portlet portlet, int index, Member loggedMember)
      Past a Portlet at the specified index into the current Collection
      Parameters:
      portlet - the portlet
      index - the index
      loggedMember - the logged member
      Returns:
      true if operation was performed and portlet was modified, false otherwise
      Since:
      jcms-4.0
    • move

      public void move(int pos, int direction, Member loggedMember)
    • processAction

      public void processAction(Member mbr, javax.servlet.http.HttpServletRequest request)
    • handleSortable

      public ControllerStatus handleSortable(JcmsJspContext jcmsContext)
      Handle a sortable request (ie a DnD) received for this portlet
      Parameters:
      jcmsContext - the jcmsContext.
      Returns:
      the status of the update.
      Since:
      jcms-10.0.4
    • findPortletSet

      public <T> Set<T> findPortletSet(Class<? extends T> clazz)
      Returns all the children portlet of the given class.
      Type Parameters:
      T - a type of
      Parameters:
      clazz - the class
      Returns:
      all the children portlet of the given class.
      Since:
      jcms-10.0.5
    • findFirstPortlet

      public <T> T findFirstPortlet(Class<? extends T> clazz)
      Returns the first child portlet of the given class.
      Type Parameters:
      T - a type of
      Parameters:
      clazz - the class
      Returns:
      the first child portlet of the given class.
      Since:
      jcms-10.0.5