Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 88227 invoked from network); 5 Oct 2010 14:56:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Oct 2010 14:56:27 -0000 Received: (qmail 87264 invoked by uid 500); 5 Oct 2010 14:56:27 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 87204 invoked by uid 500); 5 Oct 2010 14:56:26 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 87196 invoked by uid 99); 5 Oct 2010 14:56:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Oct 2010 14:56:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Tue, 05 Oct 2010 14:56:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3433C238890A; Tue, 5 Oct 2010 14:55:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1004660 - in /incubator/chemistry/opencmis-browser-binding/trunk: ./ src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/ src/main/webapp/ src/main/webapp/WE... Date: Tue, 05 Oct 2010 14:55:56 -0000 To: chemistry-commits@incubator.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101005145556.3433C238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmui Date: Tue Oct 5 14:55:55 2010 New Revision: 1004660 URL: http://svn.apache.org/viewvc?rev=1004660&view=rev Log: - reworked browser binding framework Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html (with props) incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html (with props) Removed: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisApplication.java incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisJaxbContextResolver.java incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisResource.java incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.jsp incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.jsp Modified: incubator/chemistry/opencmis-browser-binding/trunk/pom.xml incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/WEB-INF/web.xml Modified: incubator/chemistry/opencmis-browser-binding/trunk/pom.xml URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/pom.xml?rev=1004660&r1=1004659&r2=1004660&view=diff ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/pom.xml (original) +++ incubator/chemistry/opencmis-browser-binding/trunk/pom.xml Tue Oct 5 14:55:55 2010 @@ -92,16 +92,6 @@ 0.2.0-incubating-SNAPSHOT - com.sun.jersey - jersey-server - 1.3 - - - com.sun.jersey - jersey-json - 1.3 - - com.googlecode.json-simple json-simple 1.1 @@ -114,18 +104,4 @@ - - - maven-repository.dev.java.net - Java.net Repository for Maven 1 - http://download.java.net/maven/1/ - legacy - - - maven2-repository.dev.java.net - Java.net Repository for Maven 2 - http://download.java.net/maven/2/ - - - Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java Tue Oct 5 14:55:55 2010 @@ -0,0 +1,177 @@ +/* + * 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.chemistry.opencmis.server.impl.browser; + +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter; + +import java.io.IOException; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.chemistry.opencmis.commons.PropertyIds; +import org.apache.chemistry.opencmis.commons.data.ObjectData; +import org.apache.chemistry.opencmis.commons.data.Properties; +import org.apache.chemistry.opencmis.commons.data.PropertyData; +import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships; +import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException; +import org.apache.chemistry.opencmis.commons.impl.Constants; +import org.apache.chemistry.opencmis.commons.impl.UrlBuilder; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.server.impl.CallContextImpl; +import org.apache.chemistry.opencmis.server.shared.HttpUtils; +import org.json.simple.JSONStreamAware; + +public class BrowserBindingUtils { + + public static final String JSON_MIME_TYPE = "application/json"; + + public static final String METHOD_GET_CONTENT = "getContentStream"; + public static final String METHOD_GET_OBJECT = "getObject"; + public static final String METHOD_GET_CHILDREN = "getChildren"; + + public static final String PARAM_METHOD = "method"; + public static final String PARAM_CALLBACK = "callback"; + public static final String PARAM_INCLUDE_TYPE = "includeTypeInformation"; + + public static final String CONTEXT_OBJECT_ID = "org.apache.chemistry.openmis.browserbinding.objectId"; + public static final String CONTEXT_BASETYPE_ID = "org.apache.chemistry.openmis.browserbinding.basetypeId"; + + /** + * Compiles the base URL for links, collections and templates. + */ + public static UrlBuilder compileBaseUrl(HttpServletRequest request, String repositoryId) { + UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(), null); + + url.addPath(request.getContextPath()); + url.addPath(request.getServletPath()); + + if (repositoryId != null) { + url.addPathSegment(repositoryId); + } + + return url; + } + + /** + * Returns the current CMIS path. + */ + public static String getPath(HttpServletRequest request) { + String[] pathFragments = HttpUtils.splitPath(request); + if (pathFragments.length < 1) { + return null; + } + if (pathFragments.length == 1) { + return "/"; + } + + StringBuilder sb = new StringBuilder(); + for (int i = 1; i < pathFragments.length; i++) { + if (pathFragments[i].length() == 0) { + continue; + } + + sb.append("/"); + sb.append(pathFragments[i]); + } + + return sb.toString(); + } + + /** + * Returns the object id of the current request. + */ + public static void prepareContext(CallContext context, CmisService service, String repositoryId, + HttpServletRequest request) { + ObjectData object = null; + + String objectId = getStringParameter(request, Constants.PARAM_OBJECT_ID); + if (objectId != null) { + object = service.getObject(repositoryId, objectId, null, false, IncludeRelationships.NONE, "cmis:none", + false, false, null); + } else { + object = service.getObjectByPath(repositoryId, getPath(request), null, false, IncludeRelationships.NONE, + "cmis:none", false, false, null); + } + + if (context instanceof CallContextImpl) { + ((CallContextImpl) context).put(CONTEXT_OBJECT_ID, object.getId()); + ((CallContextImpl) context).put(CONTEXT_BASETYPE_ID, + getProperty(object, PropertyIds.BASE_TYPE_ID, String.class)); + } + } + + /** + * Extracts a property from an object. + */ + @SuppressWarnings("unchecked") + public static T getProperty(ObjectData object, String name, Class clazz) { + if (object == null) { + return null; + } + + Properties propData = object.getProperties(); + if (propData == null) { + return null; + } + + Map> properties = propData.getProperties(); + if (properties == null) { + return null; + } + + PropertyData property = properties.get(name); + if (property == null) { + return null; + } + + Object value = property.getFirstValue(); + if (!clazz.isInstance(value)) { + return null; + } + + return (T) value; + } + + /** + * Writes JSON to the servlet response and adds a callback wrapper if + * requested. + */ + public static void writeJSON(JSONStreamAware json, HttpServletRequest request, HttpServletResponse response) + throws IOException { + response.setContentType(JSON_MIME_TYPE); + response.setCharacterEncoding("UTF-8"); + + String callback = getStringParameter(request, PARAM_CALLBACK); + if (callback != null) { + if (!callback.matches("[A-Za-z0-9._\\[\\]]*")) { + throw new CmisInvalidArgumentException("Invalid callback name!"); + } + response.getWriter().print(callback + "("); + } + + json.writeJSONString(response.getWriter()); + + if (callback != null) { + response.getWriter().print(");"); + } + } +} Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java Tue Oct 5 14:55:55 2010 @@ -0,0 +1,248 @@ +/* + * 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.chemistry.opencmis.server.impl.browser; + +import java.io.IOException; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.chemistry.opencmis.commons.enums.BaseTypeId; +import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisFilterNotValidException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisNameConstraintViolationException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisStreamNotSupportedException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisVersioningException; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory; +import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener; +import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConstants; +import org.apache.chemistry.opencmis.server.shared.CallContextHandler; +import org.apache.chemistry.opencmis.server.shared.Dispatcher; +import org.apache.chemistry.opencmis.server.shared.HttpUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.simple.JSONObject; + +public class CmisBrowserBindingServlet extends HttpServlet { + + private static final long serialVersionUID = 1L; + + public static final String PARAM_CALL_CONTEXT_HANDLER = "callContextHandler"; + + private static final Log LOG = LogFactory.getLog(CmisBrowserBindingServlet.class.getName()); + + private Dispatcher dispatcher; + private CallContextHandler callContextHandler; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + + // initialize the call context handler + callContextHandler = null; + String callContextHandlerClass = config.getInitParameter(PARAM_CALL_CONTEXT_HANDLER); + if (callContextHandlerClass != null) { + try { + callContextHandler = (CallContextHandler) Class.forName(callContextHandlerClass).newInstance(); + } catch (Exception e) { + throw new ServletException("Could not load call context handler: " + e, e); + } + } + + // initialize the dispatcher + dispatcher = new Dispatcher(); + + try { + dispatcher.addResource(BrowserBindingUtils.METHOD_GET_OBJECT, Dispatcher.METHOD_GET, ObjectService.class, + "getObject"); + dispatcher.addResource(BrowserBindingUtils.METHOD_GET_CONTENT, Dispatcher.METHOD_GET, ObjectService.class, + "getContentStream"); + dispatcher.addResource(BrowserBindingUtils.METHOD_GET_CHILDREN, Dispatcher.METHOD_GET, + NavigationService.class, "getChildren"); + } catch (NoSuchMethodException e) { + LOG.error("Cannot initialize dispatcher!", e); + } + + } + + @Override + protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { + + // create a context object, dispatch and handle exceptions + CallContext context = null; + try { + context = HttpUtils.createContext(request, CallContext.BINDING_BROWSER, callContextHandler); + dispatch(context, request, response); + } catch (Exception e) { + if (e instanceof CmisPermissionDeniedException) { + if ((context == null) || (context.getUsername() == null)) { + response.setHeader("WWW-Authenticate", "Basic realm=\"CMIS\""); + response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authorization Required"); + } else { + writeError((CmisBaseException) e, request, response); + } + } else if (e instanceof CmisRuntimeException) { + LOG.error(e.getMessage(), e); + writeError((CmisBaseException) e, request, response); + } else if (e instanceof CmisBaseException) { + writeError((CmisBaseException) e, request, response); + } else { + LOG.error(e.getMessage(), e); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); + } + } + + // we are done. + response.flushBuffer(); + } + + // -------------------------------------------------------- + + private void dispatch(CallContext context, HttpServletRequest request, HttpServletResponse response) + throws Exception { + CmisService service = null; + try { + // get services factory + CmisServiceFactory factory = (CmisServiceFactory) getServletContext().getAttribute( + CmisRepositoryContextListener.SERVICES_FACTORY); + + if (factory == null) { + throw new CmisRuntimeException("Service factory not available! Configuration problem?"); + } + + // get the service + service = factory.getService(context); + + // analyze the path + String[] pathFragments = HttpUtils.splitPath(request); + + if (pathFragments.length < 1) { + // root -> repository infos + RepositoryService.getRepositories(context, service, request, response); + return; + } + + String method = request.getMethod(); + String repositoryId = pathFragments[0]; + + String resource = HttpUtils.getStringParameter(request, BrowserBindingUtils.PARAM_METHOD); + + // add object id and object base type id to context + BrowserBindingUtils.prepareContext(context, service, repositoryId, request); + + // set default method if necessary + if (resource == null) { + try { + BaseTypeId basetype = BaseTypeId.fromValue(context.get(BrowserBindingUtils.CONTEXT_BASETYPE_ID)); + switch (basetype) { + case CMIS_DOCUMENT: + resource = BrowserBindingUtils.METHOD_GET_CONTENT; + break; + case CMIS_FOLDER: + resource = BrowserBindingUtils.METHOD_GET_CHILDREN; + break; + default: + resource = BrowserBindingUtils.METHOD_GET_OBJECT; + break; + } + } catch (Exception e) { + resource = BrowserBindingUtils.METHOD_GET_OBJECT; + } + } + + // dispatch + boolean methodFound = dispatcher.dispatch(resource, method, context, service, repositoryId, request, + response); + + // if the dispatcher couldn't find a matching method, return an + // error message + if (!methodFound) { + throw new CmisNotSupportedException("Unknown operation"); + } + } finally { + if (service != null) { + service.close(); + } + } + } + + /** + * Translates an exception in an appropriate HTTP error code. + */ + @SuppressWarnings("unchecked") + private void writeError(CmisBaseException ex, HttpServletRequest request, HttpServletResponse response) { + int code = 500; + + if (ex instanceof CmisConstraintException) { + code = 409; + } else if (ex instanceof CmisContentAlreadyExistsException) { + code = 409; + } else if (ex instanceof CmisFilterNotValidException) { + code = 400; + } else if (ex instanceof CmisInvalidArgumentException) { + code = 400; + } else if (ex instanceof CmisNameConstraintViolationException) { + code = 409; + } else if (ex instanceof CmisNotSupportedException) { + code = 405; + } else if (ex instanceof CmisObjectNotFoundException) { + code = 404; + } else if (ex instanceof CmisPermissionDeniedException) { + code = 403; + } else if (ex instanceof CmisStorageException) { + code = 500; + } else if (ex instanceof CmisStreamNotSupportedException) { + code = 403; + } else if (ex instanceof CmisUpdateConflictException) { + code = 409; + } else if (ex instanceof CmisVersioningException) { + code = 409; + } + + response.setStatus(code); + response.setContentType(BrowserBindingUtils.JSON_MIME_TYPE); + + JSONObject jsonResponse = new JSONObject(); + JSONObject jsonResponseObject = new JSONObject(); + jsonResponse.put(JSONConstants.ERROR_INFO, jsonResponseObject); + jsonResponseObject.put(JSONConstants.ERROR_CODE, code); + jsonResponseObject.put(JSONConstants.ERROR_MESSAGE, ex.getMessage()); + + try { + BrowserBindingUtils.writeJSON(jsonResponse, request, response); + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + } +} Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java Tue Oct 5 14:55:55 2010 @@ -0,0 +1,72 @@ +/* + * 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.chemistry.opencmis.server.impl.browser; + +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBigIntegerParameter; +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBooleanParameter; +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getEnumParameter; +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter; + +import java.math.BigInteger; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList; +import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships; +import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; +import org.apache.chemistry.opencmis.commons.impl.Constants; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter; +import org.json.simple.JSONObject; + +public final class NavigationService { + + /** + * Children Collection GET. + */ + public static void getChildren(CallContext context, CmisService service, String repositoryId, + HttpServletRequest request, HttpServletResponse response) throws Exception { + // get parameters + String folderId = context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID); + String filter = getStringParameter(request, Constants.PARAM_FILTER); + String orderBy = getStringParameter(request, Constants.PARAM_ORDER_BY); + Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS); + IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS, + IncludeRelationships.class); + String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER); + Boolean includePathSegment = getBooleanParameter(request, Constants.PARAM_PATH_SEGMENT); + BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS); + BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT); + + // execute + ObjectInFolderList children = service.getChildren(repositoryId, folderId, filter, orderBy, + includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, maxItems, + skipCount, null); + + if (children == null) { + throw new CmisRuntimeException("Children are null!"); + } + + JSONObject jsonChildren = JSONConverter.convert(children); + + BrowserBindingUtils.writeJSON(jsonChildren, request, response); + } +} Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java Tue Oct 5 14:55:55 2010 @@ -0,0 +1,140 @@ +/* + * 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.chemistry.opencmis.server.impl.browser; + +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getBooleanParameter; +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getEnumParameter; +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.math.BigInteger; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.chemistry.opencmis.commons.data.ContentStream; +import org.apache.chemistry.opencmis.commons.data.ObjectData; +import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships; +import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; +import org.apache.chemistry.opencmis.commons.impl.Constants; +import org.apache.chemistry.opencmis.commons.impl.ReturnVersion; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter; +import org.json.simple.JSONObject; + +public final class ObjectService { + + private static final int BUFFER_SIZE = 64 * 1024; + + /** + * getObject. + */ + public static void getObject(CallContext context, CmisService service, String repositoryId, + HttpServletRequest request, HttpServletResponse response) throws Exception { + // get parameters + String objectId = context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID); + ReturnVersion returnVersion = getEnumParameter(request, Constants.PARAM_RETURN_VERSION, ReturnVersion.class); + String filter = getStringParameter(request, Constants.PARAM_FILTER); + Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS); + IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS, + IncludeRelationships.class); + String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER); + Boolean includePolicyIds = getBooleanParameter(request, Constants.PARAM_POLICY_IDS); + Boolean includeAcl = getBooleanParameter(request, Constants.PARAM_ACL); + + // execute + ObjectData object = null; + + if ((returnVersion == ReturnVersion.LATEST) || (returnVersion == ReturnVersion.LASTESTMAJOR)) { + object = service.getObjectOfLatestVersion(repositoryId, objectId, null, + returnVersion == ReturnVersion.LASTESTMAJOR, filter, includeAllowableActions, includeRelationships, + renditionFilter, includePolicyIds, includeAcl, null); + } else { + object = service.getObject(repositoryId, objectId, filter, includeAllowableActions, includeRelationships, + renditionFilter, includePolicyIds, includeAcl, null); + } + + if (object == null) { + throw new CmisRuntimeException("Object is null!"); + } + + JSONObject jsonObject = JSONConverter.convert(object); + + BrowserBindingUtils.writeJSON(jsonObject, request, response); + } + + /** + * getContentStream. + */ + public static void getContentStream(CallContext context, CmisService service, String repositoryId, + HttpServletRequest request, HttpServletResponse response) throws Exception { + // get parameters + String objectId = context.get(BrowserBindingUtils.CONTEXT_OBJECT_ID); + String streamId = getStringParameter(request, Constants.PARAM_STREAM_ID); + + BigInteger offset = null; + String offsetStr = context.get(CallContext.OFFSET); + if (offsetStr != null) { + offset = new BigInteger(offsetStr); + } + + BigInteger length = null; + String lengthStr = context.get(CallContext.LENGTH); + if (lengthStr != null) { + length = new BigInteger(offsetStr); + } + + // execute + ContentStream content = service.getContentStream(repositoryId, objectId, streamId, offset, length, null); + + if ((content == null) || (content.getStream() == null)) { + throw new CmisRuntimeException("Content stream is null!"); + } + + String contentType = content.getMimeType(); + if (contentType == null) { + contentType = Constants.MEDIATYPE_OCTETSTREAM; + } + + // set headers + if ((offset == null) && (length == null)) { + response.setStatus(HttpServletResponse.SC_OK); + } else { + response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT); + } + response.setContentType(contentType); + + // send content + InputStream in = new BufferedInputStream(content.getStream(), BUFFER_SIZE); + OutputStream out = new BufferedOutputStream(response.getOutputStream()); + + byte[] buffer = new byte[BUFFER_SIZE]; + int b; + while ((b = in.read(buffer)) > -1) { + out.write(buffer, 0, b); + } + + in.close(); + out.flush(); + } +} Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java Tue Oct 5 14:55:55 2010 @@ -0,0 +1,66 @@ +/* + * 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.chemistry.opencmis.server.impl.browser; + +import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter; + +import java.util.Collections; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.chemistry.opencmis.commons.data.RepositoryInfo; +import org.apache.chemistry.opencmis.commons.impl.Constants; +import org.apache.chemistry.opencmis.commons.impl.UrlBuilder; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.server.impl.CallContextImpl; +import org.apache.chemistry.opencmis.server.impl.browser.json.JSONConverter; +import org.json.simple.JSONObject; + +public final class RepositoryService { + + @SuppressWarnings("unchecked") + public static void getRepositories(CallContext context, CmisService service, HttpServletRequest request, + HttpServletResponse response) throws Exception { + // get parameters + String repositoryId = getStringParameter(request, Constants.PARAM_REPOSITORY_ID); + + // execute + List infoDataList = null; + if (repositoryId == null) { + infoDataList = service.getRepositoryInfos(null); + } else { + infoDataList = Collections.singletonList(service.getRepositoryInfo(repositoryId, null)); + if (context instanceof CallContextImpl) { + ((CallContextImpl) context).put(CallContext.REPOSITORY_ID, repositoryId); + } + } + + UrlBuilder baseUrl = BrowserBindingUtils.compileBaseUrl(request, null); + + JSONObject result = new JSONObject(); + for (RepositoryInfo ri : infoDataList) { + result.put(ri.getId(), JSONConverter.convert(ri, baseUrl)); + } + + BrowserBindingUtils.writeJSON(result, request, response); + } +} Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java?rev=1004660&r1=1004659&r2=1004660&view=diff ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java (original) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConstants.java Tue Oct 5 14:55:55 2010 @@ -20,22 +20,27 @@ package org.apache.chemistry.opencmis.se public class JSONConstants { - public final static String JSON_REPINFO_ID = "repositoryId"; - public final static String JSON_REPINFO_NAME = "repositoryName"; - public final static String JSON_REPINFO_DESCRIPTION = "repositoryDescription"; - public final static String JSON_REPINFO_VENDOR = "vendorName"; - public final static String JSON_REPINFO_PRODUCT = "productName"; - public final static String JSON_REPINFO_PRODUCT_VERSION = "productVersion"; - public final static String JSON_REPINFO_ROOT_FOLDER_ID = "rootFolderId"; - public final static String JSON_REPINFO_CAPABILITIES = "capabilities"; - public final static String JSON_REPINFO_ACL_CAPABILITIES = "aclCapabilities"; - public final static String JSON_REPINFO_CHANGE_LOCK_TOKEN = "latestChangeLogToken"; - public final static String JSON_REPINFO_CMIS_VERSION_SUPPORTED = "cmisVersionSupported"; - public final static String JSON_REPINFO_THIN_CLIENT_URI = "thinClientURI"; - public final static String JSON_REPINFO_CHANGES_INCOMPLETE = "changesIncomplete"; - public final static String JSON_REPINFO_CHANGES_ON_TYPE = "changesOnType"; - public final static String JSON_REPINFO_PRINCIPAL_ID_ANONYMOUS = "principalIdAnonymous"; - public final static String JSON_REPINFO_PRINCIPAL_ID_ANYONE = "principalIdAnyone"; + public final static String ERROR_INFO = "responseInfo"; + public final static String ERROR_CODE = "statusCode"; + public final static String ERROR_MESSAGE = "message"; + + public final static String REPINFO_ID = "repositoryId"; + public final static String REPINFO_NAME = "repositoryName"; + public final static String REPINFO_DESCRIPTION = "repositoryDescription"; + public final static String REPINFO_VENDOR = "vendorName"; + public final static String REPINFO_PRODUCT = "productName"; + public final static String REPINFO_PRODUCT_VERSION = "productVersion"; + public final static String REPINFO_ROOT_FOLDER_ID = "rootFolderId"; + public final static String REPINFO_ROOT_FOLDER_URL = "rootFolderUrl"; + public final static String REPINFO_CAPABILITIES = "capabilities"; + public final static String REPINFO_ACL_CAPABILITIES = "aclCapabilities"; + public final static String REPINFO_CHANGE_LOCK_TOKEN = "latestChangeLogToken"; + public final static String REPINFO_CMIS_VERSION_SUPPORTED = "cmisVersionSupported"; + public final static String REPINFO_THIN_CLIENT_URI = "thinClientURI"; + public final static String REPINFO_CHANGES_INCOMPLETE = "changesIncomplete"; + public final static String REPINFO_CHANGES_ON_TYPE = "changesOnType"; + public final static String REPINFO_PRINCIPAL_ID_ANONYMOUS = "principalIdAnonymous"; + public final static String REPINFO_PRINCIPAL_ID_ANYONE = "principalIdAnyone"; public final static String JSON_CAP_CONTENT_STREAM_UPDATES = "contentStreamUpdates"; public final static String JSON_CAP_CHANGES = "changes"; Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java?rev=1004660&r1=1004659&r2=1004660&view=diff ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java (original) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/json/JSONConverter.java Tue Oct 5 14:55:55 2010 @@ -46,6 +46,7 @@ import org.apache.chemistry.opencmis.com import org.apache.chemistry.opencmis.commons.enums.Action; import org.apache.chemistry.opencmis.commons.enums.BaseTypeId; import org.apache.chemistry.opencmis.commons.enums.PropertyType; +import org.apache.chemistry.opencmis.commons.impl.UrlBuilder; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -61,26 +62,30 @@ public class JSONConverter extends JSONC * Converts a repository info object. */ @SuppressWarnings("unchecked") - public static JSONObject convert(RepositoryInfo repositoryInfo) { + public static JSONObject convert(RepositoryInfo repositoryInfo, UrlBuilder baseUrl) { if (repositoryInfo == null) { return null; } + UrlBuilder repUrl = new UrlBuilder(baseUrl); + repUrl.addPathSegment(repositoryInfo.getId()); + JSONObject result = new JSONObject(); - result.put(JSON_REPINFO_ID, repositoryInfo.getId()); - result.put(JSON_REPINFO_NAME, repositoryInfo.getName()); - result.put(JSON_REPINFO_DESCRIPTION, repositoryInfo.getDescription()); - result.put(JSON_REPINFO_VENDOR, repositoryInfo.getVendorName()); - result.put(JSON_REPINFO_PRODUCT, repositoryInfo.getProductName()); - result.put(JSON_REPINFO_PRODUCT_VERSION, repositoryInfo.getProductVersion()); - result.put(JSON_REPINFO_ROOT_FOLDER_ID, repositoryInfo.getRootFolderId()); - result.put(JSON_REPINFO_CAPABILITIES, convert(repositoryInfo.getCapabilities())); - result.put(JSON_REPINFO_ACL_CAPABILITIES, convert(repositoryInfo.getAclCapabilities())); - result.put(JSON_REPINFO_CHANGE_LOCK_TOKEN, repositoryInfo.getLatestChangeLogToken()); - result.put(JSON_REPINFO_CMIS_VERSION_SUPPORTED, repositoryInfo.getCmisVersionSupported()); - result.put(JSON_REPINFO_THIN_CLIENT_URI, repositoryInfo.getThinClientUri()); - result.put(JSON_REPINFO_CHANGES_INCOMPLETE, repositoryInfo.getChangesIncomplete()); + result.put(REPINFO_ID, repositoryInfo.getId()); + result.put(REPINFO_NAME, repositoryInfo.getName()); + result.put(REPINFO_DESCRIPTION, repositoryInfo.getDescription()); + result.put(REPINFO_VENDOR, repositoryInfo.getVendorName()); + result.put(REPINFO_PRODUCT, repositoryInfo.getProductName()); + result.put(REPINFO_PRODUCT_VERSION, repositoryInfo.getProductVersion()); + result.put(REPINFO_ROOT_FOLDER_ID, repositoryInfo.getRootFolderId()); + result.put(REPINFO_ROOT_FOLDER_URL, (new UrlBuilder(repUrl)).toString()); + result.put(REPINFO_CAPABILITIES, convert(repositoryInfo.getCapabilities())); + result.put(REPINFO_ACL_CAPABILITIES, convert(repositoryInfo.getAclCapabilities())); + result.put(REPINFO_CHANGE_LOCK_TOKEN, repositoryInfo.getLatestChangeLogToken()); + result.put(REPINFO_CMIS_VERSION_SUPPORTED, repositoryInfo.getCmisVersionSupported()); + result.put(REPINFO_THIN_CLIENT_URI, repositoryInfo.getThinClientUri()); + result.put(REPINFO_CHANGES_INCOMPLETE, repositoryInfo.getChangesIncomplete()); if (repositoryInfo.getChangesOnType() != null) { JSONArray changesOnType = new JSONArray(); @@ -89,11 +94,11 @@ public class JSONConverter extends JSONC changesOnType.add(getJSONStringValue(type)); } - result.put(JSON_REPINFO_CHANGES_ON_TYPE, changesOnType); + result.put(REPINFO_CHANGES_ON_TYPE, changesOnType); } - result.put(JSON_REPINFO_PRINCIPAL_ID_ANONYMOUS, repositoryInfo.getPrincipalIdAnonymous()); - result.put(JSON_REPINFO_PRINCIPAL_ID_ANYONE, repositoryInfo.getPrincipalIdAnyone()); + result.put(REPINFO_PRINCIPAL_ID_ANONYMOUS, repositoryInfo.getPrincipalIdAnonymous()); + result.put(REPINFO_PRINCIPAL_ID_ANYONE, repositoryInfo.getPrincipalIdAnyone()); return result; } @@ -199,22 +204,19 @@ public class JSONConverter extends JSONC JSONObject properties = new JSONObject(); for (PropertyData prop : object.getProperties().getPropertyList()) { - JSONArray propertyValues = new JSONArray(); - if (prop.getValues() != null) { + if (prop.getValues() == null) { + properties.put(prop.getId(), null); + } else if (prop.getValues().size() == 1) { + properties.put(prop.getId(), getJSONValue(prop.getValues().get(0))); + } else { + JSONArray values = new JSONArray(); + for (Object value : prop.getValues()) { - propertyValues.add(getJSONValue(value)); + values.add(getJSONValue(value)); } - } - JSONObject propertyObject = new JSONObject(); - propertyObject.put(JSON_PROPERTY_ID, prop.getId()); - propertyObject.put(JSON_PROPERTY_LOCAL_NAME, prop.getLocalName()); - propertyObject.put(JSON_PROPERTY_DISPLAY_NAME, prop.getDisplayName()); - propertyObject.put(JSON_PROPERTY_QUERY_NAME, prop.getQueryName()); - propertyObject.put(JSON_PROPERTY_VALUES, propertyValues); - propertyObject.put(JSON_PROPERTY_DATATYPE, getJSONPropertyDataType(prop)); - - properties.put(prop.getId(), propertyObject); + properties.put(prop.getId(), values); + } } result.put(JSON_OBJECT_PROPERTIES, properties); @@ -380,10 +382,10 @@ public class JSONConverter extends JSONC JSONObject result = new JSONObject(); if (objectInFolderList.getObjects() != null) { - JSONArray objects = new JSONArray(); + JSONObject objects = new JSONObject(); for (ObjectInFolderData object : objectInFolderList.getObjects()) { - objects.add(convert(object)); + objects.put(object.getObject().getId(), convert(object)); } result.put(JSON_OBJECTINFOLDERLIST_OBJECTS, objects); Modified: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/WEB-INF/web.xml?rev=1004660&r1=1004659&r2=1004660&view=diff ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/WEB-INF/web.xml (original) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/WEB-INF/web.xml Tue Oct 5 14:55:55 2010 @@ -24,7 +24,7 @@ OpenCMIS Server - index.jsp + index.html @@ -46,18 +46,19 @@ org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet callContextHandler - org.apache.chemistry.opencmis.server.impl.atompub.BasicAuthCallContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler 2 cmisbrowser - com.sun.jersey.spi.container.servlet.ServletContainer + org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet - javax.ws.rs.Application - org.apache.chemistry.opencmis.server.impl.browser.CmisApplication + callContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler + 2 Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html Tue Oct 5 14:55:55 2010 @@ -0,0 +1,134 @@ + + + +OpenCMIS Browser Binding Demo + + + + + + +

