CMIS AND APACHE CHEMISTRY IN ACTION PDF
The figure on the cover of CMIS and Apache Chemistry in Action is captioned “Le Gamin If you want to copy sppn.info to another folder called target. CMIS and Apache Chemistry in Action is a comprehensive guide to the CMIS standard and related ECM concepts, written by the authors of the standard. Summary CMIS and Apache Chemistry in Action is a comprehensive guide to the CMIS standard and related ECM concepts, written by the authors of the.
|Language:||English, Spanish, Indonesian|
|ePub File Size:||MB|
|PDF File Size:||MB|
|Distribution:||Free* [*Regsitration Required]|
CMIS and Apache Chemistry in Action by Florian Müller . that allowable action, as follows: def file = new File('/users/jpotts/Documents/sample/sppn.info'). machine and you'll know how to use Groovy to work with objects stored in a CMIS server by using a handy tool from Apache Chemistry called CMIS Workbench. CMIS and Apache Chemistry in Action - Ebook download as PDF File .pdf), Text File .txt) or read book online. CMIS and Apache Chemistry in Action.
Any property single. String PropertyUri www. These properties are common to any ECM system. The flexible thing about ECM systems and about CMIS is that there can be many different types of docu- ments with any number of custom properties defined on them.
When we get into part 2 of the book and start building a custom CMIS music management application. The output from the run is always displayed in the lower window. This is one of a handful of things that make a document special in CMIS and. Verify that println "name: Note that the println "FileName: It might be a binary or text file of any MIME type and of any size.
Because the InMemory server starts up with some test data. The item object type version 1. For www. It turns out that many CMIS repositories have object types whose instances are fileable. At the most basic level. These concepts will be your guideposts as you progress through the rest of part 1.
You might choose to persist the applica- tion configuration as a set of key-value pairs that would be defined as properties on an object type that extends cmis: By the time you have completed the next three chapters. In later chap- ters. In CMIS 1. We even sprinkled in a little taste of the bindings. As in previous chapters. You saw in the previous chapter how to grab an instance of the root folder using session. To create the folder. Then you set up a properties map with the name and object type ID and pass the properties to the createFolder method.
That returns a folder object. If you look at the Javadoc for the folder interface. Do you remember the list of properties common to all CMIS objects that was provided in chapter 2?
Listing 3. In listing 3. Creating objects 41 Figure 3.
Many CMIS repositories have types that inherit from cmis: If you wanted to. Any type that inherits from cmis: Folders are created contextually. CMIS has to know where to create the new folder. Figure 3. When you do that. You still need the name and object type at a minimum. If you were using CMIS 1. In this section.
The key difference is that you have to create a content stream and then pass that to the createDocument method. If the value of the attribute is required. Creating objects 43 Not all repositories support contentless document objects Some repositories require document instances to always have a content stream. More often. Instantiate a mimetype. If you click the link in the right-hand pane see figure 3. You can check whether or not your repository requires documents to have a content stream by inspecting the type definition for cmis: In this example.
Or how about an imaging application to feed scanned invoices into the repository which then might trigger an approval workflow if your repository supports it.
The helper scripts include a function called createDocument- FromFile. Got a fileshare full of contracts and legal documents? If you stopped here. The result. Now you know how to create folders and documents.
You might be looking at listing 3. There is a shorter way to do it. Set up requires file. These are a few you might be interested in: Con- sult that file for the full list. If you want to copy sample-b. What other shortcuts are available? See the code for the method signatures. These helper scripts will only work with your code running in the Groovy console.
The document object has a method called copy that takes a target folder as its only argument. If you need to do that.
Most often. When updating objects. Similar to Action.. In the second. As you saw earlier when creating folder objects. In the previous section. In the first example. The copy method relies on create- DocumentFromSource. To figure out whether or not your repository supports unfiled documents..
But some ECM repositories support the notion of unfiled documents. You can use this approach to change any property value. Now you know how to rename a document. Recall from section 3. Defensive checks of the allowable actions allow you to not only head off error messages before they are thrown. If you no longer have a document called sample-a. To change the name of a document.
But if you open the file associ- ated with that document. Updating objects 47 3. To rename an object. You should be able to use what you learned in the previous section to cre- ate one using code.
Hiding invalid choices from users is a good usability practice. This works much like creating a document. Now when you open the PDF associated with sample-c. The second flag tells it to refresh the object. You need to set up a content stream and then call setContentStream on an existing document. This is shown in the fol- lowing listing. If the document already has a content stream set. Different ECM repositories have different rules concerning when content streams can be updated.
You can now change the content stream on a document when you need to update its content. Set up file. Now you know how to determine if and when.
To check whether a specific content stream can be updated. You can also perform this check through code. Updating objects 49 Figure 3. Then you can update the PWC and do a check-in to commit the change. Setting the content stream directly. Documents go through their normal business process. Before we try a versioning example.
If the legal team is working on the contract. This may seem like an extreme example. The people involved in the process are attempting to keep track of the different ver- sions of the document by adding things to the name of the file. Using what you know so far. Going back to the law firm example..
A CMIS repository that supports versioning fixes this problem. Users can revert back to previous versions at any time. You can. These are lawyers. When you check in a docu- ment. As the name suggests. Now refer to figure 3. Before making a change. It only exists as long as the document is checked out. When the changes are made. This is called the version label.
Once the document is checked in. Updating objects 51 2.
When you check out a document. The decision is usually business-specific. The most recent version in a version history is called the latest version. Notice that each version in the version history is identified with a number. Specify a VersioningState. You may be curious as to why the PWCs in figure 3. Now that you know how useful versioning can be and the terminology that goes with it. The next listing shows how to check in the modified local file as a new version. Once the document is checked out.
After running this example. Updating objects 53 You may have noticed that we used a custom type called cmisbook: In the InMemory Repository bundled with this book. If this happens to you. Any values will work.
After running this code. Pass in null for properties contentStream. If you click the content URL. The next listing shows how to delete it. So be careful with that delete method. The method returns a list of object IDs that were successfully updated. Some repositories have the notion of soft deletes.
Deleting objects 55 CMIS 1. But there is nothing in the CMIS specification that provides for this type of functionality. New in CMIS 1. The only decision you need to make is whether you want to delete all versions of the object or only the version you call the delete method on. Even in CMIS repositories that support versioning.
The new bulkUpdate- Properties method takes an array of object IDs to update. Deleting documents differs slightly from deleting folders. At some point. In the preceding code. Like the document class. The last argument passed to deleteTree indi- cates what should happen if a failure occurs. But if you call delete on a non-empty folder.
If you want to delete a folder and all of its descendents. Note that when you call deleteTree. You must also tell CMIS whether to delete or unfile the objects in the tree. Summary 57 so that if one object in the tree fails to get deleted. Diving deeper into types. You learned that when folders are deleted.
For some repositories. When deleting an object with a version history.
You can update them in place by updating properties or the content stream directly. In reality. One way to address that problem is to check out documents before checking them back in as new versions. You can automate a lot of document processing in your organization. Once a document is unfiled. But if you do that. The document can be retrieved by its object ID. You can now create new folders and documents.
You also saw a few different ways to update docu- ments. This also prevents others from making changes to the same document at the same time.
If you want to unfile a document. CMIS metadata: By the end of this chapter. This chapter will bring us up a level into a discussion of metadata. In other cases. If that makes no sense to you. For the rest of this book. A good place for us to start is to relate metadata to what you already know—data. In the case of the library. The book also has an associated catalog record physical or digital that contains data about the object. When we talk about types.
Somewhere you have a book sitting on a shelf—the book is the object in this example. Either way. If you have a good grasp of metadata already and want to get right to CMIS metadata. Metadata is a key part of making objects searchable. What is metadata and why do we need it?
Figure 4. TOO Remember that because the schema is also data-describing data. In section 4. The data in this record is the metadata. Perhaps a slightly more helpful definition in this case would be data about the containers of data. Simply put. Folders and documents are the most common examples of data objects.
Type is the name used in the CMIS specification to identify the objects that hold the schema for normal data objects in the repository. Type objects contain collections of property definitions that define what properties will be present on an object instance of that type. As you can see in figure 4. But with proper types defined on your repository. This is also typically the case with ECM systems. Maybe you could even sort by filename to help out a bit if you knew something about what the photo was called.
If you recall. With- out metadata. But remember. It might have books on tape. Each of these different types of objects will have different types of metadata associated with them. Later in this chap- ter. Compare that with a CMIS example: Say you were trying to find a photo in a CMIS repository that contained million or more objects.
ECM repositories generally have a large variety of objects. Imagine you want to see all of the images that were created after and updated sometime between and Even if you found a few photos that matched this criteria.
Recall that data objects are made up of instances of these types. This is directly analogous to how data objects contain collections of properties. A sixth base type cmis: In order to bring up the Types viewer in the Workbench. The same is true for the attributes on property definitions. Attribute is shorter to say than metaproperty anyway. To avoid this unfortunate verbal tangle. All of these type objects in CMIS inherit attributes from their parent type objects. Note that the Apache Chemistry InMemory Repository we used in this example has multiple child types of cmis: CMIS defines a hierarchy to organize all of the type objects.
This means that there needs to be a scalable way to organize and retrieve them. As you saw earlier in this chapter.
Some repository designs treat these type collections as a large flat list. Type collections and hierarchies 63 Figure 4. In the property definitions pane in figure 4. Also note that in this property definition view. In contrast. That is.
If an underlying repository only has a flat list. Property definitions will be explained. Listing 4. In part 2 of the book. For more examples. Now that you have that down. For this. Recall the default type hierarchy in figure 4.
Each of these base types can have child and grandchild types going down as deep and as wide as is necessary for each application. Print some Show attributes print " Fileable: Now that you know something about types and their attributes. This version adds a new method. Returns a map of the property definitions for for key in mapDefs.
As you can see. Hook in a call to the for t in tree. In listing 4. The figure shows the complete output for the type named audioFile. For exam- ple. Much like often can be more getType. That prefix is reserved for properties defined in the specification.
This technique will work for any CMIS object you encounter. These terms can have different meanings in different contexts. Custom properties are everything else. This type has many custom properties relating to audio tracks. Property object not required and the definition properties. Each choice includes a displayName and a value. Aside from specifying what type of data the property holds and its cardinality. The displayName may be used by clients for presentation purposes.
Constraints break down into two main groups. For a more detailed discussion of these. Type collections and hierarchies 69 Figure 4. If an application tries to set this property to a value outside of this range.
The date and time portion of the value should be ignored. These are the four type-specific constraints: The time portion of the value should be ignored. The permitted values for this enum are as follows: Each value in the following list implies all of the values above it. It augments the type walker v2 example to also show choice lists. If an application attempts to set the value of this property to a string longer than the specified maximum length. Check for type-specific if propDefInt.
You may recall from earlier in this chap- ter the hierarchy of the CMIS type definitions and the attributes that are inherited from the base CMIS object type. All subtypes of cmis: They allow you to dynamically add or remove lists of additional properties during the lifetime of an object.
Another way of looking at this is that the manual steps required for an administrator to create a type definition through the repository-specific interfaces are no longer necessary. But the specific Boolean value of ver- sionable for each of those subtypes is set independently.
The same is true for new property type IDs on new or existing object types. As a quick refresher. The type mutability settings for a specific type are shown later in figure 4.
Because the underlying repository may have other restrictions on the ID value. Otherwise it may be slightly modified or even entirely different. These flags are defined in the CMIS 1. For more on this. The typeMutability. This is generally true for all rights associated with type mutability. You can check whether or not a given type allows subtypes by inspecting its type definition. Put another way.
Each type may have any of these three optional Boolean values set. If the repository can use the ID you suggested. They refer to the repository as a whole in the context of an administrator. If you look towards the bottom of the figure. This will indicate which of the attri- butes this particular repository will accept for new types. The correct way to find out for certain is to refer to the capabilityNewTypeSettableAttributes list. Often these will be internally generated based on other attributes of or on inheritance from the type.
At the time of this writing. To make this clear for clients. The repository may change it if necessary. It has one additional integer property defined with the IDmy-int. This is a list of all of the CMIS-defined property types boolean. To speed things up. When an object type is created or updated. If you look at the last line in the figure.
This is necessary so that clients can tell which properties correspond to their requested properties in cases where the IDs are different from what was requested. Remember that earlier we said that the value you pass for the type and property ID is only a suggestion. At the end of the listing. The figure shows my-document selected in the type tree and the my-int property highlighted at the bottom of the properties pane.
The first of these constraints is discovered by inspecting the type definition for the object in question. To determine if the type has subtypes. Note that this type supports create. Recall that we already showed you how to programmatically check this in listing 4.
The following list highlights these important items: Then you commit the change with the updateType method. This includes constraints of any kind. The code is simple. Update fin- ishes off the set and is up next.
Section 2. A type definition has to be provided that contains the changes usually additions that you wish to have committed. Neither of these is a great option. You might also use an image content type for images related to the case. Some email might be related to a specific case. Now the object has all of the metadata defined by the primary type. That covers the basics of create.
Next up are the new sec- ondary types. To address this problem. Different reposito- ries use different names to describe these special types.
One option would be to define the property in a common ancestor type. Now suppose the CMIS repository will also be used to archive email. To keep it simple.
If these are legal cases. Email will be created using an email content type. Another option would be to define the property redundantly—every type that needs it would define its own case number property. Using the example of the legal case management system. An important difference is that the base type must be the spe- cial cmis: Unlike primary types. The repository uses these values set on the primary type to decide whether or not an object instance is fileable. As we mentioned.
To remove a secondary type from an object. A taggable secondary type makes it easy to add tag-related metadata to all of the objects that need to be tagged. If your repository returns cmis: Once added. Now objects can be both case-related and taggable.
They have the added benefit of being easy to add to and remove from an object without altering its fundamental type. This is a read-write. Here are the constraints that must be followed when creating secondary types: Objects in a repository that support secondary object types have a system property called cmis: The properties and values will be removed from the object.
All objects must be instances of primary types. To add a secondary type to an object. In this way. Now that you understand these metadata basics. In addition. That feature is Query. This chapter also covered the different types of constraints that can be present on these types.
This chapter is hands-down the most difficult one in part 1. As you get deep into this chapter. As we mentioned at the beginning of chapter 4. Remember the example from the beginning of chapter 4.
CMIS and Apache Chemistry in Action PDF Download
CMIS defines a powerful and flexible way to describe searches. At that scale. The concepts introduced here are equally 83 www. One of the stated goals of the CMIS specification was to take advantage of technol- ogies and standards that were mature and accepted.
Nothing advanced is required. You may remember from the previous chapter that quite a bit of sample metadata comes preinstalled with the InMemory server for audio files and other common document types.
This is likely one of the reasons that CMIS adoption has been so successful across the industry. Even the introduction to SQL in Wikipedia http: SQL had already been around as a standard for decades. We packed this chapter with tons of examples so that later.
But if you read it all the way through. It was for this reason that the nearly universally known at least among developers SQL syn- tax was chosen as the way to describe these queries.
A quick internet search will turn up plenty of infor- mation. The chapter includes a lot of detail that you may not need at this moment. In order to avoid droning on about a subject that most readers of this book will consider basic knowledge. It fits perfectly. Most developers are familiar with these clauses. A relational database is composed of tables.
Fig- ure 5. You can also envision the object type as a spreadsheet grid. By mapping a relational view on the CMIS data model. Figure 5. CMIS also has extended the Query grammar to make it easier to filter your query results based on multivalued properties.
Think of this as a refresher and the start of an agenda for the next few sections. If you look at the type definition for cmis: This is case sensitive.
If this attribute is false. Before trying to construct a query. Its parent type is cmisbook: In the next section. Here are the attributes you should be aware of: Because includedInSuper- TypeQuery is set to true for cmis: When writing CMIS queries. Also note the queryName is cmisbook: In this exercise. Recall that in chapter 4.
foreword by J. Newton
This will give you a taste of what to expect later as we fill in the blanks. Under Capabilities. In the same upper-right pane. That means you can create powerful queries with metadata queries and full-text searches together in one single SQL query statement. Click on Audio File cmisbook: Try the following queries to see that you can specify non-CMIS object types. Click the Query button. You can also change the order of the columns by dragging them to the right or left.
Even though you searched for cmis: You may have to widen the columns to see the column names and values. Stop when you get to the cmis: As for cmisbook: You can see that the objects that have been returned are of many different object types.
Take a minute to scroll right in the query output to see the object property values for the query results. Had includedInSuperTypeQuery been false. Listing 5.
Now you can see the direct correlation between running a query string in the Query GUI and running a query from code. Because QueryResults must be able to hold println "".
In the case of. Note that the name is case sensitive. Here are the relevant object type property definitions: The other proper- ties are inherited from cmis: Before using a particular object type property as a virtual column in the query.
Locate one of the predefined CMIS properties. The property can be directly defined or inherited by the object type in the FROM clause. Locate the Archived property from the list. Scrolling toward the end of the properties. You can think of it as the name of the virtual column from the spreadsheet example at the beginning of this chap- ter.
Examine its attributes to make sure you can use cmis: Go back to the Types pane. In the bottom- right pane are the object properties ordered alphabetically by their ID and their attri- bute definitions.
You can also specify the CMIS properties that are defined in the root object types. A common. Familiarize yourself with the property and how you can use it in your queries. B and C. This also applies to Query. We can elaborate on this concept using the existing document object types in the InMemory server.
The CMIS data model does map nicely to the relational model. Components of a query 93 Figure 5. In the rest of this chapter. As you can see from the following example 4. For each of the properties. You can specify properties defined specifically for the object type and also the pre- defined CMIS properties from which the object type inherits.
Here are the examples: Using aliases makes it easier to refer to tables and properties in later parts of the query. It can be a comma-separated list of one or more property queryNames. Aliases can be defined by adding the string AS and the alias name to the property queryName.
The CMIS query syntax supports the following restricted set of SQL query predi- cates for single-valued queryable properties see table 5. Table 5.
The rules are logical for each data type. If you want to query against data from multiple object types by specifying more than one object type in the FROM clause. See section 5. They follow the SQL con- vention as follows: The FROM clause describes the virtual table s or object type s against which you want to run your query. The SSS part of the timestamp is for fractions of a second.
The Z stands for Zulu time. Multivalued property comparisons will be discussed later in the chapter. What follows now are examples for all of the predicates listed in table 5.
Instead of specifying a time in GMT. The following are some additional specifications about the operators with respect to the data types. All are valid. Many of them will return nonzero results when executed against the sample InMemory server. FALSE or false. We encourage you to experiment and add additional objects to the repository to address specific queries that are of interest.
A DateTime literal has this format: These literals will need to be enclosed in single quotes. Depending on the CMIS client. In a LIKE predicate. Wildcard queries are powerful. To match a percent sign or underscore in a LIKE predicate. Remember that LIKE queries are case sensitive. Depending on how the String and URI properties are defined in the repository.
You should also try not to have a wildcard at the beginning of your pattern.
Tag: Apache Chemistry
You can use this predicate for both single. Try running the following two SQL queries. The CMIS specification states that the escape character can be either a backslash or the other common escape character for a single quote—another single quote.
The syntax for the NULL predicate is the same for both single-valued and multivalued properties—please refer to the previous section on the NULL predicate. The Query syntax is a bit more limited for multivalued properties.
You saw earlier in the CMIS Workbench Types window how you can select an object type and see the property definition attributes in the lower-right pane. You can accommodate both implementations with a query like the following: Some repositories allow you to store an empty String as a valid value.
What if you want to query on a multivalued property? Multivalued properties can have more than one value. You can per- form equality tests to find a specific value in any of the multiple values of the property. You can always check the cardinality of the object type property definition to find out whether a property is single-valued single or multivalued multi.
This syntax is only used for querying a multival- ued property for any of its values matching one of the literal values in the IN list. The same data types that support the IN predicate for single-valued properties are allowed for the multivalued properties—that is.
In one of the examples. Here are two examples: You can also use the AND logical operator to restrict the result set to rows that satisfy both of the two conditions. The following example will return all cmisbook: The SQL does exactly what it says: Unlike the single-valued property queries. Some CMIS server imple- mentations may be more lenient about these two requirements. It consists of tuples of sorting information—namely. In the first of the following two examples. Only single-valued properties of all data types can be orderable.
You can also find out programmatically by requesting the type definition for an object type. The first tuple is the pri- mary sort specification. The colla- tion order is repository-specific. Because the orderable attribute for a property is supposed to apply to all queries. In our earlier exercises viewing InMemory capabilities. These three levels are called none. Using relational database table jargon.
The descriptions in this section will use the relational database jargon. If you try to run a JOIN query. In the following example. The item object type version 1. Creating objects. Chapter 4 CMIS metadata: What is metadata and why do we need it? Type collections and hierarchies. Chapter 5 Query 5. Chapter 6 Meet your new project: The Blend 6. Understanding the business requirements and technical approach.
Walking through the finished product.
Setting up the development environment. Configuring the InMemory server. Taking first steps with The Blend. Chapter 7 The Blend: Building a browse page. Chapter 8 The Blend: Creating folders. Chapter 9 Using other client libraries 9. Working with other client libraries. Chapter 11 CMIS bindings CMIS binding overview. A close look at the three bindings. CMIS schemas and schema extensions. Chapter 12 Security and control General security considerations.
Authentication in web applications using the Browser binding. Authorization and permissions. Chapter 13 Performance CMIS performance. Selecting the smallest data set. Selecting the fastest binding.
You can check whether or not a given type allows subtypes by inspecting its type definition. This will start up InMemory Repository on your machine. Now you have a working CMIS server running on your machine. The figure shows the complete output for the type named audioFile.
- CLOCKWORK PRINCE CASSANDRA CLARE PDF FILE
- GANDHI VADH KYON PDF
- ORAL AND MAXILLOFACIAL PATHOLOGY NEVILLE 3RD EDITION PDF
- CCNP TSHOOT PORTABLE COMMAND GUIDE PDF
- SALIVARY GLAND PDF
- ARM ASSEMBLY LANGUAGE FUNDAMENTALS AND TECHNIQUES EBOOK
- MUD SWEAT AND TEARS PDF
- THE TREASURE ISLAND EBOOK
- COMPUTER NETWORKS TEXTBOOK BY TANENBAUM PDF
- THE WEB DESIGNERS IDEA BOOK PDF
- ANIMAIS FANTASTICOS HABITAM PDF
- THE BOOK OF UNWRITTEN TALES SUB ITA
- MODUL BAHASA KOREA PDF
- STOCKS FOR THE LONG RUN 5TH EDITION PDF