Repository: rave Updated Branches: refs/heads/master 59af9574d -> 7918052e9
RAVE-937 - Added shell or Organizations REST resource Project: http://git-wip-us.apache.org/repos/asf/rave/repo Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/7918052e Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/7918052e Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/7918052e Branch: refs/heads/master Commit: 7918052e9b009c0c1e0ad84c73f29f8f97f2b3b9 Parents: 59af957 Author: Chris Geer <[email protected]> Authored: Tue Apr 8 16:19:52 2014 -0700 Committer: Chris Geer <[email protected]> Committed: Tue Apr 8 16:19:52 2014 -0700 ---------------------------------------------------------------------- .../apache/rave/rest/OrganizationsResource.java | 50 ++++++++++++++++++++ .../apache/rave/rest/model/Organization.java | 22 +++++++++ .../rest/impl/DefaultOrganizationsResource.java | 50 ++++++++++++++++++++ .../webapp/WEB-INF/cxf-applicationContext.xml | 3 ++ 4 files changed, 125 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/rave/blob/7918052e/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/OrganizationsResource.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/OrganizationsResource.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/OrganizationsResource.java new file mode 100644 index 0000000..c0537f1 --- /dev/null +++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/OrganizationsResource.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.Organization; + +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("/organizations") +public interface OrganizationsResource { + @GET + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getOrganizations(); + + @GET + @Path("/{id}") + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getOrganization(@PathParam("id") String id); + + @PUT + @Path("/{id}") + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response updateOrganization(@PathParam("id") String id, Organization organization, @Context UriInfo uri); + + @POST + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response createOrganization(Organization organization); +} http://git-wip-us.apache.org/repos/asf/rave/blob/7918052e/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Organization.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Organization.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Organization.java new file mode 100644 index 0000000..9bcb928 --- /dev/null +++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Organization.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 Organization { +} http://git-wip-us.apache.org/repos/asf/rave/blob/7918052e/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultOrganizationsResource.java ---------------------------------------------------------------------- diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultOrganizationsResource.java b/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultOrganizationsResource.java new file mode 100644 index 0000000..5df06cb --- /dev/null +++ b/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultOrganizationsResource.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.impl; + +import org.apache.rave.rest.OrganizationsResource; +import org.apache.rave.rest.model.Organization; + +import javax.ws.rs.PathParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +public class DefaultOrganizationsResource implements OrganizationsResource { + + @Override + public Response getOrganizations() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public Response getOrganization(@PathParam("id") String id) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public Response updateOrganization(@PathParam("id") String id, Organization organization, @Context UriInfo uri) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public Response createOrganization(Organization organization) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } +} http://git-wip-us.apache.org/repos/asf/rave/blob/7918052e/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 c36f5f6..0e7e061 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 @@ -60,6 +60,7 @@ <ref bean="categoriesBean"/> <ref bean="preferencesBean"/> <ref bean="widgetsBean"/> + <ref bean="organizationsBean"/> </jaxrs:serviceBeans> </jaxrs:server> @@ -76,6 +77,8 @@ <property name="userService" ref="userService"/> </bean> + <bean id="organizationsBean" class="org.apache.rave.rest.impl.DefaultOrganizationsResource"/> + <bean id="preferencesBean" class="org.apache.rave.rest.impl.DefaultPortalPreferenceResource" autowire="byType" /> <bean id="widgetsBean" class="org.apache.rave.rest.impl.DefaultWidgetsResource" autowire="byType" />
