Examples of VersionedDocument


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

      String user, IncludeRelationships includeRelationships) {
      List<StoredObject> res = new ArrayList<StoredObject>();

        for (StoredObject so : fStoredObjectMap.values()) {
            if (so instanceof VersionedDocument) {
                VersionedDocument verDoc = (VersionedDocument) so;
                if (verDoc.isCheckedOut() && hasReadAccess(user, verDoc)) {
                    res.add(verDoc.getPwc());
                }
            }
        }

        return res;
View Full Code Here

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

    public void cancelCheckOut(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {

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

        verDoc.cancelCheckOut(user);
    }
View Full Code Here

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

            Properties properties, ContentStream contentStream, String checkinComment, List<String> policies,
            Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHandler objectInfos) {

        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:
        if (context.isObjectInfoRequired()) {
            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
View Full Code Here

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

        else if (!((DocumentTypeDefinition) typeDef).isVersionable())
            throw new CmisNotSupportedException("Object can't be checked-out, type is not versionable.");

        checkIsVersionableObject(so);

        VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);

        ContentStream content = null;

        if (so instanceof DocumentVersion) {
            // get document the version is contained in to c
            content = ((DocumentVersion) so).getContent(0, -1);
        } else {
            content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
        }

        if (verDoc.isCheckedOut())
            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()) {
View Full Code Here

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

        StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);

        if (!(so instanceof VersionedDocument))
            throw new RuntimeException("Object is not instance of a VersionedDocument (version series)");

        VersionedDocument verDoc = (VersionedDocument) so;
        List<ObjectData> res = new ArrayList<ObjectData>();
        List<DocumentVersion> versions = verDoc.getAllVersions();
        for (DocumentVersion version : versions) {
            ObjectData objData = getObject(context, repositoryId, version.getId(), filter, includeAllowableActions,
                    extension, objectInfos);
            res.add(objData);
        }
View Full Code Here

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

        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);
View Full Code Here

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

        StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
        StoredObject latestVersionObject = null;

        if (so instanceof VersionedDocument) {
            VersionedDocument verDoc = (VersionedDocument) so;
            latestVersionObject = verDoc.getLatestVersion(major);
        } else if (so instanceof Document) {
            latestVersionObject = so;
        } else
            throw new RuntimeException("Object is not instance of a document (version series)");
View Full Code Here

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

     *            version or version series id of a document
     * @return version series id
     */
    protected VersionedDocument getVersionedDocumentOfObjectId(StoredObject so) {

        VersionedDocument verDoc;
        if (so instanceof DocumentVersion) {
            // get document the version is contained in to c
            verDoc = ((DocumentVersion) so).getParentDocument();
        } else {
            verDoc = (VersionedDocument) so;
View Full Code Here

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

        return verDoc;
    }

    protected VersionedDocument testIsNotCheckedOutBySomeoneElse(StoredObject so, String user) {
        checkIsVersionableObject(so);
        VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
        if (verDoc.isCheckedOut())
            testCheckedOutByCurrentUser(user, verDoc);

        return verDoc;
    }
View Full Code Here

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

    }

    protected VersionedDocument testHasProperCheckedOutStatus(StoredObject so, String user) {

        checkIsVersionableObject(so);
        VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);

        checkHasUser(user);

        testIsCheckedOut(verDoc);
        testCheckedOutByCurrentUser(user, verDoc);
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.