com.businessobjects.dsws.saveservice
Class SaveService

java.lang.Object
  extended by com.businessobjects.dsws.Consumer
      extended by com.businessobjects.dsws.saveservice.SaveService
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class SaveService
extends Consumer
implements java.io.Externalizable

SaveService class is a proxy that can consume the SaveService Web Service and that is mapped on its WSDL.
SaveService provides services to perform save and saveAs on Web Intelligence and Desktop Intelligence document objects.


While performing save if needed, the user can update some of related document properties. Most common ones are listed below,
  1. title - Title of document.
  2. description - Description about the document.
  3. keywords - keywords about the document.
  4. locale - Locale of document.
  5. refreshonopen - false if document is not refresh on open and true else

SaveService returns a saveResult Object after performing save operation with latest documentReference, update propertyList and documentID of the documentReference used (in the case of SaveAs, latest Document ID).

See Also:
Serialized Form

Constructor Summary
SaveService()
           
SaveService(Connection objConnection, ConnectionState objConnectionState)
          Instantiate a new SaveService object using Connection and ConnectionState objects.
SaveService(java.lang.String strImplementation, ConnectionState objConnectionState)
          Internal Use Only.
 
Method Summary
static SaveService getInstance(Consumer objConsumer, java.lang.String strURL)
          GetInstance static method returns a SaveService by passing the Web Service URL and an already logged Consumer object.
 void readExternal(java.io.ObjectInput in)
          Internal Use Only.
 SaveResult Save(java.lang.String documentReference, NameValuePair[] documentProperty)
          The Save method returns a SaveResult corresponding to a unique ID (UID) or document reference.
 SaveResult SaveAs(java.lang.String documentReference, java.lang.String documentName, java.lang.String parentUID, int[] categoryUID, int[] personalCategoryID, boolean overwrite, NameValuePair[] documentProperty)
          The SaveAs method returns a SaveResult corresponding to a unique ID (UID) or document reference.
 void writeExternal(java.io.ObjectOutput out)
          Internal Use Only.
 
Methods inherited from class com.businessobjects.dsws.Consumer
displayException, GetAxisFaultDetails, getConnection, getConnection, getConnectionState, getConsumer, getConsumer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveService

public SaveService(java.lang.String strImplementation,
                   ConnectionState objConnectionState)
            throws AxisFault

Internal Use Only.

Throws:
AxisFault

SaveService

public SaveService(Connection objConnection,
                   ConnectionState objConnectionState)
            throws AxisFault
Instantiate a new SaveService object using Connection and ConnectionState objects.

Example: Initializing a SaveService instance.

 Connection objConnection = new Connection(objURLSession);
 SessionInfo objSessionInfo = objSession.Login(objEnterpriseCredential);
 String[] astrURLs = objSession.getAssociatedServicesURL("ReportEngine");

 if (astrURLs.length > 0)
 {
        objConnection.setURL(new URL(astrURLs[0]));
        SaveService objSaveService = new SaveService(objConnection, objSession.getConnectionState());
 }
 

Parameters:
objConnection - a valid Connection object with the URL set to the SaveService service.
objConnectionState - the ConnectionState of the current user session.
Throws:
AxisFault
See Also:
Connection, ConnectionState

SaveService

public SaveService()
Method Detail

getInstance

public static SaveService getInstance(Consumer objConsumer,
                                      java.lang.String strURL)
                               throws AxisFault
GetInstance static method returns a SaveService by passing the Web Service URL and an already logged Consumer object.

Parameters:
objConsumer - one of the current user's consumer objects.
strURL - URL to connect to the SaveService web service.
Returns:
An instance of SaveService.
Throws:
DSWSException - Exception raised either as a Web Service SOAP Fault or as a Consumer side trapped exception.
Note:If the user is not logged in or the service name is unknown, NULL will be returned.

Example: Initializing a SaveService instance.

 URL objURLSession = new URL("http://localhost:8080/dswsbobje/services/Session");
 Connection objConnection = new Connection(objURLSession);
 Session objSession = new Session(objConnection);
 EnterpriseCredential objEnterpriseCredential = EnterpriseCredential.Factory.newInstance();
 objEnterpriseCredential.setLogin("Administrator");
 objEnterpriseCredential.setPassword("");
 objEnterpriseCredential.setLocale("en_US");
 objEnterpriseCredential.setTimeZone("GMT+05:30");
 SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);
 SaveService objSaveService = SaveService.getInstance(objSession, astrURLs[0]);

 String[] astrURLs = objSession.getAssociatedServicesURL("SaveService");
 if (astrURLs.length > 0)
 {
                SaveService objSaveService = SaveService.getInstance(objSession, astrURLs[0]);
 }
 objSession.logout();
 
