com.plumtree.remote.prc
Interface IDocumentManager


public interface IDocumentManager

Interface that allows remote services to create new documents in the portal Knowledge Directory.


Method Summary
 void addDocuments(int documentID, int[] destinationFolderIDs)
          Adds a document to the portal.
Note: This does not duplicate the document file itself, only links to the document in the portal.
Note: Since this method performs multiple operations, any exception thrown relating to these will have details of each failure.
 IDocumentQuery createQuery(int folderID)
          Factory method to create a document query on a specified document folder.
 IRemoteDocument createRemoteDocument(int[] folderIDs, int dataSourceID, java.lang.String location, boolean mergeACLs)
          Creates a new remote document.
 IRemoteDocument createRemoteDocument(int parentFolderID, int dataSourceID, java.lang.String location)
          Creates a new remote document.
 IWebLinkDocument createWebLinkDocument(int[] folderIDs, int dataSourceID, java.lang.String link, boolean mergeACLs)
          Creates a new Web link document.
 IWebLinkDocument createWebLinkDocument(int parentFolderID, int dataSourceID, java.lang.String link)
          Creates a new Web link document.
 IACL queryACL(int documentID)
          Retrieves an ACL (Access Control List) for managing the security for a document.
 IObjectQuery queryContainingFolders(int documentID)
          Queries for all folders which contain a specific document
 IDocumentProperties queryDocumentProperties(int documentID)
          Queries the properties of a document.
 void removeDocuments(int[] documentIDs)
          Removes documents from the portal.
Note: This does not remove the document file itself, only the link to the document from the portal.
Note: Since this method performs multiple operations, any exception thrown will have details of each failure.
 void setBrokenLinkDeletionTime(int documentID, TimeInterval deletionTime)
          Sets the time interval after which a document with a broken link will be deleted.
 void setExpirationDate(int documentID, java.util.Date expires)
          Sets the date on which to expire this document.
 void setNeverExpires(int documentID)
          Sets a document to never be expired.
 void setRefreshRate(int documentID, TimeInterval refreshInterval, boolean doNotRefreshProperties)
          Sets the document refresh rate, which determines how often a document and its properties will get refreshed.
 void updateACL(int documentID, IACL acl)
          Updates the ACL (Access Control List) for a document.
 void updateDocumentProperties(int documentID, IDocumentProperties properties)
          Updates the properties of a document.
 

Method Detail

createRemoteDocument

public IRemoteDocument createRemoteDocument(int parentFolderID,
                                            int dataSourceID,
                                            java.lang.String location)
Creates a new remote document. The document will not be saved in the portal Knowledge Directory until the save() method is called on the IDocument object.

Parameters:
parentFolderID - the ID of the directory folder in which to create the new document
dataSourceID - the ID of the Data Source associated with the new document
location - the location string that will be passed to the remote crawler to indicate which document to retrieve

Note: This is the same value that would be returned in the location field of com.plumtree.remote.crawler.ChildDocument and then passed to the Data Source in com.plumtree.remote.crawler.IDocumentProvider#attachToDocument. The location string can be a full path for a file crawler; a concatenation of schema, table name, and primary key for a database crawler; a concatenation of database name, view name, and document unique ID for a Notes crawler; or a application-specific string for a custom crawler.

 //get the document manager.....
 int folderID = 20; //get from the query string from mousing over the directory folder in the ui
 int dataSourceID = 30; //get from the query string from mousing over the data source in the ui
 //location of a file; the format of the location string is data-source specific
 String location =  "\\\\MyServer\\share\\Portlet FAQ and Price list.doc"  ;
 IRemoteDocument doc = documentManager.createRemoteDocument(folderID, dataSourceID, location);
 //set the override name and description- otherwise the value would be taken from the accessor
 doc.setOverrideName("Portlet Price List");
 doc.setOverrideDescription("Portlet Prices and FAQs");
 //set the type- in this case, a word doc in the MIME namespace
 doc.setType("http://www.plumtree.com/dtm/mime", "application/msword");
 //set the docID to a negative number to check for failure
 int docID = -1;
 try
 }
   docID = documentManager.save();
 }
 catch (MalformedURLException e)
 {
  //if the query interface URL was not valid
  e.printStackTrace();
 }
 catch (PortalException pe)
 {
  //if the operation resulted in an error in the portal
  pe.printStackTrace();
 }
 catch (RemoteException re)
 {
  //if there was a communication problem during the execution of the remote method call
  re.printStackTrace();
 }
 //process docID as desired......
 

Returns:
the new document

createWebLinkDocument

public IWebLinkDocument createWebLinkDocument(int parentFolderID,
                                              int dataSourceID,
                                              java.lang.String link)
Creates a new Web link document. The document will not be saved in the portal Knowledge Directory until the save() method is called on the Document object.

Parameters:
parentFolderID - the ID of the directory folder in which to create the new document
dataSourceID - the ID of the Data Source associated with the new document
link - the Web location of the new document; must be a URL
Returns:
the new document

