com.plumtree.taskapi.portalui
Class TaskAPIUIDirectoryService

java.lang.Object
  extended by com.plumtree.taskapi.portalui.TaskAPIUIDirectoryService
All Implemented Interfaces:
ITaskAPIUIDirectory

public class TaskAPIUIDirectoryService
extends java.lang.Object
implements ITaskAPIUIDirectory

This class manages instances of the ITaskAPIUIDirectory interface for both production and testing purposes. It is a replacement for the TaskAPIUIDirectory class, since that class uses static methods and cannot be mocked for testing.


Method Summary
 IXPList AddUploadData(AActivitySpace owner, IXPList _sources)
          Adds the upload data for the Web Services associated with the Data Sources used for submitting documents to the Knowledge Directory.
 IPTURL CreateCommonOpenerDirectoryFolderURL(AActivitySpace owner, java.lang.String strTitle, int nDirMode, int nFolderID)
          Gets an URL to open a specified Knowledge Directory folder in the selected mode.
 IPTURL CreateCommonOpenerDirectoryFolderURL(AActivitySpace owner, java.lang.String strTitle, int nDirMode, int nFolderID, java.lang.String strFolderName)
          Gets an URL to open a specified Knowledge Directory folder in the selected mode.
 IPTURL CreateCommonOpenerDocumentURL(AActivitySpace owner, java.lang.String strTitle, int nDocumentID)
          Gets an URL to open a specified Document in the Knowledge Directory.
 IPTURL CreateCommonOpenerDocumentURL(AActivitySpace owner, java.lang.String strTitle, int nDocumentID, java.lang.String strDocumentName)
          Gets an URL to open a specified Document in the Knowledge Directory.
static ITaskAPIUIDirectory GetInstance()
           
 IXPList GetSubmitDataSources(AActivitySpace owner)
          Gets the Data Sources used for submitting documents to the Knowledge Directory.
 IPTURL GetURLForBrowseDirectory(AActivitySpace owner, int nFolderID)
          Gets the URL to the specified Knowledge Directory in Browse Mode.
 IPTURL GetURLForEditDirectory(AActivitySpace owner, int nFolderID)
          Gets the URL to the specified Knowledge Directory in Edit Mode.
 boolean IsCurrentPageDirectoryPage(AActivitySpace owner)
          Checks if the current page is a Knowledge Directory page.
 boolean IsDirectoryFeaturedEnabledInSubPortal(AActivitySpace owner)
          Checks if the Knowledge Directory feature is enabled in the current Experience Definition.
 boolean IsWebDataSource(IPTDataSource _dataSource, IPTSession _session)
          Check if the provider for this data source supports web paths.
static void SetMockInstanceForDebug(ITaskAPIUIDirectory _instance)
          This method sets the debug instance of the ITaskAPIUIDirectory interface for use as a mock object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

GetInstance

public static ITaskAPIUIDirectory GetInstance()
Returns:
An instance of the ITaskAPIUIDirectory interface.

SetMockInstanceForDebug

public static void SetMockInstanceForDebug(ITaskAPIUIDirectory _instance)
This method sets the debug instance of the ITaskAPIUIDirectory interface for use as a mock object. This should never be used in a production environment. This should be reset to null at the end of testing to ensure other code does not get an old mock instance.

Parameters:
_instance - The mock instance of the ITaskAPIUIDirectory interface. When the mock instance is done being used it should be reset to null by calling this method again with a null argument.

CreateCommonOpenerDirectoryFolderURL

public IPTURL CreateCommonOpenerDirectoryFolderURL(AActivitySpace owner,
                                                   java.lang.String strTitle,
                                                   int nDirMode,
                                                   int nFolderID)
Description copied from interface: ITaskAPIUIDirectory
Gets an URL to open a specified Knowledge Directory folder in the selected mode. The folder will not be accessible if the current user does not have sufficient access it.

Specified by:
CreateCommonOpenerDirectoryFolderURL in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
strTitle - Title of the URL, normally the name of the folder to open.
nDirMode - DirConstants.BROWSE_MODE or DirConstants.EDIT_MODE
nFolderID - Object ID of the Knowledge Directory Folder to get an URL to.
Returns:
An IPTURL to a folder in the Knowledge Directory - no image is assigned to the URL.
See Also:
DirConstants

CreateCommonOpenerDirectoryFolderURL

public IPTURL CreateCommonOpenerDirectoryFolderURL(AActivitySpace owner,
                                                   java.lang.String strTitle,
                                                   int nDirMode,
                                                   int nFolderID,
                                                   java.lang.String strFolderName)
Description copied from interface: ITaskAPIUIDirectory
Gets an URL to open a specified Knowledge Directory folder in the selected mode. The folder will not be accessible if the current user does not have sufficient access it.

Specified by:
CreateCommonOpenerDirectoryFolderURL in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
strTitle - Title of the URL, normally the name of the folder to open.
nDirMode - DirConstants.BROWSE_MODE or DirConstants.EDIT_MODE
nFolderID - Object ID of the Knowledge Directory Folder to get an URL to.
Returns:
An IPTURL to a folder in the Knowledge Directory - no image is assigned to the URL.
See Also:
DirConstants

