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

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


        RepositoryInfo ri = service.getRepositoryInfo(repositoryId, null);

        String repositoryUrl = BrowserBindingUtils.compileRepositoryUrl(request, ri.getId()).toString();
        String rootUrl = BrowserBindingUtils.compileRootUrl(request, ri.getId()).toString();

        JSONObject result = new JSONObject();
        result.put(ri.getId(), JSONConverter.convert(ri, repositoryUrl, rootUrl));

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


        BigInteger skipCount = getBigIntegerParameter(request, PARAM_SKIP_COUNT);

        // execute
        TypeDefinitionList typeList = service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions,
                maxItems, skipCount, null);
        JSONObject jsonTypeList = JSONConverter.convert(typeList);

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

        // get parameters
        String typeId = getStringParameter(request, PARAM_TYPE_ID);

        // execute
        TypeDefinition type = service.getTypeDefinition(repositoryId, typeId, null);
        JSONObject jsonType = JSONConverter.convert(type);

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

        @SuppressWarnings("unchecked")
        TypeDefinition typeIn = JSONConverter.convertTypeDefinition((Map<String, Object>) typeJson);

        // execute
        TypeDefinition typeOut = service.createType(repositoryId, typeIn, null);
        JSONObject jsonType = JSONConverter.convert(typeOut);

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

        @SuppressWarnings("unchecked")
        TypeDefinition typeIn = JSONConverter.convertTypeDefinition((Map<String, Object>) typeJson);

        // execute
        TypeDefinition typeOut = service.updateType(repositoryId, typeIn, null);
        JSONObject jsonType = JSONConverter.convert(typeOut);

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

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

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

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, token,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
View Full Code Here

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

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

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, token,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
View Full Code Here

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

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

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, token,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
View Full Code Here

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

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

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, token,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
View Full Code Here

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

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

        setStatus(request, response, HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, token,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));
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.