Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 03BC9200AE4 for ; Fri, 24 Jun 2016 12:03:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 02511160A38; Fri, 24 Jun 2016 10:03:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A7299160A62 for ; Fri, 24 Jun 2016 12:03:52 +0200 (CEST) Received: (qmail 18766 invoked by uid 500); 24 Jun 2016 10:03:51 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 18755 invoked by uid 99); 24 Jun 2016 10:03:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jun 2016 10:03:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2C32EC02E8 for ; Fri, 24 Jun 2016 10:03:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id O1cDk9c9wr0H for ; Fri, 24 Jun 2016 10:03:38 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 240F760CD3 for ; Fri, 24 Jun 2016 10:03:37 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 366F4E589A for ; Fri, 24 Jun 2016 10:03:35 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1D3603A23AC for ; Fri, 24 Jun 2016 10:03:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1750066 [11/13] - in /chemistry/site/trunk: content/docs/ content/docs/cmis-samples/ content/docs/cmis-samples/about/ content/docs/cmis-samples/css/ content/docs/cmis-samples/fonts/ content/docs/cmis-samples/img/ content/docs/cmis-samples/... Date: Fri, 24 Jun 2016 10:03:34 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160624100335.1D3603A23AC@svn01-us-west.apache.org> archived-at: Fri, 24 Jun 2016 10:03:55 -0000 Added: chemistry/site/trunk/content/docs/cmis-samples/samples/create-objects/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/docs/cmis-samples/samples/create-objects/index.html?rev=1750066&view=auto ============================================================================== --- chemistry/site/trunk/content/docs/cmis-samples/samples/create-objects/index.html (added) +++ chemistry/site/trunk/content/docs/cmis-samples/samples/create-objects/index.html Fri Jun 24 10:03:33 2016 @@ -0,0 +1,563 @@ + + + + + + + + + + + + Creating Objects - Apache Chemistry Samples + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +

Creating Objects

+

To create an object a client has to provide a least the two properties cmis:name and cmis:objectTypeId.
+cmis:name sets the name of the object and cmis:objectTypeId sets its object type.
+Depending on the object type, more properties can be set or must be set. See also the page about properties.

+

Creating a Folder

+

CMIS 1.0 +CMIS 1.1 +Spec 2.1.5

+

A folder is always a filed object. That is, you always need a parent folder.

+

OpenCMIS (Java)

+
Folder parent = ....
+
+// prepare properties
+Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.NAME, "a new folder");
+properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
+
+// create the folder
+Folder newFolder = parent.createFolder(properties);
+
+ +

PortCMIS (C#)

+
IFolder parent = ....
+
+// prepare properties
+IDictionary<string, object> properties = new Dictionary<string, object>();
+properties[PropertyIds.Name] = "a new folder";
+properties[PropertyIds.ObjectTypeId] = "cmis:folder";
+
+// create the folder
+IFolder newFolder = parent.CreateFolder(properties);
+
+ +

Creating a Document

+

CMIS 1.0 +CMIS 1.1 +Spec 2.1.4

+

Documents can be filed and unfiled. The following samples show how to create a filed document. Use the session object to create an unfiled document.

+

See also the page about content how to work with content streams.

+

OpenCMIS (Java)

+
Folder parent = ....
+
+String textFileName = "test.txt";
+
+// prepare content - a simple text file
+String content = "Hello World!";
+
+String filename = textFileName;
+String mimetype = "text/plain; charset=UTF-8";
+
+byte[] contentBytes = content.getBytes("UTF-8");
+ByteArrayInputStream stream = new ByteArrayInputStream(contentBytes);
+
+ContentStream contentStream = session.getObjectFactory().createContentStream(filename, contentBytes.length, mimetype, stream);
+
+// prepare properties
+Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.NAME, textFileName);
+properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
+
+// create the document
+Document newDoc = parent.createDocument(properties, contentStream, VersioningState.NONE);
+
+ +

