[gatein-issues] [JBoss JIRA] Commented: (GTNWCI-11) Re-order children container when register host in TC6ServletContainerContext

Phan Chuong (JIRA) jira-events at lists.jboss.org
Mon Jan 18 21:16:47 EST 2010


    [ https://jira.jboss.org/jira/browse/GTNWCI-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12506760#action_12506760 ] 

Phan Chuong commented on GTNWCI-11:
-----------------------------------

I didn't see anything about WCI Generic mode and Native mode. Now i have to create a patch for wci-tomcat to make our products can run properly (at least with tomcat).

Can you tell me more about these two modes ? How can i config it ?

> 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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the gatein-issues mailing list