CreateCommonOpenerDocumentURL

public IPTURL CreateCommonOpenerDocumentURL(AActivitySpace owner,
                                            java.lang.String strTitle,
                                            int nDocumentID)
Description copied from interface: ITaskAPIUIDirectory
Gets an URL to open a specified Document in the Knowledge Directory. The document will not be accessible if the current user does not have sufficient access it.

Specified by:
CreateCommonOpenerDocumentURL in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
strTitle - Title of the URL, normally the name of the Document to open.
nDocumentID - Object ID of the Document to get an URL to.
Returns:

CreateCommonOpenerDocumentURL

public IPTURL CreateCommonOpenerDocumentURL(AActivitySpace owner,
                                            java.lang.String strTitle,
                                            int nDocumentID,
                                            java.lang.String strDocumentName)
Description copied from interface: ITaskAPIUIDirectory
Gets an URL to open a specified Document in the Knowledge Directory. The document will not be accessible if the current user does not have sufficient access it.

Specified by:
CreateCommonOpenerDocumentURL in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
strTitle - Title of the URL, normally the name of the Document to open.
nDocumentID - Object ID of the Document to get an URL to.
strDocumentName - Name of the document.
Returns:
The URL to the document

GetURLForBrowseDirectory

public IPTURL GetURLForBrowseDirectory(AActivitySpace owner,
                                       int nFolderID)
Description copied from interface: ITaskAPIUIDirectory
Gets the URL to the specified Knowledge Directory in Browse Mode. The folder will not be accessible if the current user does not have sufficient access to it.

Specified by:
GetURLForBrowseDirectory in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
nFolderID - Object ID of a Knowledge Directory folder to create an URL to.
Returns:
An IPTURL with the URL to the specified folder in Knowledge Directory Browse Mode, or null if the URL is not valid in the current context.

GetURLForEditDirectory

public IPTURL GetURLForEditDirectory(AActivitySpace owner,
                                     int nFolderID)
Description copied from interface: ITaskAPIUIDirectory
Gets the URL to the specified Knowledge Directory in Edit Mode. The folder will not be accessible if the current user does not have sufficient access it.

Specified by:
GetURLForEditDirectory in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
nFolderID - Object ID of a Knowledge Directory folder to create an URL to.
Returns:
An IPTURL with the URL to the specified folder in Knowledge Directory Edit Mode, or null if the URL is not valid in the current context.

IsCurrentPageDirectoryPage

public boolean IsCurrentPageDirectoryPage(AActivitySpace owner)
Description copied from interface: ITaskAPIUIDirectory
Checks if the current page is a Knowledge Directory page.

Specified by:
IsCurrentPageDirectoryPage in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
Returns:
true if the current page us a Knowledge Directory page, false otherwise.

IsDirectoryFeaturedEnabledInSubPortal

public boolean IsDirectoryFeaturedEnabledInSubPortal(AActivitySpace owner)
Description copied from interface: ITaskAPIUIDirectory
Checks if the Knowledge Directory feature is enabled in the current Experience Definition.

Specified by:
IsDirectoryFeaturedEnabledInSubPortal in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
Returns:
true Knowledge Directory feature is enabled, false otherwise.

GetSubmitDataSources

public IXPList GetSubmitDataSources(AActivitySpace owner)
Description copied from interface: ITaskAPIUIDirectory
Gets the Data Sources used for submitting documents to the Knowledge Directory.

Specified by:
GetSubmitDataSources in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
Returns:
the list of Data Sources used for submitting documents to the Knowledge Directory. Each entry in the list will be a HashTableDataObject with entries for "name" and "id", as described in the SubmitDataSourceConstants class.

AddUploadData

public IXPList AddUploadData(AActivitySpace owner,
                             IXPList _sources)
Description copied from interface: ITaskAPIUIDirectory
Adds the upload data for the Web Services associated with the Data Sources used for submitting documents to the Knowledge Directory. This will also filter the list for invalid submit data sources. Data sources should be either web submit, or remote file upload. Any other kinds of data sources will be removed from the list.

Specified by:
AddUploadData in interface ITaskAPIUIDirectory
Parameters:
owner - Current Activityspace.
_sources - List of HashtableDataObjects of the Data Sources to lookup. This is of the same format as the result of the GetSubmitDataSources method.
Returns:
the original list of Data Sources with additional data added to each entry. The entries in the list will have additional entries for "type" (file or web), "url" (remote upload URL), and "wsid" (ID of the associated web service), as described in the SubmitDataSourceConstants class. "url" will be null for data sources that don't support remote upload.

IsWebDataSource

public boolean IsWebDataSource(IPTDataSource _dataSource,
                               IPTSession _session)
Description copied from interface: ITaskAPIUIDirectory
Check if the provider for this data source supports web paths.

Specified by:
IsWebDataSource in interface ITaskAPIUIDirectory
Parameters:
_dataSource - The data source to check.
_session - the current user session
Returns:
whether or not this data source supports web paths.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.