kstaken 02/04/02 14:57:06
Modified: java/examples/guide/src/org/apache/xindice/examples
HelloWorldXMLObject.java
java/scratchpad/src/org/apache/xindice/server/rpc
Client.java RPCDefaultMessage.java
RPCMessageHandler.java
java/scratchpad/src/org/apache/xindice/server/rpc/messages
GetDocument.java InsertDocument.java
java/src/org/apache/xindice/client/corba
CollectionServant.java
java/src/org/apache/xindice/core/objects
XMLObjectManager.java
java/src/org/apache/xindice/xml TextWriter.java
Added: java/scratchpad/src/org/apache/xindice/server/rpc/messages
CreateCollection.java CreateIndexer.java
CreateNewOID.java GetCollectionConfiguration.java
GetDocumentCount.java GetIndexerConfiguration.java
ListCollections.java ListDocuments.java
ListIndexers.java Query.java RemoveCollection.java
RemoveDocument.java RemoveIndexer.java
UpdateIndexer.java
Log:
Adding the stubs for the other XML-RPC methods.
Revision Changes Path
1.2 +2 -2
xml-xindice/java/examples/guide/src/org/apache/xindice/examples/HelloWorldXMLObject.java
Index: HelloWorldXMLObject.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/examples/guide/src/org/apache/xindice/examples/HelloWorldXMLObject.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HelloWorldXMLObject.java 6 Dec 2001 19:33:53 -0000 1.1
+++ HelloWorldXMLObject.java 2 Apr 2002 22:57:04 -0000 1.2
@@ -1,4 +1,4 @@
-package org.xpache.xindice.examples;
+package org.apache.xindice.examples;
/*
* The Apache Software License, Version 1.1
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: HelloWorldXMLObject.java,v 1.1 2001/12/06 19:33:53 bradford Exp $
+ * $Id: HelloWorldXMLObject.java,v 1.2 2002/04/02 22:57:04 kstaken Exp $
*/
import org.apache.xindice.core.objects.*;
1.4 +2 -2
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/Client.java
Index: Client.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/Client.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Client.java 22 Mar 2002 10:32:51 -0000 1.3
+++ Client.java 2 Apr 2002 22:57:05 -0000 1.4
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: Client.java,v 1.3 2002/03/22 10:32:51 kstaken Exp $
+ * $Id: Client.java,v 1.4 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.*;
@@ -80,7 +80,7 @@
public static void main(String[] args) throws Exception {
Hashtable message = new Hashtable();
message.put("message", "InsertDocument");
- message.put("key", "utf8-test");
+ message.put("name", "utf8-test");
message.put("collection", "/db/test3");
message.put("document",
"<?xml version=\"1.0\" encoding=\"utf-8\"?><test>� test �
� �</test>");
1.3 +10 -5
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/RPCDefaultMessage.java
Index: RPCDefaultMessage.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/RPCDefaultMessage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RPCDefaultMessage.java 22 Mar 2002 10:32:51 -0000 1.2
+++ RPCDefaultMessage.java 2 Apr 2002 22:57:05 -0000 1.3
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: RPCDefaultMessage.java,v 1.2 2002/03/22 10:32:51 kstaken Exp $
+ * $Id: RPCDefaultMessage.java,v 1.3 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
@@ -67,10 +67,15 @@
* @author kstaken
*/
public class RPCDefaultMessage implements RPCMessage {
- public static final String RESULT_PARAM = "result";
- public static final String KEY_PARAM = "key";
- public static final String COLLECTION_PARAM = "collection";
- public static final String DOCUMENT_PARAM = "document";
+ public static final String RESULT = "result";
+ public static final String NAME = "name";
+ public static final String COLLECTION = "collection";
+ public static final String DOCUMENT = "document";
+ public static final String COMPRESSED = "compressed";
+ public static final String PATTERN = "pattern";
+ public static final String MAXKEYSIZE = "maxkeysize";
+ public static final String PAGESIZE = "pagesize";
+ public static final String TYPE = "type";
public Hashtable execute(Hashtable message) throws Exception {
return null;
1.3 +1 -0
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/RPCMessageHandler.java
Index: RPCMessageHandler.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/RPCMessageHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RPCMessageHandler.java 22 Mar 2002 10:32:51 -0000 1.2
+++ RPCMessageHandler.java 2 Apr 2002 22:57:05 -0000 1.3
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: RPCMessageHandler.java,v 1.2 2002/03/22 10:32:51 kstaken Exp $
+ * $Id: RPCMessageHandler.java,v 1.3 2002/04/02 22:57:05 kstaken Exp $
*/
/**
@@ -114,6 +114,7 @@
// We only handle all requests under /RPC2
// We just use that endpoint since it's common in the XML-RPC
community.
+ // This could easily be made configurable.
if ( ! pathinfo.startsWith("/RPC2") ) {
return true;
}
1.3 +5 -6
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetDocument.java
Index: GetDocument.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetDocument.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GetDocument.java 22 Mar 2002 10:32:51 -0000 1.2
+++ GetDocument.java 2 Apr 2002 22:57:05 -0000 1.3
@@ -56,11 +56,10 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: GetDocument.java,v 1.2 2002/03/22 10:32:51 kstaken Exp $
+ * $Id: GetDocument.java,v 1.3 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
-import java.io.*;
import org.w3c.dom.*;
@@ -75,16 +74,16 @@
// TODO: should have a simple way to validate params.
public Hashtable execute(Hashtable message) throws Exception {
- Collection col = getCollection( (String) message.get(COLLECTION_PARAM)
);
+ Collection col = getCollection( (String) message.get(COLLECTION) );
- Document doc = col.getDocument( (String) message.get(KEY_PARAM) );
+ Document doc = col.getDocument( (String) message.get(NAME) );
if ( doc == null ) {
throw new Exception( "Document not found " +
- (String) message.get(KEY_PARAM) );
+ (String) message.get(NAME) );
}
Hashtable result = new Hashtable();
- result.put(RESULT_PARAM, TextWriter.toString( doc ));
+ result.put(RESULT, TextWriter.toString( doc ));
return result;
}
}
1.3 +5 -5
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/InsertDocument.java
Index: InsertDocument.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/InsertDocument.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- InsertDocument.java 22 Mar 2002 10:32:51 -0000 1.2
+++ InsertDocument.java 2 Apr 2002 22:57:05 -0000 1.3
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: InsertDocument.java,v 1.2 2002/03/22 10:32:51 kstaken Exp $
+ * $Id: InsertDocument.java,v 1.3 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
@@ -73,14 +73,14 @@
*/
public class InsertDocument extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
- Collection col = getCollection((String) message.get(COLLECTION_PARAM));
+ Collection col = getCollection((String) message.get(COLLECTION));
- Document doc = DOMParser.toDocument((String)
message.get(DOCUMENT_PARAM));
+ Document doc = DOMParser.toDocument((String) message.get(DOCUMENT));
if ( doc == null ) {
throw new Exception( "Unable to parse Document" );
}
- String id = (String) message.get(KEY_PARAM);
+ String id = (String) message.get(NAME);
if ( id.equals( "" ) ) {
id = col.insertDocument( doc ).toString();
}
@@ -89,7 +89,7 @@
}
Hashtable result = new Hashtable();
- result.put(RESULT_PARAM, id);
+ result.put(RESULT, id);
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateCollection.java
Index: CreateCollection.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: CreateCollection.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.util.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.xml.dom.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class CreateCollection extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
CollectionManager colman = getCollection( (String)
message.get(COLLECTION) );
Document doc = new DocumentImpl();
Element colEle = doc.createElement("collection");
colEle.setAttribute("compressed", "true");
colEle.setAttribute("name", (String) message.get(NAME));
doc.appendChild(colEle);
Element filEle = doc.createElement("filer");
filEle.setAttribute("class",
"org.apache.xindice.core.filer.BTreeFiler");
colEle.appendChild(filEle);
Configuration config = new
Configuration(doc.getDocumentElement(),false);
colman.createCollection( (String) message.get(NAME), config );
Hashtable result = new Hashtable();
result.put(RESULT, (String) message.get(NAME));
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateIndexer.java
Index: CreateIndexer.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: CreateIndexer.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.util.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.xml.dom.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class CreateIndexer extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Document doc = new DocumentImpl();
// Create the index element to hold attributes
Element index = doc.createElement("index");
index.setAttribute("class",
"org.apache.xindice.core.indexer.ValueIndexer");
index.setAttribute("name", (String) message.get(NAME));
index.setAttribute("pattern", (String) message.get(PATTERN));
doc.appendChild(index);
Collection col = getCollection( (String) message.get(COLLECTION) );
Configuration config = new Configuration(doc.getDocumentElement(),
false);
col.createIndexer( config );
Hashtable result = new Hashtable();
result.put(RESULT, (String) message.get(NAME));
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateNewOID.java
Index: CreateNewOID.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: CreateNewOID.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class CreateNewOID extends RPCDefaultMessage {
// TODO: should have a simple way to validate params.
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
Hashtable result = new Hashtable();
result.put(RESULT, col.createNewOID().toString());
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetCollectionConfiguration.java
Index: GetCollectionConfiguration.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: GetCollectionConfiguration.java,v 1.1 2002/04/02 22:57:05 kstaken Exp
$
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class GetCollectionConfiguration extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
// TODO: figure out what goes here.
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetDocumentCount.java
Index: GetDocumentCount.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: GetDocumentCount.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class GetDocumentCount extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
Hashtable result = new Hashtable();
result.put(RESULT, new Long(col.getDocumentCount()));
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetIndexerConfiguration.java
Index: GetIndexerConfiguration.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: GetIndexerConfiguration.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class GetIndexerConfiguration extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
// TODO: figure out what to do here
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/ListCollections.java
Index: ListCollections.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: ListCollections.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.util.Vector;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class ListCollections extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
String[] cols = col.listCollections();
Vector list = new Vector();
for ( int i = 0; ( cols != null ) && ( i < cols.length ); i++ ) {
list.addElement( cols[i] );
}
Hashtable result = new Hashtable();
result.put(RESULT, list);
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/ListDocuments.java
Index: ListDocuments.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: ListDocuments.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.util.Vector;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class ListDocuments extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
String[] list = col.listDocuments();
Vector docs = new Vector();
for ( int i = 0; ( list != null ) && ( i < list.length ); i++ ) {
docs.addElement( list[i] );
}
Hashtable result = new Hashtable();
result.put(RESULT, docs);
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/ListIndexers.java
Index: ListIndexers.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: ListIndexers.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.util.Vector;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class ListIndexers extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
String[] list = col.listIndexers();
Vector indexers = new Vector();
for ( int i = 0; ( list != null ) && ( i < list.length ); i++ ) {
indexers.addElement( list[i] );
}
Hashtable result = new Hashtable();
result.put(RESULT, indexers);
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/Query.java
Index: Query.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: Query.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class Query extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
Hashtable result = new Hashtable();
result.put(RESULT, null);
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/RemoveCollection.java
Index: RemoveCollection.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: RemoveCollection.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class RemoveCollection extends RPCDefaultMessage {
// TODO: should have a simple way to validate params.
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
col.dropCollection( col );
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/RemoveDocument.java
Index: RemoveDocument.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: RemoveDocument.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class RemoveDocument extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
col.remove( (String) message.get(NAME) );
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/RemoveIndexer.java
Index: RemoveIndexer.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: RemoveIndexer.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class RemoveIndexer extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
col.dropIndexer( col.getIndexer((String) message.get(NAME)) );
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.1
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/UpdateIndexer.java
Index: UpdateIndexer.java
===================================================================
package org.apache.xindice.server.rpc.messages;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xindice" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999-2001, The dbXML
* Group, L.L.C., http://www.dbxmlgroup.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: UpdateIndexer.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
*/
import java.util.Hashtable;
import java.io.*;
import org.w3c.dom.*;
import org.apache.xindice.core.*;
import org.apache.xindice.xml.*;
import org.apache.xindice.server.rpc.*;
/**
*
*/
public class UpdateIndexer extends RPCDefaultMessage {
public Hashtable execute(Hashtable message) throws Exception {
Collection col = getCollection( (String) message.get(COLLECTION) );
// TODO: figure out what to do here.
Hashtable result = new Hashtable();
result.put(RESULT, "yes");
return result;
}
}
1.4 +11 -6
xml-xindice/java/src/org/apache/xindice/client/corba/CollectionServant.java
Index: CollectionServant.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/client/corba/CollectionServant.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CollectionServant.java 26 Feb 2002 08:35:31 -0000 1.3
+++ CollectionServant.java 2 Apr 2002 22:57:06 -0000 1.4
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: CollectionServant.java,v 1.3 2002/02/26 08:35:31 kstaken Exp $
+ * $Id: CollectionServant.java,v 1.4 2002/04/02 22:57:06 kstaken Exp $
*/
import org.apache.xindice.client.corba.db.*;
@@ -378,15 +378,19 @@
DocumentImpl doc = new DocumentImpl();
if ( syms != null )
doc.setSymbols(syms.getSymbols());
+
Element root = doc.createElement("result");
doc.appendChild(root);
+
int count = 0;
while (ns != null && ns.hasMoreNodes()) {
Node n = ns.getNextNode();
if ( n.getNodeType() == Node.DOCUMENT_NODE )
- n = ((Document)n).getDocumentElement();
+ n = ((Document) n).getDocumentElement();
+
if ( n instanceof DBNode )
- ((DBNode)n).expandSource();
+ ((DBNode) n).expandSource();
+
root.appendChild(doc.importNode(n, true));
count++;
}
@@ -413,8 +417,8 @@
*/
public org.apache.xindice.client.corba.db.EncodedBuffer
queryCollection(String style,
String query, NamedVal[] namespaces, long stamp)
- throws APIException {
- try {
+ throws APIException {
+ try {
NamespaceMap nsMap = null;
if ( namespaces.length > 0 ) {
nsMap = new NamespaceMap();
@@ -422,9 +426,10 @@
nsMap.setNamespace(namespaces[i].nam, namespaces[i].val);
}
NodeSet ns = collection.queryCollection(style, query, nsMap);
+
return queryWrapper(ns, stamp);
}
- catch (Exception e) {
+ catch (Exception e) {
throw FaultCodes.createAPIException(e);
}
}
1.2 +2 -2
xml-xindice/java/src/org/apache/xindice/core/objects/XMLObjectManager.java
Index: XMLObjectManager.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/objects/XMLObjectManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLObjectManager.java 6 Dec 2001 21:00:13 -0000 1.1
+++ XMLObjectManager.java 2 Apr 2002 22:57:06 -0000 1.2
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: XMLObjectManager.java,v 1.1 2001/12/06 21:00:13 bradford Exp $
+ * $Id: XMLObjectManager.java,v 1.2 2002/04/02 22:57:06 kstaken Exp $
*/
import org.apache.xindice.core.*;
@@ -151,9 +151,9 @@
if ( cfgs[i].getAttribute(NAME).equals(name) )
throw new DuplicateObjectException("Duplicate XMLObject
'"+name+"'");
+ Class c = Class.forName(className);
config.add(cfg);
- Class c = Class.forName(className);
XMLObject obj = register(c, cfg);
return obj;
1.2 +6 -5
xml-xindice/java/src/org/apache/xindice/xml/TextWriter.java
Index: TextWriter.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/TextWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TextWriter.java 6 Dec 2001 19:33:58 -0000 1.1
+++ TextWriter.java 2 Apr 2002 22:57:06 -0000 1.2
@@ -56,7 +56,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * $Id: TextWriter.java,v 1.1 2001/12/06 19:33:58 bradford Exp $
+ * $Id: TextWriter.java,v 1.2 2002/04/02 22:57:06 kstaken Exp $
*/
import org.w3c.dom.*;
@@ -272,7 +272,7 @@
*/
public void write(OutputStream output) throws IOException {
try {
- OutputStreamWriter o = new OutputStreamWriter(output);
+ OutputStreamWriter o = new OutputStreamWriter(output, "utf-8");
BufferedWriter buf = new BufferedWriter(o, 4096);
writeNode(buf, node);
buf.flush();
@@ -298,10 +298,11 @@
* @return The String value
*/
public String toString() {
- StringWriter writer = new StringWriter();
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+
try {
- write(writer);
- return writer.toString();
+ write(output);
+ return output.toString();
}
catch ( Exception e ) {
org.apache.xindice.Debug.printStackTrace(e);