Getting the most from the Notes Java UI API’s

If you are doing any plugin development for Lotus Notes then you need to check out the OpenNTF project Java UI API Exerciser. The project is a pretty good reference and usage of the Java API’s we will be talking about at Lotusphere. The tool can also be used to inspect documents, views, etc and the different properties each of them have in the Eclipse world.

9 thoughts on “Getting the most from the Notes Java UI API’s

  1. Cool stuff.

    You have figured out a way for a sidebar app to refresh the active view have you? The only thing I’ve come up with is send keys which is a real pain, and too unreliable for real world use.

    Like

  2. Pingback: Bob Balfe: Getting the most from the Notes Java UI API’s

  3. Hi Carl, no there is no API to refresh the view yet. I actually would not be something that is too hard to do, however we didn’t get to it in 8.5.2. It will be something we can consider for the future.

    Like

  4. Adding NotesUIView.refresh() to the UI API is a good idea.
    But there is a way to solve this in 8.5.1/8.5.2:
    Put “NotesUIWorkspace.ViewRefresh” in a LotusScript agent and call it with the UI API function NotesUIWorkspace.runAgent.

    (Documentation link: http://public.dhe.ibm.com/software/dw/lotus/Domino-Designer/JavaDocs/NotesClientJavaUIAPIs/v852/com/ibm/notes/java/ui/NotesUIWorkspace.html#runAgent(com.ibm.notes.java.api.data.NotesAgentData, com.ibm.notes.java.ui.callbacks.NotesDocumentDataCallback, boolean) )

    Like

  5. altough a while ago..
    I stumbled over the same problem..
    So in case you want to refresh a view, this might help:

    use case: users want to drag’n’drop emails from their Inbox to a Eclipse Plugin. When CTRL is being pressed, the documents has to be MOVED (copied and then removed from inbox).

    After the copy function, i used this code to refresh the view:

    //first, get the current UI View
    NotesUIWorkspace nw = new NotesUIWorkspace();
    NotesUIView vw = (NotesUIView) nw.getCurrentElement();

    //then retrieve it’s data
    String viewName = vw.getViewData().getName();
    String repid = vw.getViewData().getDatabaseData().getReplicaId();
    String server = vw.getViewData().getDatabaseData().getServer();

    //Calling the UTIL method to get the view from the view pool (do not forget to recycle at the end!)
    View vwBackend = ViewUtil.getView(server, repid, viewName);
    vwBackend.refresh();

    //now open the refreshed view again.. it won’t open a new window, since the view is already open 🙂
    String url = vw.getUrl();
    nw.openUrl(url);

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s