chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Barr <>
Subject Creating Relationships
Date Wed, 20 Aug 2014 10:44:23 GMT
Hi all,

I'm using DotCMIS 0.6 to connect to Alfresco Community 4.2f, but am having problems creating
a relationship from any folder to any other folder, and any folder to any other document.
I can't create a relationship of type "cmis:relationship" because it is handily "uncreateable"
and all other relationships are clearly wrappers around Alfresco association types, so would
be unusable when I try to connect another repository.
Even if I decide to use an Alfresco type and just change it for different repositories, I
can't work  out which one to use because RelationshipType.GetAllowableSourceTypes and Relationship.GetAllowableTargetTypes
is always just an empty list.

How do I create a relationship from any folder/doc to any other folder/doc.

My code:

            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters[SessionParameter.BindingType] = BindingType.AtomPub;

            string url = "http://localhost:8080/alfresco/cmisatom";

            parameters[SessionParameter.AtomPubUrl] = url;

            parameters[SessionParameter.User] = "admin";

            parameters[SessionParameter.Password] = "admin";

            SessionFactory factory = SessionFactory.NewInstance();

            IList<IRepository> repositories = factory.GetRepositories(parameters);

            ISession session = repositories[0].CreateSession();

            IItemEnumerable<IObjectType> children = session.GetTypeChildren("cmis:relationship",

            foreach (IObjectType child in children)


                RelationshipType rel = child as RelationshipType;

                Console.WriteLine(rel.Id + ": \n");

                Console.WriteLine("\tSource Types:" );

                foreach (IObjectType type in rel.GetAllowedSourceTypes)


                    Console.WriteLine("\t\t" + type.Id);


                Console.WriteLine("\tTarget Types:");

                foreach (IObjectType type in rel.GetAllowedTargetTypes)


                    Console.WriteLine("\t\t" + type.Id);



Kind Regards,


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.: 04770224. VAT No.: 823778892

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message