OpenCMIS Browser Binding - Demo

+
+
+repositoryInfo +
+
+
+objectInfo +
+
+
+folderInfo +
+ + + + \ No newline at end of file Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/demo.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html?rev=1004660&view=auto ============================================================================== --- incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html (added) +++ incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html Tue Oct 5 14:55:55 2010 @@ -0,0 +1,63 @@ + + + +OpenCMIS Browser Binding + + + + +

OpenCMIS Browser Binding

+ +

Browser Binding

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
access by object idaccess by path
Object Data (object id 100 [root folder])browser/A1?objectId=100&method=getObjectbrowser/A1/?method=getObject
Object Data (object id 133 [document in root folder])browser/A1?objectId=133&method=getObjectbrowser/A1/My_Document-0-1?method=getObject
Content (object id 133 [document in root folder])browser/A1?objectId=133browser/A1/My_Document-0-1
Folder children (object id 100 [root folder])browser/A1?objectId=100browser/A1/
Folder children (object id 101 [folder in root folder])browser/A1?objectId=101browser/A1/My_Folder-0-0
+ +

AtomPub binding

+AtomPub Service Document + +

WebServices binding

+Web Services Overview + + + \ No newline at end of file Propchange: incubator/chemistry/opencmis-browser-binding/trunk/src/main/webapp/index.html ------------------------------------------------------------------------------ svn:eol-style = native