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 2014/07/03 18:46:41 UTC
[47/50] git commit: RAVE-936 - Added Groups REST resource shell
RAVE-936
- Added Groups REST resource shell
Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/14008d6c
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/14008d6c
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/14008d6c
Branch: refs/heads/angular
Commit: 14008d6c4423b2aa4fcc6603a4685e3a799782f2
Parents: 7918052
Author: Chris Geer <ch...@cxtsoftware.com>
Authored: Tue Apr 8 16:35:32 2014 -0700
Committer: Chris Geer <ch...@cxtsoftware.com>
Committed: Tue Apr 8 16:35:32 2014 -0700
----------------------------------------------------------------------
.../org/apache/rave/rest/GroupsResource.java | 50 ++++++++++++++++++++
.../java/org/apache/rave/rest/model/Group.java | 22 +++++++++
.../rave/rest/impl/DefaultGroupsResource.java | 47 ++++++++++++++++++
.../webapp/WEB-INF/cxf-applicationContext.xml | 2 +
4 files changed, 121 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/14008d6c/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/GroupsResource.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/GroupsResource.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/GroupsResource.java
new file mode 100644
index 0000000..687ee82
--- /dev/null
+++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/GroupsResource.java
@@ -0,0 +1,50 @@
+/*
+ * 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.rest;
+
+import org.apache.rave.rest.model.Group;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+@Path("/groups")
+public interface GroupsResource {
+ @GET
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getGroups();
+
+ @GET
+ @Path("/{id}")
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getGroup(@PathParam("id") String id);
+
+ @PUT
+ @Path("/{id}")
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response updateGroup(@PathParam("id") String id, Group group, @Context UriInfo uri);
+
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response createGroup(Group group);
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/14008d6c/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Group.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Group.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Group.java
new file mode 100644
index 0000000..a1925ed
--- /dev/null
+++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Group.java
@@ -0,0 +1,22 @@
+/*
+ * 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.rest.model;
+
+public class Group {
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/14008d6c/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultGroupsResource.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultGroupsResource.java b/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultGroupsResource.java
new file mode 100644
index 0000000..a52b11c
--- /dev/null
+++ b/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultGroupsResource.java
@@ -0,0 +1,47 @@
+/*
+ * 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.rest.impl;
+
+import org.apache.rave.rest.GroupsResource;
+import org.apache.rave.rest.model.Group;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+public class DefaultGroupsResource implements GroupsResource {
+ @Override
+ public Response getGroups() {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public Response getGroup(String id) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public Response updateGroup(String id, Group group, UriInfo uri) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public Response createGroup(Group group) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/14008d6c/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
----------------------------------------------------------------------
diff --git a/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml b/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
index 0e7e061..cf6fdb8 100644
--- a/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
+++ b/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
@@ -61,6 +61,7 @@
<ref bean="preferencesBean"/>
<ref bean="widgetsBean"/>
<ref bean="organizationsBean"/>
+ <ref bean="groupsBean"/>
</jaxrs:serviceBeans>
</jaxrs:server>
@@ -78,6 +79,7 @@
</bean>
<bean id="organizationsBean" class="org.apache.rave.rest.impl.DefaultOrganizationsResource"/>
+ <bean id="groupsBean" class="org.apache.rave.rest.impl.DefaultGroupsResource"/>
<bean id="preferencesBean" class="org.apache.rave.rest.impl.DefaultPortalPreferenceResource" autowire="byType" />
<bean id="widgetsBean" class="org.apache.rave.rest.impl.DefaultWidgetsResource" autowire="byType" />