Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E3FC11F21 for ; Wed, 20 Aug 2014 10:45:06 +0000 (UTC) Received: (qmail 82266 invoked by uid 500); 20 Aug 2014 10:45:05 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 82203 invoked by uid 500); 20 Aug 2014 10:45:05 -0000 Mailing-List: contact dev-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 dev@chemistry.apache.org Received: (qmail 82192 invoked by uid 99); 20 Aug 2014 10:45:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 10:45:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.217.234.98] (HELO mailgate.synapps-solutions.com) (83.217.234.98) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 10:45:00 +0000 Received: from SSWPROD1001.synapps-solutions.com ([10.231.234.98]) by sswprod1001.synapps-solutions.com ([10.231.234.98]) with mapi; Wed, 20 Aug 2014 11:44:25 +0100 From: Philip Barr To: "dev@chemistry.apache.org" Date: Wed, 20 Aug 2014 11:44:23 +0100 Subject: Creating Relationships Thread-Topic: Creating Relationships Thread-Index: Ac+7p6RvARvRz5IbSBKdzZ8tJms+BgAu/+KQ Message-ID: <2D9094AD2E4FBE4B86B8B274D9DB9E08C95981C34D@sswprod1001.synapps-solutions.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB x-pmwin-version: 3.1.3.0, Antivirus-Engine: 3.53.0, Antivirus-Data: 5.04G x-puremessage: [Scanned] Content-Type: multipart/alternative; boundary="_000_2D9094AD2E4FBE4B86B8B274D9DB9E08C95981C34Dsswprod1001sy_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_2D9094AD2E4FBE4B86B8B274D9DB9E08C95981C34Dsswprod1001sy_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 a= ny folder to any other document. I can't create a relationship of type "cmi= s:relationship" because it is handily "uncreateable" and all other relation= ships are clearly wrappers around Alfresco association types, so would be u= nusable when I try to connect another repository. Even if I decide to use an Alfresco type and just change it for different r= epositories, I can't work out which one to use because RelationshipType.Ge= tAllowableSourceTypes and Relationship.GetAllowableTargetTypes is always ju= st an empty list. How do I create a relationship from any folder/doc to any other folder/doc. My code: Dictionary parameters =3D new Dictionary(); parameters[SessionParameter.BindingType] =3D BindingType.AtomPu= b; string url =3D "http://localhost:8080/alfresco/cmisatom"; parameters[SessionParameter.AtomPubUrl] =3D url; parameters[SessionParameter.User] =3D "admin"; parameters[SessionParameter.Password] =3D "admin"; SessionFactory factory =3D SessionFactory.NewInstance(); IList repositories =3D factory.GetRepositories(par= ameters); ISession session =3D repositories[0].CreateSession(); IItemEnumerable children =3D session.GetTypeChildr= en("cmis:relationship", true); foreach (IObjectType child in children) { RelationshipType rel =3D 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, Phil. IMPORTANT NOTICE This e-mail contains information which is confidential and may be privilege= d and is for the exclusive use of the recipient. If you are not the named r= ecipient please contact the sender immediately and delete the communication= from your system. You are hereby notified that any disclosure, distributio= n or copying of this communication, in whole or in part, is strictly prohib= ited. It is the responsibility of the recipient to ensure that this message= and its attachments are virus free. Any views or opinions presented are so= lely those of the author and do not necessarily represent those of the Comp= any, its directors or officers unless otherwise specifically stated. The Co= mpany is not responsible for any reliance placed on the information contain= ed herein and excludes all liability. SynApps Solutions Limited is a company registered in England & Wales. Compa= ny Registration No.: 04770224. VAT No.: 823778892 --_000_2D9094AD2E4FBE4B86B8B274D9DB9E08C95981C34Dsswprod1001sy_--