[
https://jira.jboss.org/jira/browse/GTNWCI-11?page=com.atlassian.jira.plug...
]
Phan Chuong updated GTNWCI-11:
------------------------------
Description:
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:
||Application||Portal||DMS||WCM||
|dms-extension| . | x | . |
|ecm| . | x | . |
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|presentation| . | . | x |
|formgenerator| . | . | x |
|eXoDMSGadgets| . | x | . |
|starter| x | . | . |
|searches| . | . | x |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|newsletter| . | . | x |
|eXoDMSResources| . | x | . |
|eXoWCMResources| . | . | x |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|ecm-wcm-extension| . | . | x |
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
||Application||Portal||DMS||WCM||
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|starter| x | . | . |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|dms-extension| . | x | . |
|ecm| . | x | . |
|eXoDMSGadgets| . | x | . |
|eXoDMSResources| . | x | . |
|searches| . | . | x |
|presentation| . | . | x |
|formgenerator| . | . | x |
|newsletter| . | . | x |
|eXoWCMResources| . | . | x |
|ecm-wcm-extension| . | . | x |
So i added a new method in TC6ServletContainerContext:
{code:title=Bar.java|borderStyle=solid}
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]);
}
{code}
and in TC6ServletContainerContext.registerHost(Host host)
{panel:title=TC6ServletContainerContext.registerHost(Host host)| borderStyle=dashed|
borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}
//Container[] childrenContainers = host.findChildren();
Container[] childrenContainers = sortChildren(host);
{code}
was:
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:
||Application||Portal||DMS||WCM||
|dms-extension| . | x | . |
|ecm| . | x | . |
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|presentation| . | . | x |
|formgenerator| . | . | x |
|eXoDMSGadgets| . | x | . |
|starter| x | . | . |
|searches| . | . | x |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|newsletter| . | . | x |
|eXoDMSResources| . | x | . |
|eXoWCMResources| . | . | x |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|ecm-wcm-extension| . | . | x |
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
||Application||Portal||DMS||WCM||
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|starter| x | . | . |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|dms-extension| . | x | . |
|ecm| . | x | . |
|eXoDMSGadgets| . | x | . |
|eXoDMSResources| . | x | . |
|searches| . | . | x |
|presentation| . | . | x |
|formgenerator| . | . | x |
|newsletter| . | . | x |
|eXoWCMResources| . | . | x |
|ecm-wcm-extension| . | . | x |
So i added a new method in TC6ServletContainerContext:
{code}
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]);
}
{code}
and in TC6ServletContainerContext.registerHost(Host host)
{panel:title=TC6ServletContainerContext.registerHost(Host host)| borderStyle=dashed|
borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}
//Container[] childrenContainers = host.findChildren();
Container[] childrenContainers = sortChildren(host);
{code}
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:
||Application||Portal||DMS||WCM||
|dms-extension| . | x | . |
|ecm| . | x | . |
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|presentation| . | . | x |
|formgenerator| . | . | x |
|eXoDMSGadgets| . | x | . |
|starter| x | . | . |
|searches| . | . | x |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|newsletter| . | . | x |
|eXoDMSResources| . | x | . |
|eXoWCMResources| . | . | x |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|ecm-wcm-extension| . | . | x |
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
||Application||Portal||DMS||WCM||
|exoadmin| x | . | . |
|eXoGadgets| x | . | . |
|portal| x | . | . |
|starter| x | . | . |
|integration| x | . | . |
|rest| x | . | . |
|eXoGadgetServer| x | . | . |
|dashboard| x | . | . |
|web| x | . | . |
|eXoResources| x | . | . |
|dms-extension| . | x | . |
|ecm| . | x | . |
|eXoDMSGadgets| . | x | . |
|eXoDMSResources| . | x | . |
|searches| . | . | x |
|presentation| . | . | x |
|formgenerator| . | . | x |
|newsletter| . | . | x |
|eXoWCMResources| . | . | x |
|ecm-wcm-extension| . | . | x |
So i added a new method in TC6ServletContainerContext:
{code:title=Bar.java|borderStyle=solid}
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]);
}
{code}
and in TC6ServletContainerContext.registerHost(Host host)
{panel:title=TC6ServletContainerContext.registerHost(Host host)| borderStyle=dashed|
borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}
//Container[] childrenContainers = host.findChildren();
Container[] childrenContainers = sortChildren(host);
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira