cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r382810 - in /cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main: java/org/apache/cocoon/deployer/applicationserver/ resources/xsd/
Date Fri, 03 Mar 2006 13:42:32 GMT
Author: reinhard
Date: Fri Mar  3 05:42:31 2006
New Revision: 382810

URL: http://svn.apache.org/viewcvs?rev=382810&view=rev
Log:
a couple of fixes, so that the Cocoon deployer plugin runs through

fix problems with "exclusive mode":
 - a wrong method was used to read the value
 - logic what happens when exclusiveMode==true was wrong
rework deploy-schema
 - make attributes of <cocoon> optional

Modified:
    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/deploy-schema-1.0.xsd

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=382810&r1=382809&r2=382810&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
Fri Mar  3 05:42:31 2006
@@ -86,31 +86,23 @@
 	    	File baseDirectoryFile = new File(this.baseDirectory);
 	    	
 			// install the Cocoon server if necessary
-			if(baseDirectoryFile.list().length == 0) {
+			if(baseDirectoryFile.list().length == 0 && serverArtifact != null) {
 				deployCocoonServer(frm, txId, "", serverArtifact);
-			} else {
-				// TODO logging
-			}
-			
-			// read in servers wiring.xml
-			if(!frm.resourceExists(txId, WIRING_FILE)) {
-				String msg = "There is no [server-root-dir]/" + WIRING_FILE + ".";
-				log.error(msg);
-				throw new DeploymentException(msg);
 			}
-			
-			// check wiring version
-			String wiringVersion = XMLUtils.getDocumentNamespace(frm.readResource(txId, 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);				
-			}
-			
-			// create the wiring, in exclusive mode from scratch
-			Wiring wiring = (Wiring) Wiring.unmarshal(new InputStreamReader(frm.readResource(txId,
WIRING_FILE)));	
+
+			// 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(txId, 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(txId, WIRING_FILE)));

 			}
 			
 			// install all passed blocks

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=382810&r1=382809&r2=382810&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
Fri Mar  3 05:42:31 2006
@@ -27,7 +27,7 @@
 
 	public static CocoonServer createServer(Cocoon cocoon, VariableResolver variableResolver,
ArtifactProvider artifactProvider) {
 		CocoonServer cocoonServer = new CocoonServer22();
-		cocoonServer.setExclusive(cocoon.hasExclusive());
+		cocoonServer.setExclusive(cocoon.getExclusive());
 		cocoonServer.setVariableResolver(variableResolver);
 		cocoonServer.setArtifactProvider(artifactProvider);
 		

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=382810&r1=382809&r2=382810&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
Fri Mar  3 05:42:31 2006
@@ -31,8 +31,8 @@
   </xs:element>
   
   <xs:complexType name="cocoon">
-  	<xs:attribute name="target-url" type="xs:anyURI" use="required"/>
-    <xs:attribute name="exclusive" type="xs:boolean" use="required"/>
+  	<xs:attribute name="target-url" type="xs:anyURI" use="optional"/>
+    <xs:attribute name="exclusive" type="xs:boolean" use="optional" default="true"/>
   	<xs:attribute name="webapp-urn" type="xs:anyURI" use="optional"/>
   	<xs:attribute name="block-fw-urn" type="xs:anyURI" use="optional"/>
   </xs:complexType>



Mime
View raw message