Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96A87DE0A for ; Tue, 28 May 2013 07:25:01 +0000 (UTC) Received: (qmail 86745 invoked by uid 500); 28 May 2013 07:24:58 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 86072 invoked by uid 500); 28 May 2013 07:24:50 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 85590 invoked by uid 99); 28 May 2013 07:24:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 07:24:42 +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; Tue, 28 May 2013 07:24:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DEE292388CCE for ; Tue, 28 May 2013 07:22:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r863410 [22/39] - in /websites/staging/chemistry/trunk/content: ./ java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/ java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/css/ java/0.9.0/... Date: Tue, 28 May 2013 07:22:44 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130528072251.DEE292388CCE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.html (added) +++ websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.html Tue May 28 07:22:41 2013 @@ -0,0 +1,262 @@ + + + + +ControlParser xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.browser;
+20  
+21  import java.util.ArrayList;
+22  import java.util.Collections;
+23  import java.util.HashMap;
+24  import java.util.LinkedHashMap;
+25  import java.util.List;
+26  import java.util.Locale;
+27  import java.util.Map;
+28  
+29  import javax.servlet.http.HttpServletRequest;
+30  
+31  import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+32  import org.apache.chemistry.opencmis.commons.impl.Constants;
+33  
+34  /**
+35   * Parses HTML form controls.
+36   */
+37  public class ControlParser {
+38  
+39      public static final String CONTROL_PROP_ID_LOWER = "propertyid";
+40      private static final String CONTROL_PROP_VALUE_LOWER = "propertyvalue";
+41  
+42      private final HttpServletRequest request;
+43  
+44      private final Map<String, String> zeroDim = new HashMap<String, String>();
+45      private final Map<String, Map<Integer, String>> oneDim = new HashMap<String, Map<Integer, String>>();
+46      private final Map<String, Map<Integer, Map<Integer, String>>> twoDim = new HashMap<String, Map<Integer, Map<Integer, String>>>();
+47  
+48      public ControlParser(HttpServletRequest request) {
+49          this.request = request;
+50          parse();
+51      }
+52  
+53      @SuppressWarnings("unchecked")
+54      private void parse() {
+55          // gather all controls
+56          Map<String, String[]> controls = request.getParameterMap();
+57          for (Map.Entry<String, String[]> control : controls.entrySet()) {
+58              String controlName = control.getKey().trim().toLowerCase(Locale.ENGLISH);
+59  
+60              int firstIndex = getFirstIndex(controlName);
+61  
+62              if (firstIndex == -1) {
+63                  zeroDim.put(controlName, control.getValue()[0]);
+64              } else {
+65                  String strippedControlName = controlName.substring(0, controlName.indexOf('['));
+66                  int secondIndex = getSecondIndex(controlName);
+67  
+68                  if (secondIndex == -1) {
+69                      Map<Integer, String> values = oneDim.get(strippedControlName);
+70                      if (values == null) {
+71                          values = new HashMap<Integer, String>();
+72                          oneDim.put(strippedControlName, values);
+73                      }
+74  
+75                      values.put(firstIndex, control.getValue()[0]);
+76                  } else {
+77                      Map<Integer, Map<Integer, String>> values = twoDim.get(strippedControlName);
+78                      if (values == null) {
+79                          values = new HashMap<Integer, Map<Integer, String>>();
+80                          twoDim.put(strippedControlName, values);
+81                      }
+82  
+83                      Map<Integer, String> list = values.get(firstIndex);
+84                      if (list == null) {
+85                          list = new HashMap<Integer, String>();
+86                          values.put(firstIndex, list);
+87                      }
+88  
+89                      list.put(secondIndex, control.getValue()[0]);
+90                  }
+91              }
+92          }
+93      }
+94  
+95      private static int getFirstIndex(String controlName) {
+96          int result = -1;
+97  
+98          int open = controlName.indexOf('[');
+99          int close = controlName.indexOf(']');
+100 
+101         if (open == -1 || close == -1 || close < open) {
+102             return result;
+103         }
+104 
+105         String indexStr = controlName.substring(open + 1, close);
+106         try {
+107             result = Integer.parseInt(indexStr);
+108             if (result < 0) {
+109                 result = -1;
+110             }
+111         } catch (NumberFormatException e) {
+112         }
+113 
+114         return result;
+115     }
+116 
+117     private static int getSecondIndex(String controlName) {
+118         int result = -1;
+119 
+120         int open = controlName.indexOf("][");
+121         int close = controlName.lastIndexOf(']');
+122 
+123         if (open == -1 || close == -1 || close < open) {
+124             return result;
+125         }
+126 
+127         String indexStr = controlName.substring(open + 2, close);
+128         try {
+129             result = Integer.parseInt(indexStr);
+130             if (result < 0) {
+131                 result = -1;
+132             }
+133         } catch (NumberFormatException e) {
+134         }
+135 
+136         return result;
+137     }
+138 
+139     private static List<String> convertToList(String controlName, Map<Integer, String> map) {
+140         if (map == null) {
+141             return null;
+142         }
+143 
+144         int count = map.size();
+145         List<String> result = new ArrayList<String>(count);
+146 
+147         for (int i = 0; i < count; i++) {
+148             String value = map.get(i);
+149             if (value == null) {
+150                 throw new CmisInvalidArgumentException(controlName + " has gaps!");
+151             }
+152             result.add(value);
+153         }
+154 
+155         return result;
+156     }
+157 
+158     public String getValue(String controlName) {
+159         if (controlName == null) {
+160             throw new IllegalArgumentException("controlName must not be null!");
+161         }
+162 
+163         return zeroDim.get(controlName.toLowerCase(Locale.ENGLISH));
+164     }
+165 
+166     public List<String> getValues(String controlName) {
+167         if (controlName == null) {
+168             throw new IllegalArgumentException("controlName must not be null!");
+169         }
+170 
+171         return convertToList(controlName, oneDim.get(controlName.toLowerCase(Locale.ENGLISH)));
+172     }
+173 
+174     public List<String> getValues(String controlName, int index) {
+175         if (controlName == null) {
+176             throw new IllegalArgumentException("controlName must not be null!");
+177         }
+178 
+179         Map<Integer, Map<Integer, String>> map = twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
+180         if (map == null) {
+181             return null;
+182         }
+183 
+184         return convertToList(controlName, map.get(index));
+185     }
+186 
+187     public Map<Integer, String> getOneDimMap(String controlName) {
+188         if (controlName == null) {
+189             throw new IllegalArgumentException("controlName must not be null!");
+190         }
+191 
+192         return oneDim.get(controlName.toLowerCase(Locale.ENGLISH));
+193     }
+194 
+195     public Map<Integer, Map<Integer, String>> getTwoDimMap(String controlName) {
+196         if (controlName == null) {
+197             throw new IllegalArgumentException("controlName must not be null!");
+198         }
+199 
+200         return twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
+201     }
+202 
+203     public Map<String, List<String>> getProperties() {
+204         Map<Integer, String> propertyIds = oneDim.get(CONTROL_PROP_ID_LOWER);
+205         if (propertyIds == null) {
+206             return null;
+207         }
+208 
+209         Map<Integer, String> oneDimPropValues = oneDim.get(CONTROL_PROP_VALUE_LOWER);
+210         Map<Integer, Map<Integer, String>> twoDimPropValues = twoDim.get(CONTROL_PROP_VALUE_LOWER);
+211 
+212         int count = propertyIds.size();
+213         Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
+214 
+215         for (int i = 0; i < count; i++) {
+216             String propertyId = propertyIds.get(i);
+217             if (propertyId == null) {
+218                 throw new CmisInvalidArgumentException(Constants.CONTROL_PROP_ID + " has gaps!");
+219             }
+220 
+221             List<String> values = null;
+222             if (oneDimPropValues != null && oneDimPropValues.containsKey(i)) {
+223                 values = Collections.singletonList(oneDimPropValues.get(i));
+224             } else if (twoDimPropValues != null && twoDimPropValues.containsKey(i)) {
+225                 values = new ArrayList<String>();
+226 
+227                 Map<Integer, String> valuesMap = twoDimPropValues.get(i);
+228                 if (valuesMap != null) {
+229                     int valueCount = valuesMap.size();
+230 
+231                     for (int j = 0; j < valueCount; j++) {
+232                         String value = valuesMap.get(j);
+233                         if (value == null) {
+234                             throw new CmisInvalidArgumentException(Constants.CONTROL_PROP_VALUE + "[" + i
+235                                     + "] has gaps!");
+236                         }
+237 
+238                         values.add(value);
+239                     }
+240                 }
+241             }
+242 
+243             result.put(propertyId, values);
+244         }
+245 
+246         return result;
+247     }
+248 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.html (added) +++ websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.html Tue May 28 07:22:41 2013 @@ -0,0 +1,128 @@ + + + + +DiscoveryService xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.browser;
+20  
+21  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_ACL;
+22  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_CHANGE_LOG_TOKEN;
+23  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_FILTER;
+24  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_POLICY_IDS;
+25  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_PROPERTIES;
+26  
+27  import java.math.BigInteger;
+28  
+29  import javax.servlet.http.HttpServletRequest;
+30  import javax.servlet.http.HttpServletResponse;
+31  
+32  import org.apache.chemistry.opencmis.commons.data.ObjectList;
+33  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+34  import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+35  import org.apache.chemistry.opencmis.commons.impl.Constants;
+36  import org.apache.chemistry.opencmis.commons.impl.JSONConstants;
+37  import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+38  import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+39  import org.apache.chemistry.opencmis.commons.impl.json.JSONObject;
+40  import org.apache.chemistry.opencmis.commons.server.CallContext;
+41  import org.apache.chemistry.opencmis.commons.server.CmisService;
+42  import org.apache.chemistry.opencmis.commons.spi.Holder;
+43  
+44  /**
+45   * Discovery Service operations.
+46   */
+47  public class DiscoveryService {
+48  
+49      /**
+50       * query.
+51       */
+52      public static class Query extends AbstractBrowserServiceCall {
+53          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+54                  HttpServletResponse response) throws Exception {
+55              // get parameters
+56              String statement = getStringParameter(request, Constants.PARAM_STATEMENT);
+57              if (statement == null || statement.length() == 0) {
+58                  statement = getStringParameter(request, Constants.PARAM_Q);
+59              }
+60              Boolean searchAllVersions = getBooleanParameter(request, Constants.PARAM_SEARCH_ALL_VERSIONS);
+61              Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+62              IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+63                      IncludeRelationships.class);
+64              String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER);
+65              BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
+66              BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT);
+67              boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+68  
+69              // execute
+70              ObjectList results = service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+71                      includeRelationships, renditionFilter, maxItems, skipCount, null);
+72  
+73              if (results == null) {
+74                  throw new CmisRuntimeException("Results are null!");
+75              }
+76  
+77              TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+78              JSONObject jsonResults = JSONConverter.convert(results, typeCache, JSONConverter.PropertyMode.QUERY,
+79                      succinct);
+80  
+81              response.setStatus(HttpServletResponse.SC_OK);
+82              writeJSON(jsonResults, request, response);
+83          }
+84      }
+85  
+86      /**
+87       * getContentChanges.
+88       */
+89      public static class GetContentChanges extends AbstractBrowserServiceCall {
+90          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+91                  HttpServletResponse response) throws Exception {
+92              // get parameters
+93              String changeLogToken = getStringParameter(request, PARAM_CHANGE_LOG_TOKEN);
+94              Boolean includeProperties = getBooleanParameter(request, PARAM_PROPERTIES);
+95              String filter = getStringParameter(request, PARAM_FILTER);
+96              Boolean includePolicyIds = getBooleanParameter(request, PARAM_POLICY_IDS);
+97              Boolean includeAcl = getBooleanParameter(request, PARAM_ACL);
+98              BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
+99              boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+100 
+101             Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
+102             ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
+103                     filter, includePolicyIds, includeAcl, maxItems, null);
+104 
+105             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+106             JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, JSONConverter.PropertyMode.CHANGE,
+107                     succinct);
+108             jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());
+109 
+110             response.setStatus(HttpServletResponse.SC_OK);
+111             writeJSON(jsonChanges, request, response);
+112         }
+113     }
+114 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.html (added) +++ websites/staging/chemistry/trunk/content/java/0.9.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.html Tue May 28 07:22:41 2013 @@ -0,0 +1,125 @@ + + + + +MultiFilingService xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.browser;
+20  
+21  import static org.apache.chemistry.opencmis.commons.impl.Constants.PARAM_FOLDER_ID;
+22  
+23  import javax.servlet.http.HttpServletRequest;
+24  import javax.servlet.http.HttpServletResponse;
+25  
+26  import org.apache.chemistry.opencmis.commons.data.ObjectData;
+27  import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+28  import org.apache.chemistry.opencmis.commons.impl.Constants;
+29  import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+30  import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+31  import org.apache.chemistry.opencmis.commons.impl.json.JSONObject;
+32  import org.apache.chemistry.opencmis.commons.server.CallContext;
+33  import org.apache.chemistry.opencmis.commons.server.CmisService;
+34  import org.apache.chemistry.opencmis.commons.spi.Holder;
+35  
+36  /**
+37   * MultiFiling Service operations.
+38   */
+39  public class MultiFilingService {
+40  
+41      /*
+42       * addObjectToFolder.
+43       */
+44      public static class AddObjectToFolder extends AbstractBrowserServiceCall {
+45          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+46                  HttpServletResponse response) throws Exception {
+47              // get parameters
+48              String objectId = ((BrowserCallContextImpl) context).getObjectId();
+49              String folderId = getStringParameter(request, PARAM_FOLDER_ID);
+50              Boolean allVersions = getBooleanParameter(request, Constants.PARAM_ALL_VERSIONS);
+51              boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+52  
+53              // execute
+54              Holder<String> objectIdHolder = new Holder<String>(objectId);
+55              service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, null);
+56  
+57              String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
+58  
+59              ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
+60              if (object == null) {
+61                  throw new CmisRuntimeException("Object is null!");
+62              }
+63  
+64              // set headers
+65              setStatus(request, response, HttpServletResponse.SC_CREATED);
+66              response.setHeader("Location", compileObjectLocationUrl(request, repositoryId, newObjectId));
+67  
+68              // return object
+69              TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+70              JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
+71                      succinct);
+72  
+73              writeJSON(jsonObject, request, response);
+74          }
+75      }
+76  
+77      /*
+78       * removeObjectFromFolder.
+79       */
+80      public static class RemoveObjectFromFolder extends AbstractBrowserServiceCall {
+81          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+82                  HttpServletResponse response) throws Exception {
+83              // get parameters
+84              String objectId = ((BrowserCallContextImpl) context).getObjectId();
+85              String folderId = getStringParameter(request, PARAM_FOLDER_ID);
+86              boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+87  
+88              // execute
+89              Holder<String> objectIdHolder = new Holder<String>(objectId);
+90              service.removeObjectFromFolder(repositoryId, objectId, folderId, null);
+91  
+92              String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
+93  
+94              ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
+95              if (object == null) {
+96                  throw new CmisRuntimeException("Object is null!");
+97              }
+98  
+99              // set headers
+100             setStatus(request, response, HttpServletResponse.SC_CREATED);
+101             response.setHeader("Location", compileObjectLocationUrl(request, repositoryId, newObjectId));
+102 
+103             // return object
+104             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+105             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
+106                     succinct);
+107 
+108             writeJSON(jsonObject, request, response);
+109         }
+110     }
+111 }
+
+
+ +