Commit 74f5f47452b831fb9aa75055a50d4d5735cd231b

Authored by Ancuta Morarasu
1 parent 44aaeb8a5c
Exists in master

REPO-1442: Update README.md

Showing 3 changed files with 17 additions and 141 deletions   Show diff stats
... ... @@ -1,140 +0,0 @@
1   -Alfresco OpenCMIS Extension
2   -===========================
3   -
4   -The Alfresco OpenCMIS Extension provides easy access to Alfresco aspects and
5   -aspect properties.
6   -
7   -Project page: <https://gitlab.alfresco.com/platform/opencmis-extension>
8   -
9   -
10   -Using the Alfresco OpenCMIS Extension
11   --------------------------------------
12   -
13   -The Alfresco OpenCMIS Extension requires OpenCMIS 0.2 or higher.
14   -Download it from here: <http://chemistry.apache.org/java/opencmis.html>
15   -
16   -Put the Alfresco OpenCMIS Extension Jar into your classpath. When setting up
17   -an OpenCMIS session, set the object factory class to
18   -"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl".
19   -
20   -Code sample:
21   -
22   - Map<String, String> parameter = new HashMap<String, String>();
23   -
24   - // user credentials
25   - parameter.put(SessionParameter.USER, "admin");
26   - parameter.put(SessionParameter.PASSWORD, "admin");
27   -
28   - // connection settings
29   - parameter.put(SessionParameter.ATOMPUB_URL,
30   - "http://localhost:8080/alfresco/api/-default-/cmis/versions/1.0/atom");
31   - parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
32   -
33   - // set the object factory
34   - parameter.put(SessionParameter.OBJECT_FACTORY_CLASS,
35   - "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
36   -
37   - // create session
38   - SessionFactory factory = SessionFactoryImpl.newInstance();
39   - Session session = factory.getRepositories(parameter).get(0).createSession();
40   -
41   -
42   -Reading aspect properties
43   --------------------------
44   -
45   -Aspect properties automatically appear as CMIS properties.
46   -
47   -
48   -Updating aspect properties
49   ---------------------------
50   -
51   -An aspect property can be updated as any other CMIS property.
52   -
53   -
54   -Creating documents and folders with aspects
55   --------------------------------------------
56   -
57   -Aspects can be specified at creation of a document or a folder.
58   -
59   -In order to create an object, the property "cmis:objectTypeId" must be set to
60   -a valid CMIS object type id. With the Alfresco OpenCMIS Extension installed,
61   -the OpenCMIS library also accepts a comma-separated list of type ids.
62   -The first type id in that list MUST be the object type id. All following
63   -type ids MUST be aspect type ids.
64   -Aspect properties can be set for all aspects in that list.
65   -
66   -Code sample:
67   -
68   - Map<String, Object> properties = new HashMap<String, Object>();
69   - properties.put(PropertyIds.NAME, "doc1");
70   - properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled");
71   - properties.put("cm:description", "My document");
72   -
73   - Document doc = session.getRootFolder().createDocument(properties, null, null);
74   -
75   -
76   -Adding, removing and discovering aspects
77   -----------------------------------------
78   -
79   -In order to add and remove aspects, cast OpenCMIS Document objects and Folder
80   -objects to AlfrescoDocument respectively AlfrescoFolder.
81   -They provide the following additional methods:
82   -
83   - // check for applied aspects
84   - boolean hasAspect(String id);
85   - boolean hasAspect(ObjectType type);
86   - Collection<ObjectType> getAspects();
87   -
88   - // find the aspect type for a property id
89   - ObjectType findAspect(String propertyId);
90   -
91   - // add and remove aspects
92   - void addAspect(String... id);
93   - void addAspect(ObjectType... type);
94   - void removeAspect(String... id);
95   - void removeAspect(ObjectType... type);
96   -
97   -
98   -Code sample:
99   -
100   - Document doc = (Document) session.getObject(...);
101   -
102   - AlfrescoDocument alfDoc = (AlfrescoDocument) doc;
103   - alfDoc.addAspect("P:cm:taggable");
104   -
105   - if(alfDoc.hasAspect("P:cm:titled")) {
106   - Map<String, Object> properties = new HashMap<String, Object>();
107   - properties.put("cm:description", "My taggable document");
108   - alfDoc.updateProperties(properties);
109   - }
110   -
111   -
112   -If the OpenCMIS session is connected to a repository that is not an Alfresco
113   -repository, hasAspect() always returns false, getAspects() returns an empty
114   -collection and addAspect() and removeAspect() calls should be ignored by the
115   -connected repository.
116   -
117   -
118   -How does it work?
119   ------------------
120   -
121   -The CMIS specification defines several extension points. Alfresco uses these
122   -CMIS extensions to sends and accepts aspect properties. Those extensions are
123   -available to all CMIS clients but most of them ignore extensions.
124   -A vanilla OpenCMIS library can read and set CMIS extensions but that requires
125   -some code and discipline.
126   -
127   -The Alfresco OpenCMIS Extension replaces OpenCMIS' internal object factory with
128   -one that understands Alfresco CMIS extensions. The factory creates objects that
129   -are aware of Alfresco aspects and provide appropriate interfaces.
130   -
131   -So, the Alfresco OpenCMIS Extension is only a convenience layer on top of CMIS.
132   -
133   -
134   -License
135   --------
136   -
137   -Apache License, Version 2.0
138   -Please see <http://www.apache.org/licenses/LICENSE-2.0>.
139   -
140   -Copyright (C) 2005-2016 Alfresco Software Limited.
... ... @@ -0,0 +1,16 @@
  1 +Alfresco OpenCMIS Extension
  2 +===========================
  3 +
  4 +The Alfresco OpenCMIS Extension provides easy access to Alfresco aspects and aspect properties.
  5 +
  6 +Project page: <https://gitlab.alfresco.com/platform/opencmis-extension>
  7 +
  8 +Documentation page: [The Alfresco OpenCMIS Extension for CMIS 1.0](http://docs.alfresco.com/community/pra/1/concepts/opencmis-ext-intro.html)
  9 +
  10 +License
  11 +-------
  12 +
  13 +Apache License, Version 2.0
  14 +Please see <http://www.apache.org/licenses/LICENSE-2.0>.
  15 +
  16 +Copyright (C) 2005-2016 Alfresco Software Limited.
0 17 \ No newline at end of file
... ...
... ... @@ -65,7 +65,7 @@
65 65 <resource>
66 66 <directory>${basedir}</directory>
67 67 <includes>
68   - <include>README</include>
  68 + <include>README.md</include>
69 69 <include>LICENSE</include>
70 70 </includes>
71 71 <targetPath>META-INF</targetPath>
... ...