You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2010/07/06 21:45:54 UTC
svn commit: r960994 [1/2] - in /incubator/lcf/trunk/modules: ./
connectors/jcifs/ framework/ framework/core/org/apache/lcf/core/common/
framework/core/org/apache/lcf/core/interfaces/
framework/core/org/apache/lcf/core/system/ framework/crawler-ui/ fram...
Author: kwright
Date: Tue Jul 6 19:45:53 2010
New Revision: 960994
URL: http://svn.apache.org/viewvc?rev=960994&view=rev
Log:
Second checkin for example development. The jetty example is now delivered into the dist/example area under modules, and a connectors.xml file is introduced which describes the connectors that should be preregistered, and running the jetty example performs the preregistration.
Added:
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java (with props)
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java (with props)
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java (with props)
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFResourceLoader.java
- copied, changed from r960055, incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/LCFResourceLoader.java
incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml (with props)
incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java (with props)
Removed:
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/LCFResourceLoader.java
Modified:
incubator/lcf/trunk/modules/build.xml
incubator/lcf/trunk/modules/connectors/jcifs/build.xml
incubator/lcf/trunk/modules/framework/build.xml
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/XMLDoc.java
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigNode.java
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigParams.java
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Specification.java
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/SpecificationNode.java
incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCF.java
incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp
incubator/lcf/trunk/modules/framework/jetty-example/lcf.sh
incubator/lcf/trunk/modules/framework/jetty-example/properties.xml
incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/LCFJettyRunner.java
Modified: incubator/lcf/trunk/modules/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/build.xml?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/build.xml (original)
+++ incubator/lcf/trunk/modules/build.xml Tue Jul 6 19:45:53 2010
@@ -504,6 +504,144 @@
</copy>
</target>
+ <target name="cleanup-example">
+ <delete file="dist/example/connectors.xml"/>
+ </target>
+
+ <target name="deliver-framework-example" depends="cleanup-example,build-framework">
+ <mkdir dir="dist/example"/>
+ <copy todir="dist/example">
+ <fileset dir="framework/dist/example"/>
+ </copy>
+ </target>
+
+ <target name="deliver-activedirectory-example" depends="deliver-framework-example,build-activedirectory-connector,calculate-activedirectory-condition" if="activedirectory.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/activedirectory/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <authorityconnector name="Active Directory" class="org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority"/>"/>
+ </target>
+
+ <target name="deliver-documentum-example" depends="deliver-framework-example,build-documentum-connector,calculate-documentum-condition" if="documentum.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/documentum/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <authorityconnector name="Documentum" class="org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector"/>"/>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="Documentum" class="org.apache.lcf.crawler.connectors.DCTM.DCTM"/>"/>
+ </target>
+
+ <target name="deliver-filesystem-example" depends="deliver-framework-example,build-filesystem-connector,calculate-filesystem-condition" if="filesystem.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/filesystem/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="File system" class="org.apache.lcf.crawler.connectors.filesystem.FileConnector"/>"/>
+ </target>
+
+ <target name="deliver-filenet-example" depends="deliver-framework-example,build-filenet-connector,calculate-filenet-condition" if="filenet.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/filenet/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="FileNet" class="org.apache.lcf.crawler.connectors.filenet.FilenetConnector"/>"/>
+ </target>
+
+ <target name="deliver-gts-example" depends="deliver-framework-example,build-gts-connector,calculate-gts-condition" if="gts.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/gts/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your output connectors here -->" value="<!-- Add your output connectors here -->
 <outputconnector name="MetaCarta GTS" class="org.apache.lcf.agents.output.gts.GTSConnector"/>"/>
+ </target>
+
+ <target name="deliver-jcifs-example" depends="deliver-framework-example,build-jcifs-connector,calculate-jcifs-condition" if="jcifs.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/jcifs/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="Windows shares" class="org.apache.lcf.crawler.connectors.sharedrive.SharedDriveConnector"/>"/>
+ </target>
+
+ <target name="deliver-jdbc-example" depends="deliver-framework-example,build-jdbc-connector,calculate-jdbc-condition" if="jdbc.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/jdbc/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="JDBC" class="org.apache.lcf.crawler.connectors.jdbc.JDBCConnector"/>"/>
+ </target>
+
+ <target name="deliver-livelink-example" depends="deliver-framework-example,build-livelink-connector,calculate-livelink-condition" if="livelink.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/livelink/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <authorityconnector name="LiveLink" class="org.apache.lcf.crawler.connectors.livelink.LivelinkAuthority"/>"/>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="LiveLink" class="org.apache.lcf.crawler.connectors.livelink.LivelinkConnector"/>"/>
+ </target>
+
+ <target name="deliver-memex-example" depends="deliver-framework-example,build-memex-connector,calculate-memex-condition" if="memex.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/memex/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <authorityconnector name="Memex Patriarch" class="org.apache.lcf.crawler.connectors.memex.MemexAuthority"/>"/>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="Memex Patriarch" class="org.apache.lcf.crawler.connectors.memex.MemexConnector"/>"/>
+ </target>
+
+ <target name="deliver-meridio-example" depends="deliver-framework-example,build-meridio-connector,calculate-meridio-condition" if="meridio.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/meridio/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <authorityconnector name="Meridio" class="org.apache.lcf.crawler.connectors.meridio.MeridioAuthority"/>"/>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="Meridio" class="org.apache.lcf.crawler.connectors.meridio.MeridioConnector"/>"/>
+ </target>
+
+ <target name="deliver-nulloutput-example" depends="deliver-framework-example,build-nulloutput-connector,calculate-nulloutput-condition" if="nulloutput.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/nulloutput/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your output connectors here -->" value="<!-- Add your output connectors here -->
 <outputconnector name="Null" class="org.apache.lcf.agents.output.nullconnector.NullConnector"/>"/>
+ </target>
+
+ <target name="deliver-rss-example" depends="deliver-framework-example,build-rss-connector,calculate-rss-condition" if="rss.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/rss/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="RSS" class="org.apache.lcf.crawler.connectors.rss.RSSConnector"/>"/>
+ </target>
+
+ <target name="deliver-sharepoint-example" depends="deliver-framework-example,build-sharepoint-connector,calculate-sharepoint-condition" if="sharepoint.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/sharepoint/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="SharePoint" class="org.apache.lcf.crawler.connectors.sharepoint.SharePointRepository"/>"/>
+ </target>
+
+ <target name="deliver-solr-example" depends="deliver-framework-example,build-solr-connector,calculate-solr-condition" if="solr.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/solr/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your output connectors here -->" value="<!-- Add your output connectors here -->
 <outputconnector name="Solr" class="org.apache.lcf.agents.output.solr.SolrConnector"/>"/>
+ </target>
+
+ <target name="deliver-webcrawler-example" depends="deliver-framework-example,build-webcrawler-connector,calculate-webcrawler-condition" if="webcrawler.include">
+ <mkdir dir="dist/example/connector-lib"/>
+ <copy todir="dist/example/connector-lib">
+ <fileset dir="connectors/webcrawler/dist/lib"/>
+ </copy>
+ <replace file="dist/example/connectors.xml" token="<!-- Add your repository connectors here -->" value="<!-- Add your repository connectors here -->
 <repositoryconnector name="Web" class="org.apache.lcf.crawler.connectors.webcrawler.WebcrawlerConnector"/>"/>
