Package org.exist.xmldb

Examples of org.exist.xmldb.CollectionImpl


            dbUri = XmldbURI.xmldbUriFor(dbBaseUri + XmldbURI.ROOT_COLLECTION);
        } else {
            dbUri = XmldbURI.xmldbUriFor(dbBaseUri);
        }
       
        CollectionImpl current = (CollectionImpl)DatabaseManager.getCollection(dbUri.toString(), dbUsername, dbPassword);
        XmldbURI p = XmldbURI.ROOT_COLLECTION_URI;
       
        for(final XmldbURI segment : segments) {
            p = p.append(segment);
            final XmldbURI xmldbURI = dbUri.resolveCollectionPath(p);
            CollectionImpl c = (CollectionImpl)DatabaseManager.getCollection(xmldbURI.toString(), dbUsername, dbPassword);
            if(c == null) {
              current.setTriggersEnabled(false);
                final CollectionManagementServiceImpl mgtService = (CollectionManagementServiceImpl)current.getService("CollectionManagementService", "1.0");
                c = (CollectionImpl)mgtService.createCollection(segment, created);
                current.setTriggersEnabled(true);
View Full Code Here


        serializer.startDocument();
        serializer.startPrefixMapping( "", Namespaces.EXIST_NS );

        // write <collection> element
        final CollectionImpl cur  = (CollectionImpl)current;
        final AttributesImpl attr = new AttributesImpl();

        //The name should have come from an XmldbURI.toString() call
        attr.addAttribute( Namespaces.EXIST_NS, "name", "name", "CDATA", current.getName() );
        writeUnixStylePermissionAttributes(attr, currentPerms);
        attr.addAttribute( Namespaces.EXIST_NS, "created", "created", "CDATA", "" + new DateTimeValue( cur.getCreationTime() ) );
        attr.addAttribute( Namespaces.EXIST_NS, "version", "version", "CDATA", String.valueOf( currVersion ) );
       
        serializer.startElement( Namespaces.EXIST_NS, "collection", "collection", attr );

        if(currentPerms instanceof ACLPermission) {
View Full Code Here

        }
    }

    private void shutdownDb() throws XMLDBException {
        for (Connection connection : connections.values()) {
            CollectionImpl collection = (CollectionImpl) connection.getCollection("/db");
            if (!collection.isRemoteCollection()) {
                DatabaseInstanceManager mgr = (DatabaseInstanceManager)
                        collection.getService("DatabaseInstanceManager", "1.0");
                mgr.shutdown();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.exist.xmldb.CollectionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.