com.ibm.notes.java.ui
Class NotesUIWorkspace

java.lang.Object
  extended by com.ibm.notes.java.ui.NotesUIWorkspace

public class NotesUIWorkspace
extends Object

Represents the current Notes workspace window.


Constructor Summary
NotesUIWorkspace()
          Default constructor.
 
Method Summary
 void addDatabase(NotesDatabaseData database)
          Adds a database to the workspace and highlights the icon, or highlights the icon if the database is already on the workspace.
 void composeDocument(Document document)
          Create a new document in the UI from the given document fields.
 void composeDocument(NotesDatabaseData database, Document document)
          Create a new document in the UI from the given document fields.
 void composeDocument(NotesFormData form)
          Create a new document in the UI from the given form data.
 NotesUIDocument getCurrentDocument()
          Deprecated. Replaced by getCurrentElement()
 NotesUIElement getCurrentElement()
          Returns a NotesUIElement object representing the element that is currently open.
 NotesUIView getCurrentView()
          Deprecated. Replaced by getCurrentElement()
 Document getTemporaryDocument(Session session)
          Returns a new, empty document in a local, temporary database.
 NotesUIDocument getUIDocument(IWorkbenchPart part)
          Tries to create a NotesUIDocument from the given IWorkbenchPart.
 NotesUIView getUIView(IWorkbenchPart part)
          Tries to create a NotesUIView from the give IWorkbenchPart.
 void openDatabase(NotesDatabaseData database)
          Open the given database.
 void openDocument(boolean editMode, NotesDocumentData document)
          Open or edit the specified document.
 void openDocumentByKey(NotesDocumentKeyData document)
          Opens a document by its key.
 void openFrameset(NotesFramesetData frameset)
          Open the specified frameset.
 void openFrameset(NotesFramesetData frameset, NotesViewData view)
          Open the specified view in the given frameset.
 void openFrameset(NotesFramesetData frameset, String viewUnid)
          Open the specified view in the given frameset.
 void openPage(NotesPageData page)
          Open the specified page.
 void openUrl(String url)
          Opens the specified Notes URL.
 void openView(NotesViewData view)
          Open the specified view.
 Object prompt(int type, String title, String prompt, Object defValue, String[] values)
          Displays a dialog box and returns a value based on the user's actions in the dialog box.
 void runAgent(NotesAgentData agentData, NotesDocumentDataCallback callback, boolean runOnUIContext)
          Runs the agent represented by the agent data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotesUIWorkspace

public NotesUIWorkspace()
Default constructor.

Since:
8.5.1
Method Detail

getUIView

public NotesUIView getUIView(IWorkbenchPart part)
Tries to create a NotesUIView from the give IWorkbenchPart.

Parameters:
part - the IWorkbenchPart to create the NotesUIView from
Returns:
a NotesUIView if possible, else this method will return null
Since:
8.5.2
See Also:
NotesUIView, IWorkbenchPart

getCurrentView

@Deprecated
public NotesUIView getCurrentView()
Deprecated. Replaced by getCurrentElement()

Return the currently selected view. Must be called from the UI thread.

Returns:
the current view
Since:
8.5.1

getUIDocument

public NotesUIDocument getUIDocument(IWorkbenchPart part)
Tries to create a NotesUIDocument from the given IWorkbenchPart.

Parameters:
part - the IWorkbenchPart to create the NotesUIDocument from
Returns:
a NotesUIDocument is possible, else this method will return null
Since:
8.5.2
See Also:
NotesUIDocument, IWorkbenchPart

getCurrentDocument

@Deprecated
public NotesUIDocument getCurrentDocument()
Deprecated. Replaced by getCurrentElement()

Returns a NotesUIDocument object representing the document that's currently open. If there is no document currently open on the workspace, this method returns nothing. This is applicable when there is an open document, not in a view. Must be called from the UI thread.

Returns:
the current document
Since:
8.5.1

getCurrentElement

public NotesUIElement getCurrentElement()
Returns a NotesUIElement object representing the element that is currently open. If more than one element is open, the one that currently has focus will be returned. If an element isn't currently open, this method will return null. Must be called from the UI thread.

Returns:
the current element
Since:
8.5.2
See Also:
NotesUIElement

openDatabase

public void openDatabase(NotesDatabaseData database)
                  throws NotesException 
Open the given database.

Parameters:
database - the data specifying which database to open
Throws:
NotesException - thrown when the database cannot be opened
Since:
8.5.1

openView

public void openView(NotesViewData view)
              throws NotesException 
Open the specified view.

Parameters:
view - the data specifying which view to open
Throws:
NotesException - thrown when the view cannot be opened
Since:
8.5.1

openFrameset

public void openFrameset(NotesFramesetData frameset)
                  throws NotesException 
Open the specified frameset.

Parameters:
frameset - the data specifying which frameset to open
Throws:
NotesException - thrown when the frameset cannot be opened
Since:
8.5.1

openFrameset

public void openFrameset(NotesFramesetData frameset,
                         String viewUnid)
                  throws NotesException 
Open the specified view in the given frameset.

Parameters:
frameset - the data specifying which frameset to open
viewUnid - the view unid to open the frameset in
Throws:
NotesException - thrown when the frameset cannot be opened
Since:
8.5.1

openFrameset

public void openFrameset(NotesFramesetData frameset,
                         NotesViewData view)
                  throws NotesException 
