]
Matt Wringe commented on GTNWCI-11:
-----------------------------------
WCI can be used in two different modes: generic and native.
The generic mode is similar to how eXo Portal used to do things, each portlet specifies in
the web.xml how it should be deployed (usually through a servlet or a servlet context
listener).
The native mode is container specific and doesn't require anything to be added to the
web.xml of the portlet. This is the one that is using the TC6* classes.
We can't use WCI to detemine deployment order in the generic case since this is
determined based on how the wars are deployed on the server. I don't know if we want
to have wci behave differently in the generic and native implementations.
I believe the issue is with the order the javascript deployer is getting things.
Re-order children container when register host in
TC6ServletContainerContext
----------------------------------------------------------------------------
Key: GTNWCI-11
URL:
https://jira.jboss.org/jira/browse/GTNWCI-11
Project: GateIn Web Container Integration
Issue Type: Feature Request
Affects Versions: 2.0.0-CR02
Reporter: Phan Chuong
Priority: Blocker
Fix For: 2.0.0-CR03
I'm working on eXo WCM, which based on eXo DMS, and of course, based on GateIn
Portal.
This is the application's order when run eXo WCM with GateIn:
dms-extension - DMS
ecm - DMS
exoadmin - PORTAL
eXoGadgets - PORTAL
portal - PORTAL
presentation - WCM
formgenerator - WCM
eXoDMSGadgets - DMS
starter - PORTAL
searches - WCM
integration - PORTAL
rest - PORTAL
eXoGadgetServer - PORTAL
newsletter - WCM
eXoDMSResources - DMS
eXoWCMResources - WCM
dashboard - PORTAL
web - PORTAL
eXoResources - PORTAL
ecm-wcm-extension - WCM
This made a blocker bug in eXo WCM: almost javascript is ignored because eXo object
(which is initialized in eXo.js, belong to eXoResources) is not exist when other object
which need it is initialized. For example: in dms-extension, there is an object which call
eXo, but at that time, eXo object is not exist, so the javascript in dms-extension is
died. What we need is make sure all portal's component is deploy first, then DMS, then
WCM, like this
exoadmin - PORTAL
eXoGadgets - PORTAL
portal - PORTAL
starter - PORTAL
integration - PORTAL
rest - PORTAL
eXoGadgetServer - PORTAL
dashboard - PORTAL
web - PORTAL
eXoResources - PORTAL
dms-extension - DMS
ecm - DMS
eXoDMSGadgets - DMS
eXoDMSResources - DMS
presentation - WCM
formgenerator - WCM
searches - WCM
newsletter - WCM
eXoWCMResources - WCM
ecm-wcm-extension - WCM
So i added a new method in TC6ServletContainerContext:
private Container[] sortChildren(Host host) {
Container[] containers = host.findChildren();
List<Container> unsortedContainers = Arrays.asList(containers);
Collections.sort(unsortedContainers, new Comparator<Container>() {
public int compare(Container c1, Container c2) {
String priority1 = ((StandardContext)
c1).getServletContext().getInitParameter("priority");
String priority2 = ((StandardContext)
c2).getServletContext().getInitParameter("priority");
if ("null".equals(priority1) || priority1 == null) priority1 =
"0";
if ("null".equals(priority2) || priority2 == null) priority2 =
"0";
int p1 = Integer.parseInt(priority1);
int p2 = Integer.parseInt(priority2);
if (p1 > p2) return 1;
else return -1;
};
});
return unsortedContainers.toArray(new Container[containers.length]);
}
and in TC6ServletContainerContext.registerHost(Host host)
//Container[] childrenContainers = host.findChildren();
Container[] childrenContainers = sortChildren(host);
And of course, in each war project of DMS, i put new context param
<context-param>
<param-name>priority</param-name>
<param-value>1</param-value>
</context-param>
and in WCM
<context-param>
<param-name>priority</param-name>
<param-value>2</param-value>
</context-param>
This fix will assure the deployment order ALWAYS is : PORTAL > DMS > WCM
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: