Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Developing Applications > New Doc: Read Lotus Notes Text Data via URL in JDeveloper
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Run Lotus Notes Text Data via URL in JDeveloper

Knowledge Sharing Döcu Content Read Lotus Notes Data via URL in JDeveloper XpagesJSF Application Introduction: Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server Current Lotus Notes JavaAgent, code running the actual TXT file ...

New Doc: Read Lotus Notes Text Data via URL in JDeveloper

Knowledge Sharing JDeveloper Read Lotus Notes Data via URL Part 3 Introduction: Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server Going forward , we will be looking at the data through TXT data in URL from Lotus Notes Database, ...

Read Lotus Notes Text Data via URL in JDeveloper

Knowledge Sharing JDeveloper Read Lotus Notes Data via URL Part 3 Introduction: Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server Going forward , we will be looking at the data through TXT data in URL from Lotus Notes ...

Read Lotus Notes Data via URL in JDeveloper

Knowledge Sharing JDeveloper Read Lotus Notes Data via URL Part 3 Introduction: Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server Going forward , we will be looking at the data through TXT data in URL from Lotus Notes ...

Google WorkSheets Xpages App (Google Drive)

Knowledge Sharing Döcu Content Google Worksheets inputText JavaAgentJavaBean Xpages Application System Requirements: Download Domino Designer 8.5.3 Environment (DDE) http:www.ibm.comdeveloperworksdownloadslsdominodesigner Download Make available Google Spreadsheets API ...
Community articleNew Doc: Read Lotus Notes Text Data via URL in JDeveloper
Added by ~Zelda Frokrotexettu on July 24, 2015 | Version 1
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: JDeveloper, Lotus Notes Domino, Xpages and Java

Knowledge Sharing

 

JDeveloper

Read Lotus Notes Data via URL

Part 3

 

Introduction:

Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server

 

 

Going forward, we will be looking at the data through TXT data in URL from Lotus Notes Database, feed the rest of the JDeveloper application. We could as well simply throw the records right into columns on DB2, but here we wanted to demonstrate the interaction between Apps via URL using Java, Xpages, and JSF...

 

 

HTTPDDECSVDataJDevJavaAgent | JavaAgent.java

 

 

the goal is to put it out there as a CSV or TXT file...

 

/**

* Created from copy: 2015.07.04.12.39.PM

* HTTPDDECSVDataJDevJavaAgent

* CSV data for Xpages to be read by Oracle JDeveloper Apps

*/

 

load imports

import lotus.domino.*;

import lotus.domino.local.Database;

import java.io.PrintWriter;

/**

* @author Dököll Solutions, Inc.

* @version 2015.07.04.12.39.PM

*

*/

begin class

public class JavaAgent extends AgentBase {

open method, this actually runs the whole App

public void NotesMain() {

let's add a try catch here, to grab errors near the end

try {

open our session...

Session session = getSession();

load info to console for debugging purposes

System.out

.println("HTTPDDECSVDataJDevJavaAgent System User, We've got a session..."

+ session);

load agentContext

AgentContext agentContext = session.getAgentContext();

...

System.out.println("got HTTPDDECSVDataJDevJavaAgent agentContext..."

+ agentContext);

find database based on session found

Database database = (Database) agentContext.getCurrentDatabase();

Find view in question according to current database

View view = database.getView("IssuesListings");

System.out.println("View Obtained..." + view);

declare document variables

Document currDoc;

Document tempDoc;

grab first doc

currDoc = view.getFirstDocument();

PrintWriter...

PrintWriter pw = getAgentOutput();

System.out

.println("URL: http://localhost/docucontent.nsf/javaagentfeedcsvexternalsites.txt");

 

Content type set at Txt

 TODO: Figure out a better version to load a CSV file to browser

currently, the csv downloads to local directory

pw.println("Content-type:text/txt");

while (currDoc != null) {

write records from view into a Text file and show it in the

browser

pw.println(currDoc.getItemValueString("UserID") + " "

+ currDoc.getItemValueString("PageID") + " "

+ currDoc.getItemValueString("priority") + " "

+ currDoc.getItemValueString("issues"));

 

Get next document

tempDoc = view.getNextDocument(currDoc);

recycle currDoc

currDoc.recycle();

set currDoc to tempDoc

currDoc = tempDoc;

}

 

} catch (Exception e) {

e.printStackTrace();

}

}

}

 

From JDeveloper Side of things

 

Courtesy: http://stackoverflow.com/questions/6259339/how-to-read-a-text-file-directly-from-internet-using-java

 

I can do this in JDeveloper to read the file over

 

import java.net.*;
 import java.io.*;

 public class UrlTextfile {
public static void main(String[] args) throws Exception {

    URL oracle = new URL("http://yoursite.com/yourfile.txt");
    BufferedReader in = new BufferedReader(
    new InputStreamReader(oracle.openStream()));

    String inputLine;
    while ((inputLine = in.readLine()) != null)
        System.out.println(inputLine);
    in.close();
}
 }

 

 

and there you have it, data is in JDeveloper

 


 

 

Notes Database URL, ran from Domino Designer (DDE)

 

 


 

 

 

created button on JSF page launched via JDeveloper

 


 

 

Java Server Pages button

 


 

 

here is the JSF code

 

 

 

 

button text="button 1" id="b1" binding="#{backingBeanScope.backing_jdlotusfeed.b1}"

action="#{backingBeanScope.backing_jdlotusfeed.b1_action}"/>

 

 

 

 

 

Backing Bean, for above code

 

 

 

package com.dokoll.view.backing;

 

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

 

import java.net.MalformedURLException;

import java.net.URL;

 

import oracle.adf.view.rich.component.rich.RichDocument;

import oracle.adf.view.rich.component.rich.RichForm;

import oracle.adf.view.rich.component.rich.nav.RichButton;

 

public class Jdlotusfeed {

private RichForm f1;

private RichDocument d1;

private RichButton b1;

 

public void setF1(RichForm f1) {

this.f1 = f1;

}

 

public RichForm getF1() {

return f1;

}

 

public void setD1(RichDocument d1) {

this.d1 = d1;

}

 

public RichDocument getD1() {

return d1;

}

 

public void setB1(RichButton b1) {

this.b1 = b1;

}

 

public RichButton getB1() {

return b1;

}

 

@SuppressWarnings("oracle.jdeveloper.java.nested-assignment")

public String b1_action() throws MalformedURLException, IOException {

Add event code here...

 

URL lotuNotesURL = new URL("http:localhost/docucontent.nsf/javaagentfeedcsvexternalsites.txt");

 

BufferedReader in = new BufferedReader(

new InputStreamReader(lotuNotesURL.openStream()));

 

String inputLine=null;

 

while ((inputLine = in.readLine()) != null)

System.out.println(inputLine);

in.close();

 

 

return null;

}

}

 

 

 

 

 

 

 

 

version: 2015.07.05.12.08.AM

 

  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (1)Jul 24, 2015, 3:15:28 AM~Zelda Frokrotexettu  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility