Class NodeRepositoryFileDataTransformer

  • All Implemented Interfaces:
    ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>

    public class NodeRepositoryFileDataTransformer
    extends Object
    implements ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
    • Method Summary

      All Methods Instance Methods Concrete 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, org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data, javax.jcr.Node fileNode)
      Creates a JCR node subtree representing the given content.
      protected void createOrUpdateContentNode​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data, javax.jcr.Node fileNode)  
      org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData 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.
      protected void internalCreateOrUpdate​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node jcrParentNode, org.pentaho.platform.api.repository2.unified.data.node.DataNode dataNode)  
      protected org.pentaho.platform.api.repository2.unified.data.node.DataNode internalRead​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node jcrNode, org.pentaho.platform.api.repository2.unified.data.node.DataNode parentDataNode)  
      void updateContentNode​(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data, javax.jcr.Node fileNode)
      Updates a JCR node subtree representing the given content.
    • Constructor Detail

      • NodeRepositoryFileDataTransformer

        public NodeRepositoryFileDataTransformer()
    • Method Detail

      • createOrUpdateContentNode

        protected void createOrUpdateContentNode​(javax.jcr.Session session,
                                                 PentahoJcrConstants pentahoJcrConstants,
                                                 org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data,
                                                 javax.jcr.Node fileNode)
                                          throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • createContentNode

        public void createContentNode​(javax.jcr.Session session,
                                      PentahoJcrConstants pentahoJcrConstants,
                                      org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data,
                                      javax.jcr.Node fileNode)
                               throws javax.jcr.RepositoryException
        Description copied from interface: ITransformer
        Creates a JCR node subtree representing the given content.
        Specified by:
        createContentNode in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        data - data to create
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong
      • internalCreateOrUpdate

        protected void internalCreateOrUpdate​(javax.jcr.Session session,
                                              PentahoJcrConstants pentahoJcrConstants,
                                              javax.jcr.Node jcrParentNode,
                                              org.pentaho.platform.api.repository2.unified.data.node.DataNode dataNode)
                                       throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • fromContentNode

        public org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData fromContentNode​(javax.jcr.Session session,
                                                                                                             PentahoJcrConstants pentahoJcrConstants,
                                                                                                             javax.jcr.Node fileNode)
                                                                                                      throws javax.jcr.RepositoryException
        Description copied from interface: ITransformer
        Transforms a JCR node subtree into an IRepositoryFileData.
        Specified by:
        fromContentNode in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Returns:
        an IRepositoryFileData instance
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong
      • internalRead

        protected org.pentaho.platform.api.repository2.unified.data.node.DataNode internalRead​(javax.jcr.Session session,
                                                                                               PentahoJcrConstants pentahoJcrConstants,
                                                                                               javax.jcr.Node jcrNode,
                                                                                               org.pentaho.platform.api.repository2.unified.data.node.DataNode parentDataNode)
                                                                                        throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • canRead

        public 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.
        Specified by:
        canRead in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
        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

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

        public 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.
        Specified by:
        getContentType in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
        Returns:
        content type
      • updateContentNode

        public void updateContentNode​(javax.jcr.Session session,
                                      PentahoJcrConstants pentahoJcrConstants,
                                      org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData data,
                                      javax.jcr.Node fileNode)
                               throws javax.jcr.RepositoryException
        Description copied from interface: ITransformer
        Updates a JCR node subtree representing the given content.
        Specified by:
        updateContentNode in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.node.NodeRepositoryFileData>
        Parameters:
        session - JCR session
        pentahoJcrConstants - constants
        data - data to update
        fileNode - node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile
        Throws:
        javax.jcr.RepositoryException - if anything goes wrong