From: <sha...@us...> - 2012-04-28 16:36:42
|
Revision: 16290 http://exist.svn.sourceforge.net/exist/?rev=16290&view=rev Author: shabanovd Date: 2012-04-28 16:36:34 +0000 (Sat, 28 Apr 2012) Log Message: ----------- [ignore] cleanup Modified Paths: -------------- trunk/eXist/extensions/fluent/src/org/exist/fluent/Database.java trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/ConcurrencyTest.java trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java trunk/eXist/extensions/indexes/ngram/test/src/org/exist/indexing/ngram/MatchListenerTest.java trunk/eXist/extensions/indexes/spatial/test/src/org/exist/indexing/spatial/GMLIndexTest.java trunk/eXist/extensions/svn/test/src/org/exist/versioning/svn/WorkingCopyTesting.java trunk/eXist/extensions/xqdoc/src/org/exist/xqdoc/ant/XQDocTask.java trunk/eXist/extensions/xslt/test/src/org/exist/xslt/XSLTestCase.java trunk/eXist/samples/src/org/exist/examples/http/PostExample.java trunk/eXist/samples/src/org/exist/examples/http/PutExample.java trunk/eXist/samples/src/org/exist/examples/soap/GetDocument.java trunk/eXist/samples/src/org/exist/examples/soap/XUpdateExample.java trunk/eXist/samples/src/org/exist/examples/xmldb/MultipleDatabases.java trunk/eXist/samples/src/org/exist/examples/xmldb/NestedExample.java trunk/eXist/samples/src/org/exist/examples/xmldb/Put.java trunk/eXist/samples/src/org/exist/examples/xmldb/XQueryExample.java trunk/eXist/src/org/exist/backup/Backup.java trunk/eXist/src/org/exist/backup/CreateBackupDialog.java trunk/eXist/src/org/exist/backup/Main.java trunk/eXist/src/org/exist/backup/Restore.java trunk/eXist/src/org/exist/backup/SystemExport.java trunk/eXist/src/org/exist/backup/restore/RestoreHandler.java trunk/eXist/src/org/exist/client/ClientFrame.java trunk/eXist/src/org/exist/client/IndexDialog.java trunk/eXist/src/org/exist/client/QueryDialog.java trunk/eXist/src/org/exist/client/TriggersDialog.java trunk/eXist/src/org/exist/http/realm/XmldbRealm.java trunk/eXist/src/org/exist/jetty/ServerShutdown.java trunk/eXist/src/org/exist/xmldb/XmldbURI.java trunk/eXist/test/src/org/exist/storage/MoveCollectionTest.java trunk/eXist/test/src/org/exist/storage/MoveResourceTest.java trunk/eXist/test/src/org/exist/storage/UpdateRecoverTest.java Modified: trunk/eXist/extensions/fluent/src/org/exist/fluent/Database.java =================================================================== --- trunk/eXist/extensions/fluent/src/org/exist/fluent/Database.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/fluent/src/org/exist/fluent/Database.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -88,7 +88,7 @@ // If the config is already *exactly* how we want it, no need to reload and reindex. try { Node currentConfig = - db.getFolder(CollectionConfigurationManager.CONFIG_COLLECTION + Database.ROOT_PREFIX).documents() + db.getFolder(XmldbURI.CONFIG_COLLECTION + Database.ROOT_PREFIX).documents() .get(CollectionConfiguration.DEFAULT_COLLECTION_CONFIG_FILE).xml().root(); if (currentConfig.query().presub().single("deep-equal(., $1)", configXml.toString()).booleanValue()) return; } catch (DatabaseException e) { @@ -249,7 +249,7 @@ } private static String dbName = "exist"; - public static final String ROOT_PREFIX = DBBroker.ROOT_COLLECTION; + public static final String ROOT_PREFIX = XmldbURI.ROOT_COLLECTION; private static volatile BrokerPool pool; private static TransactionManager txManager; private static final ThreadLocal<Transaction> localTransaction = new ThreadLocal<Transaction>(); Modified: trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/ConcurrencyTest.java =================================================================== --- trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/ConcurrencyTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/ConcurrencyTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -32,12 +32,12 @@ import java.util.concurrent.TimeUnit; import org.exist.TestUtils; -import org.exist.storage.DBBroker; import org.exist.util.MimeTable; import org.exist.util.MimeType; import org.exist.xmldb.DatabaseInstanceManager; import org.exist.xmldb.IndexQueryService; import org.exist.xmldb.XQueryService; +import org.exist.xmldb.XmldbURI; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -194,7 +194,7 @@ database.setProperty("create-database", "true"); DatabaseManager.registerDatabase(database); - org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", null); + org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0"); test = mgmt.createCollection("test"); } catch (Exception e) { @@ -207,7 +207,7 @@ public static void closeDB() { TestUtils.cleanupDB(); try { - Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", null); + Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0"); mgr.shutdown(); } catch (XMLDBException e) { Modified: trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java =================================================================== --- trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -369,7 +369,7 @@ @Test public void boosts() { - DocumentSet docs = configureAndStore(COLLECTION_CONFIG6, XML6, "test.xml"); + configureAndStore(COLLECTION_CONFIG6, XML6, "test.xml"); DBBroker broker = null; try { broker = pool.get(pool.getSecurityManager().getSystemSubject()); @@ -392,7 +392,7 @@ @Test public void queryTranslation() { - DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, XML7, "test.xml"); + configureAndStore(COLLECTION_CONFIG1, XML7, "test.xml"); DBBroker broker = null; try { broker = pool.get(pool.getSecurityManager().getSystemSubject()); @@ -594,7 +594,7 @@ @Test public void dropDocuments() { System.out.println("Test removal of multiple documents ..."); - DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, "samples/shakespeare"); + configureAndStore(COLLECTION_CONFIG1, "samples/shakespeare"); DBBroker broker = null; TransactionManager transact = null; Txn transaction = null; Modified: trunk/eXist/extensions/indexes/ngram/test/src/org/exist/indexing/ngram/MatchListenerTest.java =================================================================== --- trunk/eXist/extensions/indexes/ngram/test/src/org/exist/indexing/ngram/MatchListenerTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/indexes/ngram/test/src/org/exist/indexing/ngram/MatchListenerTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -145,6 +145,32 @@ } @Test + public void nestedContent1() { + DBBroker broker = null; + try { + configureAndStore(CONF1, XML); + + broker = pool.get(pool.getSecurityManager().getSystemSubject()); + + XQuery xquery = broker.getXQueryService(); + assertNotNull(xquery); + + Sequence seq = xquery.execute("//para[ngram:contains(., 'content') and ngram:contains(., 'mixed')]", null, AccessContext.TEST); + assertNotNull(seq); + assertEquals(1, seq.getItemCount()); + String result = queryResult2String(broker, seq, 0); + System.out.println("RESULT: " + result); + XMLAssert.assertEquals("<para>some paragraph with <hi>" + MATCH_START + "mixed" + MATCH_END + + "</hi> " + MATCH_START + "content" + MATCH_END + ".</para>", result); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } finally { + pool.release(broker); + } + } + + @Test public void matchInParent() { DBBroker broker = null; try { Modified: trunk/eXist/extensions/indexes/spatial/test/src/org/exist/indexing/spatial/GMLIndexTest.java =================================================================== --- trunk/eXist/extensions/indexes/spatial/test/src/org/exist/indexing/spatial/GMLIndexTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/indexes/spatial/test/src/org/exist/indexing/spatial/GMLIndexTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -43,6 +43,7 @@ import org.exist.storage.BrokerPool; import org.exist.storage.DBBroker; import org.exist.xmldb.IndexQueryService; +import org.exist.xmldb.XmldbURI; import org.exist.xquery.XQuery; import org.exist.xquery.value.Sequence; import org.geotools.gml.GMLFilterDocument; @@ -1061,7 +1062,7 @@ DatabaseManager.registerDatabase(database); Collection root = - DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", null); + DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); CollectionManagementService service = (CollectionManagementService) root.getService( "CollectionManagementService", Modified: trunk/eXist/extensions/svn/test/src/org/exist/versioning/svn/WorkingCopyTesting.java =================================================================== --- trunk/eXist/extensions/svn/test/src/org/exist/versioning/svn/WorkingCopyTesting.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/svn/test/src/org/exist/versioning/svn/WorkingCopyTesting.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -20,9 +20,9 @@ import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.PostMethod; -import org.exist.storage.DBBroker; import org.exist.versioning.svn.Resource; import org.exist.xmldb.DatabaseInstanceManager; +import org.exist.xmldb.XmldbURI; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -721,7 +721,7 @@ // myWorkingCopyPath = "/"+myWorkingCopyName; org.xmldb.api.base.Collection root = DatabaseManager.getCollection( - "xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", ""); + XmldbURI.LOCAL_DB, "admin", ""); CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0"); try { mgmt.removeCollection(myWorkingCopyName); @@ -741,7 +741,7 @@ if (repositoryID != null) deleteRepository(repositoryID); - Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", null); + Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); // CollectionManagementService cmgr = (CollectionManagementService) // root.getService("CollectionManagementService", "1.0"); // cmgr.removeCollection("test"); Modified: trunk/eXist/extensions/xqdoc/src/org/exist/xqdoc/ant/XQDocTask.java =================================================================== --- trunk/eXist/extensions/xqdoc/src/org/exist/xqdoc/ant/XQDocTask.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/xqdoc/src/org/exist/xqdoc/ant/XQDocTask.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -14,8 +14,8 @@ import org.exist.ant.AbstractXMLDBTask; import org.exist.source.Source; import org.exist.source.StringSource; -import org.exist.storage.DBBroker; import org.exist.xmldb.XQueryService; +import org.exist.xmldb.XmldbURI; import org.exist.xquery.Constants; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; @@ -49,7 +49,7 @@ public void execute() throws BuildException { registerDatabase(); try { - int p = uri.indexOf(DBBroker.ROOT_COLLECTION); + int p = uri.indexOf(XmldbURI.ROOT_COLLECTION); if (p == Constants.STRING_NOT_FOUND) throw new BuildException("invalid uri: '" + uri + "'"); String baseURI = uri.substring(0, p); @@ -62,8 +62,8 @@ Collection root = null; if (createCollection) { - root = DatabaseManager.getCollection(baseURI + DBBroker.ROOT_COLLECTION, user, password); - root = mkcol(root, baseURI, DBBroker.ROOT_COLLECTION, path); + root = DatabaseManager.getCollection(baseURI + XmldbURI.ROOT_COLLECTION, user, password); + root = mkcol(root, baseURI, XmldbURI.ROOT_COLLECTION, path); } else root = DatabaseManager.getCollection(uri, user, password); Modified: trunk/eXist/extensions/xslt/test/src/org/exist/xslt/XSLTestCase.java =================================================================== --- trunk/eXist/extensions/xslt/test/src/org/exist/xslt/XSLTestCase.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/extensions/xslt/test/src/org/exist/xslt/XSLTestCase.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -39,7 +39,7 @@ import java.util.regex.Pattern; import org.exist.storage.BrokerPool; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -59,7 +59,7 @@ */ public class XSLTestCase { - private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; + private final static String URI = XmldbURI.LOCAL_DB; private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; private final static String XSLT_COLLECTION = "xslt_tests"; Modified: trunk/eXist/samples/src/org/exist/examples/http/PostExample.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/http/PostExample.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/http/PostExample.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -29,7 +29,7 @@ import java.net.URL; import org.exist.Namespaces; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; /** * PostExample @@ -63,7 +63,7 @@ } private void doPost(String request) throws IOException { - URL url = new URL("http://localhost:8080/exist/rest" + DBBroker.ROOT_COLLECTION); + URL url = new URL("http://localhost:8080/exist/rest" + XmldbURI.ROOT_COLLECTION); HttpURLConnection connect = (HttpURLConnection) url.openConnection(); connect.setRequestMethod("POST"); connect.setDoOutput(true); Modified: trunk/eXist/samples/src/org/exist/examples/http/PutExample.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/http/PutExample.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/http/PutExample.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -21,7 +21,8 @@ */ package org.exist.examples.http; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; + import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -59,7 +60,7 @@ try { URL url = new URL("http://localhost:8080/exist/rest" - + DBBroker.ROOT_COLLECTION + "/test/" + docName); + + XmldbURI.ROOT_COLLECTION + "/test/" + docName); System.out.println("PUT file to "+url.toString()); HttpURLConnection connect = (HttpURLConnection) url.openConnection(); Modified: trunk/eXist/samples/src/org/exist/examples/soap/GetDocument.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/soap/GetDocument.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/soap/GetDocument.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -24,7 +24,7 @@ import org.exist.soap.Query; import org.exist.soap.QueryService; import org.exist.soap.QueryServiceLocator; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; /** * Get document via SOAP. First insert shakespeare example documents. @@ -39,7 +39,7 @@ String session = query.connect("guest", "guest"); byte[] data = query.getResourceData(session, - DBBroker.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml", + XmldbURI.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml", true, false, false); System.out.println(new String(data, "UTF-8")); query.disconnect(session); Modified: trunk/eXist/samples/src/org/exist/examples/soap/XUpdateExample.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/soap/XUpdateExample.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/soap/XUpdateExample.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -27,7 +27,7 @@ import org.exist.soap.Query; import org.exist.soap.QueryService; import org.exist.soap.QueryServiceLocator; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; import org.exist.xupdate.XUpdateProcessor; /** @@ -61,11 +61,11 @@ Query query = queryService.getQuery(); String session = admin.connect("guest", "guest"); - admin.store(session, document.getBytes("UTF-8"), "UTF-8", DBBroker.ROOT_COLLECTION + "/test/notes.xml", true); - admin.xupdateResource(session, DBBroker.ROOT_COLLECTION + "/test/notes.xml", xupdate); + admin.store(session, document.getBytes("UTF-8"), "UTF-8", XmldbURI.ROOT_COLLECTION + "/test/notes.xml", true); + admin.xupdateResource(session, XmldbURI.ROOT_COLLECTION + "/test/notes.xml", xupdate); String data = query.getResource(session, - DBBroker.ROOT_COLLECTION + "/test/notes.xml", + XmldbURI.ROOT_COLLECTION + "/test/notes.xml", true, true); System.out.println(data); admin.disconnect(session); Modified: trunk/eXist/samples/src/org/exist/examples/xmldb/MultipleDatabases.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/xmldb/MultipleDatabases.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/xmldb/MultipleDatabases.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -2,9 +2,9 @@ import java.io.File; -import org.exist.storage.DBBroker; import org.exist.xmldb.DatabaseInstanceManager; import org.exist.xmldb.XQueryService; +import org.exist.xmldb.XmldbURI; import org.exist.xupdate.XUpdateProcessor; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; @@ -28,8 +28,8 @@ protected static String driver = "org.exist.xmldb.DatabaseImpl"; - protected static String URI_DB1 = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; - protected static String URI_DB2 = "xmldb:test://" + DBBroker.ROOT_COLLECTION; + protected static String URI_DB1 = "xmldb:exist://" + XmldbURI.ROOT_COLLECTION; + protected static String URI_DB2 = "xmldb:test://" + XmldbURI.ROOT_COLLECTION; protected static String XUPDATE_1 = "<xu:modifications version=\"1.0\" xmlns:xu=\"" + XUpdateProcessor.XUPDATE_NS + "\">" + Modified: trunk/eXist/samples/src/org/exist/examples/xmldb/NestedExample.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/xmldb/NestedExample.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/xmldb/NestedExample.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -2,8 +2,8 @@ import javax.xml.transform.OutputKeys; -import org.exist.storage.DBBroker; import org.exist.xmldb.XPathQueryServiceImpl; +import org.exist.xmldb.XmldbURI; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; @@ -33,7 +33,7 @@ database.setProperty( "create-database", "true" ); DatabaseManager.registerDatabase( database ); Collection col = - DatabaseManager.getCollection( URI + DBBroker.ROOT_COLLECTION, "admin", "" ); + DatabaseManager.getCollection( URI + XmldbURI.ROOT_COLLECTION, "admin", "" ); XMLResource res = (XMLResource)col.createResource("test.xml", "XMLResource"); res.setContent(data); col.storeResource(res); Modified: trunk/eXist/samples/src/org/exist/examples/xmldb/Put.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/xmldb/Put.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/xmldb/Put.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -2,7 +2,7 @@ import java.io.File; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; @@ -45,10 +45,10 @@ // for simplicity, we assume that the new collection is a // direct child of the root collection, e.g. /db/test. // the example will fail otherwise. - Collection root = DatabaseManager.getCollection(URI + DBBroker.ROOT_COLLECTION); + Collection root = DatabaseManager.getCollection(URI + XmldbURI.ROOT_COLLECTION); CollectionManagementService mgtService = (CollectionManagementService)root.getService("CollectionManagementService", "1.0"); - col = mgtService.createCollection(collection.substring((DBBroker.ROOT_COLLECTION + "/").length())); + col = mgtService.createCollection(collection.substring((XmldbURI.ROOT_COLLECTION + "/").length())); } File f = new File(file); // create new XMLResource Modified: trunk/eXist/samples/src/org/exist/examples/xmldb/XQueryExample.java =================================================================== --- trunk/eXist/samples/src/org/exist/examples/xmldb/XQueryExample.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/samples/src/org/exist/examples/xmldb/XQueryExample.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -8,10 +8,10 @@ import javax.xml.transform.OutputKeys; -import org.exist.storage.DBBroker; import org.exist.util.serializer.SAXSerializer; import org.exist.util.serializer.SerializerPool; import org.exist.xmldb.XQueryService; +import org.exist.xmldb.XmldbURI; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.CompiledExpression; @@ -62,7 +62,7 @@ // get root-collection Collection col = - DatabaseManager.getCollection(URI + DBBroker.ROOT_COLLECTION); + DatabaseManager.getCollection(URI + XmldbURI.ROOT_COLLECTION); // get query-service XQueryService service = (XQueryService) col.getService( "XQueryService", "1.0" ); Modified: trunk/eXist/src/org/exist/backup/Backup.java =================================================================== --- trunk/eXist/src/org/exist/backup/Backup.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/Backup.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -33,8 +33,6 @@ import org.exist.Namespaces; import org.exist.security.Permission; -import org.exist.storage.DBBroker; -import org.exist.storage.NativeBroker; import org.exist.storage.serializers.EXistOutputKeys; import org.exist.util.serializer.SAXSerializer; import org.exist.util.serializer.SerializerPool; @@ -103,7 +101,7 @@ public Backup( String user, String pass, String target ) { - this( user, pass, target, XmldbURI.create( "xmldb:exist://" + DBBroker.ROOT_COLLECTION ) ); + this( user, pass, target, XmldbURI.LOCAL_DB_URI ); } @@ -393,7 +391,7 @@ for( int i = 0; i < collections.length; i++ ) { - if( current.getName().equals( NativeBroker.SYSTEM_COLLECTION ) && collections[i].equals( "temp" ) ) { + if( current.getName().equals( XmldbURI.SYSTEM_COLLECTION ) && collections[i].equals( "temp" ) ) { continue; } attr.clear(); @@ -417,7 +415,7 @@ for( int i = 0; i < collections.length; i++ ) { child = current.getChildCollection( collections[i] ); - if( child.getName().equals( NativeBroker.TEMP_COLLECTION ) ) { + if( child.getName().equals( XmldbURI.TEMP_COLLECTION ) ) { continue; } output.newCollection( encode( URIUtils.urlDecodeUtf8( collections[i] ) ) ); Modified: trunk/eXist/src/org/exist/backup/CreateBackupDialog.java =================================================================== --- trunk/eXist/src/org/exist/backup/CreateBackupDialog.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/CreateBackupDialog.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -27,7 +27,7 @@ import org.exist.client.Messages; import org.exist.client.MimeTypeFileFilter; -import org.exist.storage.DBBroker; +import org.exist.xmldb.XmldbURI; import java.awt.Dimension; import java.awt.GridBagConstraints; @@ -155,7 +155,7 @@ Vector<String> list = new Vector<String>(); try { - Collection root = DatabaseManager.getCollection( uri + DBBroker.ROOT_COLLECTION, user, passwd ); + Collection root = DatabaseManager.getCollection( uri + XmldbURI.ROOT_COLLECTION, user, passwd ); getAllCollections( root, list ); } catch( XMLDBException e ) { Modified: trunk/eXist/src/org/exist/backup/Main.java =================================================================== --- trunk/eXist/src/org/exist/backup/Main.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/Main.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -21,10 +21,7 @@ */ package org.exist.backup; -import java.lang.reflect.InvocationTargetException; import java.util.concurrent.ExecutorService; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.avalon.excalibur.cli.CLArgsParser; import org.apache.avalon.excalibur.cli.CLOption; import org.apache.avalon.excalibur.cli.CLOptionDescriptor; @@ -37,7 +34,6 @@ import org.xmldb.api.base.Database; import org.xmldb.api.base.XMLDBException; -import org.exist.storage.DBBroker; import org.exist.util.ConfigurationHelper; import org.exist.xmldb.DatabaseInstanceManager; import org.exist.xmldb.XmldbURI; @@ -55,7 +51,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.prefs.Preferences; @@ -63,7 +58,6 @@ import javax.swing.JFileChooser; import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; import javax.xml.parsers.ParserConfigurationException; import org.exist.backup.restore.listener.DefaultRestoreListener; import org.exist.backup.restore.listener.GuiRestoreListener; @@ -262,7 +256,7 @@ properties.setProperty( "backup-dir", dialog.getBackupTarget() ); } } else { - optionBackup = DBBroker.ROOT_COLLECTION; + optionBackup = XmldbURI.ROOT_COLLECTION; } } @@ -311,9 +305,9 @@ } try { - String uri = properties.getProperty( "uri", "xmldb:exist://" ); - if(!(uri.contains(DBBroker.ROOT_COLLECTION) || uri.endsWith( DBBroker.ROOT_COLLECTION))) { - uri += DBBroker.ROOT_COLLECTION; + String uri = properties.getProperty( "uri", XmldbURI.EMBEDDED_SERVER_URI_PREFIX ); + if(!(uri.contains(XmldbURI.ROOT_COLLECTION) || uri.endsWith( XmldbURI.ROOT_COLLECTION))) { + uri += XmldbURI.ROOT_COLLECTION; } Collection root = DatabaseManager.getCollection(uri, properties.getProperty( "user", "admin" ), ( optionDbaPass == null ) ? optionPass : optionDbaPass ); Modified: trunk/eXist/src/org/exist/backup/Restore.java =================================================================== --- trunk/eXist/src/org/exist/backup/Restore.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/Restore.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -35,7 +35,6 @@ import org.exist.backup.restore.listener.RestoreListener; import org.exist.security.Account; import org.exist.security.SecurityManager; -import org.exist.storage.DBBroker; import org.exist.util.EXistInputSource; import org.exist.xmldb.UserManagementService; import org.exist.xmldb.XmldbURI; @@ -56,7 +55,6 @@ private final static Logger LOG = Logger.getLogger(Restore.class); - public void restore(RestoreListener listener, String username, String password, String newAdminPass, File f, String uri) throws XMLDBException, FileNotFoundException, IOException, SAXException, ParserConfigurationException, URISyntaxException { //set the admin password @@ -150,8 +148,8 @@ private String setAdminCredentials(String uri, String username, String password, String adminPassword) throws XMLDBException, URISyntaxException { final XmldbURI dbUri; - if(!uri.endsWith(DBBroker.ROOT_COLLECTION)) { - dbUri = XmldbURI.xmldbUriFor(uri + DBBroker.ROOT_COLLECTION); + if(!uri.endsWith(XmldbURI.ROOT_COLLECTION)) { + dbUri = XmldbURI.xmldbUriFor(uri + XmldbURI.ROOT_COLLECTION); } else { dbUri = XmldbURI.xmldbUriFor(uri); } Modified: trunk/eXist/src/org/exist/backup/SystemExport.java =================================================================== --- trunk/eXist/src/org/exist/backup/SystemExport.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/SystemExport.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -86,7 +86,7 @@ { private final static Logger LOG = Logger.getLogger( SystemExport.class ); - private static final XmldbURI TEMP_COLLECTION = XmldbURI.createInternal( NativeBroker.TEMP_COLLECTION ); + private static final XmldbURI TEMP_COLLECTION = XmldbURI.createInternal( XmldbURI.TEMP_COLLECTION ); private static final XmldbURI CONTENTS_URI = XmldbURI.createInternal( "__contents__.xml" ); private static final XmldbURI LOST_URI = XmldbURI.createInternal( "__lost_and_found__" ); @@ -197,7 +197,7 @@ BackupWriter output; if( zip ) { - output = new ZipWriter( backupFile, DBBroker.ROOT_COLLECTION ); + output = new ZipWriter( backupFile, XmldbURI.ROOT_COLLECTION ); } else { output = new FileSystemWriter( backupFile ); } Modified: trunk/eXist/src/org/exist/backup/restore/RestoreHandler.java =================================================================== --- trunk/eXist/src/org/exist/backup/restore/RestoreHandler.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/backup/restore/RestoreHandler.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -37,7 +37,6 @@ import org.exist.Namespaces; import org.exist.dom.DocumentTypeImpl; import org.exist.security.SecurityManager; -import org.exist.storage.DBBroker; import org.exist.util.EXistInputSource; import org.exist.xmldb.CollectionImpl; import org.exist.xmldb.CollectionManagementServiceImpl; @@ -494,8 +493,8 @@ final XmldbURI[] segments = Arrays.copyOfRange(allSegments, 1, allSegments.length); //drop the first 'db' segment final XmldbURI dbUri; - if(!dbBaseUri.endsWith(DBBroker.ROOT_COLLECTION)) { - dbUri = XmldbURI.xmldbUriFor(dbBaseUri + DBBroker.ROOT_COLLECTION); + if(!dbBaseUri.endsWith(XmldbURI.ROOT_COLLECTION)) { + dbUri = XmldbURI.xmldbUriFor(dbBaseUri + XmldbURI.ROOT_COLLECTION); } else { dbUri = XmldbURI.xmldbUriFor(dbBaseUri); } Modified: trunk/eXist/src/org/exist/client/ClientFrame.java =================================================================== --- trunk/eXist/src/org/exist/client/ClientFrame.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/client/ClientFrame.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -70,7 +70,6 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import java.util.prefs.Preferences; import javax.swing.BorderFactory; @@ -122,7 +121,6 @@ import org.exist.security.internal.aider.ACEAider; import org.exist.security.internal.aider.PermissionAider; import org.exist.security.internal.aider.PermissionAiderFactory; -import org.exist.storage.DBBroker; import org.exist.storage.serializers.EXistOutputKeys; import org.exist.util.MimeTable; import org.exist.util.MimeType; @@ -944,7 +942,7 @@ //get an array of collection paths try { - Collection root = client.getCollection(DBBroker.ROOT_COLLECTION); + Collection root = client.getCollection(XmldbURI.ROOT_COLLECTION); ArrayList<PrettyXmldbURI> alCollections = getCollections(root, new ArrayList<PrettyXmldbURI>()); collections = new PrettyXmldbURI[alCollections.size()]; alCollections.toArray(collections); @@ -1028,7 +1026,7 @@ //get an array of collection paths try { - Collection root = client.getCollection(DBBroker.ROOT_COLLECTION); + Collection root = client.getCollection(XmldbURI.ROOT_COLLECTION); ArrayList<PrettyXmldbURI> alCollections = getCollections(root, new ArrayList<PrettyXmldbURI>()); collections = new PrettyXmldbURI[alCollections.size()]; alCollections.toArray(collections); @@ -1304,7 +1302,7 @@ }; final ExecutorService executor = Executors.newSingleThreadExecutor(); - final Future<Void> future = executor.submit(callable); + executor.submit(callable); } private void editUsersAction(ActionEvent ev) { @@ -1398,7 +1396,7 @@ private void editPolicies() { Collection systemCollection; try { - systemCollection = client.getCollection(DBBroker.SYSTEM_COLLECTION); + systemCollection = client.getCollection(XmldbURI.SYSTEM_COLLECTION); } catch (XMLDBException e) { showErrorMessage(Messages.getString("ClientFrame.187"), e); //$NON-NLS-1$ return; Modified: trunk/eXist/src/org/exist/client/IndexDialog.java =================================================================== --- trunk/eXist/src/org/exist/client/IndexDialog.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/client/IndexDialog.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -22,7 +22,6 @@ package org.exist.client; import org.exist.collections.CollectionConfigurationManager; -import org.exist.storage.DBBroker; import org.exist.xmldb.IndexQueryService; import org.exist.xmldb.XmldbURI; import org.xmldb.api.base.Collection; @@ -110,7 +109,7 @@ setupComponents(); //Get the indexes for the root collection - actionGetIndexes(DBBroker.ROOT_COLLECTION); + actionGetIndexes(XmldbURI.ROOT_COLLECTION); } private void setupComponents() @@ -139,7 +138,7 @@ ArrayList alCollections = new ArrayList(); try { - Collection root = client.getCollection(DBBroker.ROOT_COLLECTION); + Collection root = client.getCollection(XmldbURI.ROOT_COLLECTION); ArrayList alAllCollections = getCollections(root, new ArrayList()); for(int i = 0; i < alAllCollections.size(); i++) { Modified: trunk/eXist/src/org/exist/client/QueryDialog.java =================================================================== --- trunk/eXist/src/org/exist/client/QueryDialog.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/client/QueryDialog.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -60,9 +60,9 @@ import javax.swing.border.BevelBorder; import javax.xml.transform.OutputKeys; -import org.exist.storage.DBBroker; import org.exist.xmldb.XQueryService; import org.exist.xmldb.LocalCollection; +import org.exist.xmldb.XmldbURI; import org.exist.xquery.CompiledXQuery; import org.exist.xquery.XQueryContext; import org.exist.xquery.XQueryWatchDog; @@ -297,7 +297,7 @@ final Vector<String> data= new Vector<String>(); try { - Collection root = client.getCollection(DBBroker.ROOT_COLLECTION); + Collection root = client.getCollection(XmldbURI.ROOT_COLLECTION); data.addElement(collection.getName()); getCollections(root, collection, data); } catch (XMLDBException e) { Modified: trunk/eXist/src/org/exist/client/TriggersDialog.java =================================================================== --- trunk/eXist/src/org/exist/client/TriggersDialog.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/client/TriggersDialog.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -50,8 +50,6 @@ import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; -import org.exist.collections.CollectionConfigurationManager; -import org.exist.storage.DBBroker; import org.exist.xmldb.XmldbURI; import org.xmldb.api.base.Collection; import org.xmldb.api.base.XMLDBException; @@ -105,7 +103,7 @@ setupComponents(); //Get the indexes for the root collection - actionGetTriggers(DBBroker.ROOT_COLLECTION); + actionGetTriggers(XmldbURI.ROOT_COLLECTION); } private void setupComponents() @@ -132,12 +130,12 @@ ArrayList<PrettyXmldbURI> alCollections = new ArrayList<PrettyXmldbURI>(); try { - Collection root = client.getCollection(DBBroker.ROOT_COLLECTION); + Collection root = client.getCollection(XmldbURI.ROOT_COLLECTION); ArrayList<PrettyXmldbURI> alAllCollections = getCollections(root, new ArrayList<PrettyXmldbURI>()); for(int i = 0; i < alAllCollections.size(); i++) { //TODO : use XmldbURIs ! - if(alAllCollections.get(i).toString().indexOf(CollectionConfigurationManager.CONFIG_COLLECTION) == -1) + if(alAllCollections.get(i).toString().indexOf(XmldbURI.CONFIG_COLLECTION) == -1) { alCollections.add(alAllCollections.get(i)); } Modified: trunk/eXist/src/org/exist/http/realm/XmldbRealm.java =================================================================== --- trunk/eXist/src/org/exist/http/realm/XmldbRealm.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/http/realm/XmldbRealm.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -15,10 +15,10 @@ import org.exist.security.Account; import org.exist.security.XmldbPrincipal; import org.exist.storage.BrokerPool; -import org.exist.storage.DBBroker; import org.exist.util.Configuration; import org.exist.util.DatabaseConfigurationException; import org.exist.xmldb.UserManagementService; +import org.exist.xmldb.XmldbURI; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; @@ -31,7 +31,7 @@ private String configuration = "conf.xml"; - private String uri = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; + private String uri = XmldbURI.LOCAL_DB; private String driver = "org.exist.xmldb.DatabaseImpl"; Modified: trunk/eXist/src/org/exist/jetty/ServerShutdown.java =================================================================== --- trunk/eXist/src/org/exist/jetty/ServerShutdown.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/jetty/ServerShutdown.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -12,9 +12,9 @@ import org.apache.xmlrpc.XmlRpcException; -import org.exist.storage.DBBroker; import org.exist.util.ConfigurationHelper; import org.exist.xmldb.DatabaseInstanceManager; +import org.exist.xmldb.XmldbURI; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; @@ -96,8 +96,8 @@ // create the default database Database database = (Database) cl.newInstance(); DatabaseManager.registerDatabase(database); - if (!uri.endsWith(DBBroker.ROOT_COLLECTION)) - uri = uri + DBBroker.ROOT_COLLECTION; + if (!uri.endsWith(XmldbURI.ROOT_COLLECTION)) + uri = uri + XmldbURI.ROOT_COLLECTION; Collection root = DatabaseManager.getCollection(uri, user, passwd); DatabaseInstanceManager manager = (DatabaseInstanceManager) root .getService("DatabaseInstanceManager", "1.0"); Modified: trunk/eXist/src/org/exist/xmldb/XmldbURI.java =================================================================== --- trunk/eXist/src/org/exist/xmldb/XmldbURI.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/src/org/exist/xmldb/XmldbURI.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.exist.storage.DBBroker; import org.exist.xquery.Constants; import org.exist.xquery.util.URIUtils; import org.exist.xquery.value.AnyURIValue; @@ -930,8 +929,8 @@ name2 = "/" + name2; } - if (!name2.startsWith(DBBroker.ROOT_COLLECTION)) { - name2 = DBBroker.ROOT_COLLECTION + name2; + if (!name2.startsWith(XmldbURI.ROOT_COLLECTION)) { + name2 = XmldbURI.ROOT_COLLECTION + name2; } if (name2.endsWith("/") && (name2.length() > 1)) { @@ -971,8 +970,8 @@ name2 = "/" + name2; } - if (!name2.startsWith(DBBroker.ROOT_COLLECTION)) { - name2 = DBBroker.ROOT_COLLECTION + name2; + if (!name2.startsWith(XmldbURI.ROOT_COLLECTION)) { + name2 = XmldbURI.ROOT_COLLECTION + name2; } if (name2.endsWith("/") && (name2.length() > 1)) { Modified: trunk/eXist/test/src/org/exist/storage/MoveCollectionTest.java =================================================================== --- trunk/eXist/test/src/org/exist/storage/MoveCollectionTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/test/src/org/exist/storage/MoveCollectionTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -199,7 +199,7 @@ try { pool = startDB(); assertNotNull(pool); - org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", ""); + org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); assertNotNull(root); CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl) root.getService("CollectionManagementService", "1.0"); Modified: trunk/eXist/test/src/org/exist/storage/MoveResourceTest.java =================================================================== --- trunk/eXist/test/src/org/exist/storage/MoveResourceTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/test/src/org/exist/storage/MoveResourceTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -231,7 +231,7 @@ @SuppressWarnings("unused") BrokerPool pool = startDB(); - org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", ""); + org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl) root.getService("CollectionManagementService", "1.0"); org.xmldb.api.base.Collection test = root.getChildCollection("test"); Modified: trunk/eXist/test/src/org/exist/storage/UpdateRecoverTest.java =================================================================== --- trunk/eXist/test/src/org/exist/storage/UpdateRecoverTest.java 2012-04-28 13:28:17 UTC (rev 16289) +++ trunk/eXist/test/src/org/exist/storage/UpdateRecoverTest.java 2012-04-28 16:36:34 UTC (rev 16290) @@ -311,7 +311,7 @@ try { pool = startDB(); assertNotNull(pool); - org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", ""); + org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); assertNotNull(root); CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl) root.getService("CollectionManagementService", "1.0"); @@ -457,7 +457,7 @@ assertNotNull("Document should not be null", res); System.out.println(res.getContent()); - org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", ""); + org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", ""); assertNotNull(root); CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl) root.getService("CollectionManagementService", "1.0"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |