You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Mark Weitzel <we...@gmail.com> on 2011/12/20 18:44:43 UTC
Help loading templates programmatically...
Greetings everyone...
I've got a question or two on loading and rendering a
template programmatically.
I'm trying out this app (
http://apphosting.jivesoftware.com/apps/dev/japtemp/app.xml) in the vanilla
common container in shindig.
In the app, I've got a custom template library.
<Require feature="opensocial-templates">
<Param name="requireLibrary">
http://apphosting.jivesoftware.com/apps/dev/japtemp/japtemplates.xml</Param>
</Require>
In this file, I declare a simple template:
<Template tag="jve1:Name">
<jve:If condition="${!My.person.profileUrl}">
${My.person.name.formatted}
</jve:If>
<a href="${My.person.profileUrl}"
if="${My.person.profileUrl}">${My.person.name.formatted}</a>
</Template>
What I'd like to do is use renderInto to put this into a div. To do this, I
need to get the template, and this is where the problem comes in.
opensocial.template.getTemplate("jve1:Name") always returns undefined. I
stepped through the XmlTemplateLibrary class and it looks like the library
is being loaded properly.
I also break in the browser and the opensocial.template has an nsmap that
looks like the template libraries are there.
So is there something that I'm doing wrong?
Thanks a bunch!!
-Mark W.
Re: Help loading templates programmatically...
Posted by Mark Weitzel <we...@gmail.com>.
Yeah...
I tried the same thing with the same results.
<Require feature="content-rewrite">
<Param name="include-tags"/>
</Require>
I think i even tried <Param name="include-the-^&(*$&()@$*#$)-tags" /> but I
could have been a bit frustrated at the time.
On Tue, Dec 20, 2011 at 5:12 PM, Ryan J Baxter <rj...@us.ibm.com> wrote:
> Mark, I have also seen this problem. I spent a few hours debugging the
> problem but never found the root cause. Like you said it looked like the
> template was loaded and the was being rewritten into the gadgets iFrame
> but for some reason the tag in my gadget was not being replaced. I saw
> somewhere in the code, i can't remember where right now, that you needed
> to add the feature content-rewrite and include a parameter called
> include-tags and I think I tried that but it wasn't working for me. I
> haven't had a chance to get back to debugging the problem, but would be
> interested if you find our what the root cause is.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From: Mark Weitzel <we...@gmail.com>
> To: dev@shindig.apache.org,
> Cc: henry.saputra@jivesoftware.com
> Date: 12/20/2011 12:53 PM
> Subject: Help loading templates programmatically...
>
>
>
> Greetings everyone...
>
> I've got a question or two on loading and rendering a
> template programmatically.
> I'm trying out this app (
> http://apphosting.jivesoftware.com/apps/dev/japtemp/app.xml) in the
> vanilla
> common container in shindig.
>
> In the app, I've got a custom template library.
> <Require feature="opensocial-templates">
> <Param name="requireLibrary">
> http://apphosting.jivesoftware.com/apps/dev/japtemp/japtemplates.xml
> </Param>
> </Require>
>
> In this file, I declare a simple template:
> <Template tag="jve1:Name">
> <jve:If condition="${!My.person.profileUrl}">
> ${My.person.name.formatted}
> </jve:If>
> <a href="${My.person.profileUrl}"
> if="${My.person.profileUrl}">${My.person.name.formatted}</a>
> </Template>
>
> What I'd like to do is use renderInto to put this into a div. To do this,
> I
> need to get the template, and this is where the problem comes in.
> opensocial.template.getTemplate("jve1:Name") always returns undefined. I
> stepped through the XmlTemplateLibrary class and it looks like the library
> is being loaded properly.
>
> I also break in the browser and the opensocial.template has an nsmap that
> looks like the template libraries are there.
>
> So is there something that I'm doing wrong?
>
> Thanks a bunch!!
>
> -Mark W.
>
>
>
>
Re: Help loading templates programmatically...
Posted by Ryan J Baxter <rj...@us.ibm.com>.
Mark, I have also seen this problem. I spent a few hours debugging the
problem but never found the root cause. Like you said it looked like the
template was loaded and the was being rewritten into the gadgets iFrame
but for some reason the tag in my gadget was not being replaced. I saw
somewhere in the code, i can't remember where right now, that you needed
to add the feature content-rewrite and include a parameter called
include-tags and I think I tried that but it wasn't working for me. I
haven't had a chance to get back to debugging the problem, but would be
interested if you find our what the root cause is.
-Ryan
Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile
From: Mark Weitzel <we...@gmail.com>
To: dev@shindig.apache.org,
Cc: henry.saputra@jivesoftware.com
Date: 12/20/2011 12:53 PM
Subject: Help loading templates programmatically...
Greetings everyone...
I've got a question or two on loading and rendering a
template programmatically.
I'm trying out this app (
http://apphosting.jivesoftware.com/apps/dev/japtemp/app.xml) in the
vanilla
common container in shindig.
In the app, I've got a custom template library.
<Require feature="opensocial-templates">
<Param name="requireLibrary">
http://apphosting.jivesoftware.com/apps/dev/japtemp/japtemplates.xml
</Param>
</Require>
In this file, I declare a simple template:
<Template tag="jve1:Name">
<jve:If condition="${!My.person.profileUrl}">
${My.person.name.formatted}
</jve:If>
<a href="${My.person.profileUrl}"
if="${My.person.profileUrl}">${My.person.name.formatted}</a>
</Template>
What I'd like to do is use renderInto to put this into a div. To do this,
I
need to get the template, and this is where the problem comes in.
opensocial.template.getTemplate("jve1:Name") always returns undefined. I
stepped through the XmlTemplateLibrary class and it looks like the library
is being loaded properly.
I also break in the browser and the opensocial.template has an nsmap that
looks like the template libraries are there.
So is there something that I'm doing wrong?
Thanks a bunch!!
-Mark W.