Templates - Pending Questions

0 views
Skip to first unread message

Badaro

unread,
Mar 31, 2009, 3:43:20 PM3/31/09
to Orkut Developer Forum
Hello,

I still have a few questions I posted in the past couple of weeks that
haven't been answered. Can someone from Orkut help me here? I believe
these are the only things I need to finish converting my applications
to Templates:

1) In a specific part of my application, I need to show different
messages depending on the context the application is running:

- Owner == Viewer
- Owner != Viewer && Viewer has app installed
- Owner != Viewer && Viewer does not have app installed

I was trying with the following tests:

<h5 if="${owner.id == viewer.id}">Message Viewer is Owner</h5>
<h5 if="${owner.id == viewer.id && viewer!=null}">Message Viewer has
App</h5>
<h5 if="${owner.id == viewer.id && viewer==null}">Message Viewer does
not have App</h5>

The first two work, the last one doesn't. Is this a bug? Is there
another way I can get the same behavior?

2) What is the status on os:NavigateToView?
3) Will you be implementing os:Html?
4) Will you be implementing something analog to adjustHeight?

Thanks in advance.

eduardorochabr

unread,
Mar 31, 2009, 10:42:15 PM3/31/09
to Orkut Developer Forum
In the last statement, if the viewer is null, viewer.id will fail, so
you should test only if the viewer is null:

<h5 if="${viewer==null}">Message Viewer does not have App</h5>

eduardorochabr

unread,
Mar 31, 2009, 10:46:15 PM3/31/09
to Orkut Developer Forum
Actually, I would go for something like:

<h5 if="${viewer && owner.id == viewer.id}">Message Viewer is Owner</
h5>
<h5 if="${viewer && owner.id != viewer.id}">Message Viewer has App</
h5>
<h5 if="${viewer == null}">Message Viewer does not have App</h5>

Vijaya

unread,
Apr 1, 2009, 4:45:34 AM4/1/09
to Orkut Developer Forum
I think eduardorochabr has answered question #1.
As for the others, we are in the process of implementing
<os:NavigateToView> and it should be available in a couple of weeks.
We do not have support for adjustHeight but will keep you informed
when we have a solution for that. I've also confirmed that <os:Html>
is not working, so could you please enter an issue in the the issue
tracker
(http://code.google.com/p/opensocial-resources/wiki/IssuesTab?tm=3)
about it and we can look into it?

Badaro

unread,
Apr 1, 2009, 10:38:19 AM4/1/09
to Orkut Developer Forum
Vijaya,

1) Sadly, eduardorochabr's idea doesn't work, I just tested:

<h5 if="${viewer !=null && owner.id == viewer.id}">Message Viewer is
Owner</h5>
<h5 if="${viewer !=null && owner.id != viewer.id}">Message Viewer has
App</h5>
<h5 if="${viewer == null}">Message Viewer does not have App</h5>

First two cases work, third doesn't - that message never appears.

2) Issue created for <os:Html> not working.
http://code.google.com/p/opensocial-resources/issues/detail?id=724

3) If you're not supporting adjustHeight for now, is there any to to
specify a fixed height for the app in the XML? That would be enough
for the profile.

eduardorochabr

unread,
Apr 1, 2009, 1:56:31 PM4/1/09
to Orkut Developer Forum
Hi Badaro, maybe the variable "viewer" isn't defined at all, can you
please test the following?

<h5 if="${typeof(viewer) == 'undefined'}">Message Viewer does not have
App</h5>

On 1 abr, 11:38, Badaro <bad...@gmail.com> wrote:
> Vijaya,
>
> 1) Sadly, eduardorochabr's idea doesn't work, I just tested:
>
> <h5 if="${viewer !=null && owner.id == viewer.id}">Message Viewer is
> Owner</h5>
> <h5 if="${viewer !=null && owner.id != viewer.id}">Message Viewer has
> App</h5>
> <h5 if="${viewer == null}">Message Viewer does not have App</h5>
>
> First two cases work, third doesn't - that message never appears.
>
> 2) Issue created for <os:Html> not working.http://code.google.com/p/opensocial-resources/issues/detail?id=724

Badaro

unread,
Apr 1, 2009, 5:12:04 PM4/1/09
to Orkut Developer Forum
Didn't work either:

<h5 if="${viewer !=null && owner.id == viewer.id}">Message Viewer is
Owner (A)</h5>
<h5 if="${viewer !=null && owner.id != viewer.id}">Message Viewer has
App (A)</h5>
<h5 if="${viewer == null}">Message Viewer does not have App (A)</h5>
<h5 if="${typeof(viewer) == 'undefined'}">Message Viewer does not have
App (B)</h5>

Still open for suggestions. :)

Nagib

unread,
Apr 6, 2009, 1:05:00 PM4/6/09
to Orkut Developer Forum
Hi,

can u change <h5 if="${viewer !=null && owner.id ==
viewer.id}">Message Viewer is Owner (A)</h5>
for: <h5 if="${owner.isViewer}">Message Viewer is> Owner (A)</h5>

correct?
Reply all
Reply to author
Forward
0 new messages