This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 15, 2011, 7:00 AM
9 Posts

Re: Writing files out from java in xpages

  • Category: Managed Beans in NSF
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Java Files FileOutputStream
  • Replies: 4
 Toby,
 
I seem to think that in traditional Notes/Domino land, if the Domino server is running as a Windows server "service" then it does not have the necessary security credentials to write to external shares. 
 
Keith 
Apr 15, 2011, 12:53 PM
39 Posts
Re: Writing files out from java in xpages
Does anyone know why you can't write them out,  The service is running under Local System, I have that system setup as a reader/writer on the share.
 
Thanks
-Toby
May 9, 2011, 3:35 PM
63 Posts
Re: Writing files out from java in xpages
I came accross this issue as well..  works in Eclipse Ganymede, do not in DDE.  Below is a sample I worked with:
 
[CODE] 
 
/**
 * Created: 2011.02.27.12.07.AM
 * Added to grab state list
 * Courtesy: http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html
 */
package com.osc.blackberry.outbound;
/**
 * @author Köll S. Cherizard
 * @version: 2011.02.27.12.07.AM
 *
 */
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class XMLReader {
 public static void main(String argv[]) {
  try {
   //TO DO: Load file from Application or properties file
   //2011.02.27.12.17.AM
  //File file = new File("c:\\temp\\XML_DATA\\StateList.xml");
  File file = new File("..\\files\\StateList.xml");
  DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  DocumentBuilder db = dbf.newDocumentBuilder();
  Document doc = db.parse(file);
  doc.getDocumentElement().normalize();
  System.out.println("Root element " + doc.getDocumentElement().getNodeName());
  NodeList nodeLst = doc.getElementsByTagName("states");
  System.out.println("Information of all States");
  for (int s = 0; s < nodeLst.getLength(); s++) {
    Node fstNode = nodeLst.item(s);
   
    if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
 
           Element fstElmnt = (Element) fstNode;
      NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("statename");
      Element fstNmElmnt = (Element) fstNmElmntLst.item(0);
      NodeList fstNm = fstNmElmnt.getChildNodes();
      System.out.println("State Name : "  + ((Node) fstNm.item(0)).getNodeValue());
      NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("cityname");
      Element lstNmElmnt = (Element) lstNmElmntLst.item(0);
      NodeList lstNm = lstNmElmnt.getChildNodes();
      System.out.println("City Name : " + ((Node) lstNm.item(0)).getNodeValue());
    }
  }
  } catch (Exception e) {
    e.printStackTrace();
  }
 }

[/CODE] 
 
Have you considered throwing the data in the browser, and grab it with Xpages that way, via SSJS; you probably have already tried that option (if not search XML as datasource)...  You can actually write addtional Java code to feed the XML data to Xpages.
 
I currently have a Java option working, still needs work but I'll post it when complete...
 
In a bit! 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal