Interface ITransformer<T extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canRead​(String contentType, Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
      Returns true if this transformer can read data for files with the given content type and return the data in the given form.
      boolean canWrite​(Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
      Returns true if this transformer can write data of the form clazz.
      void createContentNode​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, T data, javax.jcr.Node fileNode)
      Creates a JCR node subtree representing the given content.
      T fromContentNode​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node fileNode)
      Transforms a JCR node subtree into an IRepositoryFileData.
      String getContentType()
      Returns the content type string for this transformer.
      void updateContentNode​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, T data, javax.jcr.Node fileNode)
      Updates a JCR node subtree representing the given content.
    • Method Detail

      • canRead

        boolean canRead​(String contentType,
                        Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
        Returns true if this transformer can read data for files with the given content type and return the data in the given form.
        Parameters:
        contentType - content type to check
        clazz - class to check
        Returns:
        true if this transformer can read data for files with the given content type and return the data in the given form
      • canWrite

        boolean canWrite​(Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
        Returns true if this transformer can write data of the form clazz.
        Parameters:
        clazz - class to check
        Returns:
        true if this transformer can write data of the form clazz
      • getContentType

        String getContentType()
        Returns the content type string for this transformer. This gets set on the file and allows the file's data to be read regardless of the requested data class.
        Returns:
        content type
      • fromContentNode

        T fromContentNode​(javax.jcr.Session session,
                          PentahoJcrConstants pentahoJcrConstants,
                          javax.jcr.Node fileNode)
                   throws javax.jcr.RepositoryException
        Transforms a JCR node subtree into an IRepositoryFileData.
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        escapeHelper - escape helper
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Returns:
        an IRepositoryFileData instance
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong
      • createContentNode

        void createContentNode​(javax.jcr.Session session,
                               PentahoJcrConstants pentahoJcrConstants,
                               T data,
                               javax.jcr.Node fileNode)
                        throws javax.jcr.RepositoryException
        Creates a JCR node subtree representing the given content.
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        escapeHelper - escape helper
        data - data to create
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong
      • updateContentNode

        void updateContentNode​(javax.jcr.Session session,
                               PentahoJcrConstants pentahoJcrConstants,
                               T data,
                               javax.jcr.Node fileNode)
                        throws javax.jcr.RepositoryException
        Updates a JCR node subtree representing the given content.
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        escapeHelper - escape helper
        data - data to update
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong