You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2013/02/12 22:31:02 UTC
svn commit: r1445395 - in /rave/trunk:
rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/
rave-components/rave-core/src/test/java/org/apache/rave/portal/util/
rave-components/rave-core/src/test/resources/ rave-portal/src/test/jav...
Author: mfranklin
Date: Tue Feb 12 21:31:02 2013
New Revision: 1445395
URL: http://svn.apache.org/r1445395
Log:
Updated JSON data importer to clear IDs to support JPA persistence (RAVE-887)
Added:
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/util/DataImporterTest.java
rave/trunk/rave-components/rave-core/src/test/resources/test-data.json
- copied, changed from r1445153, rave/trunk/rave-portal-resources/src/main/resources_mongo/db/initial-data.json
Modified:
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/DataImporter.java
rave/trunk/rave-portal/src/test/java/renderer/RenderServiceIntegrationTest.java
Modified: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/DataImporter.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/DataImporter.java?rev=1445395&r1=1445394&r2=1445395&view=diff
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/DataImporter.java (original)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/data/DataImporter.java Tue Feb 12 21:31:02 2013
@@ -19,6 +19,8 @@
package org.apache.rave.portal.util.data;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.rave.portal.model.*;
import org.apache.rave.portal.repository.*;
import org.codehaus.jackson.map.AnnotationIntrospector;
@@ -32,7 +34,12 @@ import org.springframework.transaction.a
import javax.annotation.PostConstruct;
import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
import java.util.List;
+import java.util.Map;
public class DataImporter {
@@ -117,49 +124,254 @@ public class DataImporter {
@Transactional
public void loadData(ModelWrapper wrapper) {
- if (wrapper.getPageLayouts() != null) {
- for (PageLayout layout : wrapper.getPageLayouts()) {
- pageLayoutRepository.save(layout);
+ savePageLayouts(wrapper);
+ saveAuthorities(wrapper);
+ Map<String, User> usersByOriginalId = saveUsers(wrapper);
+ Map<String, Category> categoryByOldId = saveCategories(wrapper, usersByOriginalId);
+ Map<String,Widget> widgetsById = saveWidgets(wrapper, usersByOriginalId, categoryByOldId);
+ savePages(wrapper, usersByOriginalId, widgetsById);
+ savePreferences(wrapper);
+ saveTemplates(wrapper, widgetsById);
+ }
+
+ private void saveTemplates(ModelWrapper wrapper, Map<String, Widget> widgetsById) {
+ for(PageTemplate template : wrapper.getPageTemplates()) {
+ updateTemplate(widgetsById, template);
+ for(PageTemplate sub : template.getSubPageTemplates()) {
+ sub.setParentPageTemplate(template);
+ updateTemplate(widgetsById, sub);
}
+ pageTemplateRepository.save(template);
}
- if (wrapper.getUsers() != null) {
- for (User user : wrapper.getUsers()) {
- userRepository.save(user);
+ }
+
+ private void updateTemplate(Map<String, Widget> widgetsById, PageTemplate template) {
+ setIdViaReflection(template, null);
+ for(PageTemplateRegion region : template.getPageTemplateRegions()) {
+ setIdViaReflection(region, null);
+ region.setPageTemplate(template);
+ for(PageTemplateWidget widget : region.getPageTemplateWidgets()) {
+ Widget fromDb = widgetsById.get(widget.getWidgetId());
+ if(fromDb != null) {
+ widget.setWidgetId(fromDb.getId());
+ }
+ setIdViaReflection(widget, null);
+ widget.setPageTemplateRegion(region);
}
+
}
- if (wrapper.getPageLayouts() != null) {
- for (PageLayout layout : wrapper.getPageLayouts()) {
- pageLayoutRepository.save(layout);
+ }
+
+ private Map<String, Category> saveCategories(ModelWrapper wrapper, Map<String, User> usersByOriginalId) {
+ Map<String, Category> categoryByOldId = Maps.newHashMap();
+ if (wrapper.getCategories() != null) {
+ for (Category category : wrapper.getCategories()) {
+ String id = category.getId() == null ? category.getText() : category.getId();
+ category.setId(null);
+ User lastModified = usersByOriginalId.get(category.getLastModifiedUserId());
+ if(lastModified != null) {
+ category.setLastModifiedUserId(lastModified.getId());
+ }
+ User created = usersByOriginalId.get(category.getCreatedUserId());
+ if(created != null) {
+ category.setCreatedUserId(created.getId());
+ }
+ categoryByOldId.put(id, categoryRepository.save(category));
}
}
- if (wrapper.getWidgets() != null) {
- for (Widget widget : wrapper.getWidgets()) {
- widgetRepository.save(widget);
+ return categoryByOldId;
+ }
+
+ private void savePreferences(ModelWrapper wrapper) {
+ if (wrapper.getPortalPreferences() != null) {
+ for (PortalPreference preference : wrapper.getPortalPreferences()) {
+ portalPreferenceRepository.save(preference);
+ }
+ }
+ }
+
+ private Map<String, User> saveUsers(ModelWrapper wrapper) {
+ Map<String, User> usersByOriginalId = Maps.newHashMap();
+ if (wrapper.getUsers() != null) {
+ for (User user : wrapper.getUsers()) {
+ String id = user.getId();
+ user.setId(null);
+ usersByOriginalId.put(id, userRepository.save(user));
}
}
+ return usersByOriginalId;
+ }
+
+ private void savePages(ModelWrapper wrapper, Map<String, User> usersByOriginalId, Map<String, Widget> widgetsById) {
if (wrapper.getPages() != null) {
for (Page page : wrapper.getPages()) {
+ updatePage(usersByOriginalId, widgetsById, page);
+ for(Page sub: page.getSubPages()) {
+ sub.setParentPage(page);
+ updatePage(usersByOriginalId, widgetsById, sub);
+ }
pageRepository.save(page);
}
}
- if (wrapper.getAuthorities() != null) {
- for (Authority authority : wrapper.getAuthorities()) {
- authorityRepository.save(authority);
+ }
+
+ private void updatePage(Map<String, User> usersByOriginalId, Map<String, Widget> widgetsById, Page page) {
+ for(Region region : page.getRegions()) {
+ region.setPage(page);
+ setIdViaReflection(region, null);
+ for(RegionWidget widget: region.getRegionWidgets()) {
+ widget.setRegion(region);
+ Widget fromDb = widgetsById.get(widget.getId());
+ if(fromDb != null) {
+ widget.setWidgetId(fromDb.getId());
+ }
+ setIdViaReflection(widget, null);
}
}
- if (wrapper.getPortalPreferences() != null) {
- for (PortalPreference preference : wrapper.getPortalPreferences()) {
- portalPreferenceRepository.save(preference);
+ for(PageUser user: page.getMembers()) {
+ user.setPage(page);
+ setIdViaReflection(user, null);
+ User fromDb = usersByOriginalId.get(user.getUserId());
+ if(fromDb != null) {
+ user.setUserId(fromDb.getId());
}
}
- if (wrapper.getCategories() != null) {
- for (Category category : wrapper.getCategories()) {
- categoryRepository.save(category);
+ User user = usersByOriginalId.get(page.getOwnerId());
+ page.setOwnerId(user.getId());
+ }
+
+ private Map<String, Widget> saveWidgets(ModelWrapper wrapper, Map<String, User> usersById, Map<String, Category> categoryMap) {
+ Map<String, Widget> widgetsByOldId = Maps.newHashMap();
+ if (wrapper.getWidgets() != null) {
+ for (Widget widget : wrapper.getWidgets()) {
+ String id = widget.getId() == null ? widget.getUrl() : widget.getId();
+ setIdViaReflection(widget, null);
+ User user = usersById.get(widget.getOwnerId());
+ if(user != null) {
+ widget.setOwnerId(user.getId());
+ }
+ List<Category> categories = Lists.newArrayList();
+ if(widget.getCategories() != null) {
+ for(Category c : widget.getCategories()) {
+ categories.add(categoryMap.get(c.getId()));
+ }
+ widget.setCategories(categories);
+ }
+ widgetsByOldId.put(id, widgetRepository.save(widget));
}
}
- for(PageTemplate template : wrapper.getPageTemplates()) {
- pageTemplateRepository.save(template);
+ return widgetsByOldId;
+ }
+
+ private void setIdViaReflection(Object target, Object id) {
+ Class clazz = target.getClass();
+ Method setter = getMethod(clazz, "setId");
+ if(setter != null) {
+ callMethod(target, setter, id);
+ } else {
+ setField(target, id, clazz);
+ }
+ }
+
+ private void setField(Object target, Object id, Class clazz) {
+ List<String> potentialFields = Arrays.asList("id", "_id", "id_");
+ for(String name : potentialFields) {
+ if(findAndSetField(clazz, target, id, name)) return;
+ }
+ throw new IllegalStateException("Could not match field");
+ }
+
+ private boolean findAndSetField(Class clazz, Object target, Object value, String name) {
+ Field idField = getField(clazz, name);
+ if(idField != null) {
+ setField(target, idField, value);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private Field getField(Class clazz, String match) {
+ Field field = null;
+ try {
+ field = clazz.getDeclaredField(match);
+ }catch (NoSuchFieldException e) { }
+ return field;
+ }
+
+ private Method getMethod(Class clazz, String match) {
+ Method method = null;
+ try {
+ method = clazz.getMethod(match, Void.class);
+ } catch (NoSuchMethodException e) {}
+ return method;
+ }
+
+ private void callMethod(Object o, Method m, Object... param) {
+ try {
+ m.invoke(o, param);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException("Unable to call method",e) ;
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException("Unable to call method",e) ;
+ }
+ }
+
+ private void setField(Object o, Field f, Object val) {
+ try {
+ f.set(o, val);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException("Unable to set field",e) ;
+ }
+ }
+
+ private void saveAuthorities(ModelWrapper wrapper) {
+ if (wrapper.getAuthorities() != null) {
+ for (Authority authority : wrapper.getAuthorities()) {
+ authorityRepository.save(authority);
+ }
}
}
+
+ private void savePageLayouts(ModelWrapper wrapper) {
+ if (wrapper.getPageLayouts() != null) {
+ for (PageLayout layout : wrapper.getPageLayouts()) {
+ pageLayoutRepository.save(layout);
+ }
+ }
+ }
+
+
+ public void setPageLayoutRepository(PageLayoutRepository pageLayoutRepository) {
+ this.pageLayoutRepository = pageLayoutRepository;
+ }
+
+ public void setUserRepository(UserRepository userRepository) {
+ this.userRepository = userRepository;
+ }
+
+ public void setWidgetRepository(WidgetRepository widgetRepository) {
+ this.widgetRepository = widgetRepository;
+ }
+
+ public void setPageRepository(PageRepository pageRepository) {
+ this.pageRepository = pageRepository;
+ }
+
+ public void setAuthorityRepository(AuthorityRepository authorityRepository) {
+ this.authorityRepository = authorityRepository;
+ }
+
+ public void setPortalPreferenceRepository(PortalPreferenceRepository portalPreferenceRepository) {
+ this.portalPreferenceRepository = portalPreferenceRepository;
+ }
+
+ public void setCategoryRepository(CategoryRepository categoryRepository) {
+ this.categoryRepository = categoryRepository;
+ }
+
+ public void setPageTemplateRepository(PageTemplateRepository pageTemplateRepository) {
+ this.pageTemplateRepository = pageTemplateRepository;
+ }
}
}
Added: rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/util/DataImporterTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/util/DataImporterTest.java?rev=1445395&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/util/DataImporterTest.java (added)
+++ rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/util/DataImporterTest.java Tue Feb 12 21:31:02 2013
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+package org.apache.rave.portal.util;
+
+import org.apache.rave.portal.model.*;
+import org.apache.rave.portal.model.impl.*;
+import org.apache.rave.portal.repository.*;
+import org.apache.rave.portal.util.data.DataImporter;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import java.util.Arrays;
+
+import static org.easymock.EasyMock.*;
+
+public class DataImporterTest {
+
+ private PageLayoutRepository pageLayoutRepository;
+ private UserRepository userRepository;
+ private WidgetRepository widgetRepository;
+ private PageRepository pageRepository;
+ private AuthorityRepository authorityRepository;
+ private PortalPreferenceRepository portalPreferenceRepository;
+ private CategoryRepository categoryRepository;
+ private PageTemplateRepository pageTemplateRepository;
+ private DataImporter importer;
+
+ @Before
+ public void setup() {
+ pageLayoutRepository = createMock(PageLayoutRepository.class);
+ userRepository = createMock(UserRepository.class);
+ widgetRepository = createMock(WidgetRepository.class);
+ pageRepository = createMock(PageRepository.class);
+ authorityRepository = createMock(AuthorityRepository.class);
+ portalPreferenceRepository = createMock(PortalPreferenceRepository.class);
+ categoryRepository = createMock(CategoryRepository.class);
+ pageTemplateRepository = createMock(PageTemplateRepository.class);
+
+ DataImporter.ExecutorImpl executor = new DataImporter.ExecutorImpl();
+ executor.setPageLayoutRepository(pageLayoutRepository);
+ executor.setUserRepository(userRepository);
+ executor.setWidgetRepository(widgetRepository);
+ executor.setPageRepository(pageRepository);
+ executor.setAuthorityRepository(authorityRepository);
+ executor.setPortalPreferenceRepository(portalPreferenceRepository);
+ executor.setCategoryRepository(categoryRepository);
+ executor.setPageTemplateRepository(pageTemplateRepository);
+
+ importer = new DataImporter();
+ importer.setScriptLocations(Arrays.asList((Resource) new ClassPathResource("test-data.json")));
+ importer.setDataExecutor(executor);
+ }
+
+ @Test
+ public void valid() {
+ expect(pageLayoutRepository.save(isA(PageLayout.class))).andReturn(new PageLayoutImpl()).times(2);
+ expect(userRepository.save(isA(User.class))).andReturn(new UserImpl()).times(2);
+ expect(widgetRepository.getCountAll()).andReturn(0);
+ expect(widgetRepository.save(isA(Widget.class))).andReturn(new WidgetImpl()).times(2);
+ expect(authorityRepository.save(isA(Authority.class))).andReturn(new AuthorityImpl()).times(2);
+ expect(portalPreferenceRepository.save(isA(PortalPreference.class))).andReturn(new PortalPreferenceImpl()).times(2);
+ expect(categoryRepository.save(isA(Category.class))).andReturn(new CategoryImpl()).times(2);
+ expect(pageTemplateRepository.save(isA(PageTemplate.class))).andReturn(new PageTemplateImpl()).times(2);
+ replay(pageTemplateRepository, pageLayoutRepository, userRepository, widgetRepository, pageRepository, authorityRepository, portalPreferenceRepository, categoryRepository);
+
+ importer.importData();
+
+ verify(pageTemplateRepository, pageLayoutRepository, userRepository, widgetRepository, pageRepository, authorityRepository, portalPreferenceRepository, categoryRepository);
+
+ }
+
+ @Test
+ public void populated() {
+ expect(widgetRepository.getCountAll()).andReturn(1);
+ replay(pageTemplateRepository, pageLayoutRepository, userRepository, widgetRepository, pageRepository, authorityRepository, portalPreferenceRepository, categoryRepository);
+
+ importer.importData();
+
+ verify(pageTemplateRepository, pageLayoutRepository, userRepository, widgetRepository, pageRepository, authorityRepository, portalPreferenceRepository, categoryRepository);
+
+ }
+
+}
Copied: rave/trunk/rave-components/rave-core/src/test/resources/test-data.json (from r1445153, rave/trunk/rave-portal-resources/src/main/resources_mongo/db/initial-data.json)
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/resources/test-data.json?p2=rave/trunk/rave-components/rave-core/src/test/resources/test-data.json&p1=rave/trunk/rave-portal-resources/src/main/resources_mongo/db/initial-data.json&r1=1445153&r2=1445395&rev=1445395&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/resources_mongo/db/initial-data.json (original)
+++ rave/trunk/rave-components/rave-core/src/test/resources/test-data.json Tue Feb 12 21:31:02 2013
@@ -13,55 +13,6 @@
"numberOfRegions": 2,
"renderSequence": 1,
"userSelectable": true
- },
- {
- "id": 3,
- "code": "columns_2wn",
- "numberOfRegions": 2,
- "renderSequence": 2,
- "userSelectable": true
- },
- {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- {
- "id": 5,
- "code": "columns_3nwn",
- "numberOfRegions": 3,
- "renderSequence": 4,
- "userSelectable": true
- },
- {
- "id": 6,
- "code": "columns_3_newuser",
- "numberOfRegions": 3,
- "renderSequence": 5,
- "userSelectable": true
- },
- {
- "id": 7,
- "code": "columns_4",
- "numberOfRegions": 4,
- "renderSequence": 6,
- "userSelectable": true
- },
- {
- "id": 8,
- "code": "columns_3nwn_1_bottom",
- "numberOfRegions": 4,
- "renderSequence": 7,
- "userSelectable": true
- },
- {
- "id": 9,
- "code": "person_profile",
- "numberOfRegions": 1,
- "renderSequence": 8,
- "userSelectable": false
}
],
"users": [
@@ -111,694 +62,62 @@
"id": 1,
"accountNonLocked": true,
"credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 2,
- "username": "john.doe",
- "email": "john.doe@example.com",
- "displayName": "John Doe",
- "additionalName": null,
- "familyName": "Doe",
- "givenName": "John",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$8Dir7boy3UyVqy6erfj6WuQXUTf.ejTldPSsVIty7.pPT3Krkly26",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 2,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 3,
- "username": "jane.doe",
- "email": "jane.doe@example.net",
- "displayName": "Jane Doe",
- "additionalName": null,
- "familyName": "Doe",
- "givenName": "Jane",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$YP9cjZEA.gG/ng2YwTBIyucMpuiQ7Fvz0K8rOt14rIBhVwlOrh1tu",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 3,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 4,
- "username": "george.doe",
- "email": "george.doe@example.org",
- "displayName": "George Doe",
- "additionalName": null,
- "familyName": "Doe",
- "givenName": "George",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$0bcOUkQgAwE/qmdc1NcUveNzx/IYIcOUu4ydyT8DEicTCxGJF/vcW",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 4,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 5,
- "username": "mario.rossi",
- "email": "mario.rossi@example.com",
- "displayName": "Mario Rossi",
- "additionalName": null,
- "familyName": "Rossi",
- "givenName": "Mario",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$HZ6WHAKQCs8waLooL98l6.fLzwh3D8u/V0.UebIjojawfXJhX1DQ2",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 5,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 6,
- "username": "maija.m",
- "email": "maijam@example.com",
- "displayName": "Maija M",
- "additionalName": null,
- "familyName": "M",
- "givenName": "Maija",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$3feYdjrW40hkqP4/xupKP.YMgdYmDsZZus./vK4FbBs9QZG2.FuNC",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 6,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 7,
- "username": "one.col",
- "email": "one.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "Column",
- "givenName": "One",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$5VqE2YEqT75pCVjKqjP2b.gNGly9fsTVUOMQR/JEjkHSbqvA3A6IO",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 7,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 8,
- "username": "twown.col",
- "email": "twown.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "Column",
- "givenName": "Two",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$Inpufv82TRUGYoPuXhYXVuMCKHkhLz44W6FijxW2e9n3T1hgyxcVq",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 8,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 9,
- "username": "three.col",
- "email": "three.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "Column",
- "givenName": "Three",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$ImRXq4gFC9teBstOBdQrZeEwBkCAJ0S6.CwI9/9r7fxWKTZ30pgVC",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 9,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 10,
- "username": "threewn.col",
- "email": "threewn.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "ColumnWide",
- "givenName": "Three",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$LLYTJoK6MCBpeDBbmdt7tu1LNt7Eenqe1IpMlfem8xVjzynn.HpxW",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 10,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 11,
- "username": "four.col",
- "email": "four.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "Column",
- "givenName": "Four",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$tZgWcaG2EJPLtseZ339n7uTu3GZn31h3iTr20orwgbbRAI15uoIFK",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 11,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 12,
- "username": "fourwn.col",
- "email": "fourwn.col@example.com",
- "displayName": null,
- "additionalName": null,
- "familyName": "ColumnWide",
- "givenName": "Four",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$4kPYhgowurWqXGVDigxOxOVj/M.rqLRwqbn0kT/OD4pISL6pDG/c2",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 12,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 13,
- "username": "rave2011.myopenid.com",
- "email": "rave2011_openid@example.org",
- "displayName": null,
- "additionalName": null,
- "familyName": "OpenId",
- "givenName": "Rave",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$dML97.rnOn4.iSlEEdju8OCB2NckuKw0Ki5yMVzzMmWQsWMvym3qC",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": "http://rave2011.myopenid.com/",
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 13,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- }
-],
- "groups": [
- {
- "id": 1,
- "title": "Party",
- "description": "Party Group",
- "owner": null,
- "members": [
- {
- "id": 1,
- "username": "canonical",
- "email": "canonical@example.com",
- "displayName": "Canonical User",
- "additionalName": null,
- "familyName": "User",
- "givenName": "Canonical",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$TkEgze5kLy9nRlfd8PT1zunh6P1ND8WPjLojFjAMNgZMu1D9D1n4.",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 2,
- "authority": "ROLE_ADMIN",
- "users": [],
- "defaultForNewUser": false
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 1,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- },
- {
- "id": 5,
- "username": "mario.rossi",
- "email": "mario.rossi@example.com",
- "displayName": "Mario Rossi",
- "additionalName": null,
- "familyName": "Rossi",
- "givenName": "Mario",
- "honorificPrefix": null,
- "honorificSuffix": null,
- "preferredName": null,
- "aboutMe": null,
- "status": "Single",
- "addresses": [],
- "organizations": [],
- "properties": [],
- "groups": [],
- "password": "$2a$10$HZ6WHAKQCs8waLooL98l6.fLzwh3D8u/V0.UebIjojawfXJhX1DQ2",
- "expired": false,
- "locked": false,
- "enabled": true,
- "openId": null,
- "forgotPasswordHash": null,
- "forgotPasswordTime": null,
- "defaultPageLayout": {
- "id": 4,
- "code": "columns_3",
- "numberOfRegions": 3,
- "renderSequence": 3,
- "userSelectable": true
- },
- "confirmPassword": null,
- "defaultPageLayoutCode": null,
- "authorities": [
- {
- "id": 1,
- "authority": "ROLE_USER",
- "users": [],
- "defaultForNewUser": true
- }
- ],
- "pageUsers": [],
- "widgetTags": [],
- "id": 5,
- "accountNonLocked": true,
- "credentialsNonExpired": true,
- "accountNonExpired": true
- }
- ]
+ "accountNonExpired": true
},
{
"id": 2,
- "title": "Portal",
- "description": "Portal Group",
+ "username": "john.doe",
+ "email": "john.doe@example.com",
+ "displayName": "John Doe",
+ "additionalName": null,
+ "familyName": "Doe",
+ "givenName": "John",
+ "honorificPrefix": null,
+ "honorificSuffix": null,
+ "preferredName": null,
+ "aboutMe": null,
+ "status": "Single",
+ "addresses": [],
+ "organizations": [],
+ "properties": [],
+ "groups": [],
+ "password": "$2a$10$8Dir7boy3UyVqy6erfj6WuQXUTf.ejTldPSsVIty7.pPT3Krkly26",
+ "expired": false,
+ "locked": false,
+ "enabled": true,
+ "openId": null,
+ "forgotPasswordHash": null,
+ "forgotPasswordTime": null,
+ "defaultPageLayout": {
+ "id": 4,
+ "code": "columns_3",
+ "numberOfRegions": 3,
+ "renderSequence": 3,
+ "userSelectable": true
+ },
+ "confirmPassword": null,
+ "defaultPageLayoutCode": null,
+ "authorities": [
+ {
+ "id": 1,
+ "authority": "ROLE_USER",
+ "users": [],
+ "defaultForNewUser": true
+ }
+ ],
+ "pageUsers": [],
+ "widgetTags": [],
+ "id": 2,
+ "accountNonLocked": true,
+ "credentialsNonExpired": true,
+ "accountNonExpired": true
+ }
+],
+ "groups": [
+ {
+ "id": 1,
+ "title": "Party",
+ "description": "Party Group",
"owner": null,
"members": [
{
@@ -848,7 +167,15 @@
"accountNonLocked": true,
"credentialsNonExpired": true,
"accountNonExpired": true
- },
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "title": "Portal",
+ "description": "Portal Group",
+ "owner": null,
+ "members": [
{
"id": 2,
"username": "john.doe",
@@ -926,284 +253,6 @@
"disableRendering": false,
"featured": false,
"widgetStatus": "PUBLISHED"
- },
- {
- "id" : 3,
- "title": "NYTimes.com - Top Stories",
- "url": "http://widgets.nytimes.com/packages/html/igoogle/topstories.xml",
- "type": "OpenSocial",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 4,
- "title": "Google News Gadget",
- "url": "http://www.gstatic.com/ig/modules/tabnews/tabnews.xml",
- "type": "OpenSocial",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 5,
- "title": "Pet Hamster",
- "url": "http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/hamster.xml",
- "type": "OpenSocial",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 6,
- "title": "Herbie Hamster Virtual Pet",
- "url": "http://hosting.gmodules.com/ig/gadgets/file/109548057311228444554/hamster.xml",
- "type": "OpenSocial",
- "author": "Naj",
- "description": "A cute little hamster for you to feed and look after. Watch him follow your cursor around. Click on the more tab to treat him to a strawberry. Click him then put him on the wheel and watch him play! ***NEW: make Herbie hamster your very own!",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 7,
- "title": "List of CTSS Resources - Map View",
- "url": "http://localhost:8080/demogadgets/CTSSResourcesMapView.xml",
- "type": "OpenSocial",
- "author": "Suresh Deivasigamani",
- "description": "This is a gadget developed for Teragrid - OGCE project. Used Google gadgets API to retrieve the information from the Information Services REST Web Service and display the information using Google Maps API. This is a list of available CTSS resources and its details",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 8,
- "title": "Twitter",
- "url": "http://localhost:8080/demogadgets/twitter.xml",
- "type": "OpenSocial",
- "author": "LOGIKA Corporation",
- "description": "Fully functional, lightweight, AJAX-based twitter user interface with many configuration options including user specified auto-refresh rate, full timeline, pagination, and more. Control display elements such as user thumbnails, date stamps, and post source. Specify gadget size based on availble screen footprint, even incorporate into your Gmail account. Insert symbols, dingbats and emoticons into your tweets using the TwitterGadget Symbols pulldown menu.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 9,
- "title": "Youtube",
- "url": "http://localhost:8080/demogadgets/youtubesearch.xml",
- "type": "OpenSocial",
- "author": "David Olsen",
- "description": "A search module, which searches YouTube by tags like Politics News Life Music Family Photography Art Random Travel Personal Religion Movies Business Thoughts Media Humor Culture Poetry Christmas Writing Books Food Friends.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 10,
- "title": "Open Views Demo",
- "url": "http://localhost:8080/demogadgets/open_views_demo.xml",
- "type": "OpenSocial",
- "author": "Erin Noe-Payne",
- "description": "A demo gadget to show open views popups in action.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 11,
- "title": "Gadget View Type",
- "url": "http://localhost:8080/demogadgets/canvas-nav.xml",
- "type": "OpenSocial",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 12,
- "title": "User Prefs Demo",
- "url": "http://localhost:8080/demogadgets/user_prefs_demo.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "An example gadget which demos some of the different capabilities of user preferences.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 13,
- "title": "My Activity",
- "url": "http://localhost:8080/demogadgets/my_activity.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "Static widget of activities for demoing on the Person Profile page",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 14,
- "title": "Current Schedule",
- "url": "http://localhost:8080/demogadgets/schedule.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "Static widget of a schedule for demoing on the Person Profile page",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 15,
- "title": "Favorite Websites",
- "url": "http://localhost:8080/demogadgets/favorite_websites.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "Static widget of favorite websites for demoing on the Person Profile page",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 16,
- "title": "My Groups",
- "url": "http://localhost:8080/demogadgets/my_groups.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "Static widget of groups for demoing on the Person Profile page",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 17,
- "title": "My Experience",
- "url": "http://localhost:8080/demogadgets/my_experience.xml",
- "type": "OpenSocial",
- "author": "Anthony Carlucci",
- "description": "Static widget of experience for demoing on the Person Profile page",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 18,
- "title": "Activity Streams",
- "url": "http://localhost:8080/samplecontainer/examples/ActivityStreams/ActivityStreamGadget.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "Sample Activity Streams gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 19,
- "title": "Album Viewer",
- "url": "http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "Sample Embedded Experience gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 20,
- "title": "Photo List",
- "url": "http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "Sample Embedded Experience gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 21,
- "title": "OAuth2 Facebook",
- "url": "http://localhost:8080/samplecontainer/examples/oauth2/oauth2_facebook.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "Sample Facebook gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 22,
- "title": "Ohloh Apache Rave Languages",
- "url": "http://www.ohloh.net/p/521520/widgets/project_languages.xml",
- "type": "OpenSocial",
- "author": "Ohloh",
- "description": "Ohloh is an open source network that connects people through the software they create and use. Ohloh gadgets provide detailed statistics about open source software projects and developers.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 23,
- "title": "Ohloh Apache Rave Factoids",
- "url": "http://www.ohloh.net/p/521520/widgets/project_factoids.xml",
- "type": "OpenSocial",
- "author": "Ohloh",
- "description": "Ohloh is an open source network that connects people through the software they create and use. Ohloh gadgets provide detailed statistics about open source software projects and developers.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 24,
- "title": "Ohloh Apache Rave COCOMO Estimates",
- "url": "http://www.ohloh.net/p/521520/widgets/project_cocomo.xml",
- "type": "OpenSocial",
- "author": "Ohloh",
- "description": "Ohloh is an open source network that connects people through the software they create and use. Ohloh gadgets provide detailed statistics about open source software projects and developers.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 25,
- "title": "Ohloh Apache Rave Stats",
- "url": "http://www.ohloh.net/p/521520/widgets/project_basic_stats.xml",
- "type": "OpenSocial",
- "author": "Ohloh",
- "description": "Ohloh is an open source network that connects people through the software they create and use. Ohloh gadgets provide detailed statistics about open source software projects and developers.",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 26,
- "title": "OpenAJAX Hub Publisher",
- "url": "http://localhost:8080/container/sample-pubsub-2-publisher.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "OpenAJAX Hub publisher gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 27,
- "title": "OpenAJAX Hub Subscriber",
- "url": "http://localhost:8080/container/sample-pubsub-2-subscriber.xml",
- "type": "OpenSocial",
- "author": "Apache Shindig",
- "description": "OpenAJAX Hub subscriber gadget from Shindig",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
- },
- {
- "id" : 28,
- "title": "Friends",
- "url": "http://localhost:8080/demogadgets/friends.xml",
- "type": "OpenSocial",
- "author": "Viknes Balasubramanee",
- "description": "This gadget display the list of friends for a particular user",
- "disableRendering": false,
- "featured": false,
- "widgetStatus": "PUBLISHED"
}
],
"authorities": [
@@ -1236,30 +285,6 @@
"10"
],
"value": "10"
- },
- {
- "id": 3,
- "key": "javaScriptDebugMode",
- "values": [
- "1"
- ],
- "value": "1"
- },
- {
- "id": 4,
- "key": "defaultWidgetHeight",
- "values": [
- "250"
- ],
- "value": "250"
- },
- {
- "id": 5,
- "key": "showStackTrace",
- "values": [
- "0"
- ],
- "value": "0"
}
],
"categories": [
@@ -1278,30 +303,6 @@
"createdDate": 1326949200000,
"lastModifiedUserId": "1",
"lastModifiedDate": 1326949200000
- },
- {
- "id": 3,
- "text": "Travel",
- "createdUserId": "1",
- "createdDate": 1326949200000,
- "lastModifiedUserId": "1",
- "lastModifiedDate": 1326949200000
- },
- {
- "id": 4,
- "text": "Projects",
- "createdUserId": "1",
- "createdDate": 1326949200000,
- "lastModifiedUserId": "1",
- "lastModifiedDate": 1326949200000
- },
- {
- "id": 5,
- "text": "Communications",
- "createdUserId": "1",
- "createdDate": 1326949200000,
- "lastModifiedUserId":"1",
- "lastModifiedDate": 1326949200000
}
],
"pageTemplates": [
@@ -1333,7 +334,7 @@
"pageTemplate": null,
"pageTemplateWidgets": [
{
- "id": 3,
+ "id": 1,
"pageTemplateRegion": null,
"widgetId": "15",
"locked": true,
@@ -1341,7 +342,7 @@
"renderSeq": 0
},
{
- "id": 4,
+ "id": 2,
"pageTemplateRegion": null,
"widgetId": "14",
"locked": true,
@@ -1371,12 +372,12 @@
},
"pageTemplateRegions": [
{
- "id": 3,
+ "id": 1,
"renderSequence": 0,
"pageTemplate": null,
"pageTemplateWidgets": [
{
- "id": 5,
+ "id": 2,
"pageTemplateRegion": null,
"widgetId": "3",
"locked": true,
@@ -1392,7 +393,7 @@
}
],
"pageLayout": {
- "id": 9,
+ "id": 2,
"code": "person_profile",
"numberOfRegions": 1,
"renderSequence": 8,
@@ -1456,7 +457,7 @@
},
{
"pageTemplateRegion": null,
- "widgetId": "7",
+ "widgetId": "2",
"locked": false,
"hideChrome": false,
"id": 4,
@@ -1472,7 +473,7 @@
"pageTemplateWidgets": [
{
"pageTemplateRegion": null,
- "widgetId": "10",
+ "widgetId": "1",
"locked": false,
"hideChrome": false,
"id": 3,
@@ -1480,7 +481,7 @@
},
{
"pageTemplateRegion": null,
- "widgetId": "23",
+ "widgetId": "1",
"locked": false,
"hideChrome": false,
"id": 4,
@@ -1496,7 +497,7 @@
"pageTemplateWidgets": [
{
"pageTemplateRegion": null,
- "widgetId": "11",
+ "widgetId": "1",
"locked": false,
"hideChrome": false,
"id": 3,
Modified: rave/trunk/rave-portal/src/test/java/renderer/RenderServiceIntegrationTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal/src/test/java/renderer/RenderServiceIntegrationTest.java?rev=1445395&r1=1445394&r2=1445395&view=diff
==============================================================================
--- rave/trunk/rave-portal/src/test/java/renderer/RenderServiceIntegrationTest.java (original)
+++ rave/trunk/rave-portal/src/test/java/renderer/RenderServiceIntegrationTest.java Tue Feb 12 21:31:02 2013
@@ -25,6 +25,7 @@ import org.apache.rave.portal.model.Regi
import org.apache.rave.portal.model.RegionWidget;
import org.apache.rave.portal.model.User;
import org.apache.rave.portal.model.impl.*;
+import org.apache.rave.portal.repository.UserRepository;
import org.apache.rave.portal.web.renderer.RenderService;
import org.apache.rave.portal.web.renderer.ScriptLocation;
import org.apache.rave.portal.web.renderer.ScriptManager;
@@ -68,6 +69,9 @@ public class RenderServiceIntegrationTes
@Autowired
private ShindigGadgetMetadataRepository metadataRepository;
+ @Autowired
+ private UserRepository repository;
+
private RestOperations restOperations;
private static final String VALID_METADATA = "[{\"id\":\"gadgets.metadata\",\"result\"" +
@@ -107,7 +111,7 @@ public class RenderServiceIntegrationTes
@Test
public void renderOpenSocial() {
- Page page = new PageImpl("1", VALID_USER_ID);
+ Page page = new PageImpl("1", repository.getByUsername(VALID_USER_NAME).getId());
Region region = new RegionImpl("1", page, 1);
page.setRegions(Arrays.asList(region));