Interface Project

  • All Superinterfaces:
    Adaptable

    public interface Project
    extends Adaptable
    Defines the interface for a CQ Project. Note that all changes are transient and need to be committed by the caller, see ProjectManager for details.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ProjectLink addLink​(java.lang.String name, java.lang.String target)
      Creates a new link or updates an existing link for the specified target.
      Resource getAssetFolder()
      The Asset folder associated with this project.
      java.lang.String getDescription()
      Returns the description of the project.
      java.lang.Iterable<ProjectLink> getLinks()
      Returns the links that are associated with the project.
      java.util.Set<ProjectMember> getMembers()
      Return the members associated with the Project.
      Resource getProjectCover()
      Returns the resource representing the project's cover image.
      java.lang.String getTitle()
      Returns the title of the project.
      boolean isActive()
      indicates if the project is active
      void setActive​(boolean active)
      specifies if a project is active
      void setDescription​(java.lang.String description)
      Set a new description for the project.
      void setProjectCover​(java.lang.String mimeType, java.io.InputStream stream)
      Associate a new image to this project's cover.
      void setTitle​(java.lang.String name)
      Set a new title for the project.
      java.util.Collection<ProjectMember> updateMembers​(java.util.List<java.lang.String> userIds, java.util.List<java.lang.String> roleIds)
      Update the Project's members with the set of users and their associated roles.
    • Method Detail

      • getTitle

        java.lang.String getTitle()
        Returns the title of the project.
        Returns:
        the title of the project.
      • setTitle

        void setTitle​(java.lang.String name)
        Set a new title for the project.
        Parameters:
        name - the new name for the project
        Throws:
        ProjectException - if the operation fails
      • getDescription

        java.lang.String getDescription()
        Returns the description of the project.
        Returns:
        the description of the project.
      • setDescription

        void setDescription​(java.lang.String description)
        Set a new description for the project.
        Parameters:
        description - the new description for the project
        Throws:
        ProjectException - if the operation fails
      • addLink

        ProjectLink addLink​(java.lang.String name,
                            java.lang.String target)
        Creates a new link or updates an existing link for the specified target.
        Parameters:
        name - the suggested name of the new link.
        target - the target path or url of this link.
        Returns:
        the resource representing the link   
        Throws:
        ProjectException - if the operation fails
      • getLinks

        java.lang.Iterable<ProjectLink> getLinks()
        Returns the links that are associated with the project.
        Returns:
        an iterator of the links associated with this project.
        See Also:
        ProjectLink
      • getAssetFolder

        Resource getAssetFolder()
        The Asset folder associated with this project. This folder is used when new assets are uploaded through the project interface.
        Returns:
        a Resource for the Asset folder associated with this project.
      • setProjectCover

        void setProjectCover​(java.lang.String mimeType,
                             java.io.InputStream stream)
        Associate a new image to this project's cover. This call will replace the exist cover image asset and add it to the asset resource collection.
        Parameters:
        mimeType - the mime type of the provided input stream
        stream - a stream of image data.
        Throws:
        ProjectException - if updating the cover image fails.
      • getProjectCover

        Resource getProjectCover()
        Returns the resource representing the project's cover image.
        Returns:
        a image asset resource, or null if there is no cover image specified.
      • updateMembers

        java.util.Collection<ProjectMember> updateMembers​(java.util.List<java.lang.String> userIds,
                                                          java.util.List<java.lang.String> roleIds)
        Update the Project's members with the set of users and their associated roles.
        Parameters:
        userIds - a list of user ids
        roleIds - a list of role ids
        Returns:
        the updated set of members.
        Throws:
        ProjectException - if there are issues updating the members of the team.
      • setActive

        void setActive​(boolean active)
        specifies if a project is active
        Parameters:
        active - true when project is active
      • isActive

        boolean isActive()
        indicates if the project is active
        Returns:
        true when project is active