You're right. You need to add the a reference to the service's class in the 
CollectionImpl (in serviceClassesMap). It would be an idea to not
hardcode this into CollectionImpl, but have CollectionImpl read a config file 
somewhere... haven't really thought about this yet.



-----Original Message-----
From: David Viner [mailto:[EMAIL PROTECTED]
Sent: 14 May 2002 20:54
To: James Bates
Subject: RE: DB client that uses XML-RPC


hi James
    i took a look at some of the new xml rpc code you put in the xindice 
scratchpad.  i have a quick question about it: if i want to write my own 
extension service, it looks like i'd have to do a lot of work to add it to the 
list of services.  In 
http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/scratchpad/src/org/apache/xindice/client/rpc/base/CollectionImpl.java?rev=1.3&content-type=text/vnd.viewcvs-markup
it looks to me like there are 2 parts that define what services are going to be 
added:


    /* Named service classes map to instantiate for each collection */
    private static String[] serviceClassesMap =
    {  "org.apache.xindice.client.rpc.modules.XPathQueryServiceImpl",
      "org.apache.xindice.client.rpc.modules.XUpdateQueryServiceImpl",
      "org.apache.xindice.client.rpc.modules.CollectionManagementServiceImpl" };
      

and

        for (int i=0; i < serviceClassesMap.length; i++) {

            try {
            
                /*
                 * Look up service constructor that accepts CollectionImpl
                 * argument
                 */
                Service s = (Service) 
                        Class.forName(serviceClassesMap[i]).newInstance();
                s.setCollection(this);
                ...

if i want to add a service, how can I do it without reimplementing this entire 
class?

or have i just misunderstood what's happening?  

thanks
dave viner

-----Original Message-----
From: James Bates [mailto:[EMAIL PROTECTED]
Sent: Friday, May 03, 2002 9:45 AM
To: [EMAIL PROTECTED]
Subject: XML:DB client that uses XML-RPC


OK, guys. I've now got a working XML:DB client that uses the XML-RPC API 
exposed so far in the scratchpad. 
The client code is in org.apache.xindice.client.rpc in the scratchpad also. 
I used Kurt's trick to start up the XML-RPC server and that worked. 
The client currently responds to XML:DB URL's of the form 
xmldb:xindice-rpc://host:port/path/to/collection so as to not 
interfere with the current client. 
To test, I used the command-line tools, which I patched (inside scratchpad) to 
load my XML:DB client alongside the regular client.
The client contains only the base XML:DB API for the moment: reading 
collections, reading and stopring documents. Next steps will be to implement 
the Query services and collection management
services. 
Also, the client uses the standard complete XML: no compressed DOM's or 
anything. This will probably need to be introduced once that functionality is 
also present in the server.
Anyway, please try it out guys, and let me know of any issues so far. I'll be 
testing it some more myself also. 


James 

Reply via email to