Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 1 (11.1.1)
E14128-05

oracle.alm.connector
Interface DocumentConnector


public interface DocumentConnector

The DocumentConnector interface is implemented by a document connector to show documents in the Documents accordion of Oracle Team Productivity Center (OTPC) Team Navigator. It provides access to backend repository that stores the documents. OTPC document framework display these documents in either flat or hierarchical layout. To implement the document connector, document writer needs to implement login() using the connector parameters passed in the session map to connect to its document backend server. Information such as cookie, which needs to be maintained or passed around between connector calls, can be added to the session map. The document framework maintains information stored in the session map throughout the entire connector's lifecycle.

Since:
11.1.1.1.0

Method Summary
 DocumentItem createDocumentItem(java.util.Map session, DocumentItem item)
          Creates a document item on the document repository.
 void deleteDocumentItem(java.util.Map session, DocumentItem item)
          Deletes a document item from the document repository.
 void downloadDocumentFile(java.util.Map session, DocumentItem item, java.lang.String localPath)
          Downloads a document file to the specified local pathname.
 java.util.List<DocumentItem> getContent(java.util.Map session, java.lang.String itemKey)
          Get list of document items from specified path on the document repository.
 java.lang.String getDocumentRootPath(java.util.Map session)
          Returns the root path of the document repository.
 void init(java.util.Map session)
          Initializes the connector instance on the client side in a state specified by the connector parameters.
 void login(java.util.Map session, java.lang.String userName, java.lang.String password)
          Establishes a user connection between the connector instance on the client side and the backend repository.
 void logout(java.util.Map session)
          Disconnects the user session from the backend repository.
 DocumentItem updateDocumentItem(java.util.Map session, DocumentItem oldItem, DocumentItem newItem)
          Updates attributes of a document item on the document repository.
 DocumentItem uploadDocumentFile(java.util.Map session, DocumentItem item, java.lang.String localPath)
          Uploads a local file to a document repository.
 

Method Detail

init

void init(java.util.Map session)
          throws ALMException
Initializes the connector instance on the client side in a state specified by the connector parameters. These parameters are defined in the connector.xml file, and typically include the connector's physical connection parameters for corresponding repository.

Parameters:
session - initial connector parameters as specified by its corresponding repository
Throws:
ALMException - if required repository information is missing

login

void login(java.util.Map session,
           java.lang.String userName,
           java.lang.String password)
           throws ALMException
Establishes a user connection between the connector instance on the client side and the backend repository. If login is successful, connector writer may add connection cookie to the session context for later use.

Parameters:
session - user session context
userName - the Id used to access the backend repository. It will never be null
password - the password used to access the backend repository. It may be null
Throws:
ALMException - if failed to log in.

logout

void logout(java.util.Map session)
            throws ALMException
Disconnects the user session from the backend repository. If session cookie is also stored inside the session context, it can be used to log out from the backend repository. State can be saved inside the session map.

Parameters:
session - user session context
Throws:
ALMException - if failed to log off.

getContent

java.util.List<DocumentItem> getContent(java.util.Map session,
                                        java.lang.String itemKey)
                                        throws ALMException
Get list of document items from specified path on the document repository.

Parameters:
session - user session context
itemKey - the relative path from the root path in the document repository.
Returns:
the list of document items if succeeded
Throws:
ALMException - if failed to get the document list from the specified path.

createDocumentItem

DocumentItem createDocumentItem(java.util.Map session,
                                DocumentItem item)
                                throws ALMException
Creates a document item on the document repository.

Parameters:
session - user session context
item - document folder to create
Returns:
newly created doucment item if succeed
Throws:
ALMException - if failed to create the document folder item.

deleteDocumentItem

void deleteDocumentItem(java.util.Map session,
                        DocumentItem item)
                        throws ALMException
Deletes a document item from the document repository.

Parameters:
session - user session context
item - document item to delete
Throws:
ALMException - if failed to delete the document item.

updateDocumentItem

DocumentItem updateDocumentItem(java.util.Map session,
                                DocumentItem oldItem,
                                DocumentItem newItem)
                                throws ALMException
Updates attributes of a document item on the document repository.

Parameters:
session - user session context
oldItem - old document item
newItem - new document item
Returns:
N/A
Throws:
ALMException - if failed to update the document item.

downloadDocumentFile

void downloadDocumentFile(java.util.Map session,
                          DocumentItem item,
                          java.lang.String localPath)
                          throws ALMException
Downloads a document file to the specified local pathname.

Parameters:
session - user session context
item - document file to download
localPath - local pathname to download the document to
Throws:
ALMException - if failed to download the document file

uploadDocumentFile

DocumentItem uploadDocumentFile(java.util.Map session,
                                DocumentItem item,
                                java.lang.String localPath)
                                throws ALMException
Uploads a local file to a document repository. Upon a successful uplaod, a document item instance will be assigned to the file.

Parameters:
session - user session context
item - document item to create
localPath - local pathname to upload the file from
Returns:
newly created document item if the upload is successful
Throws:
ALMException - if failed to upload the document file.

getDocumentRootPath

java.lang.String getDocumentRootPath(java.util.Map session)
Returns the root path of the document repository.

Parameters:
session - user session context
Returns:
the root path of document repository if succeeded

Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 1 (11.1.1)
E14128-05

Copyright © 1999,2010, Oracle. All rights reserved.