it.eng.spagobi.bo.dao.cms
Class BIObjectCMSDAOImpl

java.lang.Object
  extended by it.eng.spagobi.bo.dao.cms.BIObjectCMSDAOImpl
All Implemented Interfaces:
IBIObjectCMSDAO

public class BIObjectCMSDAOImpl
extends java.lang.Object
implements IBIObjectCMSDAO

Implements all the methods for access the biobject cms contents

Author:
fiscato

Constructor Summary
BIObjectCMSDAOImpl()
           
 
Method Summary
 void deleteSnapshot(java.lang.String snapshotPath)
          Delete a snapshot
 void deleteSubObject(java.lang.String pathParent, java.lang.String name)
          Delete a subObject
 void exportDocument(BIObject obj, java.lang.String destFolder, boolean exportSubObjects, boolean exportSnapshots)
          Exports a document node
 void fillBIObjectTemplate(BIObject obj)
          Given a BIObject at input, fills it with template information.
 java.util.List getAccessibleSubObjects(java.lang.String pathParent, it.eng.spago.security.IEngUserProfile profile)
          Gets the list of all the current user accessible subObject.
 java.lang.String getExecutionNotes(java.lang.String biobjPath, java.lang.String execIdentif)
          Get Notes for a specific execution of the biobject
 java.util.List getSnapshots(java.lang.String pathParent)
          Gets the list of the snapshot details that are children of a biobject
 java.io.InputStream getSubObject(java.lang.String pathParent, java.lang.String name)
          Gets the inputStream of the subObject content
 java.util.List getSubObjects(java.lang.String pathParent)
          Gets the list of all the subObjects which belongs to a biobject.
 java.io.InputStream getTemplate(java.lang.String path)
          Get the template of the object
 java.lang.String importDocument(java.lang.String sourceFolder)
          Imports a document
 void saveExecutionNotes(java.lang.String biobjPath, java.lang.String execIdentif, java.lang.String notes)
          Save Notes for a specific execution of the biobject
 void saveSnapshot(byte[] content, java.lang.String pathParent, java.lang.String name, java.lang.String description)
          Save a snapshot of the object
 void saveSubObject(byte[] content, java.lang.String pathParent, java.lang.String name, java.lang.String description, boolean publicVisibility, it.eng.spago.security.IEngUserProfile profile)
          Save a subObject
 void saveTemplate(byte[] content, java.lang.String path, java.lang.String templateName)
          Save a subObject of the object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BIObjectCMSDAOImpl

public BIObjectCMSDAOImpl()
Method Detail

getTemplate

public java.io.InputStream getTemplate(java.lang.String path)
Get the template of the object

Specified by:
getTemplate in interface IBIObjectCMSDAO
Parameters:
Path - cms path of the object
profile - Profile of the current user
Returns:
InputStream of the template contents

saveSubObject

public void saveSubObject(byte[] content,
                          java.lang.String pathParent,
                          java.lang.String name,
                          java.lang.String description,
                          boolean publicVisibility,
                          it.eng.spago.security.IEngUserProfile profile)
                   throws it.eng.spago.error.EMFUserError
Save a subObject

Specified by:
saveSubObject in interface IBIObjectCMSDAO
Parameters:
content - the byte content of the subobject
pathParent - the cms path of the object father
name - name of the suboject
description - Description of the subobject
publicVisibility - Visibility of the subObject, if true the object is public if false the object is visibile only to the owner
profile - Profile of the current user useful to get the owner use rof the subobject
Throws:
it.eng.spago.error.EMFUserError

getAccessibleSubObjects

public java.util.List getAccessibleSubObjects(java.lang.String pathParent,
                                              it.eng.spago.security.IEngUserProfile profile)
Gets the list of all the current user accessible subObject. The list contains BIObject.SubObjectDetail objects

Specified by:
getAccessibleSubObjects in interface IBIObjectCMSDAO
Parameters:
profile - Profile of the current user
pathParent - cms path of the father biobject
Returns:
List of BIObject.SubObjectDetail objects each one containing the information about a subObject of the biObject

getSubObject

public java.io.InputStream getSubObject(java.lang.String pathParent,
                                        java.lang.String name)
Gets the inputStream of the subObject content

Specified by:
getSubObject in interface IBIObjectCMSDAO
Parameters:
pathParent - cms path of the parent object
name - name of the subObject
Returns:
InputStream of the subObject content

deleteSubObject

public void deleteSubObject(java.lang.String pathParent,
                            java.lang.String name)
                     throws it.eng.spago.error.EMFUserError
Delete a subObject