createRemoteDocument

public IRemoteDocument createRemoteDocument(int[] folderIDs,
                                            int dataSourceID,
                                            java.lang.String location,
                                            boolean mergeACLs)
Creates a new remote document. The document will not be saved in the portal Knowledge Directory until the save() method is called on the IDocument object.

Parameters:
folderIDs - the IDs of the directory folders in which to add the new document
dataSourceID - the ID of the Data Source associated with the new document
location - the location string that will be passed to the remote crawler to indicate which document to retrieve; can be a URL
mergeACLs - true to use the merged ACLs of the parent folders, false to use the default ACL

Note: This is the same value that would be returned in the location field of com.plumtree.remote.crawler.ChildDocument and then passed to the DataSource in com.plumtree.remote.crawler.IDocumentProvider#attachToDocument. The location string can be a full path for a file crawler; a concatenation of schema, table name, and primary key for a database crawler; a concatenation of database name, view name, and document unique ID for a Notes crawler; or a application-specific string for a custom crawler.

 //get the document manager.....
 int[] folderIDs = {20,25,20}; //get from the query string from mousing over the directory folders in the ui
 int dataSourceID = 30; //get from the query string from mousing over the data source in the ui
 //location of a file; the format of the location string is data-source specific
 String location =  "\\\\MyServer\\share\\Portlet FAQ and Price list.doc"  ;
 IRemoteDocument doc = documentManager.createRemoteDocument(folderIDs, dataSourceID, location, true);
 //set the override name and description- otherwise the value would be taken from the accessor
 doc.setOverrideName("Portlet Price List");
 doc.setOverrideDescription("Portlet Prices and FAQs");
 //set the type- in this case, a word doc in the MIME namespace
 doc.setType("http://www.plumtree.com/dtm/mime", "application/msword");
 //set the docID to a negative number to check for failure
 int docID = -1;
 try
 }
   docID = documentManager.save();
 }
 catch (MalformedURLException e)
 {
  //if the query interface URL was not valid
  e.printStackTrace();
 }
 catch (PortalException pe)
 {
  //if the operation resulted in an error in the portal
  pe.printStackTrace();
 }
 catch (RemoteException re)
 {
  //if there was a communication problem during the execution of the remote method call
  re.printStackTrace();
 }
 //process docID as desired......
 

Returns:
the new document

createWebLinkDocument

public IWebLinkDocument createWebLinkDocument(int[] folderIDs,
                                              int dataSourceID,
                                              java.lang.String link,
                                              boolean mergeACLs)
Creates a new Web link document. The document will not be saved in the portal Knowledge Directory until the save() method is called on the Document object.

Parameters:
folderIDs - the IDs of the directory folders in which to add the new document
dataSourceID - the ID of the Data Source associated with the new document
link - the Web location of the new document; must be a URL
mergeACLs - true to use the merged ACLs of the parent folders, false to use the default ACL
Returns:
the new document

queryDocumentProperties

public IDocumentProperties queryDocumentProperties(int documentID)
                                            throws PortalException,
                                                   java.rmi.RemoteException
Queries the properties of a document.

Parameters:
documentID - the document ID of the document to query
Returns:
the document properties
Throws:
PortalException - if the operation resulted in an error in the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

updateDocumentProperties

public void updateDocumentProperties(int documentID,
                                     IDocumentProperties properties)
                              throws PortalException,
                                     java.rmi.RemoteException
Updates the properties of a document.

Parameters:
documentID - the document ID of the document to update
properties - the properties to update the document with. If any intrinsic properties have been deleted from the portal, the corresponding property must be removed from the DocumentTypeMap or the update will fail
Throws:
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
PortalException - if the operation resulted in an error on the portal
java.lang.NullPointerException - if the properties set is null

setRefreshRate

public void setRefreshRate(int documentID,
                           TimeInterval refreshInterval,
                           boolean doNotRefreshProperties)
                    throws PortalException,
                           java.rmi.RemoteException
Sets the document refresh rate, which determines how often a document and its properties will get refreshed. If the boolean value of doNotRefreshProperties is set to true, only the validity of the link to this document will be confirmed and no document properties will be refreshed.
The numeric component of the refresh interval must be between 1 and 999, otherwise an IllegalArgumentException will be thrown.
Setting the refreshInterval to TimeInterval.INFINITE will set the document to never be refreshed.
The default refresh rate for a document is set by the document crawler.

Parameters:
documentID - the ID of the document to set refresh rate; cannot be negative
refreshInterval - the time interval specifying the refresh interval value and unit. The numeric component must be between 1 and 999, otherwise an IllegalArgumentException will be thrown. Setting the refreshInterval to TimeInterval.INFINITE will cause the document to never be refreshed.
doNotRefreshProperties - true if only the link to the document should be confirmed, and no document properties should be refreshed, otherwise false
Throws:
PortalException - if the document ID is invalid or the operation resulted in an error on the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
java.lang.IllegalArgumentException - if the documentID is negative or the numeric component of the refreshInterval is not between 1 and 999
java.lang.NullPointerException - if the timeInterval or the unit component of the timeInterval is null