AxisFault
See Also:
Connection, AuthenticationCredential, Session

SaveAs

public SaveResult SaveAs(java.lang.String documentReference,
                         java.lang.String documentName,
                         java.lang.String parentUID,
                         int[] categoryUID,
                         int[] personalCategoryID,
                         boolean overwrite,
                         NameValuePair[] documentProperty)
                  throws AxisFault
The SaveAs method returns a SaveResult corresponding to a unique ID (UID) or document reference.
It allows us to save to any valid folder, valid categories, valid personal categories While performing saveAs we can update some of the related document properties using an array of NameValuePair objects
A SaveResult object contains latest Document Reference, update property list as per user's change, and latest document ID after saveAs.

Example: Create a new document after performing refresh on the instance.

 Document[] aobjDocuments = boCatalog.getDocumentList("",-1,null,null,null,InstanceRetrievalType.ALL);
 Document myBODoc = aobjDocuments[0];
 String strBODocuid = myBODoc.getUID();
 Action[] actions = new Action[1];
 actions[0] = Refresh.Factory.newInstance();
 DocumentInformation docInfo = RepEng.getDocumentInformation(strBODocuid,null,actions,null, null);
 String newDocName = "saveDocument";
 String ParentUID = "1601";
 SaveResult objSaveResult=objSaveService.SaveAs(strBODocReference,newDocName,ParentUID,null,null,true,null);
 

Parameters:
documentReference - A documentInstance's unique ID, retrieved using BICatalog or a document reference, retrieved from a DocumentInformation object.
documentName - Name for the new document instance
parentUID - Folder UID retrieved using BICatalog
categoryUID - Category UID retrieved using BI Catalog
personalCategoryUID - Personal Category UID retrieved using BI Catalog
overwrite - boolean flag to find out if we can overwrite an existing document with same name in repository
documentProperty - set of document properties as name/value pair to update before saveAs
Returns:
a SaveResult object corresponding to the UID or document reference, DocumentProperties corresponding to NameValuePair supplied in the parameters.
Throws:
AxisFault
See Also:
BICatalog, Document, DocumentInformation, RetrieveMustFillInfo, Action, Navigate, RetrieveData, Connection, AuthenticationCredential, Session, NameValuePair, com.businessobjects.dsws.reportengine.getDocumentReference()

Save

public SaveResult Save(java.lang.String documentReference,
                       NameValuePair[] documentProperty)
                throws AxisFault
The Save method returns a SaveResult corresponding to a unique ID (UID) or document reference.
It allows us to do a quick save of current document reference. While performing saveAs we can update some of the related document properties using an array of NameValuePair
A SaveResult object contains latest Document Reference, update property list as per user's change, and latest document ID after saveAs.

Example: Save the current document instance after performing refresh on the instance.

 Document[] aobjDocuments = boCatalog.getDocumentList("",-1,null,null,null,InstanceRetrievalType.ALL);
 Document myBODoc = aobjDocuments[0];
 String strBODocuid = myBODoc.getUID();
 Action[] actions = new Action[1];
 actions[0] = Refresh.Factory.newInstance();
 DocumentInformation docInfo = RepEng.getDocumentInformation(strBODocuid,null,actions,null, null);
 String strBODocReference = docInfo.getDocumentReference();
 SaveResult objSaveResult = objSaveService.Save(strBODocReference,null);
 

Parameters:
documentReference - A documentInstance's unique ID, retrieved using BICatalog or a document reference, retrieved from a DocumentInformation object.
documentProperty - set of document properties as name/value pair to update before saveAs
Returns:
a SaveResult object corresponding to the UID or document reference, DocumentProperties corresponding to NameValuePair supplied in the parameters.
Throws:
AxisFault
See Also:
BICatalog, Document, DocumentInformation, RetrieveMustFillInfo, Action, Navigate, RetrieveData, Connection, AuthenticationCredential, Session, NameValuePair, com.businessobjects.dsws.reportengine.getDocumentReference()

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException

Internal Use Only.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException

Internal Use Only.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException