Package org.apache.chemistry.opencmis.client.api

Examples of org.apache.chemistry.opencmis.client.api.Document.updateProperties()


            // update
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put(PropertyIds.NAME, NAME2);

            ObjectId newId = workDoc.updateProperties(properties, false);
            Document doc2 = (Document) session.getObject(newId, SELECT_ALL_NO_CACHE_OC);

            addResult(checkObject(session, doc2, getAllProperties(doc2), "Updated document compliance"));

            f = createResult(FAILURE, "Document name doesn't match updated value!");
View Full Code Here


        String id = document.getId();
        assertNotNull(id);

        // update single property
        ObjectId newId = document.updateProperties(properties);
        assertNotNull(newId);
        assertEquals(id, newId.getId()); // should not be a new version

        session.clear();
View Full Code Here

            // update
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put(PropertyIds.NAME, NAME2);

            ObjectId newId = workDoc.updateProperties(properties, false);
            Document doc2 = (Document) session.getObject(newId, SELECT_ALL_NO_CACHE_OC);

            addResult(checkObject(session, doc2, getAllProperties(doc2), "Updated document compliance"));

            f = createResult(FAILURE, "Document name doesn't match updated value!");
View Full Code Here

            addResult(assertEquals(NAME2, doc2.getName(), null, f));

            // update nothing
            try {
                properties = new HashMap<String, Object>();
                doc2.updateProperties(properties, false);
            } catch (Exception e) {
                addResult(createResult(WARNING,
                        "updateProperties without property changes returned an error: " + e.getMessage(), e, false));
            }
View Full Code Here

        String id = document.getId();
        assertNotNull(id);

        // update single property
        ObjectId newId = document.updateProperties(properties);
        assertNotNull(newId);
        assertEquals(id, newId.getId()); // should not be a new version

        session.clear();
View Full Code Here

        String id = document.getId();
        assertNotNull(id);

        // update single property
        ObjectId newId = document.updateProperties(properties);
        assertNotNull(newId);
        assertEquals(id, newId.getId()); // should not be a new version

        session.clear();
View Full Code Here

        Document doc2 = (Document) session.getObject(id2);
        System.out.println("renaming " + doc2.getName() + " to test3.txt");
        properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, "test3.txt");
        id2 = doc2.updateProperties(properties);
        System.out.println("renamed to " + doc2.getName());

        // Update the content stream
        content = "This is some updated test content for our renamed second document.";
        buf = null;
View Full Code Here

        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
        Document document = (Document) this.session.getObjectByPath(path);
        assertNotNull("Document not found: " + path, document);

        document.setProperty(PropertyIds.NAME, "Neuer Name");
        document.updateProperties();
        assertEquals("Neuer Name", document.getName());
    }
   
    @Test
    public void updateSinglePropertyAndCheckName() {
View Full Code Here

        String id = document.getId();
        assertNotNull(id);

        // update single property
        ObjectId newId = document.updateProperties(properties);
        assertNotNull(newId);
        assertEquals(id, newId.getId())// should not be a new version
  
        session.clear();
       
View Full Code Here

        String id = document.getId();
        assertNotNull(id);

        // update single property
        ObjectId newId = document.updateProperties(properties);
        assertNotNull(newId);
        assertEquals(id, newId.getId()); // should not be a new version

        session.clear();
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.