Chapter 3. Creating, updating, and deleting objects with CMIS
This chapter covers
- Creating folders
- Creating documents with and without content
- Updating properties on objects
- Checking content into and out of the repository
- Creating versions of documents
- Deleting objects
In the previous two chapters, you’ve learned how to access a CMIS repository as well as the objects contained within it, but you haven’t made any changes to those objects and you haven’t created new objects. You’ll learn how to do that in this chapter. As in previous chapters, you’ll continue using the CMIS Workbench to run Groovy code, but now you’ll create, update, version, and delete objects in the repository.
Traversing the folder structure in the repository and reading documents and their properties is all well and good, but at some point you’ll need to create new objects. Let’s look at how to create the two objects you know about so far: folders and documents. You’ll learn how to create instances of other objects in the CMIS domain model in later chapters.
At a minimum, a CMIS server will always need two pieces of information from you in order to create a new object: the name of the object and the type of object to create. Do you remember the list of properties common to all CMIS objects that was provided in chapter 2? If so, you may recognize the name and object type from the list: