| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <Module> |
| <ModulePrefs title="EndToEndTest"> |
| <Require feature="opensocial-data" /> |
| <Require feature="opensocial-templates"/> |
| </ModulePrefs> |
| <Content type="html"> |
| <![CDATA[ |
| <script xmlns:os="http://ns.opensocial.org/2008/markup" type="text/os-data"> |
| <os:PeopleRequest key="friends" userId="@viewer" groupId="@friends"/> |
| <os:HttpRequest key="json" href="test.json"/> |
| <os:HttpRequest key="text" href="test.json" format="text"/> |
| </script> |
| |
| <script type="text/os-template" xmlns:os="http://ns.opensocial.org/2008/markup" |
| xmlns:osx="http://ns.opensocial.org/2009/extensions"> |
| <ul id="attrs"> |
| <li repeat="${friends}"> |
| <span id="id${Context.Index}">${name.givenName}</span> |
| </li> |
| </ul> |
| |
| <ul id="repeatTag"> |
| <os:Repeat expression="${friends}" if="${Context.Index == 1}"> |
| <li>${name.givenName}</li> |
| </os:Repeat> |
| </ul> |
| |
| <ul id="ifTag"> |
| <li repeat="${friends}"> |
| <os:If condition="${Context.Index == 2}"> |
| <b>${Cur.name.givenName}</b> |
| </os:If> |
| </li> |
| </ul> |
| |
| <span id="json">${json.content.key}</span> |
| <span id="text">${text.content}</span> |
| <span id="mutate" oncreate="this.innerHTML='mutated'"></span> |
| |
| <osx:Variable key="sum" value="0"/> |
| <osx:Variable key="max" value="0"/> |
| <os:Repeat expression="${osx:parseJson('[10,15,-5,25]')}"> |
| <osx:Variable key="max" value="${Cur > max ? Cur : max}"/> |
| <osx:Variable key="sum" value="${sum + Cur}"/> |
| </os:Repeat> |
| <span id="sum">${sum}</span> |
| <span id="max">${max}</span> |
| </script> |
| ]]> |
| </Content> |
| </Module> |