INTEGRATION: CWS sdksample (1.4.40); FILE MERGED

2005/01/18 15:52:16 jsc 1.4.40.3: #i29308# generate output in the output directory
2004/06/16 09:43:22 jsc 1.4.40.2: #i29308# explicit imports
2004/06/14 08:33:39 jsc 1.4.40.1: #i29308# use of new UNO bootstrap feature
This commit is contained in:
Rüdiger Timm 2005-01-31 15:57:11 +00:00
parent c6b8ef355e
commit ec9fcfe3e4

View file

@ -2,9 +2,9 @@
*
* $RCSfile: ChildrenRetriever.java,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: hr $ $Date: 2004-02-02 20:04:32 $
* last change: $Author: rt $ $Date: 2005-01-31 16:57:11 $
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
@ -38,13 +38,19 @@
*
*************************************************************************/
// base classes
import com.sun.star.ucb.*;
import com.sun.star.sdbc.XRow;
import com.sun.star.sdbc.XResultSet;
import com.sun.star.ucb.OpenCommandArgument2;
import com.sun.star.ucb.OpenMode;
import com.sun.star.ucb.XContent;
import com.sun.star.ucb.XContentAccess;
import com.sun.star.ucb.XDynamicResultSet;
import com.sun.star.beans.Property;
import com.sun.star.uno.UnoRuntime;
import java.util.*;
import com.sun.star.sdbc.XRow;
import com.sun.star.sdbc.XResultSet;
import java.util.Vector;
import java.util.Enumeration;
import java.util.StringTokenizer;
/**
* Retrieve the Children of a UCB Folder Content
@ -56,7 +62,6 @@ public class ChildrenRetriever {
*/
private Helper m_helper;
private XContent m_content;
private String m_connectString = "";
private String m_contenturl = "";
private Vector m_propnames = new Vector();
@ -64,9 +69,8 @@ public class ChildrenRetriever {
* Constructor. Create a new connection with the specific args to a running office
*
*@param String[] This construtor requires the arguments:
* -connect=socket,host=..., port=...
* -url=..
* -propNames=... (optional).
* -url=... (optional)
* -propNames=... (optional)
* See Help (method printCmdLineUsage()).
* Without the arguments a new connection to a
* running office cannot created.
@ -76,11 +80,9 @@ public class ChildrenRetriever {
// Parse arguments
parseArguments( args );
String connect = getConnect();
String url = getContentURL();
// Init
m_helper = new Helper( connect, url );
m_helper = new Helper( getContentURL() );
// Create UCB content
m_content = m_helper.createUCBContent();
@ -186,15 +188,6 @@ public class ChildrenRetriever {
return m_contenturl;
}
/**
* Get source data connection.
*
*@return String That contains the source data connection
*/
public String getConnect() {
return m_connectString;
}
/**
* Get the properties.
*
@ -213,9 +206,7 @@ public class ChildrenRetriever {
public void parseArguments( String[] args ) throws java.lang.Exception {
for ( int i = 0; i < args.length; i++ ) {
if ( args[i].startsWith( "-connect=" )) {
m_connectString = args[i].substring( 9 );
} else if ( args[i].startsWith( "-url=" )) {
if ( args[i].startsWith( "-url=" )) {
m_contenturl = args[i].substring( 5 );
} else if ( args[i].startsWith( "-propNames=" )) {
StringTokenizer tok
@ -231,10 +222,6 @@ public class ChildrenRetriever {
}
}
if ( m_connectString == null || m_connectString.equals( "" )) {
m_connectString = "socket,host=localhost,port=2083";
}
if ( m_contenturl == null || m_contenturl.equals( "" )) {
m_contenturl = "file:///";
}
@ -250,9 +237,9 @@ public class ChildrenRetriever {
*/
public void printCmdLineUsage() {
System.out.println(
"Usage : ChildrenRetriever -connect=socket,host=...,port=... -url=... -propNames=..." );
"Usage : ChildrenRetriever -url=... -propNames=..." );
System.out.println(
"Defaults: -connect=socket,host=localhost,port=2083 -url=file:/// -propNames=Title,IsDocument" );
"Defaults: -url=file:/// -propNames=Title,IsDocument" );
System.out.println(
"\nExample : -url=file:///temp/ -propNames=Title;IsFolder;IsDocument" );
}