Specified by:
deleteSubObject in interface IBIObjectCMSDAO
Parameters:
pathParent - path of the parent object
name - name of the subObject
Throws:
it.eng.spago.error.EMFUserError

fillBIObjectTemplate

public void fillBIObjectTemplate(BIObject obj)
Description copied from interface: IBIObjectCMSDAO
Given a BIObject at input, fills it with template information.

Specified by:
fillBIObjectTemplate in interface IBIObjectCMSDAO
Parameters:
obj - The object to fill template information in.
See Also:
it.eng.spagobi.bo.dao.IBIObjectDAO#fillBIObjectTemplate(it.eng.spagobi.bo.BIObject)

getSubObjects

public java.util.List getSubObjects(java.lang.String pathParent)
Gets the list of all the subObjects which belongs to a biobject. The list contains BIObject.SubObjectDetail objects

Specified by:
getSubObjects in interface IBIObjectCMSDAO
Parameters:
pathParent - cms path of the father biobject
Returns:
List of BIObject.SubObjectDetail objects each one containing the information about a subObject of the biObject

saveExecutionNotes

public void saveExecutionNotes(java.lang.String biobjPath,
                               java.lang.String execIdentif,
                               java.lang.String notes)
                        throws java.lang.Exception
Save Notes for a specific execution of the biobject

Specified by:
saveExecutionNotes in interface IBIObjectCMSDAO
Parameters:
biobjPath - path of the biobject executed
execIdentif - identifier of the execution
notes - notes to save
Throws:
java.lang.Exception

getExecutionNotes

public java.lang.String getExecutionNotes(java.lang.String biobjPath,
                                          java.lang.String execIdentif)
                                   throws java.lang.Exception
Get Notes for a specific execution of the biobject

Specified by:
getExecutionNotes in interface IBIObjectCMSDAO
Parameters:
biobjPath - path of the biobject executed
execIdentif - identifier of the execution
Returns:
String notes saved
Throws:
java.lang.Exception

saveTemplate

public void saveTemplate(byte[] content,
                         java.lang.String path,
                         java.lang.String templateName)
                  throws it.eng.spago.error.EMFUserError
Save a subObject of the object

Specified by:
saveTemplate in interface IBIObjectCMSDAO
Parameters:
content - byte array containing the content of the template
path - the cms path of the document
Throws:
it.eng.spago.error.EMFUserError

deleteSnapshot

public void deleteSnapshot(java.lang.String snapshotPath)
                    throws it.eng.spago.error.EMFUserError
Description copied from interface: IBIObjectCMSDAO
Delete a snapshot

Specified by:
deleteSnapshot in interface IBIObjectCMSDAO
Parameters:
snapshotPath - path of the snapshot
Throws:
it.eng.spago.error.EMFUserError

getSnapshots

public java.util.List getSnapshots(java.lang.String pathParent)
Description copied from interface: IBIObjectCMSDAO
Gets the list of the snapshot details that are children of a biobject

Specified by:
getSnapshots in interface IBIObjectCMSDAO
Parameters:
pathParent - Cms path of the biobject
Returns:
List of BIObject.BIObjectSnapshot objects

saveSnapshot

public void saveSnapshot(byte[] content,
                         java.lang.String pathParent,
                         java.lang.String name,
                         java.lang.String description)
                  throws it.eng.spago.error.EMFUserError
Description copied from interface: IBIObjectCMSDAO
Save a snapshot of the object

Specified by:
saveSnapshot in interface IBIObjectCMSDAO
Parameters:
content - byte array containing the content of the snapshot
pathParent - the cms path of the parent
name - the name of the new subobject
description - the description of the new subobject
Throws:
it.eng.spago.error.EMFUserError

exportDocument

public void exportDocument(BIObject obj,
                           java.lang.String destFolder,
                           boolean exportSubObjects,
                           boolean exportSnapshots)
                    throws it.eng.spago.error.EMFUserError
Description copied from interface: IBIObjectCMSDAO
Exports a document node

Specified by:
exportDocument in interface IBIObjectCMSDAO
Parameters:
obj - The BIObject document to be exported: its node is supposed to be existing
destFolder - The folder where document will be serialized
exportSubObjects - Flag indicating if the subobjects must be exported
exportSnapshots - Flag indicating if the snapshots must be exported
Throws:
it.eng.spago.error.EMFUserError

importDocument

public java.lang.String importDocument(java.lang.String sourceFolder)
                                throws it.eng.spago.error.EMFUserError
Description copied from interface: IBIObjectCMSDAO
Imports a document

Specified by:
importDocument in interface IBIObjectCMSDAO
Parameters:
sourceFolder - The folder where document will be deserialized from
Throws:
it.eng.spago.error.EMFUserError