Examples of CmisService


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

    }

    public List<CmisObjectParentsType> getObjectParents(String repositoryId, String objectId, String filter,
            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
            Boolean includeRelativePathSegment, CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

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

            List<ObjectParentData> serviceResult = service.getObjectParents(repositoryId, objectId, filter,
                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
                    renditionFilter, includeRelativePathSegment, convert(extension));

            if (serviceResult != null) {
                for (ObjectParentData parent : serviceResult) {
View Full Code Here

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

    @Resource
    WebServiceContext wsContext;

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

            ExtensionsData extData = convertExtensionHolder(extension);

            service.cancelCheckOut(repositoryId, objectId, extData);

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

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

    public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, CmisPropertiesType properties,
            CmisContentStreamType contentStream, String checkinComment, List<String> policies,
            CmisAccessControlListType addAces, CmisAccessControlListType removeAces, 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.checkIn(repositoryId, objectIdHolder, major, convert(properties), convert(contentStream),
                    checkinComment, policies, convert(addAces, null), convert(removeAces, null), extData);

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

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

        }
    }

    public void checkOut(String repositoryId, Holder<String> objectId, Holder<CmisExtensionType> extension,
            Holder<Boolean> contentCopied) 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<Boolean> contentCopiedHolder = new org.apache.chemistry.opencmis.commons.spi.Holder<Boolean>();
            ExtensionsData extData = convertExtensionHolder(extension);

            service.checkOut(repositoryId, objectIdHolder, extData, contentCopiedHolder);

            if (contentCopied != null) {
                contentCopied.value = contentCopiedHolder.getValue();
            }
View Full Code Here

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

        }
    }

    public List<CmisObjectType> getAllVersions(String repositoryId, String versionSeriesId, String filter,
            Boolean includeAllowableActions, CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

            List<ObjectData> versions = service.getAllVersions(repositoryId, null, versionSeriesId, filter,
                    includeAllowableActions, convert(extension));

            if (versions == null) {
                return null;
            }
View Full Code Here

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

    public CmisObjectType getObjectOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
            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.getObjectOfLatestVersion(repositoryId, null, versionSeriesId, major, filter,
                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
                    renditionFilter, includePolicyIds, includeAcl, convert(extension)));
        } catch (Exception e) {
            throw convertException(e);
        } finally {
View Full Code Here

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

        }
    }

    public CmisPropertiesType getPropertiesOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
            String filter, CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

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

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

public class RepositoryService extends AbstractService implements RepositoryServicePort {
    @Resource
    WebServiceContext wsContext;

    public List<CmisRepositoryEntryType> getRepositories(CmisExtensionType extension) throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, null);

            List<RepositoryInfo> infoDataList = service.getRepositoryInfos(convert(extension));

            if (infoDataList == null) {
                return null;
            }
View Full Code Here

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

        }
    }

    public CmisRepositoryInfoType getRepositoryInfo(String repositoryId, CmisExtensionType extension)
            throws CmisException {
        CmisService service = null;
        try {
            service = getService(wsContext, repositoryId);

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

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

     * 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
TOP
Copyright © 2018 www.massapi.com. 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.