Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.ObjectData


                return result;
            }
        }

        // get the object
        ObjectData objectData = this.binding.getObjectService().getObject(getRepositoryId(), objectId,
                context.getFilterString(), context.isIncludeAllowableActions(), context.getIncludeRelationships(),
                context.getRenditionFilterString(), context.isIncludePolicies(), context.isIncludeAcls(), null);

        result = getObjectFactory().convertObject(objectData, context);
View Full Code Here


                return result;
            }
        }

        // get the object
        ObjectData objectData = this.binding.getObjectService().getObjectByPath(getRepositoryId(), path,
                context.getFilterString(), context.isIncludeAllowableActions(), context.getIncludeRelationships(),
                context.getRenditionFilterString(), context.isIncludePolicies(), context.isIncludeAcls(), null);

        result = getObjectFactory().convertObject(objectData, context);
View Full Code Here

                put(VERSION_PROPERTY_ID, "ver123");
            }};

        String verIdV1 = createDocument("verdoc1", rootFolderId, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
                propertyMap1, VersioningState.MAJOR, null);
        ObjectData version = fObjSvc.getObject(repositoryId, verIdV1, "*", false, IncludeRelationships.NONE, null,
                false, false, null);

        // get version series id
        String verIdSer = (String) version.getProperties().getProperties().get(PropertyIds.VERSION_SERIES_ID).getFirstValue();

        // create second version
        final Map<String, Object> propertyMap2 =
            new HashMap<String, Object>() {
            {
View Full Code Here

            path = getPropertyValue(PropertyIds.PATH);

            // if the path property isn't set, get it
            if (path == null) {
                String objectId = getObjectId();
                ObjectData objectData = getBinding().getObjectService().getObject(getRepositoryId(), objectId,
                        getPropertyQueryName(PropertyIds.PATH), false, IncludeRelationships.NONE, "cmis:none", false,
                        false, null);

                if ((objectData.getProperties() != null) && (objectData.getProperties().getProperties() != null)) {
                    PropertyData<?> pathProperty = objectData.getProperties().getProperties().get(PropertyIds.PATH);

                    if (pathProperty instanceof PropertyString) {
                        path = ((PropertyString) pathProperty).getFirstValue();
                    }
                }
View Full Code Here

            return Collections.emptyList();
        }

        String objectId = getObjectId();

        ObjectData bindingParent = getBinding().getNavigationService().getFolderParent(getRepositoryId(), objectId,
                getPropertyQueryName(PropertyIds.OBJECT_ID), null);

        if (bindingParent.getProperties() == null) {
            // should not happen...
            throw new CmisRuntimeException("Repository sent invalid data!");
        }

        // get id property
        PropertyData<?> idProperty = bindingParent.getProperties().getProperties().get(PropertyIds.OBJECT_ID);
        if (!(idProperty instanceof PropertyId)) {
            // the repository sent an object without a valid object id...
            throw new CmisRuntimeException("Repository sent invalid data! No object id!");
        }
View Full Code Here

        if (versionSeriesId == null) {
            throw new CmisRuntimeException("Version series id is unknown!");
        }

        ObjectData objectData = getBinding().getVersioningService().getObjectOfLatestVersion(getRepositoryId(),
                objectId, versionSeriesId, major, context.getFilterString(), context.isIncludeAllowableActions(),
                context.getIncludeRelationships(), context.getRenditionFilterString(), context.isIncludePolicies(),
                context.isIncludeAcls(), null);

        ObjectFactory objectFactory = getSession().getObjectFactory();
View Full Code Here

            try {
                // switch off object info collection to avoid side effects
                addObjectInfos = false;

                // get the object and its info
                ObjectData object = getObject(repositoryId, objectId, null, Boolean.TRUE, IncludeRelationships.BOTH,
                        "*", Boolean.TRUE, Boolean.FALSE, null);
                info = getObjectInfoIntern(repositoryId, object);

                // switch on object info collection
                addObjectInfos = true;
View Full Code Here

            String objectId = getObjectId();

            OperationContext oc = getCreationContext();

            // get the latest data from the repository
            ObjectData objectData = getSession()
                    .getBinding()
                    .getObjectService()
                    .getObject(getRepositoryId(), objectId, oc.getFilterString(), oc.isIncludeAllowableActions(),
                            oc.getIncludeRelationships(), oc.getRenditionFilterString(), oc.isIncludePolicies(),
                            oc.isIncludeAcls(), null);
View Full Code Here

        }

        // Make a call to getObject to convert the resulting id into an
        // ObjectData
        TypeDefinition td = typeDefC.getTypeDefinition();
        ObjectData od = PropertyCreationHelper.getObjectData(td, so, null, context.getUsername(), false,
                IncludeRelationships.NONE, null, false, false, extension);

        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
View Full Code Here

            throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
        }

        String user = context.getUsername();
        TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
        ObjectData od = PropertyCreationHelper.getObjectData(td, so, filter, user, includeAllowableActions,
                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);

        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
            objectInfos.addObjectInfo(objectInfo);
        }

        // fill an example extension
        String ns = "http://apache.org/opencmis/inmemory";
        List<CmisExtensionElement> extElements = new ArrayList<CmisExtensionElement>();

        Map<String, String> attr = new HashMap<String, String>();
        attr.put("type", so.getTypeId());

        extElements.add(new CmisExtensionElementImpl(ns, "objectId", attr, objectId));
        extElements.add(new CmisExtensionElementImpl(ns, "name", null, so.getName()));
        od.setExtensions(Collections.singletonList(
                (CmisExtensionElement) new CmisExtensionElementImpl(ns, "exampleExtension",null,  extElements)));

        LOG.debug("stop getObject()");

        return od;
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.ObjectData

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.