Package org.apache.chemistry.opencmis.inmemory.storedobj.api

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion


        StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
        String user = context.getUsername();
        VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);

        DocumentVersion pwc = verDoc.getPwc();

        if (null != contentStream)
            pwc.setContent(contentStream, false);

        if (null != properties && null != properties.getProperties())
            pwc.setCustomProperties(properties.getProperties());

        verDoc.checkIn(major, checkinComment, user);

        // To be able to provide all Atom links in the response we need
        // additional information:
View Full Code Here


            throw new CmisUpdateConflictException("Document " + objectId.getValue() + " is already checked out.");

        String user = context.getUsername();
        checkHasUser(user);

        DocumentVersion pwc = verDoc.checkOut(content, user);
        objectId.setValue(pwc.getId()); // return the id of the created pwc

        // To be able to provide all Atom links in the response we need
        // additional information:
        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
View Full Code Here

        StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
        ObjectData objData = null;

        if (so instanceof VersionedDocument) {
            VersionedDocument verDoc = (VersionedDocument) so;
            DocumentVersion latestVersion = verDoc.getLatestVersion(major);
            objData = getObject(context, repositoryId, latestVersion.getId(), filter, includeAllowableActions,
                    extension, objectInfos);
        } else if (so instanceof Document) {
            objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions, extension,
                    objectInfos);
        } else
View Full Code Here

            throw new RuntimeException("Cannot delete object with id  " + objectId + ". Object does not exist.");

        if (obj instanceof FolderImpl) {
            deleteFolder(objectId);
        } else if (obj instanceof DocumentVersion) {
            DocumentVersion vers = (DocumentVersion) obj;
            VersionedDocument parentDoc = vers.getParentDocument();
            fStoredObjectMap.remove(path);
            boolean otherVersionsExist = vers.getParentDocument().deleteVersion(vers);
            if (!otherVersionsExist)
                fStoredObjectMap.remove(parentDoc.getId());
        } else {
            fStoredObjectMap.remove(path);
        }
View Full Code Here

        // Now we are sure to have document type definition:
        if (((DocumentTypeDefinition) typeDef).isVersionable()) {
            VersionedDocument verDoc = fStoreManager.getObjectStore(repositoryId).createVersionedDocument(name);
            verDoc.createSystemBasePropertiesWhenCreated(properties.getProperties(), user);
            verDoc.setCustomProperties(properties.getProperties());
            DocumentVersion version = verDoc.addVersion(contentStream, versioningState, user);
            if (null != folder)
                folder.addChildDocument(verDoc); // add document to folder and
            // set parent in doc
            else
                verDoc.persist();
            version.createSystemBasePropertiesWhenCreated(propMap, user);
            version.setCustomProperties(propMap);
            version.persist();
            so = version; // return the version and not the version series to
            // caller
        } else {
            Document doc = fStoreManager.getObjectStore(repositoryId).createDocument(name);
            doc.setContent(contentStream, false);
View Full Code Here

        // Now we are sure to have document type definition:
        if (((DocumentTypeDefinition) typeDef).isVersionable()) {
            VersionedDocument verDoc = fStoreManager.getObjectStore(repositoryId).createVersionedDocument(name);
            verDoc.createSystemBasePropertiesWhenCreated(properties.getProperties(), user);
            verDoc.setCustomProperties(properties.getProperties());
            DocumentVersion version = verDoc.addVersion(contentStream, versioningState, user);
            if (null != folder) {
                folder.addChildDocument(verDoc); // add document to folder and
            }
            version.createSystemBasePropertiesWhenCreated(propMap, user);
            version.setCustomProperties(propMap);
            version.persist();
            verDoc.persist();
            so = version; // return the version and not the version series to
            // caller
        } else {
            Document doc = fStoreManager.getObjectStore(repositoryId).createDocument(name);
View Full Code Here

        StoredObject so = validator.checkIn(context, repositoryId, objectId, extension);

        String user = context.getUsername();
        VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);

        DocumentVersion pwc = verDoc.getPwc();

        verDoc.checkIn(major, properties, contentStream, checkinComment, user);

        // To be able to provide all Atom links in the response we need
        // additional information:
View Full Code Here

        }

        String user = context.getUsername();
        checkHasUser(user);

        DocumentVersion pwc = verDoc.checkOut(content, user);
        objectId.setValue(pwc.getId()); // return the id of the created pwc

        // To be able to provide all Atom links in the response we need
        // additional information:
        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
View Full Code Here

        ObjectData objData = null;

        if (so instanceof VersionedDocument) {
            VersionedDocument verDoc = (VersionedDocument) so;
            DocumentVersion latestVersion = verDoc.getLatestVersion(major);
            objData = getObject(context, repositoryId, latestVersion.getId(), filter, includeAllowableActions,
                    extension, objectInfos);
        } else if (so instanceof Document) {
            objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions, extension,
                    objectInfos);
        } else {
View Full Code Here

        return !fVersions.isEmpty();
    }

    public void cancelCheckOut(String user) {
        DocumentVersion pwc = getPwc();
        fVersions.remove(pwc);
        fObjStore.removeVersion(pwc);
        fIsCheckedOut = false;
        fCheckedOutUser = null;
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion

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.