Bug in use of common:include useSubContext="true" in IGVersion.2.9.7.2

sito <[email protected]>
Newsgroups gmane.comp.cms.infoglue.devel
Message-ID <[email protected]>
This is the example:


AT THIS POINT TEMPLATELOGIC(BasicTemplateController) COMES FROM THIS 
COMPONENT

LINE X: <common:include relationAttributeName="RelatedComponents" 
contentName="P_MenuHeader"/>

AT THIS POINT TEMPLATELOGIC COMES FROM THIS COMPONENT        

LINE X+1: <common:include relationAttributeName="RelatedComponents" 
contentName="P_MenuSuperior"  useSubContext="true" />

AT THIS POINT (LINE X+2) TEMPLATELOGIC COMES FROM SUBCOMPONENT --> this 
is a failure because TemplateLogic should be the same




OUR PROPOSED SOLUTION, RESTORE PREVIOUS TEMPLATELOGIC:

#P Infoglue_2.9.7.2
Index: 
src/java/org/infoglue/deliver/controllers/kernel/impl/simple/BasicTemplateController.java
===================================================================

RCS file: 
/home/cvsroot/infoglue/src/java/org/infoglue/deliver/controllers/kernel/impl/simple/BasicTemplateController.java,v
retrieving revision 1.184

diff -u -r1.184 BasicTemplateController.java
--- 
src/java/org/infoglue/deliver/controllers/kernel/impl/simple/BasicTemplateController.java    
26 Jul 2009 22:05:19 -0000    1.184
+++ 
src/java/org/infoglue/deliver/controllers/kernel/impl/simple/BasicTemplateController.java    
14 Aug 2009 11:31:10 -0000
@@ -6270,6 +6270,9 @@
             PrintWriter cachedStream = new PrintWriter(cacheString);
             new VelocityTemplateProcessor().renderTemplate(context, 
cachedStream, template);
             result = cacheString.toString();
+            //UIB- --- RESTORE OLD TEMPLATE LOGIC
+            templateLogicContext.remove("templateLogic");
+            templateLogicContext.put("templateLogic",this);
         }
         catch(Exception e)
         {
@@ -6316,6 +6319,10 @@
             PrintWriter cachedStream = new PrintWriter(cacheString);
             new VelocityTemplateProcessor().renderTemplate(context, 
cachedStream, template);
             result = cacheString.toString();
+           
+            //UIB- --- RESTORE OLD TEMPLATE LOGIC
+            templateLogicContext.remove("templateLogic");
+            templateLogicContext.put("templateLogic",this);
         }
         catch(Exception e)
         {

-- 
--------------======ooOO000OOoo======---------------
Vicente Javier Rosselló Ferrer
E-mail: vrossello [arroba] uib.es
Tel: 971 17 2884
Centre de Tecnologies de la Informació a la UIB
CTI - http://www.cti.uib.es
Edifici Anselm Turmeda
Ctra. Valldemossa 7.5km
Universitat de les Illes Balears - http://www.uib.es
==================================================== 



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.