Class SampleRepositoryFileDataTransformer
- java.lang.Object
-
- org.pentaho.platform.repository2.unified.jcr.transform.SampleRepositoryFileDataTransformer
-
- All Implemented Interfaces:
ITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
public class SampleRepositoryFileDataTransformer extends Object implements ITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
-
-
Constructor Summary
Constructors Constructor Description SampleRepositoryFileDataTransformer()
-
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)
Returnstrue
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)
Returnstrue
if this transformer can write data of the formclazz
.void
createContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData data, javax.jcr.Node fileNode)
Creates a JCR node subtree representing the givencontent
.org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData
fromContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node fileNode)
Transforms a JCR node subtree into anIRepositoryFileData
.String
getContentType()
Returns the content type string for this transformer.void
updateContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData data, javax.jcr.Node fileNode)
Updates a JCR node subtree representing the givencontent
.
-
-
-
Method Detail
-
canRead
public boolean canRead(String contentType, Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
Returnstrue
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 interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Parameters:
contentType
- content type to checkclazz
- 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)
Returnstrue
if this transformer can write data of the formclazz
.- Specified by:
canWrite
in interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Parameters:
clazz
- class to check- Returns:
true
if this transformer can write data of the formclazz
-
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 interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Returns:
- content type
-
createContentNode
public void createContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData data, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
Creates a JCR node subtree representing the givencontent
.- Specified by:
createContentNode
in interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Parameters:
session
- JCR sessionpentahoJcrConstants
- constantsdata
- data to createfileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile- Throws:
javax.jcr.RepositoryException
- if anything goes wrong
-
fromContentNode
public org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData fromContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
Transforms a JCR node subtree into anIRepositoryFileData
.- Specified by:
fromContentNode
in interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Parameters:
session
- JCR sessionpentahoJcrConstants
- constantsfileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile- Returns:
- an
IRepositoryFileData
instance - Throws:
javax.jcr.RepositoryException
- if anything goes wrong
-
updateContentNode
public void updateContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData data, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
Updates a JCR node subtree representing the givencontent
.- Specified by:
updateContentNode
in interfaceITransformer<org.pentaho.platform.api.repository2.unified.data.sample.SampleRepositoryFileData>
- Parameters:
session
- JCR sessionpentahoJcrConstants
- constantsdata
- data to updatefileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFile- Throws:
javax.jcr.RepositoryException
- if anything goes wrong
-
-