I am trying to integrate a different cms to ofbiz, which also runs on freemarker files. The basic idea is to share the different ftls (at least the ones generated by the cms). I could setup the cms (magnolia) just fine and I could easily access the magnolia ftl files just fine from within ofbiz. However, of course, Ofbiz does not read the freemarker expressions as i hoped it would (up to that point i did not realize that freemarker expressions need to be defined within java classes prior usage) and I ended up receiving errors in return.
So much for the background... now: I was thinking that since I do have access to the cms and I could easily access the included java files, wouldn't it be possible to initiate the java classes from within the FreemarkerWorker.java file and add the needed expressions to the very same? If I do understand the matter correctly, expressions are added by the following statement from within FreemarkerWorker: ftlTransforms.put("ofbizUrl", loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); |
look at the FTl's in ofbiz.
Plus they can be defined in widgets. groovy code in the action folder are used to marshal data the send the parameters to the ftl. so no java are needed to be included in the flts if you use the widgets you can put groovy code n the widget and then call the ftl. there are many examples. The problem as I see it is that the ftls from the CMS will not bee aware of the parameters passed by ofbiz and/or groovy scripts. madppiper sent the following on 11/6/2008 3:55 AM: > I am trying to integrate a different cms to ofbiz, which also runs on > freemarker files. The basic idea is to share the different ftls (at least > the ones generated by the cms). I could setup the cms (magnolia) just fine > and I could easily access the magnolia ftl files just fine from within > ofbiz. However, of course, Ofbiz does not read the freemarker expressions as > i hoped it would (up to that point i did not realize that freemarker > expressions need to be defined within java classes prior usage) and I ended > up receiving errors in return. > > So much for the background... now: I was thinking that since I do have > access to the cms and I could easily access the included java files, > wouldn't it be possible to initiate the java classes from within the > FreemarkerWorker.java file and add the needed expressions to the very same? > > > > > If I do understand the matter correctly, expressions are added by the > following statement from within FreemarkerWorker: > > ftlTransforms.put("ofbizUrl", > loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); > |
In reply to this post by madppiper-2
If the CMS classes are in the OFBiz classpath, then you can add transforms to the framework/webapp/config/applicationTransforms.properties file and OFBiz will load them automatically.
-Adrian --- On Thu, 11/6/08, madppiper <[hidden email]> wrote: > From: madppiper <[hidden email]> > Subject: FreemarkerWorker Expression definition > To: [hidden email] > Date: Thursday, November 6, 2008, 3:55 AM > I am trying to integrate a different cms to ofbiz, which > also runs on > freemarker files. The basic idea is to share the different > ftls (at least > the ones generated by the cms). I could setup the cms > (magnolia) just fine > and I could easily access the magnolia ftl files just fine > from within > ofbiz. However, of course, Ofbiz does not read the > freemarker expressions as > i hoped it would (up to that point i did not realize that > freemarker > expressions need to be defined within java classes prior > usage) and I ended > up receiving errors in return. > > So much for the background... now: I was thinking that > since I do have > access to the cms and I could easily access the included > java files, > wouldn't it be possible to initiate the java classes > from within the > FreemarkerWorker.java file and add the needed expressions > to the very same? > > > > > If I do understand the matter correctly, expressions are > added by the > following statement from within FreemarkerWorker: > > ftlTransforms.put("ofbizUrl", > loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); > > -- > View this message in context: > http://www.nabble.com/FreemarkerWorker-Expression-definition-tp20359714p20359714.html > Sent from the OFBiz - User mailing list archive at > Nabble.com. |
hmm,
the file doesn't exist in my trunkversion (13595), do i need to upgrade for that file?
|
That file was added in revision 564914.
-Adrian madppiper wrote: > hmm, > > the file doesn't exist in my trunkversion (13595), do i need to upgrade for > that file? > > > > Adrian Crum-2 wrote: >> If the CMS classes are in the OFBiz classpath, then you can add transforms >> to the framework/webapp/config/applicationTransforms.properties file and >> OFBiz will load them automatically. >> >> -Adrian >> >> >> --- On Thu, 11/6/08, madppiper <[hidden email]> wrote: >> >>> From: madppiper <[hidden email]> >>> Subject: FreemarkerWorker Expression definition >>> To: [hidden email] >>> Date: Thursday, November 6, 2008, 3:55 AM >>> I am trying to integrate a different cms to ofbiz, which >>> also runs on >>> freemarker files. The basic idea is to share the different >>> ftls (at least >>> the ones generated by the cms). I could setup the cms >>> (magnolia) just fine >>> and I could easily access the magnolia ftl files just fine >>> from within >>> ofbiz. However, of course, Ofbiz does not read the >>> freemarker expressions as >>> i hoped it would (up to that point i did not realize that >>> freemarker >>> expressions need to be defined within java classes prior >>> usage) and I ended >>> up receiving errors in return. >>> >>> So much for the background... now: I was thinking that >>> since I do have >>> access to the cms and I could easily access the included >>> java files, >>> wouldn't it be possible to initiate the java classes >>> from within the >>> FreemarkerWorker.java file and add the needed expressions >>> to the very same? >>> >>> >>> >>> >>> If I do understand the matter correctly, expressions are >>> added by the >>> following statement from within FreemarkerWorker: >>> >>> ftlTransforms.put("ofbizUrl", >>> loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/FreemarkerWorker-Expression-definition-tp20359714p20359714.html >>> Sent from the OFBiz - User mailing list archive at >>> Nabble.com. >> >> >> >> > |
In reply to this post by madppiper-2
you look like your still in ver 4.0 code.
I suggest you check out he newest in a seperate folders then migrate any customm code. there are a lot of changes since 4.0. the first being running java jdk 1.5 or higher. madppiper sent the following on 11/6/2008 8:48 AM: > hmm, > > the file doesn't exist in my trunkversion (13595), do i need to upgrade for > that file? > > > > Adrian Crum-2 wrote: >> If the CMS classes are in the OFBiz classpath, then you can add transforms >> to the framework/webapp/config/applicationTransforms.properties file and >> OFBiz will load them automatically. >> >> -Adrian >> >> >> --- On Thu, 11/6/08, madppiper <[hidden email]> wrote: >> >>> From: madppiper <[hidden email]> >>> Subject: FreemarkerWorker Expression definition >>> To: [hidden email] >>> Date: Thursday, November 6, 2008, 3:55 AM >>> I am trying to integrate a different cms to ofbiz, which >>> also runs on >>> freemarker files. The basic idea is to share the different >>> ftls (at least >>> the ones generated by the cms). I could setup the cms >>> (magnolia) just fine >>> and I could easily access the magnolia ftl files just fine >>> from within >>> ofbiz. However, of course, Ofbiz does not read the >>> freemarker expressions as >>> i hoped it would (up to that point i did not realize that >>> freemarker >>> expressions need to be defined within java classes prior >>> usage) and I ended >>> up receiving errors in return. >>> >>> So much for the background... now: I was thinking that >>> since I do have >>> access to the cms and I could easily access the included >>> java files, >>> wouldn't it be possible to initiate the java classes >>> from within the >>> FreemarkerWorker.java file and add the needed expressions >>> to the very same? >>> >>> >>> >>> >>> If I do understand the matter correctly, expressions are >>> added by the >>> following statement from within FreemarkerWorker: >>> >>> ftlTransforms.put("ofbizUrl", >>> loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/FreemarkerWorker-Expression-definition-tp20359714p20359714.html >>> Sent from the OFBiz - User mailing list archive at >>> Nabble.com. >> >> >> >> > |
In reply to this post by madppiper-2
you look like your still in ver 4.0 code.
I suggest you check out he newest in a separate folders then migrate any custom code. there are a lot of changes since 4.0. the first being running java jdk 1.5 or higher. madppiper sent the following on 11/6/2008 8:48 AM: > hmm, > > the file doesn't exist in my trunkversion (13595), do i need to upgrade for > that file? > > > > Adrian Crum-2 wrote: >> If the CMS classes are in the OFBiz classpath, then you can add transforms >> to the framework/webapp/config/applicationTransforms.properties file and >> OFBiz will load them automatically. >> >> -Adrian >> >> >> --- On Thu, 11/6/08, madppiper <[hidden email]> wrote: >> >>> From: madppiper <[hidden email]> >>> Subject: FreemarkerWorker Expression definition >>> To: [hidden email] >>> Date: Thursday, November 6, 2008, 3:55 AM >>> I am trying to integrate a different cms to ofbiz, which >>> also runs on >>> freemarker files. The basic idea is to share the different >>> ftls (at least >>> the ones generated by the cms). I could setup the cms >>> (magnolia) just fine >>> and I could easily access the magnolia ftl files just fine >>> from within >>> ofbiz. However, of course, Ofbiz does not read the >>> freemarker expressions as >>> i hoped it would (up to that point i did not realize that >>> freemarker >>> expressions need to be defined within java classes prior >>> usage) and I ended >>> up receiving errors in return. >>> >>> So much for the background... now: I was thinking that >>> since I do have >>> access to the cms and I could easily access the included >>> java files, >>> wouldn't it be possible to initiate the java classes >>> from within the >>> FreemarkerWorker.java file and add the needed expressions >>> to the very same? >>> >>> >>> >>> >>> If I do understand the matter correctly, expressions are >>> added by the >>> following statement from within FreemarkerWorker: >>> >>> ftlTransforms.put("ofbizUrl", >>> loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance()); >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/FreemarkerWorker-Expression-definition-tp20359714p20359714.html >>> Sent from the OFBiz - User mailing list archive at >>> Nabble.com. >> >> >> >> > |
Yup, that was it. I updated to the latest trunk and everything is in place for a serious reconfiguration ;)
I tried to do as planned and use the applicationTransforms.properties file. However, the Magnolia-cms doesn't seem to be using Freemarker-Transform-Classes at all. But a mix of context filters and freemarker interpretation classes (yes, using the freemarker intepreter class only resolves in blank spaces - I think it it must be because no context is specified) If I still want to integrate Magnolia properly as part of the ofbiz system, would there be another approach for letting the magnolia system handle parts of the Freemarker definitions and OFBiz the other?
|
Free forum by Nabble | Edit this page |