PortCMIS (C#)

+
IFolder parent = ....
+
+string textFileName = "test.txt";
+
+// prepare content - a simple text file
+string content = "Hello World!";
+
+string filename = textFileName;
+string mimetype = "text/plain; charset=UTF-8";
+
+byte[] contentBytes = Encoding.UTF8.GetBytes(content);
+Stream stream = new MemoryStream(contentBytes);
+
+IContentStream contentStream = session.ObjectFactory.CreateContentStream(filename, contentBytes.length, mimetype, stream);
+
+// prepare properties
+IDictionary<string, object> properties = new Dictionary<string, object>();
+properties[PropertyIds.Name] = textFileName;
+properties[PropertyIds.ObjectTypeId] = "cmis:document";
+
+// create the document
+IDocument newDoc = parent.CreateDocument(properties, contentStream, VersioningState.None);
+
+ +

Creating a Documet from Source (Copy Content)

+

OpenCMIS (Java)

+
Folder folder = ...
+Document doc = ...
+
+doc.copy(folder); // create a copy of the document in this folder
+
+ +

PortCMIS (C#)

+
IFolder folder = ...
+IDocument doc = ...
+
+doc.Copy(folder); // create a copy of the document in this folder
+
+ +

Creating a Relationship

+

CMIS 1.0 +CMIS 1.1 +Spec 2.1.6

+

Relationships are always unfiled objects. The ID of the source object and the ID of the target object must be provided. +See the page about types how to discover relationship types and their properties.

+

OpenCMIS (Java)

+
String sourceId = ...
+String targetId = ...
+
+Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.NAME, "a new relationship");
+properties.put(PropertyIds.OBJECT_TYPE_ID, "my:relationsip");
+properties.put(PropertyIds.SOURCE_ID, sourceId);
+properties.put(PropertyIds.TARGET_ID, targetId);
+
+ObjectId newRelId = session.createRelationship(properties);
+
+ +

PortCMIS (C#)

+
string sourceId = ...
+string targetId = ...
+
+IDictionary<string, object> properties = new Dictionary<string, object>();
+properties[PropertyIds.Name] = "a new relationship";
+properties[PropertyIds.ObjectTypeId] = "my:relationsip";
+properties[PropertyIds.SourceId] = sourceId;
+properties[PropertyIds.TargetId] = targetId;
+
+IObjectId newRelId = session.CreateRelationship(properties);
+
+ +

Creating a Policy

+

CMIS 1.0 +CMIS 1.1 +Spec 2.1.7

+

Policies can be filed and unfiled. The following samples show how to create a filed policy. Use the session object to create an unfiled policy.

+

In most cases it doesn’t make sense to create an policies of the type cmis:policy because it has no semantics. Usually, the repository provides specific policy types with or without additional properties. See the page about types how to discover policy types and their properties.

+

OpenCMIS (Java)

+
Folder parent = ....
+
+// prepare properties
+Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.NAME, "a new policy");
+properties.put(PropertyIds.OBJECT_TYPE_ID, "my:policy");
+properties.put(PropertyIds.POLICY_TEXT, "my policy description");
+
+// create the policy
+Policy newPolicy = parent.createPolicy(properties);
+
+ +

PortCMIS (C#)

+
IFolder parent = ....
+
+// prepare properties
+IDictionary<string, object> properties = new Dictionary<string, object>();
+properties[PropertyIds.Name] = "a new policy";
+properties[PropertyIds.ObjectTypeId] = "my:policy";
+properties[PropertyIds.PolicyText] = "my policy description";
+
+// create the policy
+IPolicy newPolicy = parent.CreatePolicy(properties);
+
+ +

Creating an Item

+

CMIS 1.1 +Spec 2.1.8

+

Items can be filed and unfiled. The following samples show how to create a filed item. Use the session object to create an unfiled item.

+

In most cases it doesn’t make sense to create an item of the type cmis:item. Usually, the repository provides specific item types with or without additional properties. See the page about types how to discover item types and their properties.

+

OpenCMIS (Java)

+
Folder parent = ....
+
+// prepare properties
+Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.NAME, "a new item");
+properties.put(PropertyIds.OBJECT_TYPE_ID, "my:item");
+
+// create the item
+Item newItem = parent.createItem(properties);
+
+ +

PortCMIS (C#)

+
IFolder parent = ....
+
+// prepare properties
+IDictionary<string, object> properties = new Dictionary<string, object>();
+properties[PropertyIds.Name] = "a new item";
+properties[PropertyIds.ObjectTypeId] = "cmis:item";
+
+// create the item
+IItem newItem = parent.CreateItem(properties);
+
+ +

Creating object with a Folder Object vs Creating object with the Session Object

+

OpenCMIS and PortCMIS provide two ways to create objects. +The code samples above create objects in a folder. It is also possible to create an object with the session object +and without getting the parent folder first.

+

OpenCMIS (Java)

+
Map<String, Object> properties = new HashMap<String, Object>();
+properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
+properties.put(PropertyIds.NAME, "a new folder");
+
+ObjectId newFolderId = session.createFolder(properties, parentId);
+
+ +

Both approaches have advantages and disadvantages.

+

Creating an object with a folder object is more convenient. The create methods return the newly created object.

+

Creating an object with the session object is faster because it only needs one round-trip to the server. But it only returns the ID of the newly created object.

+

Unfiled objects can only be created with the session object.

+ +
+ +
+
+

+

+ + + + + + + + + + + + + + + + \ No newline at end of file Added: chemistry/site/trunk/content/docs/cmis-samples/samples/create-session/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/docs/cmis-samples/samples/create-session/index.html?rev=1750066&view=auto ============================================================================== --- chemistry/site/trunk/content/docs/cmis-samples/samples/create-session/index.html (added) +++ chemistry/site/trunk/content/docs/cmis-samples/samples/create-session/index.html Fri Jun 24 10:03:33 2016 @@ -0,0 +1,499 @@ + + + + + + + + + + + + Creating a Session - Apache Chemistry Samples + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +

Creating a Session

+

A session is the entry point to the content repository. Creating a session is the first thing an application has to do to interact with the repository.

+

A few details such as the URL of the repository endpoint, the user name and the user’s credentials are necessary to establish a session. +Beyond that more details might be required, depending on the repository and the environment. Those details are controlled by session parameters.

+

A complete list of all session parameters for OpenCMIS can be found in the JavaDoc. For PortCMIS, please refer to the help file that is contained in the binary packages.

+
+

Which binding should I use?

+

The Browser Binding is the fastest binding and is recommended for CMIS 1.1 repositories.
+Choose the AtomPub Binding for CMIS 1.0 repositories.
+The Web Services Binding is the last resort and should be avoided. It is the slowest binding and is the most complex to set up.

+
+

AtomPub Binding

+

CMIS 1.0 +CMIS 1.1

+

OpenCMIS (Java)

+
// default factory implementation
+SessionFactory factory = SessionFactoryImpl.newInstance();
+Map<String, String> parameters = new HashMap<String, String>();
+
+// user credentials
+parameters.put(SessionParameter.USER, "Otto");
+parameters.put(SessionParameter.PASSWORD, "****");
+
+// connection settings
+parameters.put(SessionParameter.ATOMPUB_URL, "http://<host>:<port>/cmis/atom");
+parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+parameters.put(SessionParameter.REPOSITORY_ID, "myRepository");
+
+// create session
+Session session = factory.createSession(parameters);
+
+ +

PortCMIS (C#)

+
// default factory implementation
+SessionFactory factory = SessionFactory.NewInstance();
+Dictionary<string, string> parameters = new Dictionary<string, string>();
+
+// user credentials
+parameters[SessionParameter.User] = "Otto";
+parameters[SessionParameter.Password] = "****";
+
+// connection settings
+parameters[SessionParameter.AtomPubUrl] = "http://<host>:<port>/cmis/atom";
+parameters[SessionParameter.BindingType] = BindingType.AtomPub;
+parameters[SessionParameter.RepositoryId] = "myRepository";
+
+// create session
+ISession session = factory.CreateSession(parameters);
+
+ +

Browser Binding

+

CMIS 1.1

+

OpenCMIS (Java)

+
// default factory implementation
+SessionFactory factory = SessionFactoryImpl.newInstance();
+Map<String, String> parameters = new HashMap<String, String>();
+
+// user credentials
+parameters.put(SessionParameter.USER, "Otto");
+parameters.put(SessionParameter.PASSWORD, "****");
+
+// connection settings
+parameters.put(SessionParameter.BROWSER_URL, "http://<host>:<port>/cmis/browser");
+parameters.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
+parameters.put(SessionParameter.REPOSITORY_ID, "myRepository");
+
+// create session
+Session session = factory.createSession(parameters);
+
+ +

PortCMIS (C#)

+
// default factory implementation
+SessionFactory factory = SessionFactory.NewInstance();
+Dictionary<string, string> parameters = new Dictionary<string, string>();
+
+// user credentials
+parameters[SessionParameter.User] = "Otto";
+parameters[SessionParameter.Password] = "****";
+
+// connection settings
+parameters[SessionParameter.BrowserUrl] = "http://<host>:<port>/cmis/browser";
+parameters[SessionParameter.BindingType] = BindingType.Browser;
+parameters[SessionParameter.RepositoryId] = "myRepository";
+
+// create session
+ISession session = factory.CreateSession(parameters);
+
+ +

Web Services Binding

+

CMIS 1.0 +CMIS 1.1

+

PortCMIS does not support the Web Service binding.

+

OpenCMIS (Java)

+
// default factory implementation
+SessionFactory factory = SessionFactoryImpl.newInstance();
+Map<String, String> parameters = new HashMap<String, String>();
+
+// user credentials
+parameters.put(SessionParameter.USER, "Otto");
+parameters.put(SessionParameter.PASSWORD, "****");
+
+// connection settings
+parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, "http://<host>:<port>/cmis/services/ACLService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, "http://<host>:<port>/cmis/services/DiscoveryService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, "http://<host>:<port>/cmis/services/MultiFilingService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, "http://<host>:<port>/cmis/services/NavigationService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, "http://<host>:<port>/cmis/services/ObjectService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, "http://<host>:<port>/cmis/services/PolicyService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, "http://<host>:<port>/cmis/services/RelationshipService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, "http://<host>:<port>/cmis/services/RepositoryService?wsdl");
+parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, "http://<host>:<port>/cmis/services/VersioningService?wsdl");
+parameters.put(SessionParameter.REPOSITORY_ID, "myRepository");
+
+// create session
+Session session = factory.createSession(parameters);
+
+ +

Local Binding

+

CMIS 1.0 +CMIS 1.1

+

The local binding is specific to OpenCMIS. It lets an OpenCMIS client connect to an OpenCMIS server in the same JVM. +There is no PortCMIS equivalent.

+

OpenCMIS (Java)

+
// default factory implementation
+SessionFactory factory = SessionFactoryImpl.newInstance();
+Map<String, String> parameters = new HashMap<String, String>();
+
+// user credentials
+parameters.put(SessionParameter.USER, "Otto");
+parameters.put(SessionParameter.PASSWORD, "****");
+
+// connection settings
+parameters.put(SessionParameter.BINDING_TYPE, BindingType.LOCAL.value());
+parameters.put(SessionParameter.LOCAL_FACTORY, "my.local.factory");
+parameters.put(SessionParameter.REPOSITORY_ID, "myRepository");
+
+// create session
+Session session = factory.createSession(parameters);
+
+ +

Connecting to the First Repository

+

Some CMIS endpoints only provide one repository. In this case it is not necessary to provide its repository ID. +The following code snippet gets the list of all available repositories and connects to the first one.

+

OpenCMIS (Java)

+
SessionFactory factory = SessionFactoryImpl.newInstance();
+List<Repository> repositories = factory.getRepositories(parameters);
+Session session = repositories.get(0).createSession();
+
+ +

PortCMIS (C#)

+
SessionFactory factory = SessionFactory.NewInstance();
+ISession session = factory.GetRepositories(parameters)[0].CreateSession();
+
+ +
+ +
+
+

+

+ + + + + + + + + + + + + + + + \ No newline at end of file Added: chemistry/site/trunk/content/docs/cmis-samples/samples/delete-objects/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/docs/cmis-samples/samples/delete-objects/index.html?rev=1750066&view=auto ============================================================================== --- chemistry/site/trunk/content/docs/cmis-samples/samples/delete-objects/index.html (added) +++ chemistry/site/trunk/content/docs/cmis-samples/samples/delete-objects/index.html Fri Jun 24 10:03:33 2016 @@ -0,0 +1,400 @@ + + + + + + + + + + + + Deleting Objects - Apache Chemistry Samples + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +

Deleting Objects

+
+

Allowable Actions

+

Before you delete an object, check the Allowable Actions to determine if the +current user is allowed to delete the object.

+
+

Deleting Objects

+

The following snippet deletes an object. +If the object is a document, all versions of the document are deleted. +If the object is a folder and it is not empty, a constraint exception is thrown.

+

OpenCMIS (Java)

+
CmisObject cmisObject = ...
+cmisObject.delete();
+
+ +

PortCMIS (C#)

+
ICmisObject cmisObject = ...
+cmisObject.Delete();
+
+ +

Deleting Documents and Versions

+

If a document is versioned, the whole version series can be deleted or just a single version. This is controlled with the allVersions parameter.

+

For documents that are not versioned it doesn’t matter if the allVersions parameter is set to true or false.

+

Deleting a Document and All Versions

+

To delete a whole version series, set the allVersions to true.

+

OpenCMIS (Java)

+
Document document = ...
+document.delete(true); // allVersions = true
+
+ +

PortCMIS (C#)

+
IDocument document = ...
+document.Delete(true); // allVersions = true
+
+ +

Deleting a Single Version

+

To delete one version with a version series, set the allVersions to false.

+

OpenCMIS (Java)

+
Document document = ...
+document.delete(false); // allVersions = false
+
+ +

PortCMIS (C#)

+
IDocument document = ...
+document.Delete(false); // allVersions = false
+
+ +

Deleting a Folder Hierarchy

+

OpenCMIS (Java)

+
Folder folder = ...
+folder.deleteTree(true, UnfileObject.DELETE, true);
+
+ +

PortCMIS (C#)

+
IFolder folder = ...
+folder.DeleteTree(true, UnfileObject.Delete, true);
+
+ +
+ +
+
+

+

+ + + + + + + + + + + + + + + + \ No newline at end of file Added: chemistry/site/trunk/content/docs/cmis-samples/samples/exceptions/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/docs/cmis-samples/samples/exceptions/index.html?rev=1750066&view=auto ============================================================================== --- chemistry/site/trunk/content/docs/cmis-samples/samples/exceptions/index.html (added) +++ chemistry/site/trunk/content/docs/cmis-samples/samples/exceptions/index.html Fri Jun 24 10:03:33 2016 @@ -0,0 +1,426 @@ + + + + + + + + + + + + CMIS Exceptions - Apache Chemistry Samples + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +

Exceptions

+

CMIS 1.0 +CMIS 1.1 +Spec 2.2.1.4

+

Exceptions are divided into three groups: general exceptions, specific exceptions, and implementation exceptions.
+General exceptions and specific exceptions are defined in the CMIS specification. +Implementation exceptions are exceptions introduced by OpenCMIS and PortCMIS. Those exceptions handle connection and authentication problems.

+

General Exceptions

+

General exceptions may be returned by a repository in response to any CMIS service method call.

+

invalidArgument

+

One or more of the input parameters is missing or invalid.

+

notSupported

+

The CMIS operation is not supported by the repository.

+

objectNotFound

+

The object, or object type, or repository does not exist or the current user has no permission to see it.

+

permissionDenied

+

The user does not have sufficient permissions to perform the operation.

+

runtime

+

Any other cause not expressible by another CMIS exception.

+

Specific Exceptions

+

The following exceptions may be returned by a repository in response to one or more CMIS service methods +calls.

+

constraint

+

The operation violates a repository- or object-level constraint defined in the CMIS domain model.

+

contentAlreadyExists

+

The operation attempts to set the content stream for a document that already has a content stream without explicitly specifying the “overwriteFlag” parameter.

+

filterNotValid

+

The property filter or rendition filter input to the operation is not valid.

+

nameConstraintViolation

+

The repository is not able to store the object that the user is creating/updating due to a name constraint violation. +There could already be an object with the same name or the name contains a character that is not allowed.

+

storage

+

The repository is not able to store the object that the user is creating/updating due to an internal storage problem.

+

streamNotSupported

+

The operation is attempting to get or set a content stream for a document whose object type specifies that a content stream +is not allowed for documents of that type.

+

updateConflict

+

The operation is attempting to update an object that is no longer current (as determined by the repository).

+

versioning

+

The operation is attempting to perform an action on a non-current version of a document that cannot be performed on a non-current version.

+

Implementation Exceptions

+

base

+

The OpenCMIS and PortCMIS exceptions are all derived from the CMIS base exception. If you want handle all CMIS exceptions at once, catch the CmisBaseException.

+

connection

+

The client could not connect to the repository for some reason. Check if you need to configure a proxy server.

+

unauthorized

+

User authentication failed.

+

proxyAuthentication

+

Proxy authentication failed.

+

serviceUnavailable

+

The server reported that the CMIS service is currently not available.

+ +
+ +
+
+

+

+ + + + + + + + + + + + + + + + \ No newline at end of file Added: chemistry/site/trunk/content/docs/cmis-samples/samples/extensions/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/docs/cmis-samples/samples/extensions/index.html?rev=1750066&view=auto ============================================================================== --- chemistry/site/trunk/content/docs/cmis-samples/samples/extensions/index.html (added) +++ chemistry/site/trunk/content/docs/cmis-samples/samples/extensions/index.html Fri Jun 24 10:03:33 2016 @@ -0,0 +1,369 @@ + + + + + + + + + + + + Getting Extensions - Apache Chemistry Samples + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +

Getting Extensions

+

CMIS 1.0 +CMIS 1.1

+

OpenCMIS (Java)

+
CmisObject cmisObject = ...
+String extensionValue = null;
+
+// extensions can be attached to different levels
+// in this example we get the extensions on the properties level
+List<CmisExtensionElement> extensions = cmisObject.getExtensions(ExtensionLevel.PROPERTIES);
+
+if (extensions != null) {
+    // iterate through the extensions until we find the one we are looking for
+    for (CmisExtensionElement ext: extensions) {
+        if ("myExtension".equals(ext.getName())) {
+            extensionValue = ext.getValue();
+            break;
+        }
+    }
+}
+
+ +

PortCMIS (C#)

+
ICmisObject cmisObject = ...
+string extensionValue = null;
+
+// extensions can be attached to different levels
+// in this example we get the extensions on the properties level
+IList<ICmisExtensionElement> extensions = cmisObject.GetExtensions(ExtensionLevel.Properties);
+
+if (extensions != null) {
+    // iterate through the extensions until we find the one we are looking for
+    try {
+        extensionValue = extensions.First(ext => ext.Name == "myExtension").Value;
+    } catch (InvalidOperationException) {
+        // not found
+    }
+}
+
+ +
+ +
+
+

+

+ + + + + + + + + + + + + + + + \ No newline at end of file