/Java

Read a Single XML File in Java

The following should complement the supplied article for reading XML files (DCRs) based on a directory.  This will read the contents of a singe file package com.littleforest.examples; import com.interwoven.livesite.dom4j.Dom4jUtils; import com.interwoven.livesite.external.ParameterHash; import com.interwoven.livesite.runtime.RequestContext; import com.interwoven.livesite.external.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.*; import org.dom4j.*; import java.util.Properties; /* Added for proxy use */ [...]

By |2017-11-30T10:42:09+00:00March 2nd, 2009|Articles, Java|0 Comments

Read List of XML Files from Directory Tree in Java

This is a TeamSite 6.7.2/LiveSite 3.1 compliant mechanism that can be used to read all DCR files into a single XML files for further processing: package com.littleforest.examples; import com.interwoven.livesite.dom4j.Dom4jUtils; import com.interwoven.livesite.external.ParameterHash; import com.interwoven.livesite.runtime.RequestContext; import com.interwoven.livesite.file.FileDALIfc; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.*; import org.dom4j.*; import java.util.Properties; /* Added for proxy use [...]

By |2017-10-05T16:08:19+00:00March 2nd, 2009|Articles, Java|0 Comments

Compiling Java Classes in LiveSite 3.0.2

Java classes created in TeamSite & LiveSite reference many other Java files.  These files are located in a different directory of TeamSite, so are referred to as external files to the location where Java classes. The problem with compiling a Java class comes when the Java file to be compiled looks for these reference files, [...]

By |2009-01-20T14:12:57+00:00January 20th, 2009|Java, LiveSite, TeamSite|0 Comments

Getting MultipleSelect values in a Java External

It is often useful to setup a "Multi-Select Datum" in a LiveSite component, but how do you write the Java external to receive this array of parameters? The following code snippet from Raj Shekhawat shows you how: //LiveSite returns Multiple select values in the form of ArrayList object //Searchproperties is my parameter name ArrayList selectedProperties= [...]

By |2008-09-23T23:24:50+00:00September 23rd, 2008|Java, LiveSite|0 Comments

Creating a “Hello World” LiveSite Java External

I wanted to demonstrate the bare bones Hello World for LiveSite 3.x Java External Component, so here it is (if you can reduce this to being even simpler then please let us know): package com.littleforest.examples; import com.interwoven.livesite.dom4j.Dom4jUtils; import com.interwoven.livesite.runtime.RequestContext; import org.dom4j.Document; public class Hello { public static Document hello(RequestContext context) { Document doc = Dom4jUtils.newDocument(""); [...]

By |2008-07-04T14:55:06+00:00July 4th, 2008|Java, LiveSite|0 Comments