[Hippo-cms7-user] Templates stored in the repo

Mansour Al Akeel mansour.alakeel at gmail.com
Wed Jun 2 14:54:06 CEST 2010


Hello Ard:
I have checked again, and found that all the nodes are present. 
Here's the types.cnd:

<'contact'='http://www.mysite.com/hippocms/contact/0.12'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'hippo'='http://www.onehippo.org/jcr/hippo/nt/2.0.1'>
<'hippostd'='http://www.onehippo.org/jcr/hippostd/nt/2.0'>
<'hippostdpubwf'='http://www.onehippo.org/jcr/hippostdpubwf/nt/1.0'>
<'hst'='http://www.hippoecm.org/hst/nt/1.4'>

[contact:message] > hippo:document, hippostd:publishableSummary,
hippostdpubwf:document 
    - contact:firstName (string)
    - contact:email (string)
    - contact:organization (string)
    - contact:text (string)
    - contact:lastName (string)

[hst:freemarkerTemplate] 
    - hst:code (String)

I will change the namespace once I get this to work fine. Here's the
message I get when I request the page,

2010-06-02 15:44:11,525 [75373366 at qtp-1032432821-5] DEBUG freemarker.cache - Could not find template in cache, creating new one; id=[/repository://content/documents/templates/contact.ftl[en_US,ISO-8859-1,parsed] ]

Subsequent requests gives:

2010-06-02 15:44:36,248 [1802843879 at qtp-1032432821-4] DEBUG freemarker.cache - /repository://content/documents/templates/contact.ftl[en_US,ISO-8859-1,parsed] no source found.

I have followed your steps, and modifed the renderpath from :
jsp/component/contact.jsp

to the following:

repository://content/documents/templates/contact.ftl

created the "templates" hippostd:directory, and a node called
"contact.ftl" of type, hst:freemarkerTemplate. Then I added a propery
"hst:code" with value "This is my freemarker template".

Any idea ? 


On Wed Jun 02,2010 01:22 pm, Ard Schrijvers wrote:
> Hello Mansour,
> 
> No, the slash is added during the dispatcher call, and the
> RepositoryTemplateLoader expects it.
> 
> If there are more people who need it we can try to put it in the 2.05
> hst. I am not sure whether this will be to late for, as we are
> currently working on the 2.05.
> 
> Otherwise, you can step through a debugger to see where your issue is.
> It might be that some node is not present you are referring to?
> 
> Regards Ard
> 
> On Wed, Jun 2, 2010 at 1:12 PM, Mansour Al Akeel
> <mansour.alakeel at gmail.com> wrote:
> > Hello Ard:
> >
> > I am still having an issue with templates.
> >
> > 2010-06-02 13:47:11,258 [1269922636 at qtp-1190881123-4] DEBUG freemarker.cache - /repository://content/documents/templates/c.ftl[en_US,ISO-8859-1,parsed] no source found.
> >
> > Does this tell you anything. I can see it adding "/" before the world
> > "repository:". Could this be the problem ?
> >
> > Thank you.
> >
> > On Tue Jun 01,2010 02:56 pm, Ard Schrijvers wrote:
> >> On Tue, Jun 1, 2010 at 1:47 PM, Mansour Al Akeel
> >> <mansour.alakeel at gmail.com> wrote:
> >> > Hello Ard:
> >> >
> >> > [hst:freemarkerTemplate] > nt:base
> >> > ?- hst:code (hst:template)
> >>
> >> A - is for a property, but hst:template is a nodetype. Also see the
> >> jackrabbit cnd documentation.
> >>
> >>
> >> [hst:freemarkerTemplate]
> >> - hst:code (String)
> >>
> >> should be fine, although I would not reuse a namespace prefix that is
> >> not yours. Thus rather make it:
> >>
> >> [mynamespace:freemarkerTemplate]
> >> - hst:code (String)
> >>
> >> Regards Ard
> >>
> >> >
> >> > Here's the exception:
> >> >
> >> > rg.apache.jackrabbit.core.nodetype.compact.ParseException: Unkown property type 'hst:template' specified (jar:file:/home/mansour/workspace/hippo-cms/mysite/cms/target/work/webapp/WEB-INF/lib/contact-content-1.0-SNAPSHOT.jar!/types.cnd, line 16)
> >> > ? ? ? ? ? ? ? ?at org.apache.jackrabbit.core.nodetype.compact.Lexer.fail(Lexer.java:148)
> >> > ? ? ? ? ? ? ? ?at org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.doPropertyType(CompactNodeTypeDefReader.java:444)
> >> > ? ? ? ? ? ? ? ?at org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.doPropertyDefinition(CompactNodeTypeDefReader.java:406)
> >> > ? ? ? ? ? ? ? ?at org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.doItemDefs(CompactNodeTypeDefReader.java:361)
> >> >
> >> > I don't know what's wrong.
> >> >
> >> > Now with regard to making this functionality avialable by default, I won't
> >> > recommend it. If you like we can discuss this further.
> >> >
> >> > Thank you.
> >> >
> >> >
> >> > On Tue May 25,2010 10:03 am, Ard Schrijvers wrote:
> >> >> Hello Mansour,
> >> >>
> >> >> I did have it all running locally (including caching & invalidation),
> >> >> but unfortunately, at that moment, I did not want to check it in as it
> >> >> meant a cnd change. Currently we are working on the 2.05.0xx. If more
> >> >> people need it, we can make sure it is available by default.
> >> >>
> >> >> OTOH, it should be pretty simple to get it up & running. All you need
> >> >> it instead of having a template like:
> >> >>
> >> >> /jsp/news/overview.jsp you add something like:
> >> >>
> >> >> repository://freemarker/scripts/news/overview.ftl
> >> >>
> >> >> Now, you make sure, that you have a node (some custom type of your
> >> >> project) below the root with:
> >> >>
> >> >> freemarker
> >> >> ? ? ?`scripts
> >> >> ? ? ? ? ? `news
> >> >> ? ? ? ? ? ? ? ?`overview.ftl
> >> >>
> >> >> where the node overview.ftl contains a property 'hst:template' . In
> >> >> this property, you can drop the freemarker code. That should be pretty
> >> >> much it (and of course, add the freemarker servlet to your web.xml)
> >> >>
> >> >> Ard
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On Sun, May 23, 2010 at 5:32 PM, Mansour Al Akeel
> >> >> <mansour.alakeel at gmail.com> wrote:
> >> >> > Hello all:
> >> >> > I am wondering if there's an example code for
> >> >> > org.hippoecm.hst.freemarker.RepositoryTemplateLoader showing how to
> >> >> > store templated in the repo ?
> >> >> >
> >> >> >
> >> >> > _______________________________________________
> >> >> > Hippo-cms7-user mailing list and forums
> >> >> > http://www.onehippo.org/cms7/support/forums.html
> >> >> >
> >> >> _______________________________________________
> >> >> Hippo-cms7-user mailing list and forums
> >> >> http://www.onehippo.org/cms7/support/forums.html
> >> > _______________________________________________
> >> > Hippo-cms7-user mailing list and forums
> >> > http://www.onehippo.org/cms7/support/forums.html
> >> >
> >> _______________________________________________
> >> Hippo-cms7-user mailing list and forums
> >> http://www.onehippo.org/cms7/support/forums.html
> > _______________________________________________
> > Hippo-cms7-user mailing list and forums
> > http://www.onehippo.org/cms7/support/forums.html
> >
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



More information about the Hippo-cms7-user mailing list