You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2012/08/31 09:35:08 UTC
svn commit: r1379333 -
/chemistry/site/trunk/content/java/examples/example-create-update.mdtext
Author: fmui
Date: Fri Aug 31 07:35:07 2012
New Revision: 1379333
URL: http://svn.apache.org/viewvc?rev=1379333&view=rev
Log:
Improved update properties example
Modified:
chemistry/site/trunk/content/java/examples/example-create-update.mdtext
Modified: chemistry/site/trunk/content/java/examples/example-create-update.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-create-update.mdtext?rev=1379333&r1=1379332&r2=1379333&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-create-update.mdtext (original)
+++ chemistry/site/trunk/content/java/examples/example-create-update.mdtext Fri Aug 31 07:35:07 2012
@@ -44,13 +44,21 @@ This example creates a document in the f
## Updating properties
-This example updates two properties of a CMIS object
+This example updates five properties of a CMIS object
CmisObject cmisobject = ....
- Map<String, Object> updateproperties = new HashMap<String, Object>();
- updateproperties.put("my:property", "new value");
- updateproperties.put("my:other.property", 42);
+ Map<String, Object> updateProperties = new HashMap<String, Object>();
- cmisobject.updateProperties(updateproperties);
+ updateProperties.put("my:property", "new value"); // single-value property
+ updateProperties.put("my:int.property", 42);
+ updateProperties.put("my:date.property", new GregorianCalendar());
+ updateProperties.put("my:bool.property", true);
+
+ List<String> shoppingList = new ArrayList<String>();
+ shoppingList.add("milk");
+ shoppingList.add("bread");
+ shoppingList.add("cheese");
+ updateProperties.put("my:shopping.list", shoppingList); // multi-value property
+ cmisobject.updateProperties(updateProperties);