Package org.apache.chemistry.opencmis.commons.impl.jaxb

Examples of org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectType


    /**
     * Writes an entry that is attached to an object.
     */
    private static void writePolicyEntry(CmisService service, AtomEntry entry, String objectId, ObjectData policy,
            String repositoryId, UrlBuilder baseUrl) throws Exception {
        CmisObjectType resultJaxb = convert(policy);
        if (resultJaxb == null) {
            return;
        }

        ObjectInfo info = service.getObjectInfo(repositoryId, policy.getId());
View Full Code Here


        feed.endDocument();
    }

    private static void writeQueryResultEntry(AtomEntry entry, ObjectData result, String id, GregorianCalendar now)
            throws Exception {
        CmisObjectType resultJaxb = convert(result);
        if (resultJaxb == null) {
            return;
        }

        // start
View Full Code Here

            propFile.delete();
            return;
        }

        // create object
        CmisObjectType object = new CmisObjectType();
        object.setProperties(Converter.convert(properties));

        // write it
        try {
            JAXBElement<CmisObjectType> objElement = JaxBHelper.CMIS_EXTRA_OBJECT_FACTORY.createObject(object);
View Full Code Here

    /**
     * Creates a CMIS object that only contains an id in the property list.
     */
    protected CmisObjectType createIdObject(String objectId) {
        CmisObjectType object = new CmisObjectType();

        CmisPropertiesType properties = new CmisPropertiesType();
        object.setProperties(properties);

        CmisPropertyId idProperty = new CmisPropertyId();
        properties.getProperty().add(idProperty);
        idProperty.setPropertyDefinitionId(PropertyIds.OBJECT_ID);
        idProperty.getValue().add(objectId);
View Full Code Here

        url.addParameter(Constants.PARAM_CHECKIN_COMMENT, checkinComment);
        url.addParameter(Constants.PARAM_MAJOR, major);
        url.addParameter(Constants.PARAM_CHECK_IN, "true");

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        if (object.getProperties() == null) {
            object.setProperties(new CmisPropertiesType());
        }

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object, contentStream);

        // update
        Response resp = put(url, Constants.MEDIATYPE_ENTRY, new Output() {
            public void write(OutputStream out) throws Exception {
                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());

        Acl originalAces = null;

        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 current ACL
                    object = (CmisObjectType) element.getObject();
                    originalAces = convert(object.getAcl(), object.isExactACL());
                }
            }
        } finally {
            unlockLinks();
        }
View Full Code Here

        UrlBuilder url = new UrlBuilder(link);
        url.addParameter(Constants.PARAM_VERSIONIG_STATE, versioningState);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object, contentStream);

        // post the new folder object
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
View Full Code Here

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);

        // post the new folder object
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
View Full Code Here

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);

        // post the new folder object
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
View Full Code Here

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);

        // post the new folder object
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
View Full Code Here

        }

        UrlBuilder url = new UrlBuilder(link);

        // set up object and writer
        CmisObjectType object = new CmisObjectType();
        object.setProperties(convert(properties));
        object.setPolicyIds(convertPolicyIds(policies));

        final AtomEntryWriter entryWriter = new AtomEntryWriter(object);

        // post the new folder object
        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectType

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.