Interface ProjectLink

  • All Superinterfaces:
    Adaptable

    public interface ProjectLink
    extends Adaptable
    Defines the interface for a CQ Project Link. 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
      Resource getCoverImage()
      Returns the resource representing the project's cover image.
      java.lang.String getDescription()
      Returns the description of the link.
      Project getProject()
      Returns the project that this link is associated with.
      java.lang.String getResolvedTitle()
      Returns the title of the target of this link if no title was set on this link.
      java.lang.String getTarget()
      Returns the target path or url of this link.
      java.lang.String getTitle()
      Returns the title of the link.
      void setCoverImage​(java.lang.String mimeType, java.io.InputStream stream)
      Associate a new image to this link's cover.
      void setDescription​(java.lang.String description)
      Set a new description for the link.
      void setTarget​(java.lang.String target)
      Set the target path or url for this link.
      void setTitle​(java.lang.String title)
      Set a new title for the link.
    • Method Detail

      • getProject

        Project getProject()
        Returns the project that this link is associated with.
        Returns:
        the project that this link is associated with.
      • getTarget

        java.lang.String getTarget()
        Returns the target path or url of this link.
        Returns:
        the target path or url of this link.
      • setTarget

        void setTarget​(java.lang.String target)
        Set the target path or url for this link.
        Parameters:
        target - the target path or url for this link
      • getTitle

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

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

        java.lang.String getResolvedTitle()
        Returns the title of the target of this link if no title was set on this link. If a title was set on this link with setTitle(java.lang.String) then that title will be returned, otherwise the title of the target resource will be returned. E.g. If the link points to a cq:Page the page's title will be returned, similarly if the link points to an Asset the asset's title will be returned.
        Returns:
        the resolved title for this link.
      • getDescription

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

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

        void setCoverImage​(java.lang.String mimeType,
                           java.io.InputStream stream)
        Associate a new image to this link'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.
      • getCoverImage

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