setBrokenLinkDeletionTime

public void setBrokenLinkDeletionTime(int documentID,
                                      TimeInterval deletionTime)
                               throws PortalException,
                                      java.rmi.RemoteException
Sets the time interval after which a document with a broken link will be deleted. Setting the deletionTime to TimeInterval.INFINITE will cause a broken link document to never be deleted.
The numeric component of the deletionTime must be between 1 and 999, otherwise an IllegalArgumentException will be thrown.
The default broken link deletion time for a document is set by the document crawler.

Parameters:
documentID - the ID of the document to set broken link deletion time; cannot be negative
deletionTime - the time interval after which a missing document will be deleted. The numeric component must be between 1 and 999, otherwise an IllegalArgumentException will be thrown. Setting the deletionTime to TimeInterval.INFINITE will cause the document to never be deleted.
Throws:
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
PortalException - if the document ID is invalid or the operation resulted in an error in the portal
java.lang.IllegalArgumentException - if the documentID is negative or the numeric component of the refreshInterval is not between 1 and 999
java.lang.NullPointerException - if the deletionTime or the unit component of the deletionTime is null

setExpirationDate

public void setExpirationDate(int documentID,
                              java.util.Date expires)
                       throws PortalException,
                              java.rmi.RemoteException
Sets the date on which to expire this document.
The default expiration date for a document is set by the document crawler.

Parameters:
documentID - the ID of the document to set an expiration date for
expires - the time at which the document is set to expire. Cannot be null.
Throws:
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
PortalException - if the document ID is invalid or the operation resulted in an error on the portal
java.lang.IllegalArgumentException - if the documentID is negative

setNeverExpires

public void setNeverExpires(int documentID)
                     throws PortalException,
                            java.rmi.RemoteException
Sets a document to never be expired.
The default expiration date for a document is set by the document crawler.

Parameters:
documentID - the ID of the document to disable expiration for
Throws:
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
PortalException - if the document ID is invalid or the operation resulted in an error in the portal
java.lang.IllegalArgumentException - if the documentID is negative

removeDocuments

public void removeDocuments(int[] documentIDs)
                     throws PortalException,
                            java.rmi.RemoteException
Removes documents from the portal.
Note: This does not remove the document file itself, only the link to the document from the portal.
Note: Since this method performs multiple operations, any exception thrown will have details of each failure.

Parameters:
documentIDs - the IDs of the documents to remove
Throws:
PortalException - if the operation resulted in an error in the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

addDocuments

public void addDocuments(int documentID,
                         int[] destinationFolderIDs)
                  throws PortalException,
                         java.rmi.RemoteException
Adds a document to the portal.
Note: This does not duplicate the document file itself, only links to the document in the portal.
Note: Since this method performs multiple operations, any exception thrown relating to these will have details of each failure.

Parameters:
documentID - the ID of the document to add
destinationFolderIDs - the IDs of the folders to which to add the document
Throws:
PortalException - if the operation resulted in an error in the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

createQuery

public IDocumentQuery createQuery(int folderID)
Factory method to create a document query on a specified document folder. The created query parameters default to start row=0, maximum of 100 results, show unapproved documents, sort by Document ID and no filters.

Parameters:
folderID - thefolder ID to query
Returns:
the document query object

queryContainingFolders

public IObjectQuery queryContainingFolders(int documentID)
                                    throws PortalException,
                                           java.rmi.RemoteException
Queries for all folders which contain a specific document

Parameters:
documentID - the ID of the document to query for
Returns:
the folder objects that contain the document
Throws:
PortalException - if the operation resulted in an error on the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
java.lang.IllegalArgumentException - if passed an invalid document ID

queryACL

public IACL queryACL(int documentID)
              throws java.net.MalformedURLException,
                     PortalException,
                     java.rmi.RemoteException
Retrieves an ACL (Access Control List) for managing the security for a document.

Parameters:
documentID - the document ID of the object for which to retrieve the ACL
Returns:
the ACL for the document
Throws:
java.net.MalformedURLException - if the query interface URL is not valid
java.lang.IllegalArgumentException - if an invalid document ID was passed
PortalException - if the operation resulted in an error in the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

updateACL

public void updateACL(int documentID,
                      IACL acl)
               throws java.net.MalformedURLException,
                      PortalException,
                      java.rmi.RemoteException
Updates the ACL (Access Control List) for a document. Note: You can only update the ACL on a document with an ACL that was retrieved from the same document.

Parameters:
documentID - the document ID of the document for which to set the ACL
acl - the ACL to set on the document
Throws:
java.net.MalformedURLException - if the query interface URL is not valid
java.lang.IllegalArgumentException - if an an invalid document ID was passed
PortalException - if the operation resulted in an error in the portal
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call
ACLEntryReadOnlyException - if the ACL contains read-only ACLEntrys that have been modified


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2008 Oracle® Corporation. All Rights Reserved.