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 9A7E117968 for ; Mon, 6 Apr 2015 17:13:38 +0000 (UTC) Received: (qmail 47238 invoked by uid 500); 6 Apr 2015 17:13:37 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 47090 invoked by uid 500); 6 Apr 2015 17:13:37 -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 45223 invoked by uid 99); 6 Apr 2015 17:13:36 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2015 17:13:36 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id E5613AC0E1C for ; Mon, 6 Apr 2015 17:13:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r946531 [24/44] - in /websites/staging/chemistry/trunk/content: ./ java/0.13.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/ java/0.13.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/css/ java/0.13... Date: Mon, 06 Apr 2015 17:13:32 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150406171335.E5613AC0E1C@hades.apache.org> Added: websites/staging/chemistry/trunk/content/java/0.13.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.13.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.13.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.html Mon Apr 6 17:13:30 2015 @@ -0,0 +1,268 @@ + + + + +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          if (controls == null) {
+58              return;
+59          }
+60  
+61          for (Map.Entry<String, String[]> control : controls.entrySet()) {
+62              String controlName = control.getKey().trim().toLowerCase(Locale.ENGLISH);
+63  
+64              int firstIndex = getFirstIndex(controlName);
+65  
+66              if (firstIndex == -1) {
+67                  zeroDim.put(controlName, control.getValue()[0]);
+68              } else {
+69                  String strippedControlName = controlName.substring(0, controlName.indexOf('['));
+70                  int secondIndex = getSecondIndex(controlName);
+71  
+72                  if (secondIndex == -1) {
+73                      Map<Integer, String> values = oneDim.get(strippedControlName);
+74                      if (values == null) {
+75                          values = new HashMap<Integer, String>();
+76                          oneDim.put(strippedControlName, values);
+77                      }
+78  
+79                      values.put(firstIndex, control.getValue()[0]);
+80                  } else {
+81                      Map<Integer, Map<Integer, String>> values = twoDim.get(strippedControlName);
+82                      if (values == null) {
+83                          values = new HashMap<Integer, Map<Integer, String>>();
+84                          twoDim.put(strippedControlName, values);
+85                      }
+86  
+87                      Map<Integer, String> list = values.get(firstIndex);
+88                      if (list == null) {
+89                          list = new HashMap<Integer, String>();
+90                          values.put(firstIndex, list);
+91                      }
+92  
+93                      list.put(secondIndex, control.getValue()[0]);
+94                  }
+95              }
+96          }
+97      }
+98  
+99      private static int getFirstIndex(String controlName) {
+100         int result = -1;
+101 
+102         int open = controlName.indexOf('[');
+103         int close = controlName.indexOf(']');
+104 
+105         if (open == -1 || close == -1 || close < open) {
+106             return result;
+107         }
+108 
+109         String indexStr = controlName.substring(open + 1, close);
+110         try {
+111             result = Integer.parseInt(indexStr);
+112             if (result < 0) {
+113                 result = -1;
+114             }
+115         } catch (NumberFormatException e) {
+116             // return default value (-1)
+117         }
+118 
+119         return result;
+120     }
+121 
+122     private static int getSecondIndex(String controlName) {
+123         int result = -1;
+124 
+125         int open = controlName.indexOf("][");
+126         int close = controlName.lastIndexOf(']');
+127 
+128         if (open == -1 || close == -1 || close < open) {
+129             return result;
+130         }
+131 
+132         String indexStr = controlName.substring(open + 2, close);
+133         try {
+134             result = Integer.parseInt(indexStr);
+135             if (result < 0) {
+136                 result = -1;
+137             }
+138         } catch (NumberFormatException e) {
+139             // return default value (-1)
+140         }
+141 
+142         return result;
+143     }
+144 
+145     private static List<String> convertToList(String controlName, Map<Integer, String> map) {
+146         if (map == null) {
+147             return null;
+148         }
+149 
+150         int count = map.size();
+151         List<String> result = new ArrayList<String>(count);
+152 
+153         for (int i = 0; i < count; i++) {
+154             String value = map.get(i);
+155             if (value == null) {
+156                 throw new CmisInvalidArgumentException(controlName + " has gaps!");
+157             }
+158             result.add(value);
+159         }
+160 
+161         return result;
+162     }
+163 
+164     public String getValue(String controlName) {
+165         if (controlName == null) {
+166             throw new IllegalArgumentException("controlName must not be null!");
+167         }
+168 
+169         return zeroDim.get(controlName.toLowerCase(Locale.ENGLISH));
+170     }
+171 
+172     public List<String> getValues(String controlName) {
+173         if (controlName == null) {
+174             throw new IllegalArgumentException("controlName must not be null!");
+175         }
+176 
+177         return convertToList(controlName, oneDim.get(controlName.toLowerCase(Locale.ENGLISH)));
+178     }
+179 
+180     public List<String> getValues(String controlName, int index) {
+181         if (controlName == null) {
+182             throw new IllegalArgumentException("controlName must not be null!");
+183         }
+184 
+185         Map<Integer, Map<Integer, String>> map = twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
+186         if (map == null) {
+187             return null;
+188         }
+189 
+190         return convertToList(controlName, map.get(index));
+191     }
+192 
+193     public Map<Integer, String> getOneDimMap(String controlName) {
+194         if (controlName == null) {
+195             throw new IllegalArgumentException("controlName must not be null!");
+196         }
+197 
+198         return oneDim.get(controlName.toLowerCase(Locale.ENGLISH));
+199     }
+200 
+201     public Map<Integer, Map<Integer, String>> getTwoDimMap(String controlName) {
+202         if (controlName == null) {
+203             throw new IllegalArgumentException("controlName must not be null!");
+204         }
+205 
+206         return twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
+207     }
+208 
+209     public Map<String, List<String>> getProperties() {
+210         Map<Integer, String> propertyIds = oneDim.get(CONTROL_PROP_ID_LOWER);
+211         if (propertyIds == null) {
+212             return null;
+213         }
+214 
+215         Map<Integer, String> oneDimPropValues = oneDim.get(CONTROL_PROP_VALUE_LOWER);
+216         Map<Integer, Map<Integer, String>> twoDimPropValues = twoDim.get(CONTROL_PROP_VALUE_LOWER);
+217 
+218         int count = propertyIds.size();
+219         Map<String, List<String>> result = new LinkedHashMap<String, List<String>>();
+220 
+221         for (int i = 0; i < count; i++) {
+222             String propertyId = propertyIds.get(i);
+223             if (propertyId == null) {
+224                 throw new CmisInvalidArgumentException(Constants.CONTROL_PROP_ID + " has gaps!");
+225             }
+226 
+227             List<String> values = null;
+228             if (oneDimPropValues != null && oneDimPropValues.containsKey(i)) {
+229                 values = Collections.singletonList(oneDimPropValues.get(i));
+230             } else if (twoDimPropValues != null && twoDimPropValues.containsKey(i)) {
+231                 values = new ArrayList<String>();
+232 
+233                 Map<Integer, String> valuesMap = twoDimPropValues.get(i);
+234                 if (valuesMap != null) {
+235                     int valueCount = valuesMap.size();
+236 
+237                     for (int j = 0; j < valueCount; j++) {
+238                         String value = valuesMap.get(j);
+239                         if (value == null) {
+240                             throw new CmisInvalidArgumentException(Constants.CONTROL_PROP_VALUE + "[" + i
+241                                     + "] has gaps!");
+242                         }
+243 
+244                         values.add(value);
+245                     }
+246                 }
+247             }
+248 
+249             result.put(propertyId, values);
+250         }
+251 
+252         return result;
+253     }
+254 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.13.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.13.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.13.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.html Mon Apr 6 17:13:30 2015 @@ -0,0 +1,159 @@ + + + + +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.DateTimeFormat;
+34  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+35  import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+36  import org.apache.chemistry.opencmis.commons.impl.Constants;
+37  import org.apache.chemistry.opencmis.commons.impl.JSONConstants;
+38  import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+39  import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+40  import org.apache.chemistry.opencmis.commons.impl.json.JSONObject;
+41  import org.apache.chemistry.opencmis.commons.server.CallContext;
+42  import org.apache.chemistry.opencmis.commons.server.CmisService;
+43  import org.apache.chemistry.opencmis.commons.spi.Holder;
+44  
+45  /**
+46   * Discovery Service operations.
+47   */
+48  public class DiscoveryService {
+49  
+50      /**
+51       * query.
+52       */
+53      public static class Query extends AbstractBrowserServiceCall {
+54          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+55                  HttpServletResponse response) throws Exception {
+56              assert context != null;
+57              assert service != null;
+58              assert repositoryId != null;
+59              assert request != null;
+60              assert response != null;
+61  
+62              // get parameters
+63              String statement = getStringParameter(request, Constants.PARAM_STATEMENT);
+64              if (statement == null || statement.length() == 0) {
+65                  statement = getStringParameter(request, Constants.PARAM_Q);
+66              }
+67              Boolean searchAllVersions = getBooleanParameter(request, Constants.PARAM_SEARCH_ALL_VERSIONS);
+68              Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
+69              IncludeRelationships includeRelationships = getEnumParameter(request, Constants.PARAM_RELATIONSHIPS,
+70                      IncludeRelationships.class);
+71              String renditionFilter = getStringParameter(request, Constants.PARAM_RENDITION_FILTER);
+72              BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
+73              BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT);
+74              boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+75              DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+76  
+77              // execute
+78              if (stopBeforeService(service)) {
+79                  return;
+80              }
+81  
+82              ObjectList results = service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+83                      includeRelationships, renditionFilter, maxItems, skipCount, null);
+84  
+85              if (stopAfterService(service)) {
+86                  return;
+87              }
+88  
+89              if (results == null) {
+90                  throw new CmisRuntimeException("Results are null!");
+91              }
+92  
+93              TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+94              JSONObject jsonResults = JSONConverter.convert(results, typeCache, JSONConverter.PropertyMode.QUERY,
+95                      succinct, dateTimeFormat);
+96  
+97              response.setStatus(HttpServletResponse.SC_OK);
+98              writeJSON(jsonResults, request, response);
+99          }
+100     }
+101 
+102     /**
+103      * getContentChanges.
+104      */
+105     public static class GetContentChanges extends AbstractBrowserServiceCall {
+106         public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+107                 HttpServletResponse response) throws Exception {
+108             assert context != null;
+109             assert service != null;
+110             assert repositoryId != null;
+111             assert request != null;
+112             assert response != null;
+113 
+114             // get parameters
+115             String changeLogToken = getStringParameter(request, PARAM_CHANGE_LOG_TOKEN);
+116             Boolean includeProperties = getBooleanParameter(request, PARAM_PROPERTIES);
+117             String filter = getStringParameter(request, PARAM_FILTER);
+118             Boolean includePolicyIds = getBooleanParameter(request, PARAM_POLICY_IDS);
+119             Boolean includeAcl = getBooleanParameter(request, PARAM_ACL);
+120             BigInteger maxItems = getBigIntegerParameter(request, Constants.PARAM_MAX_ITEMS);
+121             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+122             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+123 
+124             if (stopBeforeService(service)) {
+125                 return;
+126             }
+127 
+128             Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
+129             ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
+130                     filter, includePolicyIds, includeAcl, maxItems, null);
+131 
+132             if (stopAfterService(service)) {
+133                 return;
+134             }
+135 
+136             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+137             JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, JSONConverter.PropertyMode.CHANGE,
+138                     succinct, dateTimeFormat);
+139             jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());
+140 
+141             response.setStatus(HttpServletResponse.SC_OK);
+142             writeJSON(jsonChanges, request, response);
+143         }
+144     }
+145 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.13.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.13.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.13.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.html Mon Apr 6 17:13:30 2015 @@ -0,0 +1,156 @@ + + + + +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.enums.DateTimeFormat;
+28  import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+29  import org.apache.chemistry.opencmis.commons.impl.Constants;
+30  import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
+31  import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+32  import org.apache.chemistry.opencmis.commons.impl.json.JSONObject;
+33  import org.apache.chemistry.opencmis.commons.server.CallContext;
+34  import org.apache.chemistry.opencmis.commons.server.CmisService;
+35  import org.apache.chemistry.opencmis.commons.spi.Holder;
+36  
+37  /**
+38   * MultiFiling Service operations.
+39   */
+40  public class MultiFilingService {
+41  
+42      /*
+43       * addObjectToFolder.
+44       */
+45      public static class AddObjectToFolder extends AbstractBrowserServiceCall {
+46          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+47                  HttpServletResponse response) throws Exception {
+48              assert context != null;
+49              assert service != null;
+50              assert repositoryId != null;
+51              assert request != null;
+52              assert response != null;
+53  
+54              // get parameters
+55              String objectId = ((BrowserCallContextImpl) context).getObjectId();
+56              String folderId = getStringParameter(request, PARAM_FOLDER_ID);
+57              Boolean allVersions = getBooleanParameter(request, Constants.PARAM_ALL_VERSIONS);
+58              boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
+59              DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+60  
+61              // execute
+62              if (stopBeforeService(service)) {
+63                  return;
+64              }
+65  
+66              Holder<String> objectIdHolder = new Holder<String>(objectId);
+67              service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, null);
+68  
+69              if (stopAfterService(service)) {
+70                  return;
+71              }
+72  
+73              String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
+74  
+75              ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
+76              if (object == null) {
+77                  throw new CmisRuntimeException("Object is null!");
+78              }
+79  
+80              // set headers
+81              setStatus(request, response, HttpServletResponse.SC_CREATED);
+82              response.setHeader("Location", compileObjectLocationUrl(request, repositoryId, newObjectId));
+83  
+84              // return object
+85              TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+86              JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
+87                      succinct, dateTimeFormat);
+88  
+89              writeJSON(jsonObject, request, response);
+90          }
+91      }
+92  
+93      /*
+94       * removeObjectFromFolder.
+95       */
+96      public static class RemoveObjectFromFolder extends AbstractBrowserServiceCall {
+97          public void serve(CallContext context, CmisService service, String repositoryId, HttpServletRequest request,
+98                  HttpServletResponse response) throws Exception {
+99              assert context != null;
+100             assert service != null;
+101             assert repositoryId != null;
+102             assert request != null;
+103             assert response != null;
+104 
+105             // get parameters
+106             String objectId = ((BrowserCallContextImpl) context).getObjectId();
+107             String folderId = getStringParameter(request, PARAM_FOLDER_ID);
+108             boolean succinct = getBooleanParameter(request, Constants.CONTROL_SUCCINCT, false);
+109             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
+110 
+111             // execute
+112             if (stopBeforeService(service)) {
+113                 return;
+114             }
+115 
+116             Holder<String> objectIdHolder = new Holder<String>(objectId);
+117             service.removeObjectFromFolder(repositoryId, objectId, folderId, null);
+118 
+119             if (stopAfterService(service)) {
+120                 return;
+121             }
+122 
+123             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
+124 
+125             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
+126             if (object == null) {
+127                 throw new CmisRuntimeException("Object is null!");
+128             }
+129 
+130             // set headers
+131             setStatus(request, response, HttpServletResponse.SC_CREATED);
+132             response.setHeader("Location", compileObjectLocationUrl(request, repositoryId, newObjectId));
+133 
+134             // return object
+135             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
+136             JSONObject jsonObject = JSONConverter.convert(object, typeCache, JSONConverter.PropertyMode.OBJECT,
+137                     succinct, dateTimeFormat);
+138 
+139             writeJSON(jsonObject, request, response);
+140         }
+141     }
+142 }
+
+
+ +