You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2006/03/05 15:29:28 UTC
svn commit: r383327 - in
/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src:
main/java/org/apache/cocoon/deployer/
main/java/org/apache/cocoon/deployer/applicationserver/ main/resources/xsd/
test/java/org/apache/cocoon/deployer/ test/mocks/va...
Author: reinhard
Date: Sun Mar 5 06:29:26 2006
New Revision: 383327
URL: http://svn.apache.org/viewcvs?rev=383327&view=rev
Log:
COCOON-1791 and COCOON-1792
- removed all elements from block.xml which are covered by pom.xml
- exclusive mode isn't part of deployment descriptor any more
Modified:
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/BlockDeployer.java
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServer22.java
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServerFactory.java
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/BlockDeployerTest.java
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/valid-block-1.0.jar
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/blockRoot/META-INF/block.xml
cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/valid-block-1.0.jar
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/BlockDeployer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/BlockDeployer.java?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/BlockDeployer.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/BlockDeployer.java Sun Mar 5 06:29:26 2006
@@ -42,8 +42,16 @@
private final VariableResolver variableResolver;
private final Logger log;
private final ArtifactProvider artifactProvider;
- private final List blockList = new ArrayList();
+ /**
+ * Creates the BlockDeployer object. Pass the artifact provider (How to get access to the binaries
+ * and blocks?), the variable resolver (If you want to use variable resolving in deployment descriptors)
+ * and the logger.
+ *
+ * @param artifactProvider - provide your implementation how to access the block binaries
+ * @param variableResolver - if you use variables in your deployment descriptor, you have to provide an implementation that resolves them
+ * @param log - a logger for user-orientated messages about the deployment process.
+ */
public BlockDeployer( final ArtifactProvider artifactProvider,
final VariableResolver variableResolver, final Logger log) {
@@ -62,40 +70,30 @@
* <p>If any error occurres, the unchecked @link DeploymentException is thrown.</p>
*
* @param deploymentDescriptor - the descriptor that contains all blocks that should be deployed
- * @param artifactProvider - provide your implementation how to access the block binaries
- * @param variableResolver - if you use variables in your deployment descriptor, you have to provide an implementation that resolves them
- * @param log - a logger for user-orientated messages about the deployment process.
+ * @param transactional - set it 'true' if you want the deployment process being transactional (all or nothing)
+ * @param exclusive - set it 'true' if you want to deploy a complete Cocoon application from scratch. If set to 'false', then the blocks of the descriptor are only added to the application. Currently only 'true' is supported.
*/
- public void deploy(final Deploy deploymentDescriptor, final boolean transactional) {
-
+ public void deploy(final Deploy deploymentDescriptor, final boolean transactional, final boolean exclusive) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
+ // validations
+ if(!exclusive) {
+ throw new DeploymentException("The block deployer only supports the exclusive mode at the moment.");
+ }
Validate.notNull(deploymentDescriptor, "A deployment descriptor object has to be passed.");
- // read the deploy script
- org.apache.cocoon.deployer.generated.deploy.x10.Block[] installBlocks = deploymentDescriptor.getBlock();
-
- for(int i = 0; i < installBlocks.length; i++) {
- org.apache.cocoon.deployer.generated.deploy.x10.Block installBlock = installBlocks[i];
- log.verbose("Block urn: " + installBlock.getUrn());
- String blockUrn = installBlock.getUrn();
- File blockArchive = null;
- if(installBlock.getLocation() == null) {
- blockArchive = this.artifactProvider.getArtifact(blockUrn);
- blockList.add(BlockFactory.createBinaryBlock(blockArchive, installBlock));
- } else {
- blockList.add(BlockFactory.createLocalBlock(installBlock,
- deploymentDescriptor.getCocoon().getTargetUrl()));
- }
- }
+ // variable resolving
+ // TODO implement resolving of variables
+
+ // read the deploy script and get a list of all Block objects to be installed
+ List blockList = createBlockList(deploymentDescriptor);
- // auto-wiring: if a connection is not specified, use the default implementation and
- // add the "new" blocks to the list
- new AutoWiringResolver(this.artifactProvider, this.log).resolve(this.blockList);
+ // auto-wiring: if a connection is not specified, use the default implementation and add the "new" blocks to the list
+ new AutoWiringResolver(this.artifactProvider, this.log).resolve(blockList);
- // validate deployment descriptor (correct dependencies, mount path only used once in exclusive mode,
- // set only available properties)
+ // validate deployment descriptor
+ // TODO (correct dependencies, mount path only used once in exclusive mode, set only available properties)
// get the Cocoon urn
String cocoonWebappUrn = deploymentDescriptor.getCocoon().getWebappUrn();
@@ -103,24 +101,49 @@
// get all dependant libraries transitivly
File[] libraries = artifactProvider.getArtifact(
- this.getAllBlockUrns(this.blockList, cocoonBlockFwWebappUrn));
+ this.getAllBlockUrns(blockList, cocoonBlockFwWebappUrn));
// deploy the blocks
CocoonServer cocoonServer = CocoonServerFactory.createServer(
- deploymentDescriptor.getCocoon(), this.variableResolver, this.artifactProvider);
+ deploymentDescriptor.getCocoon(), this.variableResolver, this.artifactProvider, exclusive);
+
Collections.reverse(blockList);
+
cocoonServer.deploy((Block[]) blockList.toArray(new Block[blockList.size()]),
cocoonWebappUrn, libraries, this.log, transactional);
stopWatch.stop();
this.log.info("SUCESSFULLY deployed in " + stopWatch);
-
+ }
+
+ /**
+ * Reads a deployment descriptor and creates a list of <code>Block</code> objects to be installed.
+ * @param deploymentDescriptor
+ * @return a list of <code>Block</code> objects
+ */
+ protected List createBlockList(final Deploy deploymentDescriptor) {
+ List blockList = new ArrayList();
+ org.apache.cocoon.deployer.generated.deploy.x10.Block[] installBlocks = deploymentDescriptor.getBlock();
+ for(int i = 0; i < installBlocks.length; i++) {
+ org.apache.cocoon.deployer.generated.deploy.x10.Block installBlock = installBlocks[i];
+ log.verbose("Block urn: " + installBlock.getUrn());
+ String blockUrn = installBlock.getUrn();
+ File blockArchive = null;
+ if(installBlock.getLocation() == null) {
+ blockArchive = this.artifactProvider.getArtifact(blockUrn);
+ blockList.add(BlockFactory.createBinaryBlock(blockArchive, installBlock));
+ } else {
+ blockList.add(BlockFactory.createLocalBlock(installBlock,
+ deploymentDescriptor.getCocoon().getTargetUrl()));
+ }
+ }
+ return blockList;
}
/**
* @return a list of all urns to be installed
*/
- private String[] getAllBlockUrns(List blocks, String urn) {
+ protected String[] getAllBlockUrns(List blocks, String urn) {
List urnList = new ArrayList();
urnList.add(urn);
for(Iterator it = blocks.iterator(); it.hasNext();) {
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServer22.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServer22.java?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServer22.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServer22.java Sun Mar 5 06:29:26 2006
@@ -47,6 +47,9 @@
import org.apache.cocoon.deployer.util.XMLUtils;
import org.apache.cocoon.deployer.util.ZipUtils;
import org.apache.commons.lang.Validate;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.xml.sax.SAXException;
public class CocoonServer22 implements CocoonServer {
@@ -66,10 +69,6 @@
* all or any blocks get deployed. Note that the used filesystem transaction implementation only
* supports transactions within a single thread. Therefore this method is synchronized.
*/
- /*
- * TODO exclusive mode not implemented yet
- * TODO variable resolver not used yet
- */
public synchronized boolean deploy(Block[] blocks, String serverArtifact, File[] libraries, Logger log, boolean transactional) {
Validate.notNull(blocks, "A blocks object (Block[]) has to be passed to this method!");
Validate.notNull(libraries, "A libraries object (File[]) has to passed to this method!");
@@ -77,9 +76,6 @@
// create transaction context
FileManager frm = FileUtils.createFileManager(this.baseDirectory, transactional);
- // create installed block index
- Map installedBlocks = new HashMap();
-
try {
File baseDirectoryFile = new File(this.baseDirectory);
@@ -88,81 +84,17 @@
deployCocoonServer(frm, "", serverArtifact);
}
- // create the wiring, in exclusive mode from scratch, elese take the existing one
- Wiring wiring = null;
- if(this.isExclusive()) {
- wiring = new Wiring();
- } else {
- // check wiring version
- String wiringVersion = XMLUtils.getDocumentNamespace(frm.readResource(WIRING_FILE));
- if(!WIRING_10_NAMESPACE.equals(wiringVersion)) {
- String msg = "The deployer only supports " + WIRING_10_NAMESPACE + " files.";
- log.error(msg);
- throw new DeploymentException(msg);
- }
- wiring = (Wiring) Wiring.unmarshal(new InputStreamReader(frm.readResource(WIRING_FILE)));
- }
+ // get the wiring, in exclusive mode from scratch, else take the existing one
+ Wiring wiring = getWiring(log, frm);
// install all passed blocks
- for(int i = 0; i < blocks.length; i++) {
- Block block = blocks[i];
-
- org.apache.cocoon.deployer.generated.deploy.x10.Block deployBlock =
- (org.apache.cocoon.deployer.generated.deploy.x10.Block) block.getDeployDescriptor();
- org.apache.cocoon.deployer.generated.block.x10.Block blockDesc =
- (org.apache.cocoon.deployer.generated.block.x10.Block) block.getBlockDescriptor();
-
- // create the wiring object
- org.apache.cocoon.deployer.generated.wiring.x10.Block wiringBlock =
- createWiring10BlockInstance(deployBlock, blockDesc);
-
- // in the case of a binary block, unpack it into the blocks directory
- if (block instanceof BinaryBlock) {
- BinaryBlock binaryBlock = (BinaryBlock) block;
- // check if the block has already been unpacked
- if(!installedBlocks.containsKey(block.getId())) {
- String nextDirectory = intDirToStringDirConvert(
- getNextDirectory(new File(baseDirectoryFile, BLOCKS_DIR), this.lastDir));
- this.lastDir = Integer.parseInt(nextDirectory);
- String installDirectory = BLOCKS_DIR + nextDirectory + "/";
- wiringBlock.setLocation(installDirectory);
- deployBlock(binaryBlock, frm, BLOCKS_DIR + nextDirectory);
- installedBlocks.put(block.getId(), installDirectory);
- } else {
- wiringBlock.setLocation((String) installedBlocks.get(block.getId()));
- }
- }
- else if(block instanceof LocalBlock) {
- LocalBlock localBlock = (LocalBlock) block;
- wiringBlock.setLocation(localBlock.getBaseDirectory());
- }
- wiring.addBlock(wiringBlock);
- }
+ installBlocks(blocks, wiring, frm, baseDirectoryFile);
- // install all libraries
- // TODO What happens if two libraries have the same filename by chance ...?
- for(int i = 0; i < libraries.length; i++) {
- File lib = libraries[i];
-
- // check if a library is a block, if yes, don't add it to WEB_INF_LIBS_DIR
- boolean isBlock = true;
- try {
- ZipUtils.getBlockDescriptorIs(lib);
- } catch(FileNotFoundException fnfe) {
- isBlock = false;
- }
-
- if(!isBlock) {
- String libName = WEB_INF_LIBS_DIR + "/" + lib.getName();
- log.info("Installing library " + libName);
- FileUtils.copy(new FileInputStream(lib), frm.writeResource(libName));
- }
- }
+ // install libraries
+ installLibraries(libraries, log, frm);
// write the wiring
- OutputStream out = frm.writeResource(WIRING_FILE);
- wiring.marshal(new OutputStreamWriter(out));
- out.close();
+ writeWiring(wiring, frm);
// committ transaction
frm.commitTransaction();
@@ -178,6 +110,106 @@
}
return false;
+ }
+
+ /**
+ * Write the wiring by marshalling the <code>Wiring</code> object.
+ */
+ protected void writeWiring(Wiring wiring, FileManager frm)
+ throws FileManagerException, MarshalException, ValidationException, IOException {
+
+ OutputStream out = frm.writeResource(WIRING_FILE);
+ wiring.marshal(new OutputStreamWriter(out));
+ out.close();
+ }
+
+ /**
+ * Install all blocks and adapt wiring.xml. Installing either means copying or just referencing the location
+ * in wiring.xml.
+ */
+ protected void installBlocks(Block[] blocks, Wiring wiring, FileManager frm, File baseDirectoryFile) {
+ Map installedBlocks = new HashMap();
+
+ for(int i = 0; i < blocks.length; i++) {
+ Block block = blocks[i];
+
+ org.apache.cocoon.deployer.generated.deploy.x10.Block deployBlock =
+ (org.apache.cocoon.deployer.generated.deploy.x10.Block) block.getDeployDescriptor();
+ org.apache.cocoon.deployer.generated.block.x10.Block blockDesc =
+ (org.apache.cocoon.deployer.generated.block.x10.Block) block.getBlockDescriptor();
+
+ // create the wiring object
+ org.apache.cocoon.deployer.generated.wiring.x10.Block wiringBlock =
+ createWiring10BlockInstance(deployBlock, blockDesc);
+
+ // in the case of a binary block, unpack it into the blocks directory
+ if (block instanceof BinaryBlock) {
+ BinaryBlock binaryBlock = (BinaryBlock) block;
+ // check if the block has already been unpacked
+ if(!installedBlocks.containsKey(block.getId())) {
+ String nextDirectory = intDirToStringDirConvert(
+ getNextDirectory(new File(baseDirectoryFile, BLOCKS_DIR), this.lastDir));
+ this.lastDir = Integer.parseInt(nextDirectory);
+ String installDirectory = BLOCKS_DIR + nextDirectory + "/";
+ wiringBlock.setLocation(installDirectory);
+ deployBlock(binaryBlock, frm, BLOCKS_DIR + nextDirectory);
+ installedBlocks.put(block.getId(), installDirectory);
+ } else {
+ wiringBlock.setLocation((String) installedBlocks.get(block.getId()));
+ }
+ }
+ else if(block instanceof LocalBlock) {
+ LocalBlock localBlock = (LocalBlock) block;
+ wiringBlock.setLocation(localBlock.getBaseDirectory());
+ }
+ wiring.addBlock(wiringBlock);
+ }
+ }
+
+ /**
+ * Get the wiring object. Depending on the mode (exclusive/non-exclusive) either a new one is created
+ * or the existing one is returned.
+ */
+ protected Wiring getWiring(Logger log, FileManager frm) throws SAXException, IOException, FileManagerException, MarshalException, ValidationException {
+ Wiring wiring = null;
+ if(this.isExclusive()) {
+ wiring = new Wiring();
+ } else {
+ // check wiring version
+ String wiringVersion = XMLUtils.getDocumentNamespace(frm.readResource(WIRING_FILE));
+ if(!WIRING_10_NAMESPACE.equals(wiringVersion)) {
+ String msg = "The deployer only supports " + WIRING_10_NAMESPACE + " files.";
+ log.error(msg);
+ throw new DeploymentException(msg);
+ }
+ wiring = (Wiring) Wiring.unmarshal(new InputStreamReader(frm.readResource(WIRING_FILE)));
+ }
+ return wiring;
+ }
+
+ /*
+ * TODO What happens if two libraries have the same filename by chance ...?
+ */
+ protected void installLibraries(File[] libraries, Logger log, FileManager frm)
+ throws IOException, FileNotFoundException, FileManagerException {
+
+ for(int i = 0; i < libraries.length; i++) {
+ File lib = libraries[i];
+
+ // check if a library is a block, if yes, don't add it to WEB_INF_LIBS_DIR
+ boolean isBlock = true;
+ try {
+ ZipUtils.getBlockDescriptorIs(lib);
+ } catch(FileNotFoundException fnfe) {
+ isBlock = false;
+ }
+
+ if(!isBlock) {
+ String libName = WEB_INF_LIBS_DIR + "/" + lib.getName();
+ log.info("Installing library " + libName);
+ FileUtils.copy(new FileInputStream(lib), frm.writeResource(libName));
+ }
+ }
}
/**
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServerFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServerFactory.java?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServerFactory.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/applicationserver/CocoonServerFactory.java Sun Mar 5 06:29:26 2006
@@ -25,10 +25,11 @@
public class CocoonServerFactory {
- public static CocoonServer createServer(Cocoon cocoon, VariableResolver variableResolver, ArtifactProvider artifactProvider) {
+ public static CocoonServer createServer(Cocoon cocoon, VariableResolver variableResolver,
+ ArtifactProvider artifactProvider, boolean exclusive) {
CocoonServer cocoonServer = new CocoonServer22();
- cocoonServer.setExclusive(cocoon.getExclusive());
+ cocoonServer.setExclusive(exclusive);
cocoonServer.setVariableResolver(variableResolver);
cocoonServer.setArtifactProvider(artifactProvider);
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd Sun Mar 5 06:29:26 2006
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2004 The Apache Software Foundation
+ Copyright 2005 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.
@@ -22,11 +22,6 @@
<xs:element name="block">
<xs:complexType>
<xs:all>
- <xs:element name="name" type="name"/>
- <xs:element name="description" type="href"/>
- <xs:element name="state" type="state"/>
- <xs:element name="license" type="href"/>
- <xs:element name="author" type="href"/>
<xs:element name="properties" type="properties" minOccurs="0"/>
<xs:element name="requirements" type="requirements" minOccurs="0"/>
<xs:element name="implements" type="implements" minOccurs="0"/>
@@ -37,47 +32,6 @@
<xs:attribute name="id" type="xs:anyURI" use="required"/>
</xs:complexType>
</xs:element>
-
- <!-- general meta data -->
- <xs:complexType name="name">
- <xs:simpleContent>
- <xs:extension base="xs:string"/>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:complexType name="state">
- <xs:attribute name="href" type="xs:anyURI" use="required"/>
- <xs:attribute name="community" type="community" use="required"/>
- <xs:attribute name="interfaces" type="stability" use="required"/>
- <xs:attribute name="implementation" type="stability" use="required"/>
- </xs:complexType>
-
- <xs:simpleType name="community">
- <xs:restriction base="xs:string">
- <xs:pattern value="committed|supported|deprecated|core"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="stability">
- <xs:restriction base="xs:string">
- <xs:pattern value="stable|unstable"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="href">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="href" type="xs:anyURI"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- <xs:complexType name="src">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="src" type="xs:string" use="required"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
<!-- properties -->
<xs:complexType name="properties">
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd Sun Mar 5 06:29:26 2006
@@ -31,8 +31,7 @@
</xs:element>
<xs:complexType name="cocoon">
- <xs:attribute name="target-url" type="xs:anyURI" use="optional"/>
- <xs:attribute name="exclusive" type="xs:boolean" use="optional" default="true"/>
+ <xs:attribute name="target-url" type="xs:anyURI" use="optional"/>
<xs:attribute name="webapp-urn" type="xs:anyURI" use="optional"/>
<xs:attribute name="block-fw-urn" type="xs:anyURI" use="optional"/>
</xs:complexType>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml Sun Mar 5 06:29:26 2006
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2004 The Apache Software Foundation
+ Copyright 2005 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.
@@ -16,18 +16,6 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="http://cocoon.apache.org/blocks/anyblock/1.0">
-
- <name>anyblock</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A block based on the Apache Cocoon portal
- </description>
- <state
- href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
<properties>
<property name="mailserver">
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/BlockDeployerTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/BlockDeployerTest.java?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/BlockDeployerTest.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/BlockDeployerTest.java Sun Mar 5 06:29:26 2006
@@ -29,12 +29,12 @@
public class BlockDeployerTest extends AbstractDeployerTestCase {
public void testDeployNonTransactional() throws Exception {
- createBlockDeployer("validDeploy-04/deploy.xml", false);
+ createBlockDeployer("validDeploy-04/deploy.xml", false, true);
// assertions: ...
}
public void testDeployTransactional() throws Exception {
- createBlockDeployer("validDeploy-04/deploy.xml", true);
+ createBlockDeployer("validDeploy-04/deploy.xml", true, true);
// assertions: ...
}
@@ -42,14 +42,14 @@
// TODO
}
- private void createBlockDeployer(String deploymentDescriptorPath, boolean transactional)
+ private void createBlockDeployer(String deploymentDescriptorPath, boolean transactional, boolean exclusive)
throws MarshalException, ValidationException, FileNotFoundException {
BlockDeployer blockDeployer = new BlockDeployer(
this.getArtifactProviderInstance(),
new NullVariableResolver(),
new ConsoleLogger());
Deploy deploy = (Deploy) Deploy.unmarshal(new FileReader(this.getMockArtefact(deploymentDescriptorPath)));
- blockDeployer.deploy(absolutizeDeploy(deploy), transactional);
+ blockDeployer.deploy(absolutizeDeploy(deploy), transactional, exclusive);
}
private ArtifactProvider getArtifactProviderInstance() {
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 1999-2004 The Apache Software Foundation
+ Copyright 2005 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.
@@ -15,15 +15,4 @@
limitations under the License.
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
- id="http://cocoon.apache.org/blocks/anyblock/1.0">
- <name>anyblock</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
-</block>
\ No newline at end of file
+ id="http://cocoon.apache.org/blocks/anyblock/1.0"/>
\ No newline at end of file
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-01/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,16 +16,6 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="http://cocoon.apache.org/blocks/anyblock-01/1.0">
- <name>anyblock02</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
<properties>
<property name="prop1">
<default>defaultValue1</default>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,16 +16,6 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="anyblock:anyblock-03:1.0">
- <name>anyblock03</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
<properties>
<property name="prop1">
<default>defaultValue1</default>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,16 +16,6 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="anyblock:anyblock-04:1.0">
- <name>anyblock-07</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block for unit tests.
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
<implements>
<interface id="db-interface01"/>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,17 +16,7 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="anyblock:anyblock-05:1.0">
- <name>db-block</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block for unit tests.
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
-
+
<implements>
<interface id="interface-01"/>
</implements>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,16 +16,6 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="anyblock:anyblock-06:1.0">
- <name>anyblock-06</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block for unit tests.
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
<implements>
<interface id="interface-02"/>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-06/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/blockRoot/META-INF/block.xml?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/blockRoot/META-INF/block.xml Sun Mar 5 06:29:26 2006
@@ -16,17 +16,7 @@
-->
<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
id="anyblock:anyblock-07:1.0">
- <name>anyblock-07</name>
- <description href="http://cocoon.apache.org/blocks/anyblock/1.0">
- A test block for unit tests.
- </description>
- <state href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html"
- community="committed"
- interfaces="unstable"
- implementation="stable"/>
- <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
- <author href="http://cocoon.apache.org">Apache Cocoon community</author>
-
+
<implements>
<interface id="interface-03"/>
</implements>
Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/valid-block-1.0.jar
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-07/valid-block-1.0.jar?rev=383327&r1=383326&r2=383327&view=diff
==============================================================================
Binary files - no diff available.