Return-Path: X-Original-To: apmail-incubator-isis-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-isis-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4238F671D for ; Wed, 22 Jun 2011 22:59:36 +0000 (UTC) Received: (qmail 51290 invoked by uid 500); 22 Jun 2011 22:59:36 -0000 Delivered-To: apmail-incubator-isis-commits-archive@incubator.apache.org Received: (qmail 51273 invoked by uid 500); 22 Jun 2011 22:59:36 -0000 Mailing-List: contact isis-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: isis-dev@incubator.apache.org Delivered-To: mailing list isis-commits@incubator.apache.org Received: (qmail 51266 invoked by uid 99); 22 Jun 2011 22:59:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 22:59:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 22:59:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 19249238890D; Wed, 22 Jun 2011 22:59:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1138673 - in /incubator/isis/trunk/viewer/restful/applib2: ./ src/ src/main/ src/main/java/ src/main/java/META-INF/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/isis/ src/main/java/org/apache/isis/viewer/ src/main/... Date: Wed, 22 Jun 2011 22:59:12 -0000 To: isis-commits@incubator.apache.org From: danhaywood@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110622225913.19249238890D@eris.apache.org> Author: danhaywood Date: Wed Jun 22 22:59:11 2011 New Revision: 1138673 URL: http://svn.apache.org/viewvc?rev=1138673&view=rev Log: cloned restful applib to applib2 Added: incubator/isis/trunk/viewer/restful/applib2/ incubator/isis/trunk/viewer/restful/applib2/pom.xml incubator/isis/trunk/viewer/restful/applib2/src/ incubator/isis/trunk/viewer/restful/applib2/src/main/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/MANIFEST.MF incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/AbstractRestfulClient.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/Constants.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/RestfulClientException.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/StringUtils.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/UrlEncodeUtils.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/BootstrapResource.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/HomePageResource.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ObjectResource.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ServicesResource.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/SpecsResource.java incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/UserResource.java incubator/isis/trunk/viewer/restful/applib2/src/site/ incubator/isis/trunk/viewer/restful/applib2/src/site/apt/ incubator/isis/trunk/viewer/restful/applib2/src/site/apt/index.apt incubator/isis/trunk/viewer/restful/applib2/src/site/apt/jottings.apt incubator/isis/trunk/viewer/restful/applib2/src/site/resources/ incubator/isis/trunk/viewer/restful/applib2/src/site/site.xml Added: incubator/isis/trunk/viewer/restful/applib2/pom.xml URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/pom.xml?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/pom.xml (added) +++ incubator/isis/trunk/viewer/restful/applib2/pom.xml Wed Jun 22 22:59:11 2011 @@ -0,0 +1,71 @@ + + + + 4.0.0 + + + org.apache.isis.viewer + restful + 0.1.2-incubating-SNAPSHOT + + + restful-applib2 + Restful Viewer AppLib2 + + + ../../.. + viewer/restful/applib/ + + + + http://incubator.apache.org/isis/${relativeUrl} + + + + org.jboss.resteasy + resteasy-jaxrs + + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + + log4j + log4j + + + + + + + + java.net + http://download.java.net/maven/1 + + + + Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/MANIFEST.MF URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/MANIFEST.MF?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/MANIFEST.MF (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/META-INF/MANIFEST.MF Wed Jun 22 22:59:11 2011 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/AbstractRestfulClient.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/AbstractRestfulClient.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/AbstractRestfulClient.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/AbstractRestfulClient.java Wed Jun 22 22:59:11 2011 @@ -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.isis.viewer.restful.applib2; + +import org.apache.log4j.Logger; + +public abstract class AbstractRestfulClient { + + private static Logger LOG = Logger.getLogger(AbstractRestfulClient.class); + + private final String hostUri; + + public String getHostUri() { + return hostUri; + } + + public AbstractRestfulClient(final String hostUri) { + this.hostUri = hostUri; + } + + + // ////////////////////////////////////////////////////////////////////// + // Helpers: string + // ////////////////////////////////////////////////////////////////////// + + protected static String combine(final String... pathParts) { + final StringBuilder buf = new StringBuilder(); + for (final String part : pathParts) { + buf.append(part); + } + return buf.toString(); + } + +} Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/Constants.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/Constants.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/Constants.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/Constants.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,28 @@ +/* + * 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.isis.viewer.restful.applib2; + +public final class Constants { + + public static final String URL_ENCODING_CHAR_SET = "UTF-8"; + + private Constants() { + } + +} Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/RestfulClientException.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/RestfulClientException.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/RestfulClientException.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/RestfulClientException.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,40 @@ +/* + * 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.isis.viewer.restful.applib2; + +public class RestfulClientException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public RestfulClientException() { + } + + public RestfulClientException(final String message) { + super(message); + } + + public RestfulClientException(final Throwable cause) { + super(cause); + } + + public RestfulClientException(final String message, final Throwable cause) { + super(message, cause); + } + +} Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/StringUtils.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/StringUtils.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/StringUtils.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/StringUtils.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,80 @@ +/* + * 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.isis.viewer.restful.applib2; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +/** + * Not API, so intentionally not visible outside this package. + */ +final class StringUtils { + + private StringUtils() { + } + + /** + * Converts a list of objects [a, 1, b, 2] into a map {a -> 1; b -> 2} + */ + static Map asMap(final String... paramArgs) { + final Map map = new LinkedHashMap(); + boolean param = true; + String paramStr = null; + for (final String paramArg : paramArgs) { + if (param) { + paramStr = paramArg; + } else { + final String arg = paramArg; + map.put(paramStr, arg); + paramStr = null; + } + param = !param; + } + if (paramStr != null) { + throw new IllegalArgumentException("Must have equal number of parameters and arguments"); + } + return map; + } + + static void writeMap(final Map formArgumentsByParameter, final Writer writer) { + try { + final Set> parameterArguments = formArgumentsByParameter.entrySet(); + for (final Map.Entry parameterArgument : parameterArguments) { + writer.write(parameterArgument.getKey()); + writer.write("="); + writer.write(parameterArgument.getValue()); + writer.write("\n"); + } + writer.flush(); + } catch (final IOException e) { + throw new RestfulClientException(e); + } + } + + static String asString(final Map formArgumentsByParameter) { + final StringWriter sw = new StringWriter(); + writeMap(formArgumentsByParameter, sw); + return sw.toString(); + } + +} Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/UrlEncodeUtils.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/UrlEncodeUtils.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/UrlEncodeUtils.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/UrlEncodeUtils.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,56 @@ +/* + * 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.isis.viewer.restful.applib2; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.ws.rs.WebApplicationException; + +/** + * Not API, so intentionally not visible outside this package. + */ +final class UrlEncodeUtils { + + private UrlEncodeUtils() { + } + + static String encode(final String value) { + try { + return URLEncoder.encode(value, Constants.URL_ENCODING_CHAR_SET); + } catch (final UnsupportedEncodingException e) { + throw new WebApplicationException(e); + } + } + + static Map urlEncode(final Map asMap) { + final Map encodedMap = new HashMap(); + final Set> entrySet = asMap.entrySet(); + for (final Entry entry : entrySet) { + final String value = entry.getValue(); + encodedMap.put(entry.getKey(), encode(value)); + } + return encodedMap; + } + +} Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/BootstrapResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/BootstrapResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/BootstrapResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/BootstrapResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,32 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public interface BootstrapResource { + + @GET + @Produces({ MediaType.TEXT_HTML }) + public String bootstrap(); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/HomePageResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/HomePageResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/HomePageResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/HomePageResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,31 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import javax.ws.rs.GET; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public interface HomePageResource { + + @GET + @Produces({ MediaType.APPLICATION_JSON }) + public String resources(); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ObjectResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ObjectResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ObjectResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ObjectResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,77 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import java.io.InputStream; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +public interface ObjectResource { + + @GET + @Path("/{oid}") + @Produces({ MediaType.APPLICATION_JSON }) + public String object(@PathParam("oid") final String oidStr); + + @PUT + @Path("/{oid}/property/{propertyId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String modifyProperty(@PathParam("oid") final String oidStr, + @PathParam("propertyId") final String propertyId, @QueryParam("proposedValue") final String proposedValue); + + @DELETE + @Path("/{oid}/property/{propertyId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String clearProperty(@PathParam("oid") final String oidStr, @PathParam("propertyId") final String propertyId); + + @GET + @Path("/{oid}/collection/{collectionId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String accessCollection(@PathParam("oid") final String oidStr, + @PathParam("collectionId") final String collectionId); + + @PUT + @Path("/{oid}/collection/{collectionId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String addToCollection(@PathParam("oid") final String oidStr, + @PathParam("collectionId") final String collectionId, + @QueryParam("proposedValue") final String proposedValueOidStr); + + @DELETE + @Path("/{oid}/collection/{collectionId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String removeFromCollection(@PathParam("oid") final String oidStr, + @PathParam("collectionId") final String collectionId, + @QueryParam("proposedValue") final String proposedValueOidStr); + + @POST + @Path("/{oid}/action/{actionId}") + @Produces({ MediaType.APPLICATION_JSON }) + public String invokeAction(@PathParam("oid") final String oidStr, @PathParam("actionId") final String actionId, + final InputStream body); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ServicesResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ServicesResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ServicesResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/ServicesResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,33 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public interface ServicesResource { + + @GET + @Produces({ MediaType.APPLICATION_JSON }) + @Path("/") + public String services(); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/SpecsResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/SpecsResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/SpecsResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/SpecsResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,81 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public interface SpecsResource { + + @GET + @Path("/") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specs(); + + @GET + @Path("/{specFullName}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String spec(@PathParam("specFullName") final String specFullName); + + @GET + @Path("/{specFullName}/facet/{facetType}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specFacet(@PathParam("specFullName") final String specFullName, + @PathParam("facetType") final String facetTypeName); + + @GET + @Path("/{specFullName}/property/{propertyName}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specProperty(@PathParam("specFullName") final String specFullName, + @PathParam("propertyName") final String propertyName); + + @GET + @Path("/{specFullName}/collection/{collectionName}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specCollection(@PathParam("specFullName") final String specFullName, + @PathParam("collectionName") final String collectionName); + + @GET + @Path("/{specFullName}/action/{actionId}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specAction(@PathParam("specFullName") final String specFullName, + @PathParam("actionId") final String actionId); + + @GET + @Path("/{specFullName}/property/{propertyName}/facet/{facetType}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specPropertyFacet(@PathParam("specFullName") final String specFullName, + @PathParam("propertyName") final String propertyName, @PathParam("facetType") final String facetTypeName); + + @GET + @Path("/{specFullName}/collection/{collectionName}/facet/{facetType}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specCollectionFacet(@PathParam("specFullName") final String specFullName, + @PathParam("collectionName") final String collectionName, @PathParam("facetType") final String facetTypeName); + + @GET + @Path("/{specFullName}/action/{actionId}/facet/{facetType}") + @Produces({ MediaType.APPLICATION_JSON }) + public abstract String specActionFacet(@PathParam("specFullName") final String specFullName, + @PathParam("actionId") final String actionId, @PathParam("facetType") final String facetTypeName); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/UserResource.java URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/UserResource.java?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/UserResource.java (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/main/java/org/apache/isis/viewer/restful/applib2/resources/UserResource.java Wed Jun 22 22:59:11 2011 @@ -0,0 +1,31 @@ +/* + * 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.isis.viewer.restful.applib2.resources; + +import javax.ws.rs.GET; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public interface UserResource { + + @GET + @Produces({ MediaType.APPLICATION_JSON }) + public String user(); + +} \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/site/apt/index.apt?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/site/apt/index.apt (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/site/apt/index.apt Wed Jun 22 22:59:11 2011 @@ -0,0 +1,28 @@ +~~ 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. + +Restful AppLib + + The restful viewer's module defines (among other things) the + JAX-RS (JSR-311) compliant interfaces which define the URIs exposed by + the viewer. These do allow frameworks (such as JBoss' {{{http://jboss.org/resteasy}RestEasy}} + framework) to generate client-side bindings. + +Further Info + + See this module's {{{./apidocs/index.html}Javadoc}} and the {{{../docbkx/html/guide/isis-restful-viewer.html}user guide}} for more information. + \ No newline at end of file Added: incubator/isis/trunk/viewer/restful/applib2/src/site/apt/jottings.apt URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/site/apt/jottings.apt?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/site/apt/jottings.apt (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/site/apt/jottings.apt Wed Jun 22 22:59:11 2011 @@ -0,0 +1,24 @@ +~~ 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. + + + +Jottings + + This page is to capture any random jottings relating to this module prior + to being moved into formal documentation. + Added: incubator/isis/trunk/viewer/restful/applib2/src/site/site.xml URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/applib2/src/site/site.xml?rev=1138673&view=auto ============================================================================== --- incubator/isis/trunk/viewer/restful/applib2/src/site/site.xml (added) +++ incubator/isis/trunk/viewer/restful/applib2/src/site/site.xml Wed Jun 22 22:59:11 2011 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + +