Applied RAVE-1068 from Stanton Sievers git-svn-id: https://svn.apache.org/repos/asf/rave/trunk@1552320 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/rave/repo Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/bdd0d4b8 Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/bdd0d4b8 Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/bdd0d4b8 Branch: refs/heads/angular Commit: bdd0d4b848fadc899c21f830f51fcede47b6711e Parents: 9b7ed63 Author: Matthew B. Franklin <[email protected]> Authored: Thu Dec 19 13:44:29 2013 +0000 Committer: Matthew B. Franklin <[email protected]> Committed: Thu Dec 19 13:44:29 2013 +0000 ---------------------------------------------------------------------- pom.xml | 2 +- .../org/apache/rave/model/ApplicationData.java | 12 ++-- .../portal/model/impl/ApplicationDataImpl.java | 52 +++++++------- .../rave/portal/model/JpaApplicationData.java | 48 ++++++------- .../impl/JpaApplicationDataRepository.java | 75 +++++++++----------- .../JpaApplicationDataConverterTest.java | 14 ++-- .../impl/JpaApplicationDataRepositoryTest.java | 52 +++++++------- .../impl/DefaultActivityStreamsService.java | 15 ++-- .../service/impl/DefaultAppDataService.java | 28 ++++---- .../service/impl/DefaultPersonService.java | 8 ++- .../opensocial/service/AppDataServiceTest.java | 54 +++++++------- .../DefaultActivityStreamsServiceTest.java | 7 +- .../src/main/resources/rave.shindig.properties | 20 ++++-- .../classes/containers/default/container.js | 33 +++++---- 14 files changed, 221 insertions(+), 199 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 7ffad9c..59a156b 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ </scm> <properties> - <apache.shindig.version>2.5.0-beta5</apache.shindig.version> + <apache.shindig.version>2.5.0-update1</apache.shindig.version> <apache.wookie.version>0.13.1</apache.wookie.version> <org.springframework.version>3.2.3.RELEASE</org.springframework.version> <org.springframework.security.version>3.1.4.RELEASE</org.springframework.security.version> http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-core-api/src/main/java/org/apache/rave/model/ApplicationData.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/model/ApplicationData.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/model/ApplicationData.java index 1847436..fa4bb5d 100644 --- a/rave-components/rave-core-api/src/main/java/org/apache/rave/model/ApplicationData.java +++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/model/ApplicationData.java @@ -29,9 +29,9 @@ public interface ApplicationData { String getUserId(); void setUserId(String userId); - String getAppUrl(); - void setAppUrl(String appUrl); - - Map<String, String> getData(); - void setData(Map<String, String> data); -} + String getAppUrl(); + void setAppUrl(String appUrl); + + Map<String, Object> getData(); + void setData(Map<String, Object> data); +} http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ApplicationDataImpl.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ApplicationDataImpl.java b/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ApplicationDataImpl.java index 097baeb..856eed4 100644 --- a/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ApplicationDataImpl.java +++ b/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ApplicationDataImpl.java @@ -23,21 +23,21 @@ import org.apache.rave.model.ApplicationData; import java.util.Map; public class ApplicationDataImpl implements ApplicationData { - private String id; - private String userId; - private String appUrl; - private Map<String, String> data; - - public ApplicationDataImpl() {} - + private String id; + private String userId; + private String appUrl; + private Map<String, Object> data; + + public ApplicationDataImpl() {} + public ApplicationDataImpl(String id) { - this.id = id; - } - - public ApplicationDataImpl(String id, String userId, String appUrl, Map<String, String> data) { - this.id = id; - this.userId = userId; - this.appUrl = appUrl; + this.id = id; + } + + public ApplicationDataImpl(String id, String userId, String appUrl, Map<String, Object> data) { + this.id = id; + this.userId = userId; + this.appUrl = appUrl; this.data = data; } @@ -69,15 +69,15 @@ public class ApplicationDataImpl implements ApplicationData { @Override public void setAppUrl(String appUrl) { this.appUrl = appUrl; - } - - @Override - public Map<String, String> getData() { - return data; - } - - @Override - public void setData(Map<String, String> data) { - this.data = data; - } -} + } + + @Override + public Map<String, Object> getData() { + return data; + } + + @Override + public void setData(Map<String, Object> data) { + this.data = data; + } +} http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaApplicationData.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaApplicationData.java b/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaApplicationData.java index 2216aaf..eab1c6c 100644 --- a/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaApplicationData.java +++ b/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaApplicationData.java @@ -53,18 +53,18 @@ public class JpaApplicationData implements BasicEntity, ApplicationData { private String userId; @Column(name = "app_url") - private String appUrl; - - @Transient - private Map<String, String> data; - - public JpaApplicationData() { - } - - public JpaApplicationData(Long entityId, String userId, String appUrl, Map<String, String> data) { - this.entityId = entityId; - this.userId = userId; - this.appUrl = appUrl; + private String appUrl; + + @Transient + private Map<String, Object> data; + + public JpaApplicationData() { + } + + public JpaApplicationData(Long entityId, String userId, String appUrl, Map<String, Object> data) { + this.entityId = entityId; + this.userId = userId; + this.appUrl = appUrl; this.data = data; } @@ -106,15 +106,15 @@ public class JpaApplicationData implements BasicEntity, ApplicationData { @Override public void setAppUrl(String appUrl) { this.appUrl = appUrl; - } - - @Override - public Map<String, String> getData() { - return data; - } - - @Override - public void setData(Map<String, String> data) { - this.data = data; - } -} + } + + @Override + public Map<String, Object> getData() { + return data; + } + + @Override + public void setData(Map<String, Object> data) { + this.data = data; + } +} http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepository.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepository.java b/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepository.java index a560be1..95f6453 100644 --- a/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepository.java +++ b/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepository.java @@ -23,24 +23,26 @@ import org.apache.commons.lang3.StringUtils; import org.apache.rave.exception.DataSerializationException; import org.apache.rave.model.ApplicationData; import org.apache.rave.portal.model.JpaApplicationData; -import org.apache.rave.portal.model.conversion.JpaApplicationDataConverter; -import org.apache.rave.portal.repository.ApplicationDataRepository; -import org.apache.rave.util.CollectionUtils; -import org.json.JSONException; -import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.rave.portal.model.conversion.JpaApplicationDataConverter; +import org.apache.rave.portal.repository.ApplicationDataRepository; +import org.apache.rave.util.CollectionUtils; +import org.apache.rave.util.JsonUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EntityManager; -import javax.persistence.Lob; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; +import javax.persistence.Lob; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -158,32 +160,25 @@ public class JpaApplicationDataRepository implements ApplicationDataRepository { private String serializedData; public JpaSerializableApplicationData() { - super(); - } - - public JpaSerializableApplicationData(Long entityId, String userId, String appUrl, Map<String, String> data) { - super(entityId, userId, appUrl, data); - } - - public void serializeData() { - serializedData = new JSONObject(this.getData()).toString(); - } - - public void deserializeData() { - try { - Map<String, String> data = new HashMap<String, String>(); - if (StringUtils.isNotBlank(serializedData)) { - JSONObject jsonObject = new JSONObject(serializedData); - Iterator keys = jsonObject.keys(); - while (keys.hasNext()) { - String key = (String) keys.next(); - data.put(key, (String) jsonObject.get(key)); - } - } - this.setData(data); - } catch (JSONException e) { - throw new DataSerializationException("Exception caught while deserializing data: " + serializedData, e); - } - } - } + super(); + } + + public JpaSerializableApplicationData(Long entityId, String userId, String appUrl, Map<String, Object> data) { + super(entityId, userId, appUrl, data); + } + + public void serializeData() { + Map<String, Object> data = this.getData(); + if (data != null) { + serializedData = JsonUtils.stringify(data); + } + } + + @SuppressWarnings("unchecked") + public void deserializeData() { + if (serializedData != null && StringUtils.isNotBlank(serializedData)) { + this.setData(JsonUtils.parse(serializedData, Map.class)); + } + } + } } http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaApplicationDataConverterTest.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaApplicationDataConverterTest.java b/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaApplicationDataConverterTest.java index c27da22..caf8722 100644 --- a/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaApplicationDataConverterTest.java +++ b/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaApplicationDataConverterTest.java @@ -53,13 +53,13 @@ public class JpaApplicationDataConverterTest { @Test public void newApplicationData() { - ApplicationData applicationData = new ApplicationDataImpl(); - applicationData.setId("1"); - applicationData.setAppUrl("url"); - applicationData.setData(new HashMap<String, String>()); - applicationData.setUserId("userid"); - - JpaApplicationData converted = applicationDataConverter.convert(applicationData); + ApplicationData applicationData = new ApplicationDataImpl(); + applicationData.setId("1"); + applicationData.setAppUrl("url"); + applicationData.setData(new HashMap<String, Object>()); + applicationData.setUserId("userid"); + + JpaApplicationData converted = applicationDataConverter.convert(applicationData); assertThat(converted, is(not(sameInstance(applicationData)))); assertThat(converted, is(instanceOf(JpaApplicationData.class))); assertThat(converted.getId(), is(equalTo(applicationData.getId()))); http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepositoryTest.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepositoryTest.java b/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepositoryTest.java index f83c5a8..5ff9b00 100644 --- a/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepositoryTest.java +++ b/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/repository/impl/JpaApplicationDataRepositoryTest.java @@ -54,17 +54,17 @@ public class JpaApplicationDataRepositoryTest { private static final String VALID_USER_ID = "12345"; private static final String VALID_APPLICATION_ID = "http://example.com/gadget.xml"; - private static final String SECOND_VALID_APPLICATION_ID = "http://example.com/gadget2.xml"; - private static final Long VALID_APPLICATION_DATA_ID = 1L; - - private Map<String, String> validApplicationDataMap; - - @Before - public void setup() { - validApplicationDataMap = new HashMap<String, String>(); - validApplicationDataMap.put("color", "blue"); - validApplicationDataMap.put("speed", "fast"); - validApplicationDataMap.put("state", "MA"); + private static final String SECOND_VALID_APPLICATION_ID = "http://example.com/gadget2.xml"; + private static final Long VALID_APPLICATION_DATA_ID = 1L; + + private Map<String, Object> validApplicationDataMap; + + @Before + public void setup() { + validApplicationDataMap = new HashMap<String, Object>(); + validApplicationDataMap.put("color", "blue"); + validApplicationDataMap.put("speed", "fast"); + validApplicationDataMap.put("state", "MA"); } @Test @@ -134,13 +134,13 @@ public class JpaApplicationDataRepositoryTest { @Test @Transactional - @Rollback(true) - public void save_existingEntity() { - JpaApplicationData applicationData = new JpaApplicationData(VALID_APPLICATION_DATA_ID, VALID_USER_ID, - VALID_APPLICATION_ID, new HashMap<String, String>()); - - JpaApplicationData saved = (JpaApplicationData)repository.save(applicationData); - manager.flush(); + @Rollback(true) + public void save_existingEntity() { + JpaApplicationData applicationData = new JpaApplicationData(VALID_APPLICATION_DATA_ID, VALID_USER_ID, + VALID_APPLICATION_ID, new HashMap<String, Object>()); + + JpaApplicationData saved = (JpaApplicationData)repository.save(applicationData); + manager.flush(); assertThat(saved, is(not(sameInstance(applicationData)))); assertThat(saved.getEntityId(), is(equalTo(applicationData.getEntityId()))); } @@ -171,12 +171,12 @@ public class JpaApplicationDataRepositoryTest { private void validateApplicationData(JpaApplicationData applicationData) { assertThat(applicationData, is(not(nullValue()))); assertThat(applicationData.getEntityId(), is(equalTo(VALID_APPLICATION_DATA_ID))); - assertThat(applicationData.getUserId(), is(equalTo(VALID_USER_ID))); - assertThat(applicationData.getAppUrl(), is(equalTo(VALID_APPLICATION_ID))); - - Map<String, String> actualData = applicationData.getData(); - for (Map.Entry<String, String> entry : validApplicationDataMap.entrySet()) { - assertEquals(entry.getValue(), actualData.get(entry.getKey())); - } - } + assertThat(applicationData.getUserId(), is(equalTo(VALID_USER_ID))); + assertThat(applicationData.getAppUrl(), is(equalTo(VALID_APPLICATION_ID))); + + Map<String, Object> actualData = applicationData.getData(); + for (Map.Entry<String, Object> entry : validApplicationDataMap.entrySet()) { + assertEquals(entry.getValue(), actualData.get(entry.getKey())); + } + } } http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java index c98330b..2be8bde 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java @@ -23,6 +23,8 @@ import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import com.google.common.util.concurrent.Futures; + import org.apache.rave.model.ActivityStreamsEntry; import org.apache.rave.model.ActivityStreamsObject; import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl; @@ -31,7 +33,6 @@ import org.apache.rave.portal.repository.ActivityStreamsRepository; import org.apache.rave.util.ActivityConversionUtil; import org.apache.shindig.auth.BasicSecurityToken; import org.apache.shindig.auth.SecurityToken; -import org.apache.shindig.common.util.ImmediateFuture; import org.apache.shindig.protocol.ProtocolException; import org.apache.shindig.protocol.RestfulCollection; import org.apache.shindig.protocol.model.SortOrder; @@ -90,7 +91,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { @Override public Future<RestfulCollection<ActivityEntry>> getActivityEntries(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, SecurityToken token) { List<ActivityEntry> result = getFromRepository(userIds, groupId, appId, fields, options, token); - return ImmediateFuture.newInstance(new RestfulCollection<ActivityEntry>(result)); + return Futures.immediateFuture(new RestfulCollection<ActivityEntry>(result)); } @@ -121,7 +122,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { entries.add(getActivity(fields, userId.getUserId(token), peopleById, id)); } - return ImmediateFuture.newInstance(new RestfulCollection<ActivityEntry>(entries)); + return Futures.immediateFuture(new RestfulCollection<ActivityEntry>(entries)); } /** @@ -142,7 +143,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { */ @Override public Future<ActivityEntry> getActivityEntry(UserId userId, GroupId groupId, String appId, Set<String> fields, String activityId, SecurityToken token) throws ProtocolException { - return ImmediateFuture.newInstance(getActivity(fields, userId.getUserId(token), Maps.<String, Person>newHashMap(), activityId)); + return Futures.immediateFuture(getActivity(fields, userId.getUserId(token), Maps.<String, Person>newHashMap(), activityId)); } /** @@ -173,7 +174,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { } } - return ImmediateFuture.newInstance(null); + return Futures.immediateFuture(null); } /** @@ -223,7 +224,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { ActivityStreamsEntry saved = repository.save(tmp); ActivityEntryImpl impl = converter.convert(saved); - return ImmediateFuture.newInstance((ActivityEntry) impl); + return Futures.immediateFuture((ActivityEntry) impl); } /** @@ -251,7 +252,7 @@ public class DefaultActivityStreamsService implements ActivityStreamService { ActivityStreamsEntryImpl activityEntity = converter.convert(activity); ActivityStreamsEntry saved = repository.save(activityEntity); - return ImmediateFuture.newInstance((ActivityEntry)converter.convert(saved)); + return Futures.immediateFuture((ActivityEntry)converter.convert(saved)); } http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultAppDataService.java ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultAppDataService.java b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultAppDataService.java index 26f62d6..d07ddd7 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultAppDataService.java +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultAppDataService.java @@ -27,7 +27,6 @@ import org.apache.rave.portal.model.impl.ApplicationDataImpl; import org.apache.rave.portal.repository.ApplicationDataRepository; import org.apache.rave.service.LockService; import org.apache.shindig.auth.SecurityToken; -import org.apache.shindig.common.util.ImmediateFuture; import org.apache.shindig.protocol.DataCollection; import org.apache.shindig.protocol.ProtocolException; import org.apache.shindig.social.opensocial.spi.AppDataService; @@ -36,7 +35,10 @@ import org.apache.shindig.social.opensocial.spi.UserId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.google.common.util.concurrent.Futures; + import javax.servlet.http.HttpServletResponse; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -91,7 +93,7 @@ public class DefaultAppDataService implements AppDataService { //fetch their appdata, convert it to a DataCollection and return it List<ApplicationData> applicationData = applicationDataRepository.getApplicationData(personIds, appId); DataCollection dataCollection = convertAppDataMapToDataCollection(personIds, applicationData, fields); - return ImmediateFuture.newInstance(dataCollection); + return Futures.immediateFuture(dataCollection); } /** @@ -120,11 +122,11 @@ public class DefaultAppDataService implements AppDataService { //if there is no data, there's nothing to delete, so we're done... if (applicationData == null || applicationData.getData() == null) { - return ImmediateFuture.newInstance(null); + return Futures.immediateFuture(null); } //remove the fields specified -- empty field set implies remove all, otherwise remove just the fields specified - Map<String, String> data = applicationData.getData(); + Map<String, Object> data = applicationData.getData(); if (fields == null || fields.size() == 0) { data.clear(); } else { @@ -137,7 +139,7 @@ public class DefaultAppDataService implements AppDataService { lock.unlock(); lockService.returnLock(lock); } - return ImmediateFuture.newInstance(null); + return Futures.immediateFuture(null); } /** @@ -156,7 +158,7 @@ public class DefaultAppDataService implements AppDataService { */ @Override public Future<Void> updatePersonData(UserId userId, GroupId groupId, String appId, Set<String> - fields, Map<String, String> values, SecurityToken token) throws ProtocolException { + fields, Map<String, Object> values, SecurityToken token) throws ProtocolException { //make sure the request conforms to the OpenSocial visibility rules String personId = validateWriteRequest(userId, groupId, appId, token); @@ -169,7 +171,7 @@ public class DefaultAppDataService implements AppDataService { //if there is no data, create an empty object to store the data in that we'll save when we're done if (applicationData == null) { - applicationData = new ApplicationDataImpl(null, personId, appId, new HashMap<String, String>()); + applicationData = new ApplicationDataImpl(null, personId, appId, new HashMap<String, Object>()); } //if the fields parameter is empty, we can just use the values map directly since this is a full update @@ -185,7 +187,7 @@ public class DefaultAppDataService implements AppDataService { //map (due to the check above), so we can just enumerate over it now to finish our work. So we want to remove //any fields found in the fields set that are not found in the values map and update the rest. else { - Map<String, String> data = applicationData.getData(); + Map<String, Object> data = applicationData.getData(); for (String field : fields) { //if this field is not in the values map, its a delete if (!values.containsKey(field)) { @@ -203,7 +205,7 @@ public class DefaultAppDataService implements AppDataService { lock.unlock(); lockService.returnLock(lock); } - return ImmediateFuture.newInstance(null); + return Futures.immediateFuture(null); } private List<String> validateReadRequest(Set<UserId> userIds, GroupId groupId, String appId, SecurityToken token) { @@ -251,18 +253,18 @@ public class DefaultAppDataService implements AppDataService { private DataCollection convertAppDataMapToDataCollection(List<String> personIds, List<ApplicationData> applicationData, Set<String> fields) { //create the map that we'll use to associate users with their appdata - Map<String, Map<String, String>> dataCollectionMap = new HashMap<String, Map<String, String>>(); + Map<String, Map<String, Object>> dataCollectionMap = new HashMap<String, Map<String, Object>>(); //enumerate the data we have mapping it back to the owner for (ApplicationData data : applicationData) { //create a map for our return values - Map<String, String> returnData = new HashMap<String, String>(); + Map<String, Object> returnData = new HashMap<String, Object>(); //if there isn't a set of fields to filter on return all user data, otherwise filter to the specified fields if (fields == null || fields.size() == 0) { returnData.putAll(data.getData()); } else { //otherwise filter the values - for (Map.Entry<String, String> userDataEntry : data.getData().entrySet()) { + for (Map.Entry<String, Object> userDataEntry : data.getData().entrySet()) { if (fields.contains(userDataEntry.getKey())) { returnData.put(userDataEntry.getKey(), userDataEntry.getValue()); } @@ -276,7 +278,7 @@ public class DefaultAppDataService implements AppDataService { //now enumerate all of the personIds to be sure we have some data in the map for them, and if not, add empty data for (String personId : personIds) { if (!dataCollectionMap.containsKey(personId)) { - dataCollectionMap.put(personId, new HashMap<String, String>()); + dataCollectionMap.put(personId, new HashMap<String, Object>()); } } http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java index 1d2199f..c55c9e4 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java @@ -20,12 +20,13 @@ package org.apache.rave.opensocial.service.impl; import com.google.common.collect.Lists; +import com.google.common.util.concurrent.Futures; + import org.apache.rave.opensocial.repository.OpenSocialPersonRepository; import org.apache.rave.opensocial.service.SimplePersonService; import org.apache.rave.util.CollectionUtils; import org.apache.shindig.auth.AbstractSecurityToken; import org.apache.shindig.auth.SecurityToken; -import org.apache.shindig.common.util.ImmediateFuture; import org.apache.shindig.protocol.ProtocolException; import org.apache.shindig.protocol.RestfulCollection; import org.apache.shindig.social.opensocial.model.Person; @@ -37,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; + import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -66,13 +68,13 @@ public class DefaultPersonService implements PersonService, SimplePersonService collectionOptions = manipulateCollectionOptions(collectionOptions,token); List<org.apache.rave.model.Person> people = getPeople(userIds, groupId, collectionOptions, token); - return ImmediateFuture.newInstance(new RestfulCollection<Person>(convertPeople(people, fields))); + return Futures.immediateFuture(new RestfulCollection<Person>(convertPeople(people, fields))); } @Override public Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken token) throws ProtocolException { - return ImmediateFuture.newInstance(convertPerson(getPersonForId(id, token), fields)); + return Futures.immediateFuture(convertPerson(getPersonForId(id, token), fields)); } @Override http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/AppDataServiceTest.java ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/AppDataServiceTest.java b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/AppDataServiceTest.java index a4549a1..3a4166d 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/AppDataServiceTest.java +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/AppDataServiceTest.java @@ -60,7 +60,7 @@ public class AppDataServiceTest { private static final String VALID_APPLICATION_DATA_ID = "1"; private static final Long VALID_MODULE_ID = 1l; - private Map<String, String> validApplicationDataMap; + private Map<String, Object> validApplicationDataMap; private ApplicationData validApplicationData; private Person validPerson; @@ -72,7 +72,7 @@ public class AppDataServiceTest { appDataRepository = createMock(ApplicationDataRepository.class); appDataService = new DefaultAppDataService(personService, lockService, appDataRepository); - validApplicationDataMap = new HashMap<String, String>(); + validApplicationDataMap = new HashMap<String, Object>(); validApplicationDataMap.put("color", "blue"); validApplicationDataMap.put("speed", "fast"); validApplicationDataMap.put("state", "MA"); @@ -92,7 +92,7 @@ public class AppDataServiceTest { @Test public void getPersonData_validRequest_noAppData() throws Exception { testGetPersonData(validApplicationData.getData().keySet(), VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, - null, new HashMap<String, String>()); + null, new HashMap<String, Object>()); } @Test @@ -109,7 +109,7 @@ public class AppDataServiceTest { @Test public void getPersonData_validRequest_hasAppData_partialFields() throws Exception { - HashMap<String, String> expectedData = new HashMap<String, String>(validApplicationDataMap); + HashMap<String, Object> expectedData = new HashMap<String, Object>(validApplicationDataMap); expectedData.remove("color"); testGetPersonData(expectedData.keySet(), VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, @@ -126,24 +126,24 @@ public class AppDataServiceTest { public void deletePersonData_validRequest_clearAllDataWithAllFields() throws Exception { Set<String> fieldsToDelete = new HashSet<String>(validApplicationData.getData().keySet()); - testDeletePersonData(fieldsToDelete, new HashMap<String, String>()); + testDeletePersonData(fieldsToDelete, new HashMap<String, Object>()); } @Test public void deletePersonData_validRequest_clearAllDataWithNullFields() throws Exception { - testDeletePersonData(null, new HashMap<String, String>()); + testDeletePersonData(null, new HashMap<String, Object>()); } @Test public void deletePersonData_validRequest_clearAllDataWithEmptyFields() throws Exception { - testDeletePersonData(new HashSet<String>(), new HashMap<String, String>()); + testDeletePersonData(new HashSet<String>(), new HashMap<String, Object>()); } @Test public void deletePersonData_validRequest_clearSomeData() throws Exception { Set<String> fieldsToDelete = new HashSet<String>(validApplicationData.getData().keySet()); fieldsToDelete.remove("color"); - HashMap<String, String> expectedApplicationDataAfterDelete = new HashMap<String, String>(validApplicationData.getData()); + HashMap<String, Object> expectedApplicationDataAfterDelete = new HashMap<String, Object>(validApplicationData.getData()); for (String fieldToDelete : fieldsToDelete) { expectedApplicationDataAfterDelete.remove(fieldToDelete); } @@ -153,7 +153,7 @@ public class AppDataServiceTest { @Test(expected = ProtocolException.class) public void deletePersonData_invalidRequest_wrongViewer() throws Exception { - testDeletePersonData("11111", "11111", new HashSet<String>(), new HashMap<String, String>(), + testDeletePersonData("11111", "11111", new HashSet<String>(), new HashMap<String, Object>(), validApplicationData); } @@ -171,13 +171,13 @@ public class AppDataServiceTest { @Test public void updatePersonData_validRequest_removeAllValues() throws Exception { - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); testUpdatePersonData(null, values, values, validApplicationData); } @Test public void updatePersonData_validRequest_replaceAllValues_nullFields() throws Exception { - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put("newKey1", "newValue1"); values.put("newKey2", "newValue2"); testUpdatePersonData(null, values, values, validApplicationData); @@ -185,7 +185,7 @@ public class AppDataServiceTest { @Test public void updatePersonData_validRequest_replaceAllValues_emptyFields() throws Exception { - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put("newKey1", "newValue1"); values.put("newKey2", "newValue2"); testUpdatePersonData(new HashSet<String>(), values, values, validApplicationData); @@ -193,11 +193,11 @@ public class AppDataServiceTest { @Test public void updatePersonData_validRequest_appendNewValues() throws Exception { - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put("newKey1", "newValue1"); values.put("newKey2", "newValue2"); - HashMap<String, String> expectedValuesAfterUpdate = new HashMap<String, String>(validApplicationData.getData()); + HashMap<String, Object> expectedValuesAfterUpdate = new HashMap<String, Object>(validApplicationData.getData()); expectedValuesAfterUpdate.putAll(values); testUpdatePersonData(values.keySet(), values, expectedValuesAfterUpdate, validApplicationData); @@ -205,7 +205,7 @@ public class AppDataServiceTest { @Test public void updatePersonData_validRequest_appendNewValues_nullApplicationData() throws Exception { - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put("newKey1", "newValue1"); values.put("newKey2", "newValue2"); @@ -218,10 +218,10 @@ public class AppDataServiceTest { Set<String> fields = new HashSet<String>(); fields.add(propertyToRemove); - HashMap<String, String> expectedValuesAfterUpdate = new HashMap<String, String>(validApplicationData.getData()); + HashMap<String, Object> expectedValuesAfterUpdate = new HashMap<String, Object>(validApplicationData.getData()); expectedValuesAfterUpdate.remove(propertyToRemove); - testUpdatePersonData(fields, new HashMap<String, String>(), expectedValuesAfterUpdate, validApplicationData); + testUpdatePersonData(fields, new HashMap<String, Object>(), expectedValuesAfterUpdate, validApplicationData); } @Test @@ -232,10 +232,10 @@ public class AppDataServiceTest { Set<String> fields = new HashSet<String>(); fields.add(propertyToUpdate); - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put(propertyToUpdate, updatedValue); - HashMap<String, String> expectedValuesAfterUpdate = new HashMap<String, String>(validApplicationData.getData()); + HashMap<String, Object> expectedValuesAfterUpdate = new HashMap<String, Object>(validApplicationData.getData()); expectedValuesAfterUpdate.put(propertyToUpdate, updatedValue); testUpdatePersonData(fields, values, expectedValuesAfterUpdate, validApplicationData); @@ -246,13 +246,13 @@ public class AppDataServiceTest { Set<String> fields = new HashSet<String>(); fields.add("foo"); - HashMap<String, String> values = new HashMap<String, String>(); + HashMap<String, Object> values = new HashMap<String, Object>(); values.put("a key", "that is not present in the fields set"); testUpdatePersonData(fields, values, values, validApplicationData); } private void testGetPersonData(Set<String> fields, String ownerId, String viewerId, String applicationId, - ApplicationData applicationData, Map<String, String> expectedData) throws Exception { + ApplicationData applicationData, Map<String, Object> expectedData) throws Exception { Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(new UserId(UserId.Type.userId, VALID_USER_ID))); @@ -269,20 +269,20 @@ public class AppDataServiceTest { Future<DataCollection> result = appDataService.getPersonData(userIds, groupId, VALID_APPLICATION_ID, fields, securityToken); - Map<String, String> actualData = result.get().getEntry().get(viewerId); + Map<String, Object> actualData = result.get().getEntry().get(viewerId); assertThat(actualData, is(not(nullValue()))); - for (Map.Entry<String, String> entry : expectedData.entrySet()) { + for (Map.Entry<String, Object> entry : expectedData.entrySet()) { assertEquals(entry.getValue(), actualData.get(entry.getKey())); } } - private void testDeletePersonData(Set<String> fieldsToDelete, HashMap<String, String> expectedApplicationDataAfterDelete) { + private void testDeletePersonData(Set<String> fieldsToDelete, HashMap<String, Object> expectedApplicationDataAfterDelete) { testDeletePersonData(VALID_OWNER_ID, VALID_VIEWER_ID, fieldsToDelete, expectedApplicationDataAfterDelete, validApplicationData); } private void testDeletePersonData(String ownerId, String viewerId, Set<String> fieldsToDelete, - HashMap<String, String> expectedApplicationDataAfterDelete, + HashMap<String, Object> expectedApplicationDataAfterDelete, ApplicationData applicationData) { UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID); @@ -341,8 +341,8 @@ public class AppDataServiceTest { assertEquals(null, result.get()); } - private void testUpdatePersonData(Set<String> fields, Map<String, String> values, - HashMap<String, String> expectedApplicationDataAfterUpdate, + private void testUpdatePersonData(Set<String> fields, Map<String, Object> values, + HashMap<String, Object> expectedApplicationDataAfterUpdate, ApplicationData applicationData) { UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID); http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java index 6b2ebc0..fda4ea2 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java @@ -20,6 +20,8 @@ package org.apache.rave.opensocial.service; import com.google.common.collect.Lists; +import com.google.common.util.concurrent.Futures; + import org.apache.rave.opensocial.service.impl.DefaultActivityStreamsService; import org.apache.rave.model.ActivityStreamsEntry; import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl; @@ -28,7 +30,6 @@ import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl; import org.apache.rave.portal.repository.ActivityStreamsRepository; import org.apache.rave.util.ActivityConversionUtil; import org.apache.shindig.auth.SecurityToken; -import org.apache.shindig.common.util.ImmediateFuture; import org.apache.shindig.protocol.RestfulCollection; import org.apache.shindig.social.core.model.ActivityObjectImpl; import org.apache.shindig.social.core.model.PersonImpl; @@ -143,7 +144,7 @@ public class DefaultActivityStreamsServiceTest { expect(repository.save(activityStreamsEntry)).andReturn(activityStreamsEntry); expect(repository.getByUserId(ID_1)).andReturn((List) getActivityList()); - expect(personService.getPeople(users,groupId,null,fields,token)).andReturn(ImmediateFuture.newInstance(new RestfulCollection<Person>(getDbPersonList()))); + expect(personService.getPeople(users,groupId,null,fields,token)).andReturn(Futures.immediateFuture(new RestfulCollection<Person>(getDbPersonList()))); replay(repository); replay(personService); @@ -170,7 +171,7 @@ public class DefaultActivityStreamsServiceTest { expect(repository.save(EasyMock.isA(ActivityStreamsEntryImpl.class))).andReturn(activityStreamsEntry); expect(repository.get(ACTIVITY_ID)).andReturn(activityStreamsEntry); - expect(personService.getPeople(users,groupId,null,fields,token)).andReturn(ImmediateFuture.newInstance(new RestfulCollection<Person>(getDbPersonList()))); + expect(personService.getPeople(users,groupId,null,fields,token)).andReturn(Futures.immediateFuture(new RestfulCollection<Person>(getDbPersonList()))); replay(repository); replay(personService); http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/resources/rave.shindig.properties ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/resources/rave.shindig.properties b/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/resources/rave.shindig.properties index fd00bbf..1ab4839 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/resources/rave.shindig.properties +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/resources/rave.shindig.properties @@ -89,18 +89,18 @@ shindig.oauth.validator-max-timestamp-age-ms=300000 shindig.signing.state-key= shindig.signing.key-name= shindig.signing.key-file= -shindig.signing.global-callback-url=http://localhost:8080/gadgets/oauthcallback +shindig.signing.global-callback-url=http://%authority%%contextRoot%/gadgets/oauthcallback shindig.signing.enable-signed-callbacks=true ### If a OAuth2Client does not specify a redirect uri it will default here -shindig.oauth2.global-redirect-uri=http://localhost:8080/gadgets/oauth2callback +shindig.oauth2.global-redirect-uri=http://%authority%%contextRoot%/gadgets/oauth2callback ### Setting to true will cause the registered OAuth2Persistence plugin to load it's values ### with what's in config/oauth2.json, no meaning without a second persistence implementation. shindig.oauth2.import=false ### Determines if the import will start by removing everything currently in persistence. shindig.oauth2.import.clean=false # Set to true if you want to allow the use of 3-party (authorization_code) OAuth 2.0 flow when viewer != owner. -# This setting is not recommeneded for pages that allow user-controlled javascript, since +# This setting is not recommended for pages that allow user-controlled javascript, since # that javascript could be used to make unauthorized requests on behalf of the viewer of the page shindig.oauth2.viewer-access-tokens-enabled=true # Set to true to send extended trace messages to the client. Probably want this to be false for @@ -109,13 +109,16 @@ shindig.oauth2.send-trace-to-client=true shindig.signing.oauth2.state-key= # Set to true if you want to allow the use of 3-legged OAuth tokens when viewer != owner. -# This setting is not recommeneded for pages that allow user-controlled javascript, since +# This setting is not recommended for pages that allow user-controlled javascript, since # that javascript could be used to make unauthorized requests on behalf of the viewer of the page shindig.signing.viewer-access-tokens-enabled=false # If enabled here, configuration values can be found in container configuration files. shindig.locked-domain.enabled=false +# Enable or disable referrer check. +shindig.locked-domain.refererCheck.enabled=false + # TODO: This needs to be moved to container configuration. shindig.content-rewrite.only-allow-excludes=false shindig.content-rewrite.include-urls=.* @@ -266,6 +269,15 @@ shindig.oauth2.refreshTokenExpiration=432000000 # Allows unauthenticated requests to Shindig shindig.allowUnauthenticated=true +# Allows JSONP requests to Shindig +shindig.allowJSONP=true + # Comma separated tags that need to have its relative path to be resolved as absolute. # Possible values are RESOURCES and HYPERLINKS shindig.gadgets.rewriter.absolutePath.tags=RESOURCES + +# Configure cache characteristics of js content (max-age in seconds) +# where -1 caches "forever, 0 means "no-cache" +shindig.jscontent.unversioned.maxage=3600 +shindig.jscontent.versioned.maxage=-1 +shindig.jscontent.invalid.maxage=0 http://git-wip-us.apache.org/repos/asf/rave/blob/bdd0d4b8/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/webapp/WEB-INF/classes/containers/default/container.js ---------------------------------------------------------------------- diff --git a/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/webapp/WEB-INF/classes/containers/default/container.js b/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/webapp/WEB-INF/classes/containers/default/container.js index fa15b74..725e413 100644 --- a/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/webapp/WEB-INF/classes/containers/default/container.js +++ b/rave-providers/rave-opensocial-provider/rave-opensocial-server/rave-shindig-resources/src/main/webapp/WEB-INF/classes/containers/default/container.js @@ -119,12 +119,16 @@ // Should all gadgets be forced on to a locked domain? "gadgets.uri.iframe.lockedDomainRequired" : false, - -"gadgets.uri.iframe.alwaysAppendSecurityToken" : true, - -// Default Js Uri config: also must be overridden. -// gadgets.uri.js.host should be protocol relative. -"gadgets.uri.js.host" : "//${Cur['default.domain.unlocked.server']}", // Use unlocked host for better caching. + +"gadgets.uri.iframe.alwaysAppendSecurityToken" : true, + +//The permitted domain where the render request is sent from. For examle: ["www.hostA.com", "www.hostB.com"] +//Empty means all domains are permitted. +"shindig.locked-domain.permittedRefererDomains" : [], + +// Default Js Uri config: also must be overridden. +// gadgets.uri.js.host should be protocol relative. +"gadgets.uri.js.host" : "//${Cur['default.domain.unlocked.server']}", // Use unlocked host for better caching. // If you change the js.path you will need to define window.__CONTAINER_SCRIPT_ID prior to loading the <script> // tag for container JavaScript into the DOM. @@ -181,12 +185,17 @@ "aliases" : ["FULL_PAGE"] }, "default" : { - "isOnlyVisible" : false, - "urlTemplate" : "http://localhost${CONTEXT_ROOT}/gadgets/default?{var}", - "aliases" : ["home", "profile", "canvas"] - } - }, - "tabs": { + "isOnlyVisible" : false, + "urlTemplate" : "http://localhost${CONTEXT_ROOT}/gadgets/default?{var}", + "aliases" : ["home", "profile", "canvas"] + }, + "embedded" : { + "isOnlyVisible" : false, + "urlTemplate" : "http://localhost${CONTEXT_ROOT}/gadgets/embedded?{var}", + "aliases" : ["embedded"] + } + }, + "tabs": { "css" : [ ".tablib_table {", "width: 100%;",
