taylor 2003/12/12 14:01:30
Modified: portal/src/java/org/apache/jetspeed/tools/pamanager
DeployUtilities.java
Log:
Patch from Roger Ruttimann to fix the PAM deploy bug with not finding the DTD on the
web.
This patch allows for system to be disconnected when deploying portlet apps
Revision Changes Path
1.2 +20 -2
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/DeployUtilities.java
Index: DeployUtilities.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/DeployUtilities.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DeployUtilities.java 28 Jul 2003 23:47:52 -0000 1.1
+++ DeployUtilities.java 12 Dec 2003 22:01:30 -0000 1.2
@@ -60,9 +60,12 @@
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import java.io.FileInputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
@@ -208,6 +211,21 @@
PortletApplicationException e = new PortletApplicationException(
"Failed to create an XML DOM!");
throw e;
}
+
+ // Use the local dtd instead of remote dtd. This
+ // allows to deploy the application offline
+ db.setEntityResolver(new EntityResolver() {
+ public InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
+ throws SAXException, java.io.IOException
+ {
+
+ if
(systemId.equals("http://java.sun.com/dtd/web-app_2_3.dtd"))
+ {
+ return new InputSource(new
FileInputStream("./web-app_2_3.dtd"));
+ }
+ else return null;
+ }
+ });
Document doc = db.parse(new File(webXml));
if ( doc == null)
@@ -299,7 +317,7 @@
format.setIndent(4);
// Doctype gets removed by the DOM. Add it otherwise Tomcat throws
an exception
format.setDoctype
- ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN",
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd");
+ ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN",
"http://java.sun.com/dtd/web-app_2_3.dtd");
FileWriter fw = new FileWriter(webXml);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]