Package org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects

Examples of org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry


        AtomPubParser parser = new AtomPubParser(new ByteArrayInputStream(entryContent));
        parser.parse();
        AtomBase parseResult = parser.getResults();

        assertTrue(parseResult instanceof AtomEntry);
        AtomEntry entry = (AtomEntry) parseResult;

        assertNotNull(entry);
        assertTrue(entry.getElements().size() > 0);

        // find the object
        CmisObjectType object2 = null;
        for (AtomElement element : entry.getElements()) {
            if (element.getObject() instanceof CmisObjectType) {
                assertNull(object2);
                object2 = (CmisObjectType) element.getObject();
            }
        }
View Full Code Here


            url.addParameter(Constants.PARAM_RETURN_VERSION, returnVersion);
        }

        // read and parse
        HttpUtils.Response resp = read(url);
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        lockLinks();
        ObjectData result = null;
        try {
            // clean up cache
            removeLinks(repositoryId, entry.getId());

            // walk through the entry
            for (AtomElement element : entry.getElements()) {
                if (element.getObject() instanceof AtomLink) {
                    addLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
                } else if (element.getObject() instanceof CmisObjectType) {
                    result = convert((CmisObjectType) element.getObject());
                }
            }
        } finally {
View Full Code Here

            throw new CmisObjectNotFoundException("Unknown repository!");
        }

        // read and parse
        HttpUtils.Response resp = read(new UrlBuilder(link));
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        lockTypeLinks();
        TypeDefinition result = null;
        try {
            // clean up cache
            removeTypeLinks(repositoryId, entry.getId());

            // walk through the entry
            for (AtomElement element : entry.getElements()) {
                if (element.getObject() instanceof AtomLink) {
                    addTypeLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
                } else if (element.getObject() instanceof CmisTypeDefinitionType) {
                    result = convert((CmisTypeDefinitionType) element.getObject());
                }
            }
        } finally {
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // handle ACL modifications
        handleAclModifications(repositoryId, entry, addAces, removeAces);

        return entry.getId();
    }
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // handle ACL modifications
        handleAclModifications(repositoryId, entry, addAces, removeAces);

        return entry.getId();
    }
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // handle ACL modifications
        handleAclModifications(repositoryId, entry, addAces, removeAces);

        return entry.getId();
    }
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // handle ACL modifications
        handleAclModifications(repositoryId, entry, addAces, removeAces);

        return entry.getId();
    }
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse new entry
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        // set object id
        objectId.setValue(entry.getId());

        if (changeToken != null) {
            changeToken.setValue(null); // just in case
        }

        lockLinks();
        try {
            // clean up cache
            removeLinks(repositoryId, entry.getId());

            // walk through the entry
            for (AtomElement element : entry.getElements()) {
                if (element.getObject() instanceof AtomLink) {
                    addLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
                } else if (element.getObject() instanceof CmisObjectType) {
                    // extract new change token
                    if (changeToken != null) {
                        object = (CmisObjectType) element.getObject();
View Full Code Here

                entryWriter.write(out);
            }
        });

        // parse the response
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        objectId.setValue(entry.getId());
    }
View Full Code Here

            url.addParameter(Constants.PARAM_RETURN_VERSION, returnVersion);
        }

        // read and parse
        HttpUtils.Response resp = read(url);
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        lockLinks();
        ObjectData result = null;
        try {
            // clean up cache
            removeLinks(repositoryId, entry.getId());

            // walk through the entry
            for (AtomElement element : entry.getElements()) {
                if (element.getObject() instanceof AtomLink) {
                    addLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
                } else if (element.getObject() instanceof CmisObjectType) {
                    result = convert((CmisObjectType) element.getObject());
                }
            }
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry

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.