chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: Update Alfresco Aspect Properties From DotCMIS
Date Wed, 01 Feb 2012 16:56:55 GMT

 Hi Phil,

 Could you please create an issue in the Apache JIRA [1]? I'll fix it as 
 soon as possible.


 Regarding your questions:

 1) For OpenCMIS there is the Alfresco OpenCMIS Extension [2] that 
 handles aspects and aspect properties. It basically does what you did 
 but from the API perspective aspect properties are just properties, not 
 extensions.
 Up to now there was no demand to port this Java library to .Net. It's 
 not difficult because the interfaces are pretty similar, but nobody has 
 done it so far.
 As long as we don't identify another use-case for extensions in the 
 UpdateProperties call I don't think we will support extensions on that 
 level.
 In the long run this will become obsolete anyway with CMIS 1.1. The new 
 spec defines "secondary types" which are similar to aspects. With that 
 there will be native support for that feature in OpenCMIS and DotCMIS.

 2) CMIS 1.0 has no notion of aspects. You can fetch all aspect type 
 definitions (they are all child types of cmis:policy), but the CMIS 
 interface does not expose the relationships between a type and an aspect 
 type.
 You should get hold of the CMIS Workbench [3]. It lets your browse all 
 type definitions.

 3) DotCMIS is more or less feature complete. Compared to OpenCMIS there 
 are only a few convenience methods missing. We (well ... I) are fixing 
 bugs when they are reported. At some point we will add CMIS 1.1 support. 
 But OpenCMIS has priority.
 You are very welcome to support us here! Whenever you have a fix or an 
 improvement or just an idea for an improvement, please write to the 
 mailing list or open an improvement issue in the Apache JIRA. I'll pick 
 it up.


 Regards,

 Florian


 [1] https://issues.apache.org/jira/browse/CMIS
 [2] 
 https://code.google.com/a/apache-extras.org/p/alfresco-opencmis-extension/
 [3] 
 http://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html




 Am Mittwoch, den 01.02.2012, 14:05 +0100 schrieb Philip Barr 
 <Philip.Barr@synapps-solutions.com>:
> I have managed to use DotCMIS to update aspect properties using the
> following code and have a couple of questions. This code is an 
> example
> and updates cm:description of a document for which you know the id.
> Note that if you want to use this it requires a small change to the
> source (from latest trunk) stated below the code.
>
>     class Program
>     {
>         static void Main()
>         {
>             const string description = "this is a new description";
>
>             const string repositoryId =
> "7270744f-c07c-48c9-aa01-ef90089785e3";
>             string documentId =
> "workspace://SpacesStore/f8e3dc76-4781-49d6-b5d1-d3af1299ea80";
>
>             Dictionary<string, string> parameters = new
> Dictionary<string, string>();
>             parameters[SessionParameter.BindingType] = 
> BindingType.AtomPub;
>             parameters[SessionParameter.AtomPubUrl] =
> "http://localhost:8082/alfresco/service/cmis";
>             parameters[SessionParameter.User] = "admin";
>             parameters[SessionParameter.Password] = "admin";
>             parameters[SessionParameter.RepositoryId] = repositoryId;
>
>             SessionFactory factory = SessionFactory.NewInstance();
>             ISession session = factory.CreateSession(parameters);
>
>             string changeToken = null; // not sure why I need this
>
>             Properties props = new Properties();
>             props.Extensions = CreateData(description).Extensions;
>
> session.Binding.GetObjectService().UpdateProperties(repositoryId, ref
> documentId, ref changeToken, props, null);
>         }
>
>         private static ExtensionsData CreateData(string description)
>         {
>             ExtensionsData data = new ExtensionsData();
>             data.Extensions = new List<ICmisExtensionElement>();
>             CmisExtensionElement element = new CmisExtensionElement
>                 {
>                     Name = "alf:setAspects",
>                     Namespace = "http://www.alfresco.org",
>                     Children = new List<ICmisExtensionElement>
>                     {
>                         new CmisExtensionElement
>                             {
>                                 Name = "alf:properties",
>                                 Namespace = 
> "http://www.alfresco.org",
>                                 Children = new 
> List<ICmisExtensionElement>
>                                     {
>                                         new CmisExtensionElement
>                                             {
>                                                 Name = 
> "cmis:propertyString",
>                                                 Namespace =
> "http://docs.oasis-open.org/ns/cmis/core/200908/",
>                                                 Attributes = new
> Dictionary<string, string>
>                                                         {
>
> {"propertyDefinitionId","cm:description"},
>
> {"displayName","Description"},
>
> {"queryName","cm:description"}
>                                                         },
>                                                 Children = new
> List<ICmisExtensionElement>
>                                                         {
>                                                             new
> CmisExtensionElement
>                                                                 {
>
> Name = "cmis:value",
>
> Namespace = "http://docs.oasis-open.org/ns/cmis/core/200908/",
>
> Value = description
>                                                                 }
>                                                         }
>                                             }
>                                     }
>                             }
>                     }
>                 };
>             data.Extensions.Add(element);
>
>             return data;
>         }
>
> This works as long as you make the following change in converter.cs,
> line 1869 in Converter::CreateXMLElement(XmlDocument doc,
> ICmisExtensionElement element) :
>    result.Value = element.Value;
> should be
>    result.InnerText = element.Value;
>
> Questions:
>
> 1.       In the future will we be expected to add Extensions to the
> Properties as above, or will we be able to use the ExtensionsData
> attribute on UpdateProperties call which is currently ignored in the
> code?
>
> 2.       I am able to retrieve type information for an aspect by
> calling, for example, GetTypeDefinition("P:cm:titled"). But I do not
> know of any way to find out which aspects exist without finding a
> specific object first. Is there any way to find out what aspects are
> applied to a *type* without getting hold of an object first?
> It would seem to me that, since cm:content is mapped to
> cmis:document, that calling GetTypeDefinition("cmis:document") would
> return aspect information in the Extensions, but this does not seem 
> to
> be the case.
>
> 3.       How actively is DotCMIS developed? If you are looking for
> devs I have spent some time looking at the code to work this out and
> would be happy to help.
>
> Kind Regards,
> Phil Barr.
>
>
>
> IMPORTANT NOTICE
>
> This e-mail contains information which is confidential and may be
> privileged and is for the exclusive use of the recipient. If you are
> not the named recipient please contact the sender immediately and
> delete the communication from your system. You are hereby notified
> that any disclosure, distribution or copying of this communication, 
> in
> whole or in part, is strictly prohibited. It is the responsibility of
> the recipient to ensure that this message and its attachments are
> virus free. Any views or opinions presented are solely those of the
> author and do not necessarily represent those of the Company, its
> directors or officers unless otherwise specifically stated. The
> Company is not responsible for any reliance placed on the information
> contained herein and excludes all liability.
>
> SynApps Solutions Limited is a company registered in England & Wales.
> Company Registration No.: 047702224. VAT No.: 823778892


Mime
View raw message