Open the specified view in the given frameset.

Parameters:
frameset - the data specifying which frameset to open
view - the view data containing a view unid to open the frameset in
Throws:
NotesException - thrown when the frameset cannot be opened
Since:
8.5.1

openPage

public void openPage(NotesPageData page)
              throws NotesException 
Open the specified page.

Parameters:
page - the data specifying which page to open
Throws:
NotesException - thrown when the page cannot be opened
Since:
8.5.1

openDocument

public void openDocument(boolean editMode,
                         NotesDocumentData document)
                  throws NotesException 
Open or edit the specified document.

Parameters:
editMode - if true, the document will be opened in edit mode, otherwise, it will be opened in read only mode
document - the data specifying which document to open
Throws:
NotesException - thrown when the document cannot be opened
Since:
8.5.1

openDocumentByKey

public void openDocumentByKey(NotesDocumentKeyData document)
                       throws NotesException 
Opens a document by its key.

Parameters:
document - the document key data specifying which document to open
Throws:
NotesException - thrown when the document cannot be opened
Since:
8.5.1

addDatabase

public void addDatabase(NotesDatabaseData database)
Adds a database to the workspace and highlights the icon, or highlights the icon if the database is already on the workspace.

Parameters:
database - the data specifying which database to add to the workspace
Since:
8.5.1

openUrl

public void openUrl(String url)
             throws NotesException 
Opens the specified Notes URL.

Parameters:
url - URL of object to open
Throws:
NotesException - thrown when the URL is null or has no length
Since:
8.5.1

composeDocument

public void composeDocument(Document document)
                     throws NotesException 
Create a new document in the UI from the given document fields. The new document is created within the document's database. This should be called from within a thread that has a Notes Session.

Parameters:
document - contains fields to use for new document
Throws:
NotesException - thrown when the document could not be composed properly
Since:
8.5.1

composeDocument

public void composeDocument(NotesDatabaseData database,
                            Document document)
                     throws NotesException 
Create a new document in the UI from the given document fields. The new document is created in the given database. This should be called from within a thread that has a Notes Session.

Parameters:
database - the data specifying which database to create the document within
document - contains fields to use for new document
Throws:
NotesException - thrown when the document could not be composed properly
Since:
8.5.1

composeDocument

public void composeDocument(NotesFormData form)
                     throws NotesException 
Create a new document in the UI from the given form data. The new document is created in the database specified inside the form data. This can be called from within a thread that does not have a Notes Session.
Note, NotesFormData.getName must return the alias of the form, if there is one, for this method to work correctly.

There is a limit on how large the fields can be on the document you are creating. If values are added to NotesFormData, using addComposeItem, and are greater than 30,000 characters in length, you may see unexpected results when composing the document.

Parameters:
form - the data specifying the form to compose
Throws:
NotesException
Since:
8.5.1
See Also:
NotesFormData.getName()

getTemporaryDocument

public Document  getTemporaryDocument(Session session)
                                           throws NotesException 
Returns a new, empty document in a local, temporary database.

Parameters:
session - the current session
Returns:
document in a temporary database
Throws:
NotesException - thrown when temporary document could not be created
Since:
8.5.1

prompt

public Object prompt(int type,
                     String title,
                     String prompt,
                     Object defValue,
                     String[] values)
Displays a dialog box and returns a value based on the user's actions in the dialog box.

Parameters:
type - indicates the type of dialog box that you want to display, values from the Prompt class specifies type
title - the text that you want displayed in the dialog box title bar
prompt - the text that you want displayed within the dialog box
defValue - the value that will be used as your default input value
values - the values that you want displayed in the dialog box's list box, where applicable
Returns:
value selected by the user
Since:
8.5.1

runAgent

public void runAgent(NotesAgentData agentData,
                     NotesDocumentDataCallback callback,
                     boolean runOnUIContext)
Runs the agent represented by the agent data. Pass in false for runOnUIContext to run your agent on a temporary document. Pass in true for runOnUIContext to run your agent on the current selected document in the UI. Values added to the NotesAgentData object, using the addItem method, will be added to the temporary document. Also note with this method you can run an agent from one database on a completely different database. In other words, the agent you are running does not have to run on documents from the same database. While this gives the user more flexibility it also may break some assumptions of the agent, for example what fields are on the document.

When running an agent on a temporary document it is recommended that you set the Target the in the properties dialog of the agent to be 'None'. You can do this while editing the agent in Domino Designer. This allows you to run the agent without having anything selected in the UI. To access the temporary document from your agent, you can use Session.DocumentContext in LotusScript, or Session.getAgentContext().getDocumentContext() in Java. The note id of the temporary document is returned to you in the NotesDocumentDataCallback object.

Formula agents must be run on the UI context. The context must also have a view in order to run formula agents. For example, running a formula agent with the Workspace as the context does not work. When running a formula agent you must pass true to this method for runOnUIContext. As a result of this limitation, formula agents cannot be run on temporary documents.

There is a limit on how large the fields that are added to the temporary document can be. If a value is added to NotesAgentData, using addItem, and it is greater than 30,000 characters in length, you may see unexpected results when running the agent.

Parameters:
agentData - data about the agent to run
callback - callback to run when agent is done running
runOnUIContext - true to run the agent on the current UI context false to run the agent on the temporary document
Since:
8.5.1