001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019 package org.apache.isis.viewer.xhtml.applib.resources;
020
021 import java.io.InputStream;
022
023 import javax.ws.rs.DELETE;
024 import javax.ws.rs.GET;
025 import javax.ws.rs.POST;
026 import javax.ws.rs.PUT;
027 import javax.ws.rs.Path;
028 import javax.ws.rs.PathParam;
029 import javax.ws.rs.Produces;
030 import javax.ws.rs.QueryParam;
031
032 public interface ObjectResource {
033
034 @GET
035 @Path("/{oid}")
036 @Produces({ "application/xhtml+xml", "text/html" })
037 public String object(@PathParam("oid") final String oidStr);
038
039 @PUT
040 @Path("/{oid}/property/{propertyId}")
041 @Produces({ "application/xhtml+xml", "text/html" })
042 public String modifyProperty(@PathParam("oid") final String oidStr,
043 @PathParam("propertyId") final String propertyId, @QueryParam("proposedValue") final String proposedValue);
044
045 @DELETE
046 @Path("/{oid}/property/{propertyId}")
047 @Produces({ "application/xhtml+xml", "text/html" })
048 public String clearProperty(@PathParam("oid") final String oidStr, @PathParam("propertyId") final String propertyId);
049
050 @GET
051 @Path("/{oid}/collection/{collectionId}")
052 @Produces({ "application/xhtml+xml", "text/html" })
053 public String accessCollection(@PathParam("oid") final String oidStr,
054 @PathParam("collectionId") final String collectionId);
055
056 @PUT
057 @Path("/{oid}/collection/{collectionId}")
058 @Produces({ "application/xhtml+xml", "text/html" })
059 public String addToCollection(@PathParam("oid") final String oidStr,
060 @PathParam("collectionId") final String collectionId,
061 @QueryParam("proposedValue") final String proposedValueOidStr);
062
063 @DELETE
064 @Path("/{oid}/collection/{collectionId}")
065 @Produces({ "application/xhtml+xml", "text/html" })
066 public String removeFromCollection(@PathParam("oid") final String oidStr,
067 @PathParam("collectionId") final String collectionId,
068 @QueryParam("proposedValue") final String proposedValueOidStr);
069
070 @POST
071 @Path("/{oid}/action/{actionId}")
072 @Produces({ "application/xhtml+xml", "text/html" })
073 public String invokeAction(@PathParam("oid") final String oidStr, @PathParam("actionId") final String actionId,
074 final InputStream body);
075
076 }