Package org.apache.chemistry.opencmis.commons.server

Examples of org.apache.chemistry.opencmis.commons.server.CmisService


    }

    public CmisObjectType getObjectByPath(String repositoryId, String path, String filter,
            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
            Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            return convert(service.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
                    includeAcl, convert(extension)));
        } catch (Exception e) {
            throw convertException(e);
        } finally {
View Full Code Here


        }
    }

    public CmisPropertiesType getProperties(String repositoryId, String objectId, String filter,
            CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            return convert(service.getProperties(repositoryId, objectId, filter, convert(extension)));
        } catch (Exception e) {
            throw convertException(e);
        } finally {
            closeService(service);
        }
View Full Code Here

        }
    }

    public List<CmisRenditionType> getRenditions(String repositoryId, String objectId, String renditionFilter,
            BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            List<CmisRenditionType> result = new ArrayList<CmisRenditionType>();

            List<RenditionData> renditionList = service.getRenditions(repositoryId, objectId, renditionFilter,
                    maxItems, skipCount, convert(extension));

            if (renditionList != null) {
                for (RenditionData rendition : renditionList) {
                    result.add(convert(rendition));
View Full Code Here

        }
    }

    public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
            Holder<CmisExtensionType> extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            org.apache.chemistry.opencmis.commons.spi.Holder<String> objectIdHolder = convertHolder(objectId);
            ExtensionsData extData = convertExtensionHolder(extension);

            service.moveObject(repositoryId, objectIdHolder, targetFolderId, sourceFolderId, extData);

            setHolderValue(objectIdHolder, objectId);
            setExtensionValues(extData, extension);
        } catch (Exception e) {
            throw convertException(e);
View Full Code Here

    }

    public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
            Holder<String> changeToken, CmisContentStreamType contentStream, Holder<CmisExtensionType> extension)
            throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            org.apache.chemistry.opencmis.commons.spi.Holder<String> objectIdHolder = convertHolder(objectId);
            org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
            ExtensionsData extData = convertExtensionHolder(extension);

            service.setContentStream(repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder,
                    convert(contentStream), extData);

            setHolderValue(objectIdHolder, objectId);
            setHolderValue(changeTokenHolder, changeToken);
            setExtensionValues(extData, extension);
View Full Code Here

        }
    }

    public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
            CmisPropertiesType properties, Holder<CmisExtensionType> extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            org.apache.chemistry.opencmis.commons.spi.Holder<String> objectIdHolder = convertHolder(objectId);
            org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
            ExtensionsData extData = convertExtensionHolder(extension);

            service.updateProperties(repositoryId, objectIdHolder, changeTokenHolder, convert(properties), extData);

            setHolderValue(objectIdHolder, objectId);
            setHolderValue(changeTokenHolder, changeToken);
            setExtensionValues(extData, extension);
        } catch (Exception e) {
View Full Code Here

     * Dispatches to feed, entry or whatever.
     */
    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 < 2) {
                // root -> service document
                RepositoryService.getRepositories(context, service, request, response);
                return;
            }

            String method = request.getMethod();
            String repositoryId = pathFragments[0];
            String resource = pathFragments[1];

            // 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) {
                response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "Unknown operation");
            }
        } finally {
            if (service != null) {
                service.close();
            }
        }
    }
View Full Code Here

        }
    }

    public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
            Properties properties, ExtensionsData extension) {
        CmisService service = getService(repositoryId);

        try {
            service.updateProperties(repositoryId, objectId, changeToken, properties, extension);
        } finally {
            service.close();
        }
    }
View Full Code Here

        setServiceFactory(factory);
    }

    public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
            String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
        CmisService service = getService(repositoryId);

        try {
            return service.getContentChanges(repositoryId, changeLogToken, includeProperties, filter, includePolicyIds,
                    includeAcl, maxItems, extension);
        } finally {
            service.close();
        }
    }
View Full Code Here

    }

    public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
        CmisService service = getService(repositoryId);

        try {
            return service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
                    includeRelationships, renditionFilter, maxItems, skipCount, extension);
        } finally {
            service.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.server.CmisService

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.