+ </target>
+
+ <target name="deliver-example" depends="deliver-framework-example,deliver-activedirectory-example,deliver-documentum-example,deliver-filesystem-example,deliver-filenet-example,deliver-gts-example,deliver-jcifs-example,deliver-jdbc-example,deliver-livelink-example,deliver-memex-example,deliver-meridio-example,deliver-nulloutput-example,deliver-rss-example,deliver-sharepoint-example,deliver-solr-example,deliver-webcrawler-example">
+ </target>
+
<target name="calculate-tests-condition" depends="calculate-filesystem-condition,calculate-nulloutput-condition">
<condition property="tests.include">
<and>
@@ -560,7 +698,7 @@
<target name="deliver-proprietary-connectors" depends="deliver-documentum-connector,deliver-filenet-connector,deliver-livelink-connector,deliver-memex-connector,deliver-meridio-connector,deliver-sharepoint-connector"/>
- <target name="all" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors,run-tests"/>
+ <target name="all" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors,deliver-example,run-tests"/>
</project>
Modified: incubator/lcf/trunk/modules/connectors/jcifs/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/jcifs/build.xml?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/jcifs/build.xml (original)
+++ incubator/lcf/trunk/modules/connectors/jcifs/build.xml Tue Jul 6 19:45:53 2010
@@ -47,9 +47,6 @@
<mkdir dir="dist/lib"/>
<copy todir="dist/lib" file="build/jar/lcf-jcifs-connector.jar"/>
<copy todir="dist/lib">
- <fileset dir="lib">
- <include name="poi*.jar"/>
- </fileset>
<fileset dir="jcifs" includes="*.jar"/>
</copy>
</target>
Modified: incubator/lcf/trunk/modules/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/build.xml?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/build.xml (original)
+++ incubator/lcf/trunk/modules/framework/build.xml Tue Jul 6 19:45:53 2010
@@ -79,6 +79,7 @@
</fileset>
<pathelement location="build/core/classes"/>
<pathelement location="build/agents/classes"/>
+ <pathelement location="build/pull-agent/classes"/>
</classpath>
</javac>
</target>
@@ -287,9 +288,9 @@
</copy>
</target>
- <target name="jetty-runner" depends="war-crawler-ui,war-authority-service,jar-jetty-runner,jar-core,jar-agents,jar-pull-agent">
- <mkdir dir="dist/jetty-runner/lib"/>
- <copy todir="dist/jetty-runner/lib">
+ <target name="example" depends="war-crawler-ui,war-authority-service,jar-jetty-runner,jar-core,jar-agents,jar-pull-agent">
+ <mkdir dir="dist/example/lib"/>
+ <copy todir="dist/example/lib">
<fileset dir="lib">
<include name="commons-codec*.jar"/>
<include name="commons-collections*.jar"/>
@@ -317,7 +318,7 @@
<include name="derby*.jar"/>
</fileset>
</copy>
- <copy todir="dist/jetty-runner/lib">
+ <copy todir="dist/example/lib">
<fileset dir="build/jar">
<include name="lcf-core.jar"/>
<include name="lcf-ui-core.jar"/>
@@ -326,15 +327,16 @@
<include name="lcf-jetty-runner.jar"/>
</fileset>
</copy>
- <mkdir dir="dist/jetty-runner/war"/>
- <copy todir="dist/jetty-runner/war">
+ <mkdir dir="dist/example/war"/>
+ <copy todir="dist/example/war">
<fileset dir="dist/web/war"/>
</copy>
- <mkdir dir="dist/jetty-runner/connector-lib"/>
- <mkdir dir="dist/jetty-runner/logs"/>
- <copy todir="dist/jetty-runner">
+ <mkdir dir="dist/example/connector-lib"/>
+ <mkdir dir="dist/example/logs"/>
+ <copy todir="dist/example">
<fileset dir="jetty-example">
<include name="properties.xml"/>
+ <include name="connectors.xml"/>
<include name="logging.ini"/>
<include name="executecommand.sh"/>
<include name="lcf.sh"/>
@@ -392,6 +394,6 @@
</junit>
</target>
- <target name="all" depends="processes,war-authority-service,war-crawler-ui,jetty-runner,doc,tests,run-tests"/>
+ <target name="all" depends="processes,war-authority-service,war-crawler-ui,example,doc,tests,run-tests"/>
</project>
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/XMLDoc.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/XMLDoc.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/XMLDoc.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/XMLDoc.java Tue Jul 6 19:45:53 2010
@@ -27,7 +27,7 @@ import javax.xml.parsers.*;
import org.xml.sax.*;
import org.w3c.dom.*;
-import org.apache.lcf.core.interfaces.*;
+import org.apache.lcf.core.interfaces.LCFException;
public class XMLDoc
{
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigNode.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigNode.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigNode.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigNode.java Tue Jul 6 19:45:53 2010
@@ -21,72 +21,33 @@ package org.apache.lcf.core.interfaces;
import java.io.*;
import java.util.*;
-/** This class represents a node in a configuration structure.
+/** This class represents a node in a repository configuration structure. Its existence apart from ConfigurationNode is
+* largely a relic.
*/
-public class ConfigNode
+public class ConfigNode extends ConfigurationNode
{
public static final String _rcsid = "@(#)$Id$";
- // Member variables
- protected ArrayList children = new ArrayList();
- protected HashMap attributes = new HashMap();
- protected String type = null;
- protected String value = null;
-
/** Constructor.
*/
public ConfigNode(String type)
{
- this.type = type;
- }
-
- /** Duplicate.
- *@return the duplicate.
- */
- public ConfigNode duplicate()
- {
- ConfigNode rval = new ConfigNode(type);
- rval.value = value;
- rval.attributes = (HashMap)attributes.clone();
- int i = 0;
- while (i < children.size())
- {
- ConfigNode node = (ConfigNode)children.get(i++);
- rval.children.add(node.duplicate());
- }
- return rval;
- }
-
- /** Get type.
- *@return the node type.
- */
- public String getType()
- {
- return type;
+ super(type);
}
- /** Set value.
- *@param value is the value to set.
+ /** Create a new node of this same type and class.
*/
- public void setValue(String value)
+ protected ConfigurationNode createNewNode()
{
- this.value = value;
+ return new ConfigNode(type);
}
-
- /** Get value.
- *@return the value.
- */
- public String getValue()
- {
- return value;
- }
-
- /** Get child count.
- *@return the count.
+
+ /** Duplicate.
+ *@return the duplicate.
*/
- public int getChildCount()
+ public ConfigNode duplicate(boolean readOnly)
{
- return children.size();
+ return (ConfigNode)createDuplicate(readOnly);
}
/** Get child n.
@@ -95,119 +56,7 @@ public class ConfigNode
*/
public ConfigNode getChild(int index)
{
- return (ConfigNode)children.get(index);
- }
-
- /** Remove child n.
- *@param index is the child to remove.
- */
- public void removeChild(int index)
- {
- children.remove(index);
- }
-
- /** Add child at specified position.
- *@param index is the position to add the child.
- *@param child is the child to add.
- */
- public void addChild(int index, ConfigNode child)
- {
- children.add(index,child);
- }
-
- /** Set an attribute.
- *@param attribute is the name of the attribute.
- *@param value is the value of the attribute (null to remove it).
- */
- public void setAttribute(String attribute, String value)
- {
- if (value == null)
- attributes.remove(attribute);
- else
- attributes.put(attribute,value);
- }
-
- /** Iterate over attributes.
- *@return the attribute iterator.
- */
- public Iterator getAttributes()
- {
- return attributes.keySet().iterator();
- }
-
- /** Get an attribute value.
- *@param attribute is the name of the attribute.
- *@return the value.
- */
- public String getAttributeValue(String attribute)
- {
- return (String)attributes.get(attribute);
- }
-
- /** Calculate a hashcode */
- public int hashCode()
- {
- int rval = type.hashCode();
- if (value != null)
- rval += value.hashCode();
- Iterator iter = attributes.keySet().iterator();
- // Make sure this is not sensitive to order!
- while (iter.hasNext())
- {
- String key = (String)iter.next();
- String attrValue = (String)attributes.get(key);
- rval += key.hashCode() + attrValue.hashCode();
- }
- // Do children
- int i = 0;
- while (i < children.size())
- {
- rval += children.get(i++).hashCode();
- }
- return rval;
- }
-
- /** Check if equals */
- public boolean equals(Object o)
- {
- if (!(o instanceof ConfigNode))
- return false;
- ConfigNode n = (ConfigNode)o;
- if (attributes.size() != n.attributes.size())
- return false;
- if (children.size() != n.children.size())
- return false;
- if (!type.equals(n.type))
- return false;
- if (value == null || n.value == null)
- {
- if (value != n.value)
- return false;
- }
- else
- {
- if (!value.equals(n.value))
- return false;
- }
- Iterator iter = attributes.keySet().iterator();
- while (iter.hasNext())
- {
- String key = (String)iter.next();
- String attrValue = (String)attributes.get(key);
- String nAttrValue = (String)n.attributes.get(key);
- if (nAttrValue == null || !attrValue.equals(nAttrValue))
- return false;
- }
- int i = 0;
- while (i < children.size())
- {
- ConfigNode child = (ConfigNode)children.get(i);
- ConfigNode nChild = (ConfigNode)n.children.get(i);
- if (!child.equals(nChild))
- return false;
- i++;
- }
- return true;
+ return (ConfigNode)findChild(index);
}
}
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigParams.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigParams.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigParams.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigParams.java Tue Jul 6 19:45:53 2010
@@ -27,7 +27,7 @@ import org.apache.lcf.core.common.XMLDoc
/** This class represents a set of configuration parameters, with structure, which is a generalized hierarchy of nodes that
* can be interpreted by a repository or authority connector in an appropriate way.
*/
-public class ConfigParams
+public class ConfigParams extends Configuration
{
public static final String _rcsid = "@(#)$Id$";
@@ -35,9 +35,6 @@ public class ConfigParams
protected final static String PARAMETER_TYPE = "_PARAMETER_";
protected final static String ATTR_NAME = "name";
-
- // The children
- protected ArrayList children = new ArrayList();
// The parameter map (which stores name/value pairs also listed in the children)
protected HashMap params = new HashMap();
@@ -45,6 +42,7 @@ public class ConfigParams
*/
public ConfigParams()
{
+ super();
}
/** Constructor.
@@ -53,6 +51,7 @@ public class ConfigParams
*/
public ConfigParams(Map map)
{
+ super();
Iterator iter = map.keySet().iterator();
while (iter.hasNext())
{
@@ -61,8 +60,7 @@ public class ConfigParams
ConfigNode cn = new ConfigNode(PARAMETER_TYPE);
cn.setAttribute(ATTR_NAME,key);
cn.setValue(value);
- children.add(cn);
- params.put(key,value);
+ addChild(getChildCount(),cn);
}
}
@@ -72,6 +70,7 @@ public class ConfigParams
public ConfigParams(String xml)
throws LCFException
{
+ super();
fromXML(xml);
}
@@ -81,150 +80,64 @@ public class ConfigParams
public ConfigParams(InputStream xmlstream)
throws LCFException
{
+ super();
fromXML(xmlstream);
}
- /** Get as XML
- *@return the xml corresponding to these ConfigParams.
+ /** Return the root node type.
+ *@return the node type name.
*/
- public String toXML()
- throws LCFException
+ protected String getRootNodeLabel()
{
- XMLDoc doc = new XMLDoc();
- // name of root node in definition
- Object top = doc.createElement(null,"configuration");
- // Now, go through all children
- int i = 0;
- while (i < children.size())
- {
- ConfigNode node = (ConfigNode)children.get(i++);
- writeNode(doc,top,node);
- }
-
- return doc.getXML();
+ return "configuration";
}
-
- /** Write a specification node.
- *@param doc is the document.
- *@param parent is the parent.
- *@param node is the node.
+
+ /** Create a new object of the appropriate class.
*/
- protected static void writeNode(XMLDoc doc, Object parent, ConfigNode node)
- throws LCFException
+ protected Configuration createNew()
{
- // Get the type
- String type = node.getType();
- String value = node.getValue();
- Object o = doc.createElement(parent,type);
- Iterator iter = node.getAttributes();
- while (iter.hasNext())
- {
- String attribute = (String)iter.next();
- String attrValue = node.getAttributeValue(attribute);
- // Add to the element
- doc.setAttribute(o,attribute,attrValue);
- }
-
- if (value != null)
- doc.createText(o,value);
- // Now, do children
- int i = 0;
- while (i < node.getChildCount())
- {
- ConfigNode child = node.getChild(i++);
- writeNode(doc,o,child);
- }
+ return new ConfigParams();
}
- /** Read from XML.
- *@param xml is the input XML.
+ /** Create a new child node of the appropriate type and class.
*/
- public void fromXML(String xml)
- throws LCFException
+ protected ConfigurationNode createNewNode(String type)
{
- XMLDoc doc = new XMLDoc(xml);
- initializeFromDoc(doc);
+ return new ConfigNode(type);
}
- /** Read from an XML binary stream.
- *@param xmlstream is the input XML stream. Does NOT close the stream.
+ /** Note the removal of all outer nodes.
*/
- public void fromXML(InputStream xmlstream)
- throws LCFException
+ protected void clearOuterNodes()
{
- XMLDoc doc = new XMLDoc(xmlstream);
- initializeFromDoc(doc);
+ params.clear();
}
-
- protected void initializeFromDoc(XMLDoc doc)
- throws LCFException
+
+ /** Note the addition of a new outer node.
+ *@param node is the node that was just read.
+ */
+ protected void addOuterNode(ConfigurationNode node)
{
- children.clear();
- params.clear();
- ArrayList list = new ArrayList();
- doc.processPath(list, "*", null);
-
- if (list.size() != 1)
- {
- throw new LCFException("Bad xml - missing outer 'configuration' node - there are "+Integer.toString(list.size())+" nodes");
- }
- Object parent = list.get(0);
- if (!doc.getNodeName(parent).equals("configuration"))
- throw new LCFException("Bad xml - outer node is not 'configuration'");
-
- list.clear();
- doc.processPath(list, "*", parent);
-
- // Outer level processing.
- int i = 0;
- while (i < list.size())
+ if (node.getType().equals(PARAMETER_TYPE))
{
- Object o = list.get(i++);
- ConfigNode node = readNode(doc,o);
- children.add(node);
- // Populate the params too.
- if (node.getType().equals(PARAMETER_TYPE))
- {
- String name = node.getAttributeValue(ATTR_NAME);
- String value = node.getValue();
- if (name != null && value != null)
- params.put(name,value);
- }
+ String name = node.getAttributeValue(ATTR_NAME);
+ String value = node.getValue();
+ if (name != null && value != null)
+ params.put(name,value);
}
}
-
- /** Read a specification node from XML.
- *@param doc is the document.
- *@param object is the object.
- *@return the specification node.
+
+ /** Note the removal of an outer node.
+ *@param node is the node that was just removed.
*/
- protected static ConfigNode readNode(XMLDoc doc, Object object)
- throws LCFException
+ protected void removeOuterNode(ConfigurationNode node)
{
- String type = doc.getNodeName(object);
- ConfigNode rval = new ConfigNode(type);
- String value = doc.getData(object);
- rval.setValue(value);
- // Do attributes
- ArrayList list = doc.getAttributes(object);
- int i = 0;
- while (i < list.size())
- {
- String attribute = (String)list.get(i++);
- String attrValue = doc.getValue(object,attribute);
- rval.setAttribute(attribute,attrValue);
- }
- // Now, do children
- list.clear();
- doc.processPath(list,"*",object);
- i = 0;
- while (i < list.size())
+ if (node.getType().equals(PARAMETER_TYPE))
{
- Object o = list.get(i);
- ConfigNode node = readNode(doc,o);
- rval.addChild(i++,node);
+ String name = node.getAttributeValue(ATTR_NAME);
+ if (name != null)
+ params.remove(name);
}
- return rval;
}
/** Get a parameter value.
@@ -286,8 +199,7 @@ public class ConfigParams
ConfigNode cn = new ConfigNode(PARAMETER_TYPE);
cn.setAttribute(ATTR_NAME,key);
cn.setValue(value);
- children.add(cn);
- params.put(key,value);
+ addChild(getChildCount(),cn);
}
/** Set an obfuscated parameter.
@@ -323,106 +235,16 @@ public class ConfigParams
*/
public ConfigParams duplicate()
{
- ConfigParams rval = new ConfigParams();
- int i = 0;
- while (i < children.size())
- {
- ConfigNode node = (ConfigNode)children.get(i++);
- rval.children.add(node.duplicate());
- if (node.getType().equals(PARAMETER_TYPE))
- {
- String name = node.getAttributeValue(ATTR_NAME);
- String value = node.getValue();
- if (value != null)
- rval.params.put(name,value);
- }
- }
- return rval;
+ return (ConfigParams)createDuplicate(false);
}
- /** Get child count.
- *@return the count.
- */
- public int getChildCount()
- {
- return children.size();
- }
-
- /** Get child n.
- *@param index is the child number.
- *@return the child node.
+ /** Get child node.
+ *@param index is the node number.
+ *@return the node.
*/
public ConfigNode getChild(int index)
{
- return (ConfigNode)children.get(index);
- }
-
- /** Remove child n.
- *@param index is the child to remove.
- */
- public void removeChild(int index)
- {
- ConfigNode node = (ConfigNode)children.remove(index);
- if (node.getType().equals(PARAMETER_TYPE))
- {
- String name = node.getAttributeValue(ATTR_NAME);
- if (name != null)
- params.remove(name);
- }
+ return (ConfigNode)findChild(index);
}
-
- /** Add child at specified position.
- *@param index is the position to add the child.
- *@param child is the child to add.
- */
- public void addChild(int index, ConfigNode child)
- {
- children.add(index,child);
- if (child.getType().equals(PARAMETER_TYPE))
- {
- String name = child.getAttributeValue(ATTR_NAME);
- String value = child.getValue();
- if (name != null && value != null)
- params.put(name,value);
- }
- }
-
- /** Clear children.
- */
- public void clearChildren()
- {
- children.clear();
- params.clear();
- }
-
- /** Calculate a hash code */
- public int hashCode()
- {
- int rval = 0;
- int i = 0;
- while (i < children.size())
- {
- rval += children.get(i++).hashCode();
- }
- return rval;
- }
-
- /** Do a comparison */
- public boolean equals(Object o)
- {
- if (!(o instanceof ConfigParams))
- return false;
- ConfigParams p = (ConfigParams)o;
- if (children.size() != p.children.size())
- return false;
- int i = 0;
- while (i < children.size())
- {
- if (!children.get(i).equals(p.children.get(i)))
- return false;
- i++;
- }
- return true;
- }
-
+
}
Added: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java?rev=960994&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java (added)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java Tue Jul 6 19:45:53 2010
@@ -0,0 +1,357 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.lcf.core.interfaces;
+
+import org.apache.lcf.core.interfaces.*;
+import java.util.*;
+import java.io.*;
+import org.apache.lcf.core.system.LCF;
+import org.apache.lcf.core.common.XMLDoc;
+
+/** This class represents XML configuration information, in its most basic incarnation.
+*/
+public abstract class Configuration
+{
+ public static final String _rcsid = "@(#)$Id$";
+
+ // The children
+ protected ArrayList children = new ArrayList();
+ // Read-only flag
+ protected boolean readOnly = false;
+
+ /** Constructor.
+ */
+ public Configuration()
+ {
+ }
+
+ /** Construct from XML.
+ *@param xml is the input XML.
+ */
+ public Configuration(String xml)
+ throws LCFException
+ {
+ fromXML(xml);
+ }
+
+ /** Construct from XML.
+ *@param xmlstream is the input XML stream. Does NOT close the stream.
+ */
+ public Configuration(InputStream xmlstream)
+ throws LCFException
+ {
+ fromXML(xmlstream);
+ }
+
+ /** Return the root node type.
+ *@return the node type name.
+ */
+ protected abstract String getRootNodeLabel();
+
+ /** Create a new object of the appropriate class.
+ *@return the newly-created configuration object.
+ */
+ protected abstract Configuration createNew();
+
+ /** Create a new child node of the appropriate type and class.
+ *@return the newly-created node.
+ */
+ protected ConfigurationNode createNewNode(String type)
+ {
+ return new ConfigurationNode(type);
+ }
+
+ /** Note the removal of all outer nodes.
+ */
+ protected void clearOuterNodes()
+ {
+ }
+
+ /** Note the addition of a new outer node.
+ *@param node is the node that was just read.
+ */
+ protected void addOuterNode(ConfigurationNode node)
+ {
+ }
+
+ /** Note the removal of an outer node.
+ *@param node is the node that was just removed.
+ */
+ protected void removeOuterNode(ConfigurationNode node)
+ {
+ }
+
+ /** Create a duplicate.
+ */
+ protected Configuration createDuplicate(boolean readOnly)
+ {
+ if (readOnly && this.readOnly)
+ return this;
+ // Create a new object.
+ Configuration rval = createNew();
+ rval.readOnly = readOnly;
+ // Copy the children.
+ if (children != null)
+ {
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode child = (ConfigurationNode)children.get(i++);
+ // Duplicate the child
+ ConfigurationNode newChild = child.createDuplicate(readOnly);
+ rval.addChild(rval.getChildCount(),newChild);
+ }
+ }
+ return rval;
+ }
+
+ /** Make the configuration read-only */
+ public void makeReadOnly()
+ {
+ if (readOnly)
+ return;
+ if (children != null)
+ {
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode child = (ConfigurationNode)children.get(i++);
+ child.makeReadOnly();
+ }
+ }
+ readOnly = true;
+ }
+
+ /** Get as XML
+ *@return the xml corresponding to these ConfigParams.
+ */
+ public String toXML()
+ throws LCFException
+ {
+ XMLDoc doc = new XMLDoc();
+ // name of root node in definition
+ Object top = doc.createElement(null,getRootNodeLabel());
+ // Now, go through all children
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode node = (ConfigurationNode)children.get(i++);
+ writeNode(doc,top,node);
+ }
+
+ return doc.getXML();
+ }
+
+ /** Write a specification node.
+ *@param doc is the document.
+ *@param parent is the parent.
+ *@param node is the node.
+ */
+ protected static void writeNode(XMLDoc doc, Object parent, ConfigurationNode node)
+ throws LCFException
+ {
+ // Get the type
+ String type = node.getType();
+ String value = node.getValue();
+ Object o = doc.createElement(parent,type);
+ Iterator iter = node.getAttributes();
+ while (iter.hasNext())
+ {
+ String attribute = (String)iter.next();
+ String attrValue = node.getAttributeValue(attribute);
+ // Add to the element
+ doc.setAttribute(o,attribute,attrValue);
+ }
+
+ if (value != null)
+ doc.createText(o,value);
+ // Now, do children
+ int i = 0;
+ while (i < node.getChildCount())
+ {
+ ConfigurationNode child = node.findChild(i++);
+ writeNode(doc,o,child);
+ }
+ }
+
+ /** Read from XML.
+ *@param xml is the input XML.
+ */
+ public void fromXML(String xml)
+ throws LCFException
+ {
+ XMLDoc doc = new XMLDoc(xml);
+ initializeFromDoc(doc);
+ }
+
+ /** Read from an XML binary stream.
+ *@param xmlstream is the input XML stream. Does NOT close the stream.
+ */
+ public void fromXML(InputStream xmlstream)
+ throws LCFException
+ {
+ XMLDoc doc = new XMLDoc(xmlstream);
+ initializeFromDoc(doc);
+ }
+
+ protected void initializeFromDoc(XMLDoc doc)
+ throws LCFException
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ clearChildren();
+ ArrayList list = new ArrayList();
+ doc.processPath(list, "*", null);
+
+ if (list.size() != 1)
+ {
+ throw new LCFException("Bad xml - missing outer '"+getRootNodeLabel()+"' node - there are "+Integer.toString(list.size())+" nodes");
+ }
+ Object parent = list.get(0);
+ if (!doc.getNodeName(parent).equals(getRootNodeLabel()))
+ throw new LCFException("Bad xml - outer node is not '"+getRootNodeLabel()+"'");
+
+ list.clear();
+ doc.processPath(list, "*", parent);
+
+ // Outer level processing.
+ int i = 0;
+ while (i < list.size())
+ {
+ Object o = list.get(i++);
+ ConfigurationNode node = readNode(doc,o);
+ addChild(getChildCount(),node);
+ }
+ }
+
+ /** Read a configuration node from XML.
+ *@param doc is the document.
+ *@param object is the object.
+ *@return the specification node.
+ */
+ protected ConfigurationNode readNode(XMLDoc doc, Object object)
+ throws LCFException
+ {
+ String type = doc.getNodeName(object);
+ ConfigurationNode rval = createNewNode(type);
+ String value = doc.getData(object);
+ rval.setValue(value);
+ // Do attributes
+ ArrayList list = doc.getAttributes(object);
+ int i = 0;
+ while (i < list.size())
+ {
+ String attribute = (String)list.get(i++);
+ String attrValue = doc.getValue(object,attribute);
+ rval.setAttribute(attribute,attrValue);
+ }
+ // Now, do children
+ list.clear();
+ doc.processPath(list,"*",object);
+ i = 0;
+ while (i < list.size())
+ {
+ Object o = list.get(i);
+ ConfigurationNode node = readNode(doc,o);
+ rval.addChild(i++,node);
+ }
+ return rval;
+ }
+
+ /** Get child count.
+ *@return the count.
+ */
+ public int getChildCount()
+ {
+ return children.size();
+ }
+
+ /** Get child n.
+ *@param index is the child number.
+ *@return the child node.
+ */
+ public ConfigurationNode findChild(int index)
+ {
+ return (ConfigurationNode)children.get(index);
+ }
+
+ /** Remove child n.
+ *@param index is the child to remove.
+ */
+ public void removeChild(int index)
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ ConfigurationNode node = (ConfigurationNode)children.remove(index);
+ removeOuterNode(node);
+ }
+
+ /** Add child at specified position.
+ *@param index is the position to add the child.
+ *@param child is the child to add.
+ */
+ public void addChild(int index, ConfigurationNode child)
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ children.add(index,child);
+ addOuterNode(child);
+ }
+
+ /** Clear children.
+ */
+ public void clearChildren()
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ children.clear();
+ clearOuterNodes();
+ }
+
+ /** Calculate a hash code */
+ public int hashCode()
+ {
+ int rval = 0;
+ int i = 0;
+ while (i < children.size())
+ {
+ rval += children.get(i++).hashCode();
+ }
+ return rval;
+ }
+
+ /** Do a comparison */
+ public boolean equals(Object o)
+ {
+ if (!(o instanceof Configuration))
+ return false;
+ Configuration p = (Configuration)o;
+ if (children.size() != p.children.size())
+ return false;
+ int i = 0;
+ while (i < children.size())
+ {
+ if (!children.get(i).equals(p.children.get(i)))
+ return false;
+ i++;
+ }
+ return true;
+ }
+
+}
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Configuration.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java?rev=960994&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java (added)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java Tue Jul 6 19:45:53 2010
@@ -0,0 +1,281 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.lcf.core.interfaces;
+
+import java.io.*;
+import java.util.*;
+
+/** This class represents a node in a configuration structure.
+*/
+public class ConfigurationNode
+{
+ public static final String _rcsid = "@(#)$Id$";
+
+ // Member variables
+ protected ArrayList children = null;
+ protected HashMap attributes = null;
+ protected String type = null;
+ protected String value = null;
+
+ // Readonly flag
+ protected boolean readOnly = false;
+
+ /** Constructor.
+ */
+ public ConfigurationNode(String type)
+ {
+ this.type = type;
+ }
+
+ /** Make a new blank node identical in type and class to the current node.
+ *@return the new node.
+ */
+ protected ConfigurationNode createNewNode()
+ {
+ return new ConfigurationNode(type);
+ }
+
+ /** Make this node (and its children) read-only
+ */
+ public void makeReadOnly()
+ {
+ if (readOnly)
+ return;
+ if (children != null)
+ {
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode child = (ConfigurationNode)children.get(i++);
+ child.makeReadOnly();
+ }
+ }
+ readOnly = true;
+ }
+
+ /** Create a duplicate of the current node.
+ *@return the duplicate
+ */
+ protected ConfigurationNode createDuplicate(boolean readOnly)
+ {
+ if (readOnly && this.readOnly)
+ return this;
+ ConfigurationNode rval = createNewNode();
+ rval.value = value;
+ if (attributes != null)
+ rval.attributes = (HashMap)attributes.clone();
+ if (children != null)
+ {
+ rval.children = new ArrayList();
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode node = (ConfigurationNode)children.get(i++);
+ rval.children.add(node.createDuplicate(readOnly));
+ }
+ }
+ rval.readOnly = readOnly;
+ return rval;
+ }
+
+ /** Get type.
+ *@return the node type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /** Set value.
+ *@param value is the value to set.
+ */
+ public void setValue(String value)
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ this.value = value;
+ }
+
+ /** Get value.
+ *@return the value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /** Get child count.
+ *@return the count.
+ */
+ public int getChildCount()
+ {
+ if (children == null)
+ return 0;
+ return children.size();
+ }
+
+ /** Get child n.
+ *@param index is the child number.
+ *@return the child node.
+ */
+ public ConfigurationNode findChild(int index)
+ {
+ return (ConfigurationNode)children.get(index);
+ }
+
+ /** Remove child n.
+ *@param index is the child to remove.
+ */
+ public void removeChild(int index)
+ {
+ children.remove(index);
+ }
+
+ /** Add child at specified position.
+ *@param index is the position to add the child.
+ *@param child is the child to add.
+ */
+ public void addChild(int index, ConfigurationNode child)
+ {
+ if (children == null)
+ children = new ArrayList();
+ children.add(index,child);
+ }
+
+ /** Set an attribute.
+ *@param attribute is the name of the attribute.
+ *@param value is the value of the attribute (null to remove it).
+ */
+ public void setAttribute(String attribute, String value)
+ {
+ if (readOnly)
+ throw new IllegalStateException("Attempt to change read-only object");
+ if (value == null)
+ {
+ if (attributes != null)
+ attributes.remove(attribute);
+ }
+ else
+ {
+ if (attributes == null)
+ attributes = new HashMap();
+ attributes.put(attribute,value);
+ }
+ }
+
+ /** Iterate over attributes.
+ *@return the attribute iterator.
+ */
+ public Iterator getAttributes()
+ {
+ if (attributes == null)
+ return new HashMap().keySet().iterator();
+ return attributes.keySet().iterator();
+ }
+
+ /** Get an attribute value.
+ *@param attribute is the name of the attribute.
+ *@return the value.
+ */
+ public String getAttributeValue(String attribute)
+ {
+ if (attributes == null)
+ return null;
+ return (String)attributes.get(attribute);
+ }
+
+ /** Calculate a hashcode */
+ public int hashCode()
+ {
+ int rval = type.hashCode();
+ if (value != null)
+ rval += value.hashCode();
+ if (attributes != null)
+ {
+ Iterator iter = attributes.keySet().iterator();
+ // Make sure this is not sensitive to order!
+ while (iter.hasNext())
+ {
+ String key = (String)iter.next();
+ String attrValue = (String)attributes.get(key);
+ rval += key.hashCode() + attrValue.hashCode();
+ }
+ }
+ if (children != null)
+ {
+ // Do children
+ int i = 0;
+ while (i < children.size())
+ {
+ rval += children.get(i++).hashCode();
+ }
+ }
+ return rval;
+ }
+
+ /** Check if equals */
+ public boolean equals(Object o)
+ {
+ if (!(o instanceof ConfigurationNode))
+ return false;
+ ConfigurationNode n = (ConfigurationNode)o;
+ if (((attributes==null)?0:attributes.size()) != ((n.attributes==null)?0:n.attributes.size()))
+ return false;
+ if (((children==null)?0:children.size()) != ((n.children==null)?0:n.children.size()))
+ return false;
+ if (!type.equals(n.type))
+ return false;
+ if (value == null || n.value == null)
+ {
+ if (value != n.value)
+ return false;
+ }
+ else
+ {
+ if (!value.equals(n.value))
+ return false;
+ }
+ if (attributes != null && n.attributes != null)
+ {
+ Iterator iter = attributes.keySet().iterator();
+ while (iter.hasNext())
+ {
+ String key = (String)iter.next();
+ String attrValue = (String)attributes.get(key);
+ String nAttrValue = (String)n.attributes.get(key);
+ if (nAttrValue == null || !attrValue.equals(nAttrValue))
+ return false;
+ }
+ }
+ if (children != null && n.children != null)
+ {
+ int i = 0;
+ while (i < children.size())
+ {
+ ConfigurationNode child = (ConfigurationNode)children.get(i);
+ ConfigurationNode nChild = (ConfigurationNode)n.children.get(i);
+ if (!child.equals(nChild))
+ return false;
+ i++;
+ }
+ }
+ return true;
+ }
+
+}
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/ConfigurationNode.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Specification.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Specification.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Specification.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/Specification.java Tue Jul 6 19:45:53 2010
@@ -22,22 +22,18 @@ import java.util.*;
import java.io.*;
import org.apache.lcf.core.common.XMLDoc;
-/** This class represents a document specification, which is a generalized hierarchy of nodes that
-* can be interpreted by a repository connector in an appropriate way.
+/** This class represents a specification, which is a generalized hierarchy of nodes that
+* can be interpreted by an appropriate connector in an appropriate way.
*/
-public class Specification
+public class Specification extends Configuration
{
public static final String _rcsid = "@(#)$Id$";
- // The children
- protected ArrayList children = new ArrayList();
- // Read-only flag
- protected boolean readOnly = false;
-
/** Constructor.
*/
public Specification()
{
+ super();
}
/** Construct from XML.
@@ -46,152 +42,29 @@ public class Specification
public Specification(String xml)
throws LCFException
{
- fromXML(xml);
- }
-
- /** Make the specification read-only */
- public void makeReadOnly()
- {
- if (readOnly)
- return;
- if (children != null)
- {
- int i = 0;
- while (i < children.size())
- {
- SpecificationNode child = (SpecificationNode)children.get(i++);
- child.makeReadOnly();
- }
- }
- readOnly = true;
+ super(xml);
}
- /** Get as XML
- *@return the xml corresponding to this DocumentSpecification.
- */
- public String toXML()
- throws LCFException
- {
- XMLDoc doc = new XMLDoc();
- // name of root node in definition
- Object top = doc.createElement(null,"specification");
- // Now, go through all children
- int i = 0;
- while (i < children.size())
- {
- SpecificationNode node = (SpecificationNode)children.get(i++);
- writeNode(doc,top,node);
- }
-
- return doc.getXML();
- }
-
- /** Write a specification node.
- *@param doc is the document.
- *@param parent is the parent.
- *@param node is the node.
+ /** Return the root node type.
+ *@return the node type name.
*/
- protected static void writeNode(XMLDoc doc, Object parent, SpecificationNode node)
- throws LCFException
+ protected String getRootNodeLabel()
{
- // Get the type
- String type = node.getType();
- String value = node.getValue();
- Object o = doc.createElement(parent,type);
- Iterator iter = node.getAttributes();
- while (iter.hasNext())
- {
- String attribute = (String)iter.next();
- String attrValue = node.getAttributeValue(attribute);
- // Add to the element
- doc.setAttribute(o,attribute,attrValue);
- }
-
- if (value != null)
- doc.createText(o,value);
- // Now, do children
- int i = 0;
- while (i < node.getChildCount())
- {
- SpecificationNode child = node.getChild(i++);
- writeNode(doc,o,child);
- }
+ return "specification";
}
-
- /** Read from XML.
- *@param xml is the input XML.
+
+ /** Create a new object of the appropriate class.
*/
- public void fromXML(String xml)
- throws LCFException
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- children.clear();
- XMLDoc doc = new XMLDoc(xml);
- ArrayList list = new ArrayList();
- doc.processPath(list, "*", null);
-
- if (list.size() != 1)
- {
- throw new LCFException("Bad xml - missing outer 'specification' node - there are "+Integer.toString(list.size())+" nodes");
- }
- Object parent = list.get(0);
- if (!doc.getNodeName(parent).equals("specification"))
- throw new LCFException("Bad xml - outer node is not 'specification'");
-
- list.clear();
- doc.processPath(list, "*", parent);
-
- // Outer level processing.
- int i = 0;
- while (i < list.size())
- {
- Object o = list.get(i++);
- SpecificationNode node = readNode(doc,o);
- children.add(node);
- }
- }
-
- /** Read a specification node from XML.
- *@param doc is the document.
- *@param object is the object.
- *@return the specification node.
- */
- protected static SpecificationNode readNode(XMLDoc doc, Object object)
- throws LCFException
+ protected Configuration createNew()
{
- String type = doc.getNodeName(object);
- SpecificationNode rval = new SpecificationNode(type);
- String value = doc.getData(object);
- rval.setValue(value);
- // Do attributes
- ArrayList list = doc.getAttributes(object);
- int i = 0;
- while (i < list.size())
- {
- String attribute = (String)list.get(i++);
- String attrValue = doc.getValue(object,attribute);
- rval.setAttribute(attribute,attrValue);
- }
- // Now, do children
- list.clear();
- doc.processPath(list,"*",object);
- i = 0;
- while (i < list.size())
- {
- Object o = list.get(i);
- SpecificationNode node = readNode(doc,o);
- rval.addChild(i++,node);
- }
- return rval;
+ return new Specification();
}
-
- /** Get child count.
- *@return the count.
+
+ /** Create a new child node of the appropriate type and class.
*/
- public int getChildCount()
+ protected ConfigurationNode createNewNode(String type)
{
- return children.size();
+ return new SpecificationNode(type);
}
/** Get child n.
@@ -200,37 +73,7 @@ public class Specification
*/
public SpecificationNode getChild(int index)
{
- return (SpecificationNode)children.get(index);
- }
-
- /** Remove child n.
- *@param index is the child to remove.
- */
- public void removeChild(int index)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- children.remove(index);
- }
-
- /** Add child at specified position.
- *@param index is the position to add the child.
- *@param child is the child to add.
- */
- public void addChild(int index, SpecificationNode child)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- children.add(index,child);
- }
-
- /** Clear children.
- */
- public void clearChildren()
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- children.clear();
+ return (SpecificationNode)findChild(index);
}
}
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/SpecificationNode.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/SpecificationNode.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/SpecificationNode.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/SpecificationNode.java Tue Jul 6 19:45:53 2010
@@ -21,105 +21,33 @@ package org.apache.lcf.core.interfaces;
import java.io.*;
import java.util.*;
-/** This class represents a node in a specification structure.
+/** This class represents a node in a specification structure. Its existence apart from
+* ConfigurationNode is largely a relic.
*/
-public class SpecificationNode
+public class SpecificationNode extends ConfigurationNode
{
public static final String _rcsid = "@(#)$Id$";
- // Member variables
- protected ArrayList children = null;
- protected HashMap attributes = null;
- protected String type = null;
- protected String value = null;
-
- // Readonly flag
- protected boolean readOnly = false;
-
/** Constructor.
*/
public SpecificationNode(String type)
{
- this.type = type;
+ super(type);
}
- /** Make this specification node (and its children) read-only
+ /** Create a new node of this same type and class.
*/
- public void makeReadOnly()
+ protected ConfigurationNode createNewNode()
{
- if (readOnly)
- return;
- if (children != null)
- {
- int i = 0;
- while (i < children.size())
- {
- SpecificationNode child = (SpecificationNode)children.get(i++);
- child.makeReadOnly();
- }
- }
- readOnly = true;
+ return new SpecificationNode(type);
}
-
+
/** Duplicate.
*@return the duplicate.
*/
public SpecificationNode duplicate(boolean readOnly)
{
- if (readOnly && this.readOnly)
- return this;
- SpecificationNode rval = new SpecificationNode(type);
- rval.value = value;
- if (attributes != null)
- rval.attributes = (HashMap)attributes.clone();
- if (children != null)
- {
- rval.children = new ArrayList();
- int i = 0;
- while (i < children.size())
- {
- SpecificationNode node = (SpecificationNode)children.get(i++);
- rval.children.add(node.duplicate(readOnly));
- }
- }
- rval.readOnly = readOnly;
- return rval;
- }
-
- /** Get type.
- *@return the node type.
- */
- public String getType()
- {
- return type;
- }
-
- /** Set value.
- *@param value is the value to set.
- */
- public void setValue(String value)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- this.value = value;
- }
-
- /** Get value.
- *@return the value.
- */
- public String getValue()
- {
- return value;
- }
-
- /** Get child count.
- *@return the count.
- */
- public int getChildCount()
- {
- if (children == null)
- return 0;
- return children.size();
+ return (SpecificationNode)createDuplicate(readOnly);
}
/** Get child n.
@@ -128,72 +56,7 @@ public class SpecificationNode
*/
public SpecificationNode getChild(int index)
{
- return (SpecificationNode)children.get(index);
- }
-
- /** Remove child n.
- *@param index is the child to remove.
- */
- public void removeChild(int index)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- children.remove(index);
- }
-
- /** Add child at specified position.
- *@param index is the position to add the child.
- *@param child is the child to add.
- */
- public void addChild(int index, SpecificationNode child)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- if (children == null)
- children = new ArrayList();
- children.add(index,child);
- }
-
- /** Set an attribute.
- *@param attribute is the name of the attribute.
- *@param value is the value of the attribute (null to remove it).
- */
- public void setAttribute(String attribute, String value)
- {
- if (readOnly)
- throw new IllegalStateException("Attempt to change read-only object");
- if (value == null)
- {
- if (attributes != null)
- attributes.remove(attribute);
- }
- else
- {
- if (attributes == null)
- attributes = new HashMap();
- attributes.put(attribute,value);
- }
- }
-
- /** Iterate over attributes.
- *@return the attribute iterator.
- */
- public Iterator getAttributes()
- {
- if (attributes == null)
- return new HashMap().keySet().iterator();
- return attributes.keySet().iterator();
- }
-
- /** Get an attribute value.
- *@param attribute is the name of the attribute.
- *@return the value.
- */
- public String getAttributeValue(String attribute)
- {
- if (attributes == null)
- return null;
- return (String)attributes.get(attribute);
+ return (SpecificationNode)findChild(index);
}
}
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCF.java?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCF.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCF.java Tue Jul 6 19:45:53 2010
@@ -19,7 +19,6 @@
package org.apache.lcf.core.system;
import org.apache.lcf.core.interfaces.*;
-import org.apache.lcf.core.common.LCFResourceLoader;
import java.io.*;
import java.util.*;
import java.security.MessageDigest;
@@ -84,7 +83,7 @@ public class LCF
protected static String masterDatabaseName = null;
protected static String masterDatabaseUsername = null;
protected static String masterDatabasePassword = null;
- protected static ConfigParams localConfiguration = null;
+ protected static LCFConfiguration localConfiguration = null;
protected static Map localProperties = null;
protected static long propertyFilelastMod = -1L;
protected static String propertyFilePath = null;
@@ -160,7 +159,7 @@ public class LCF
resourceLoader = new LCFResourceLoader(Thread.currentThread().getContextClassLoader());
// Read configuration!
- localConfiguration = new ConfigParams();
+ localConfiguration = new LCFConfiguration();
localProperties = new HashMap();
checkProperties();
@@ -248,7 +247,7 @@ public class LCF
int i = 0;
while (i < localConfiguration.getChildCount())
{
- ConfigNode cn = localConfiguration.getChild(i++);
+ ConfigurationNode cn = localConfiguration.findChild(i++);
if (cn.getType().equals(NODE_PROPERTY))
{
String name = cn.getAttributeValue(ATTRIBUTE_NAME);
Added: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java?rev=960994&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java (added)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java Tue Jul 6 19:45:53 2010
@@ -0,0 +1,63 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.lcf.core.system;
+
+import org.apache.lcf.core.interfaces.*;
+import java.util.*;
+import java.io.*;
+
+/** This class represents the configuration data read from the main LCF configuration
+* XML file.
+*/
+public class LCFConfiguration extends Configuration
+{
+ public static final String _rcsid = "@(#)$Id$";
+
+ /** Constructor.
+ */
+ public LCFConfiguration()
+ {
+ super();
+ }
+
+ /** Construct from XML.
+ *@param xmlStream is the input XML stream.
+ */
+ public LCFConfiguration(InputStream xmlStream)
+ throws LCFException
+ {
+ super(xmlStream);
+ }
+
+ /** Return the root node type.
+ *@return the node type name.
+ */
+ protected String getRootNodeLabel()
+ {
+ return "configuration";
+ }
+
+ /** Create a new object of the appropriate class.
+ */
+ protected Configuration createNew()
+ {
+ return new LCFConfiguration();
+ }
+
+}
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Id
Copied: incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFResourceLoader.java (from r960055, incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/LCFResourceLoader.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFResourceLoader.java?p2=incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFResourceLoader.java&p1=incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/LCFResourceLoader.java&r1=960055&r2=960994&rev=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/common/LCFResourceLoader.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/system/LCFResourceLoader.java Tue Jul 6 19:45:53 2010
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.lcf.core.common;
+package org.apache.lcf.core.system;
import org.apache.lcf.core.interfaces.*;
import java.net.URL;
@@ -182,4 +182,4 @@ public class LCFResourceLoader
}
-}
\ No newline at end of file
+}
Modified: incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp (original)
+++ incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp Tue Jul 6 19:45:53 2010
@@ -71,6 +71,9 @@
else
connectionName = null;
+ if (connectionName == null)
+ connectionName = "";
+
// Initialize tabs array.
ArrayList tabsArray = new ArrayList();
Added: incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml?rev=960994&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml (added)
+++ incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml Tue Jul 6 19:45:53 2010
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- The connectors registry file permits registration of connectors upon the
+ startup of the jetty-based LCF example. In a real installation, this registration
+ step would be done ideally just once, but in the example the connectors
+ are all reregistered on every startup.
+-->
+<connectors>
+ <!-- Add your output connectors here -->
+ <!-- Add your authority connectors here -->
+ <!-- Add your repository connectors here -->
+</connectors>
Propchange: incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/modules/framework/jetty-example/connectors.xml
------------------------------------------------------------------------------
svn:keywords = Id
Modified: incubator/lcf/trunk/modules/framework/jetty-example/lcf.sh
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/jetty-example/lcf.sh?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/jetty-example/lcf.sh (original)
+++ incubator/lcf/trunk/modules/framework/jetty-example/lcf.sh Tue Jul 6 19:45:53 2010
@@ -23,7 +23,7 @@ if [ -e "$JAVA_HOME"/bin/java ] ; then
# Build the defines
DEFINES="-Dorg.apache.lcf.configfile=./properties.xml"
- "$JAVA_HOME/bin/java" $DEFINES -cp "$CLASSPATH" org.apache.lcf.jettyrunner.LCFJettyRunner 8888 war/lcf-crawler-ui.war war/lcf-authority-service.war
+ "$JAVA_HOME/bin/java" $DEFINES -cp "$CLASSPATH" org.apache.lcf.jettyrunner.LCFJettyRunner
exit $?
else
Modified: incubator/lcf/trunk/modules/framework/jetty-example/properties.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/jetty-example/properties.xml?rev=960994&r1=960993&r2=960994&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/jetty-example/properties.xml (original)
+++ incubator/lcf/trunk/modules/framework/jetty-example/properties.xml Tue Jul 6 19:45:53 2010
@@ -1,6 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
<configuration>
<property name="org.apache.lcf.databaseimplementationclass" value="org.apache.lcf.core.database.DBInterfaceDerby"/>
<property name="org.apache.lcf.derbydatabasepath" value="."/>
<property name="org.apache.lcf.logconfigfile" value="./logging.ini"/>
+ <property name="org.apache.lcf.connectorsconfigurationfile" value="./connectors.xml"/>
<libdir path="./connector-lib"/>
</configuration>
Added: incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java?rev=960994&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java (added)
+++ incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java Tue Jul 6 19:45:53 2010
@@ -0,0 +1,63 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.lcf.jettyrunner;
+
+import org.apache.lcf.core.interfaces.*;
+import java.util.*;
+import java.io.*;
+
+/** This class represents the configuration data read from the 'connectors.xml' file, which
+* describes all the individual connector classes and their pretty names.
+*/
+public class Connectors extends Configuration
+{
+ public static final String _rcsid = "@(#)$Id$";
+
+ /** Constructor.
+ */
+ public Connectors()
+ {
+ super();
+ }
+
+ /** Construct from XML.
+ *@param xmlStream is the input XML stream.
+ */
+ public Connectors(InputStream xmlStream)
+ throws LCFException
+ {
+ super(xmlStream);
+ }
+
+ /** Return the root node type.
+ *@return the node type name.
+ */
+ protected String getRootNodeLabel()
+ {
+ return "connectors";
+ }
+
+ /** Create a new object of the appropriate class.
+ */
+ protected Configuration createNew()
+ {
+ return new Connectors();
+ }
+
+}
Propchange: incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/modules/framework/jetty-runner/org/apache/lcf/jettyrunner/Connectors.java
------------------------------------------------------------------------------
svn:keywords = Id