You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Daniel L. Rall" <dl...@apache.org> on 2004/04/20 20:52:04 UTC
[Fwd: [PATCH] Pluto and JBoss]
[Resending because I don't see this in the archive on nagoya and it's no
longer in the moderator queue on daedalus. Please include me in any follow-ups.]
Hello all, fine work you're doing here. Happy to hear about your
successful exit from the Incubator.
I'm curious whether the JBoss integration problem outlined and worked
around by Richard Berger at the beginning of May (pluto-user@ list, id
<EA...@fargo.corp.actiontech.com>)
has been remedied in the latest CVS source. I looked over
portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
(the file I _think_ Richard meant to reference in his post), and its
CVS change log messages, but didn't see anything to indicate that
Pluto and JBoss are likely to play together nicely in the sandbox
without adult supervision.
My experience has been that it's best to teach'em to get along while
they're still young and malleable, and am looking for guidance towards
an acceptable path of submitting Richard's change as a patch. Here's
what I've got so far based on his original suggestion:
*
portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
resolveURI(String): Resolves a web module's file system name to its
URI identifier, working around JBoss incompatibility.
load(String, String): Use the new resolveURI() method to turn web
module file system paths for JBoss into URI identifiers
(e.g. "tmp12345foo.war" to "foo").
Index: PortletDefinitionRegistryServiceFileImpl.java
===================================================================
RCS file:
/home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v
retrieving revision 1.3
diff -u -u -r1.3 PortletDefinitionRegistryServiceFileImpl.java
--- PortletDefinitionRegistryServiceFileImpl.java 2 Mar 2004 14:49:04 -0000 1.3
+++ PortletDefinitionRegistryServiceFileImpl.java 14 Apr 2004 22:59:45 -0000
@@ -156,6 +156,26 @@
}
}
+ /**
+ * Handles resolution of a web module's file system name to its
+ * URI identifier.
+ *
+ * @param webModule The file system name.
+ * @return The URI part.
+ */
+ private String resolveURI(String webModule)
+ {
+ // For JBoss compatibility, change webModule from the form
+ // of "tmp12345foo.war" to "foo".
+ int len = webModule.length();
+ if (webModule.endsWith(".war") && webModule.startsWith(TMP_PREFIX) &&
+ len > 13) {
+ webModule = webModule.substring(8, len - 4);
+ }
+ // else assumed literal.
+ return webModule;
+ }
+
private void load(String baseDir, String webModule) throws Exception
{
String directory =
baseDir+webModule+fileSeparator+"WEB-INF"+fileSeparator;
@@ -194,7 +214,7 @@
Vector structure = new Vector();
structure.add(portletApp);
- structure.add("/"+webModule);
+ structure.add("/" + resolveURI(webModule));
webApp.postLoad(structure);
@@ -215,7 +235,7 @@
log.debug("no web.xml...");
}
Vector structure = new Vector();
- structure.add("/" + webModule);
+ structure.add("/" + resolveURI(webModule));
structure.add(null);
structure.add(null);
Also of interest to me -- but possibly unrelated to Pluto -- is
Richard's reference to the lack of a web.xml in his testsuite.war,
supposedly created by Maven. Is Maven's "fulldeploy" goal something I
need to worry about fixing? If so, Richard, what version of Maven
were you using (e.g. 1.0 rc2)?
--
Daniel Rall
Re: [Fwd: [PATCH] Pluto and JBoss]
Posted by Michael Blum <bl...@apache.org>.
I am going to include your patch as a kind of temporary fix. IMO it
would be better to have it a more configurable solution. I would like to
have a setting in a property file, e.g. in
pluto/WEB-INF/config/services/PortletDefinitionRegistryService.properties
to be edited by a JBOSS administrator.
Michael
Daniel L. Rall wrote:
> [Resending because I don't see this in the archive on nagoya and it's no
> longer in the moderator queue on daedalus. Please include me in any
> follow-ups.]
>
> Hello all, fine work you're doing here. Happy to hear about your
> successful exit from the Incubator.
>
> I'm curious whether the JBoss integration problem outlined and worked
> around by Richard Berger at the beginning of May (pluto-user@ list, id
> <EA...@fargo.corp.actiontech.com>)
> has been remedied in the latest CVS source. I looked over
> portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
>
> (the file I _think_ Richard meant to reference in his post), and its
> CVS change log messages, but didn't see anything to indicate that
> Pluto and JBoss are likely to play together nicely in the sandbox
> without adult supervision.
>
> My experience has been that it's best to teach'em to get along while
> they're still young and malleable, and am looking for guidance towards
> an acceptable path of submitting Richard's change as a patch. Here's
> what I've got so far based on his original suggestion:
>
>
> *
> portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
>
> resolveURI(String): Resolves a web module's file system name to its
> URI identifier, working around JBoss incompatibility.
>
> load(String, String): Use the new resolveURI() method to turn web
> module file system paths for JBoss into URI identifiers
> (e.g. "tmp12345foo.war" to "foo").
>
>
> Index: PortletDefinitionRegistryServiceFileImpl.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v
>
> retrieving revision 1.3
> diff -u -u -r1.3 PortletDefinitionRegistryServiceFileImpl.java
> --- PortletDefinitionRegistryServiceFileImpl.java 2 Mar 2004 14:49:04
> -0000 1.3
> +++ PortletDefinitionRegistryServiceFileImpl.java 14 Apr 2004
> 22:59:45 -0000
> @@ -156,6 +156,26 @@
> }
> }
>
> + /**
> + * Handles resolution of a web module's file system name to its
> + * URI identifier.
> + *
> + * @param webModule The file system name.
> + * @return The URI part.
> + */
> + private String resolveURI(String webModule)
> + {
> + // For JBoss compatibility, change webModule from the form
> + // of "tmp12345foo.war" to "foo".
> + int len = webModule.length();
> + if (webModule.endsWith(".war") &&
> webModule.startsWith(TMP_PREFIX) &&
> + len > 13) {
> + webModule = webModule.substring(8, len - 4);
> + }
> + // else assumed literal.
> + return webModule;
> + }
> +
> private void load(String baseDir, String webModule) throws Exception
> {
> String directory =
> baseDir+webModule+fileSeparator+"WEB-INF"+fileSeparator;
> @@ -194,7 +214,7 @@
>
> Vector structure = new Vector();
> structure.add(portletApp);
> - structure.add("/"+webModule);
> + structure.add("/" + resolveURI(webModule));
>
> webApp.postLoad(structure);
>
> @@ -215,7 +235,7 @@
> log.debug("no web.xml...");
> }
> Vector structure = new Vector();
> - structure.add("/" + webModule);
> + structure.add("/" + resolveURI(webModule));
> structure.add(null);
> structure.add(null);
>
>
>
>
> Also of interest to me -- but possibly unrelated to Pluto -- is
> Richard's reference to the lack of a web.xml in his testsuite.war,
> supposedly created by Maven. Is Maven's "fulldeploy" goal something I
> need to worry about fixing? If so, Richard, what version of Maven
> were you using (e.g. 1.0 rc2)?