Package org.apache.chemistry.opencmis.commons.impl.json

Examples of org.apache.chemistry.opencmis.commons.impl.json.JSONObject


        setStatus(request, response, HttpServletResponse.SC_CREATED);
        response.setHeader("Location", location);

        // return object
        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);

        writeJSON(jsonObject, request, response);
    }
View Full Code Here


        setStatus(request, response, HttpServletResponse.SC_CREATED);
        response.setHeader("Location", location);

        // return object
        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);

        writeJSON(jsonObject, request, response);
    }
View Full Code Here

        if (results == null) {
            throw new CmisRuntimeException("Results are null!");
        }

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonResults = JSONConverter.convert(results, typeCache, true);

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonResults, request, response);
    }
View Full Code Here

        Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
        ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties, filter,
                includePolicyIds, includeAcl, maxItems, null);

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, false);
        jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonChanges, request, response);
    }
View Full Code Here

        if (transaction == null) {
            setStatus(request, response, statusCode);
            response.setContentType(JSON_MIME_TYPE);

            JSONObject jsonResponse = new JSONObject();
            jsonResponse.put(ERROR_EXCEPTION, exceptionName);
            jsonResponse.put(ERROR_MESSAGE, ex.getMessage());

            String st = ExceptionHelper.getStacktraceAsString(ex);
            if (st != null) {
                jsonResponse.put(ERROR_STACKTRACE, st);
            }

            try {
                writeJSON(jsonResponse, request, response);
            } catch (Exception e) {
View Full Code Here

        if (children == null) {
            throw new CmisRuntimeException("Children are null!");
        }

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonChildren = JSONConverter.convert(children, typeCache);

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonChildren, request, response);
    }
View Full Code Here

        if (parent == null) {
            throw new CmisRuntimeException("Parent is null!");
        }

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonObject = JSONConverter.convert(parent, typeCache, false);

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonObject, request, response);
    }
View Full Code Here

        if (checkedout == null) {
            throw new CmisRuntimeException("Checked out list is null!");
        }

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonCheckedOut = JSONConverter.convert(checkedout, typeCache, false);

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonCheckedOut, request, response);
    }
View Full Code Here

            throw new CmisRuntimeException("PWC is null!");
        }

        // return object
        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);

        // set headers
        String location = compileUrl(compileBaseUrl(request, repositoryId), RESOURCE_CONTENT, object.getId());

        setStatus(request, response, HttpServletResponse.SC_CREATED);
View Full Code Here

        if (object == null) {
            throw new CmisRuntimeException("New version is null!");
        }

        // return object
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);

        String location = compileUrl(compileBaseUrl(request, repositoryId), RESOURCE_CONTENT, object.getId());

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        response.setHeader("Location", location);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.