Author: vgritsenko Date: Mon Oct 4 16:58:14 2004 New Revision: 53769 Added: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/WEB-INF/ - copied from rev 53759, cocoon/trunk/src/blocks/xmldb/WEB-INF/ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xindice-mapping.xweb - copied unchanged from rev 53759, cocoon/trunk/src/blocks/xmldb/conf/xindice-mapping.xweb cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xindice-servlet.xweb - copied unchanged from rev 53759, cocoon/trunk/src/blocks/xmldb/conf/xindice-servlet.xweb Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/WEB-INF/xindice.xml cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xmldb.xconf cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource.java cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java Log: sync xmldb block with 2.2
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/WEB-INF/xindice.xml ============================================================================== --- cocoon/trunk/src/blocks/xmldb/WEB-INF/xindice.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/WEB-INF/xindice.xml Mon Oct 4 16:58:14 2004 @@ -15,7 +15,7 @@ - See the License for the specific language governing permissions and - limitations under the License. - - - CVS $Id: xindice.xml,v 1.1 2004/05/28 12:45:00 vgritsenko Exp $ + - CVS $Id$ --> <!-- Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xmldb.xconf ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xmldb.xconf (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/conf/xmldb.xconf Mon Oct 4 16:58:14 2004 @@ -47,6 +47,8 @@ Default is `pwd` (current working directory). <db-home>/var/xindice/db</db-home> --> + + <managed>true</managed> </driver> <!-- Add here other XML:DB compliant databases' drivers --> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource.java Mon Oct 4 16:58:14 2004 @@ -61,7 +61,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Gianugo Rabellino</a> * @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a> - * @version CVS $Id: XMLDBSource.java,v 1.17 2004/05/16 16:13:25 cziegeler Exp $ + * @version CVS $Id$ */ public class XMLDBSource extends AbstractLogEnabled implements Source, ModifiableSource, XMLizable { @@ -493,7 +493,7 @@ base = this.url.substring(0, this.url.lastIndexOf("/")); name = this.url.substring(this.url.lastIndexOf("/")+1); } - Collection collection = DatabaseManager.getCollection(base); + Collection collection = DatabaseManager.getCollection(base, user, password); if (name.equals("")) { name = collection.createId(); @@ -526,7 +526,7 @@ base = k.substring(0, k.lastIndexOf("/")); name = k.substring(k.lastIndexOf("/")+1); - Collection collection = DatabaseManager.getCollection(base); + Collection collection = DatabaseManager.getCollection(base, user, password); CollectionManagementService service = (CollectionManagementService) collection.getService("CollectionManagementService", "1.0"); @@ -541,7 +541,7 @@ base = this.url.substring(0, this.url.lastIndexOf("/")); name = this.url.substring(this.url.lastIndexOf("/")+1); - Collection collection = DatabaseManager.getCollection(base); + Collection collection = DatabaseManager.getCollection(base, user, password); Resource resource = collection.getResource(name); if (resource == null) { Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java Mon Oct 4 16:58:14 2004 @@ -1,12 +1,12 @@ /* * Copyright 1999-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,16 +16,16 @@ package org.apache.cocoon.generation; import org.apache.avalon.framework.activity.Initializable; -import org.apache.avalon.framework.component.ComponentException; -import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.parameters.Parameters; + import org.apache.cocoon.ProcessingException; import org.apache.cocoon.ResourceNotFoundException; import org.apache.cocoon.caching.CacheableProcessingComponent; import org.apache.cocoon.environment.SourceResolver; + import org.apache.excalibur.source.SourceValidity; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; @@ -56,10 +56,10 @@ * slash in the base tag is important! * * @author <a href="mailto:[EMAIL PROTECTED]">Gianugo Rabellino</a> - * @version CVS $Id: XMLDBCollectionGenerator.java,v 1.4 2004/03/05 13:02:36 bdelacretaz Exp $ + * @version CVS $Id$ * @deprecated Use the XML:DB pseudo protocol instead. */ -public class XMLDBCollectionGenerator extends ComposerGenerator +public class XMLDBCollectionGenerator extends ServiceableGenerator implements CacheableProcessingComponent, Configurable, Initializable { protected static final String URI = @@ -78,10 +78,6 @@ protected Database database; protected Collection collection; protected final AttributesImpl attributes = new AttributesImpl(); - - public void compose(ComponentManager manager) throws ComponentException { - super.compose(manager); - } /** * Recycle the component, keep only the configuration variables Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java Mon Oct 4 16:58:14 2004 @@ -1,12 +1,12 @@ /* * Copyright 1999-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,16 +16,16 @@ package org.apache.cocoon.generation; import org.apache.avalon.framework.activity.Initializable; -import org.apache.avalon.framework.component.ComponentException; -import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.parameters.Parameters; + import org.apache.cocoon.ProcessingException; import org.apache.cocoon.ResourceNotFoundException; import org.apache.cocoon.caching.CacheableProcessingComponent; import org.apache.cocoon.environment.SourceResolver; + import org.apache.excalibur.source.SourceValidity; import org.xml.sax.SAXException; import org.xmldb.api.DatabaseManager; @@ -56,10 +56,10 @@ * slash in the base tag is important! * * @author <a href="mailto:[EMAIL PROTECTED]">Gianugo Rabellino</a> - * @version CVS $Id: XMLDBGenerator.java,v 1.4 2004/03/05 13:02:36 bdelacretaz Exp $ + * @version CVS $Id$ * @deprecated Use the XML:DB pseudo protocol instead. */ -public class XMLDBGenerator extends ComposerGenerator +public class XMLDBGenerator extends ServiceableGenerator implements CacheableProcessingComponent, Configurable,Initializable { protected String driver; @@ -69,10 +69,6 @@ protected Database database; protected Collection collection; protected XMLResource xmlResource; - - public void compose(ComponentManager manager) throws ComponentException { - super.compose(manager); - } /** * Recycle the component, keep only the configuration variables