xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kurt" <kurt-kavana...@comcast.net>
Subject Re: Creating a nested collection
Date Fri, 24 Oct 2003 23:20:20 GMT

Ahh I think I figured out my own answer.... duh.

I need to get the collection("foo") and then do

colFoo.getService()

and then add the

new collection.

I will try this.

----- Original Message -----
From: "Kurt Kavanaugh" <kkavanaugh@teletrol.com>
To: "Xindice users (E-mail)" <xindice-users@xml.apache.org>
Sent: Friday, October 24, 2003 5:16 PM
Subject: Creating a nested collection



How?

Here is what I am doing....


CollectionManagementService service = (CollectionManagementService)
colRoot.getService("CollectionManager", "1.0");
String sCollectionName = "foo";
String sNestedName = sCollectionName + "/" + "bar";
service.createCollection(sCollectionName);

// works fine

service.createCollection(sNestedName);

// fails

The interesting thing to note is.... Code snipped from Xindice
CollectionImpl.java

    /* see superclass for documentation */
    public org.xmldb.api.base.Collection createCollection(String name,
Document configuration) throws XMLDBException {
        checkOpen();
        try {
            Configuration config = new
Configuration(configuration.getDocumentElement(), false);
            col.createCollection(name, config);

            return getChildCollection(name);
        } catch (Exception e) {
            throw
FaultCodes.createXMLDBException(ErrorCodes.INVALID_COLLECTION,
                                                  FaultCodes.GEN_UNKNOWN,
                                                  "Cannot create child
collection", e);
        }
    }

That it gets all the way through the col.createCollection( name, config );

but fails in the getCollectionName()....

    public org.xmldb.api.base.Collection getChildCollection(String name)
throws XMLDBException {

        if (name.indexOf('/') != -1) {
            throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                                     "Invalid collection: " + name);
        }


Because it contains a "/" is this intended?






Mime
View raw message