Index by title

CMIS for Microsoft SharePoint

Full documentation (EN)

Documentation complète (FR)

CMIS source code is hosted in CodePlex: http://cmis4sharepoint.codeplex.com/.

Downloads
Documentation
Report a bug
Discussion boards
Source Code

W'd like to hear from you:


Créer le fichier svc

<%@ Assembly Name="$Nom de votre Assembly$, Version=1.0.0.0, Culture=neutral, PublicKeyToken=$PKT de votre assembly$"%> 
<% @ServiceHost Service="$namespace$.$classe implementant le service$" %>
<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <system.serviceModel>
    <services>
      <service behaviorConfiguration="$1" name="$namespace$.$classe implementant le service$">
        <endpoint address="" binding="wsHttpBinding" contract="$namespace$.$Interface definissant le service$">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="REST" binding="webHttpBinding" contract="$namespace$.$Interface definissant le service$" behaviorConfiguration="$2" />
        <host>
          <baseAddresses>
            <add baseAddress="http://$adresse de votre site SharePoint$/_wcf/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="$1">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="$2">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
</configuration>

Créer une librairie WCF

Pour créer une librairie WCF de test suivez les étapes suivantes:

<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <compilation debug="true" />
      </system.web>
      <system.serviceModel>
        <services>
        </services>
        <behaviors>
          <serviceBehaviors>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>

* Faites un clic droit sur le projet et choisir "Add->New item" et choisisez de rajouter un "WCF service" que vous appelerez "HelloWorld" * Modifiez les fichier HelloWorld.cs et IHelloWorld.cs pour qu'ils soint comme cela:
    [WebGet(UriTemplate="SayHello/{inputName}")]//Cette ligne specifie l'uri pour l'acces REST
    [ServiceContract]
    public interface IHelloWorld
    {
        [OperationContract]
        string SayHello(string inputName);
    }

   public class HelloWorld : IHelloWorld
   {
        #region IHelloWorld Members
        public string SayHello(string inputName)
        {
            return "Hello " + inputName;
        }
        #endregion
   }


Créer un répertoire WCF sous SharePoint

Nous allons créer un répertoire sur le site SharePoint hébergé avec IIS 7.0.

  1. Créer un dossier physique dans le meme Virtual directory qui heberge SharePoint (afin d'heriter des permissions d'accées) par exemple j'ai crée le répertoire : C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_wcf
  2. A traver IISmanager verifier que le dossier existe, sinon en créer un nouveau portant le meme nom (attention a ne pas le convertir en virtual directory)
  3. Executer les commandes suivantes afin d'enregistrer WCF sur windows server et IIS, la premiere est pour enregister le namespace de ServiceModel et la deuxieme est pour rajouter certaines extensions de bindings specifiques aux services REST.

Create a WCF directory in SharePoint

We will create a directory on the SharePoint site hosted with IIS 7.0.

  1. Create a physical folder in the same virtual directory that hosts SharePoint (to inherit permissions) for example I created the directory: C: \ Inetpub \ wwwroot \ wss \ VirtualDirectories \ 80 \ _wcf
  2. Through IISmanager verify that the file exists, otherwise create a new one bearing the same name (warning: do not convert to a virtual directory)
  3. Execute the following commands to register WCF on Windows Server and IIS, the first is to Save the namespace ServiceModel and the second is to add some specific extensions bindings forREST services.

Create the svc file

<%@ Assembly Name="$Nom de votre Assembly$, Version=1.0.0.0, Culture=neutral, PublicKeyToken=$PKT de votre assembly$"%> 
<% @ServiceHost Service="$namespace$.$classe implementant le service$" %>
<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <system.serviceModel>
    <services>
      <service behaviorConfiguration="$1" name="$namespace$.$classe implementant le service$">
        <endpoint address="" binding="wsHttpBinding" contract="$namespace$.$Interface definissant le service$">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="REST" binding="webHttpBinding" contract="$namespace$.$Interface definissant le service$" behaviorConfiguration="$2" />
        <host>
          <baseAddresses>
            <add baseAddress="http://$adresse de votre site SharePoint$/_wcf/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="$1">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="$2">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
</configuration>

Create a WCF library

To create a library of test WCF follow the following steps:

<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <compilation debug="true" />
      </system.web>
      <system.serviceModel>
        <services>
        </services>
        <behaviors>
          <serviceBehaviors>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>

<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <compilation debug="true" />
      </system.web>
      <system.serviceModel>
        <services>
        </services>
        <behaviors>
          <serviceBehaviors>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>

    [WebGet(UriTemplate="SayHello/{inputName}")]
    [ServiceContract]
    public interface IHelloWorld
    {
        [OperationContract]
        string SayHello(string inputName);
    }

   public class HelloWorld : IHelloWorld
   {
        #region IHelloWorld Members
        public string SayHello(string inputName)
        {
            return "Hello " + inputName;
        }
        #endregion
   }

* Build the project (with a "Strong name") and put the assembly in the GAC("%windir%\assembly\").

Customize the URL for the REST services

Now that our WCF service is installed we want to delete. "Svc" when accessing REST.
So instead of typing a URL in this form

http://moss2007/_wcf/HelloWorld.svc/REST/<parametres>
we will use instead this URL
http://moss2007/_wcf/HelloWorld/REST/<parametres>

To do this we will use an additional module for IIS7 which is the IIS 7 URL Rewrite Module.

After installing the module, open the folder containing your WCF service using "IIS7 manager". You will find the new module available.
Click it and choose the option "Add Rule". Name the new rule "remove. Svc”.
Then edit the rule as represented in the screenshot below:


Ecrire un "WCF Virtual Path Provider"

Une fois que le fichier .svc est créé et que vous tentez d'y accéder à travers votre navigateur web, vous recevrez une erreur de type "404-Not found".
Ce problème est dû a un mauvais fonctionnement du VirtualPathProvider implémenté pas SharePoint, dans la classe SPVirtualPathProvider, et qui plante lorsqu'on lui présente des URL commencent avec le caractère "~".

Pour résoudre ce problème il suffit de créer son propre VirtualPathProvider. Il est important de souligner que cette implémentation ne reprendra pas tous le travail du SPVirtualPathProvider, mais elle viendra se greffer aprés lui grâce au fonctionnement en chaine des VirtualPathProvider, ainsi l'attribut "Previous" de notre provider pointera sur le SPVirtualPathProvider.

Mais avant tout il faut créer une classe qui hérite de "System.Web.Hosting.VirtualPathProvider.

  public class WCFVirtualPathProvider : VirtualPathProvider
    {

        public override string CombineVirtualPaths(string basePath, string relativePath)
        {

            return Previous.CombineVirtualPaths(basePath, relativePath);

        }

         //...
        // Les autres méthodes ne sont pas mentionnées car elles ne font qu'appeler l'attribut Previous comme ci-dessus

        public override bool FileExists(string virtualPath)
        {

            string fixedVirtualPath = virtualPath;

            if (

                  virtualPath.StartsWith("~") &&

                  virtualPath.EndsWith(".svc")

               )
            {

                fixedVirtualPath = virtualPath.Remove(0, 1);

            }

            return Previous.FileExists(fixedVirtualPath);

        }

        protected override void Initialize()
        {

            base.Initialize();

        }

    }

Donc pour reprendre un peu le fonctionnement de cette classe, nous n'allons modifier que la méthode "FileExists", elle se chargera d'enlever le tilde "~" du path reçu et le fera passer pour traitement au SPVirtualPathProvider.
Maintenant il faut enregistrer notre VirtualPathProvider et le chainer au SPVirtualPathProvider. Pour ce faire nous devons exécuter les deux lignes de codes qui suivent:

WCFVirtualPathProvider wcfVPP = new WCFVirtualPathProvider();

HostingEnvironment.RegisterVirtualPathProvider(wcfVPP);

Or il faut veiller à n'exécuter ce code qu' une SEULE fois, et ceci a chaque éxecution de "IISRESET" et/ou modification de web.config. Car ASP.NET oublie les VirtualPathProvider qu'il utilisait après chaque IISRESET.

La façon la plus élégante de régler ce problème c'est de placer ce code dans un HttpModule, qui possède une variable statique chargée de vérifier l'enregistrement de notre VirtualPathProvider. Voici le code du HttpModule:

    public class WCFVPPRegModule: IHttpModule
     {

         static bool wcfProviderInitialized = false;

         static object locker = new object();

         public void Init(HttpApplication context)

         {

             if (!wcfProviderInitialized)

             {

                 lock (locker)

                 {

                     if (!wcfProviderInitialized)

                     {

                         WCFVirtualPathProvider wcfVPP = new WCFVirtualPathProvider();

                         HostingEnvironment.RegisterVirtualPathProvider(wcfVPP);

                         wcfProviderInitialized = true;

                     }

                 }

             }

         }

     }

Une fois que nos classes sont prêtes nous devons les mettre dans le GAC (dans notre cas nous allons les mettre dans un seul module dénommé "WCFSupport"), puis nous modifions le fichier web.config pour rajouter le HttpModule qui a son tour va référencer le VirtualPathProvider.

  <add 

     name="WCFVPPRegModule" 

    type="WCFSupport.WCFVPPRegModule, WCFSupport, Version=1.0.0.0, Culture=neutral,PublicKeyToken=d4f7bd9e55b39661" 

  />

Pour les utilisateurs de Windows Sever 2008: Dans IIS7 Manager cliquez sur la configuration d'authentification ("authentication settings") du site sharePoint ciblé, et activez l'authentification anonyme "anonymous authentication". Ceci permettra l'accès annonyme aux service sans corrompre la sécuité du site sharePoint.

Maintenant tout est prêt pour l'utilisation de WCF sous SharePoint pour vous en assurer dirigez vous, avec votre navigateur web, à l'adresse de votre service et si vous obtenez une page similaire a l'image ci-dessous c'est que tout est en règle:


CMIS4SharePoint

IP-Tech to the forefront

IP-Tech is a Tunisian booming software services provider. Founded by two senior engineers having ten years of experience each. They joined to them a highly qualified team working on major and challenging projects.

This increased IP-Tech notoriety and recognition among several customers while outsourcing their software development to a qualified and reliable offshore partner.

Aiming to distinguish itself from the competition, IP-Tech attaches great importance to technological and active participation within the community. IP-Tech was able to detect very early the important role that CMIS will play in the market of Enterprise Content Management (ECM).

So IP-Tech has decided to implement the first version of CMIS for the Microsoft SharePoint product. In this wiki you will find information necessary for understanding CMIS and particularly CMIS4SharePoint.

Business contacts

Tel. +216.70.93.77.73 - Fax +216.70.93.77.74

Postal address Tanit Center B2.42 - 2070 La Marsa, Tunisia.

Internet | http://www.iptech-offshore.com

CMIS

CMIS stands for "Content Management Interoperability Services". It is a draft standard established by the three biggest actors in the ECM industry:
Microsoft (with its SharePoint product), EMC (Documentum) and IBM (IBM Content Manager, IBM FileNet P8), which together represent the biggest part in the ECM market.

CMIS is being validated by the Organization for the Advancement of Structured Information Standards
The CMIS specification is now available under the public review version 1.0c .
CMIS was quickly supported by other ECM market players as: Alfresco, Oracle, Open Text, SAP, etc.
These players are currently the technical committee within OASIS.

The CMIS standard aims to provide a high-level layer of services, to ensure minimal interoperability between systems. It aims to provide just the essential, not a full API covering all the capabilities of ECM.

The purpose of CMIS is the result of a Forester study, this study provides, that it is common nowadays to find within the same company different content management systems. For example, the data service works on EMC Documentum, but other departments running with Microsoft SharePoint, this leads to a stack of incompatible products.

But companies today tend to use tools to centralize the information circulating within them (use of ERP and CRM, etc.) And the ECM are no exception to this rule. This led to the manufacture of "Ad-hoc” tools for information synthesis. These solutions are not reusable and a minor change in the architecture entails enormous expense. CMIS’s willing is to ensure minimal interoperability; its implementation will not result in major changes in the data model of the applications. The goals of CMIS are:

Known implementations of CMIS

The community was quickly interested in this standard and we found now many implementations and tools. This development will allow the committee to test ideas and to detect inconsistencies in the standard.

CMIS Servers

CMIS Tools

CMIS Clients

Microsoft and CMIS

Although one of the originators of CMIS and an editor of the original document, it is important to note the silence from Microsoft for possible implementation of CMIS. Microsoft has indeed announced its participation in CMIS, and the availability of the standard in SharePoint 2010.

SharePoint is falling behind

Although you have some idea about SharePoint is well to recall some fundamental
SharePoint (in both versions WSS 3.0 and MOSS 2007) they are the Microsoft’s platforms for entreprise content management. They provide management capabilities for documents, web content management, collaboration, enterprise search and business intelligence.
In reality MOSS is built on WSS. This is the kernel of the ECM present in each free Microsoft Windows server. It represents the basic functionality in document management, web content management, and collaboration.

Currently, SharePoint is the most used solution of content management in business, with more than 1 billion (U.S. $) license sold.
Due to the clear weight of Microsoft and its product, analysts are almost unanimous ( word-of-pie, Cmstrends), CMIS will succeed by SharePoint adopting the standard.

But the reactions of Microsoft slow to come and we see that SharePoint is fully behind its competitors in the implementation of CMIS. By the time this wiki is written in Microsoft wrote one article relating to a possible use of CMIS. This article appeared in MSDN and talks about how to integrate a SharePoint library to a CMIS repository.

And even if SharePoint 2010 integrates CMIS, it is important to note that most licenses are sold on MOSS 2007, and for companies who do not (or cannot) migrate to SharePoint2010 they can't benefit from features of CMIS.

CMIS4SharePoint

The silence from Microsoft, relating to the fate of CMIS and SharePoint, pushed IP-Tech to achieve CMIS4SharePoint.IP-Tech’s CMIS4SharePoint today is the first implementation of CMIS compatible with the Microsoft SharePoint product.
We will discuss later in this wiki the implementation details of CMIS4SharePoint.

Implementing CMIS4SharePoint

SharePoint is characterized by its rich object model; this enabled him to be a true programming platform. This results in an exceptional modularity. These two elements used jointly helped to establish an implementation of CMIS for SharePoint. This implementation requires the addition of new software bricks to those already provided by SharePoint. Thus we have developed an architecture based on. Net Framework 3.5 Sp1 and essentially WCF.
WCF three magic letters designating Windows Communication Foundation was an essential element for the implementation of this project. Thanks to the separation between the communication layer and service’s implementation, WCF allowed to establish means of communication following the interoperable Web services specifications (WS-I and WS-*) and Atom Publishing Protocol. In addition its modularity also allowed us to adapt exchanged messages as well as expose some flexibility of use thanks to supervision through the configuration file.

Ultimately the software architecture adopted by CMIS4SharePoint is as follows:

To use CMIS4SharePoint you need the following hardware:

These various components are summarized in the following deployment diagram:

Compliance with specification

CMIS4SharePoint aims to be consistent with the CMIS version 0.5. For more detail on the choices made during implementation of CMIS 4SharePoint to illustrate the concepts and basic functionality of CMIS please visit the following:

RoadMap

Implementing CMIS4SharePoint is not yet complete. The following describes the operations available and what remains to be done.
As a reminder, CMIS offers to consume the services either via SOAP or via AtomPub.

N.B: Relationship Services and Policy Services are not implemented,
in due to the mismatch between these concepts and the SharePoint object model

Installing CMIS4sharePoint: Host a WCF service on SharePoint

To get the power of WCF, which is not included by default in SharePoint we have to realize the support in a personalized way.
the steps are described on the Sahil Malik’s blog

We will try in what follows to take these steps while adding to those specific to IIS 7.0 and Windows Server 2008

Step1:Create a WCF directory under SharePoint  
Step2:Creating a WCF library
Step3:Create the .svc file
Step4:Write "WCF Virtual Path Provider"
Step5:Custom URLs for REST Services
Step6:Put the CMIS4SharePoint.dll file in the GAC
Step7:Put CMIS4SharePoint.svc and web.config file under the WCF directory in SharePoint (see step 1)
Step8:Execute the console command c:\>iireset

Example of consuming CMIS services

Once CMIS4SharePoint properly installed (Test the operation with a web browser), we will now illustrate the use of CMIS, with a client that will list the name and URL of all document libraries available on the SharePoint site.
To start we'll create in a client computer (other than the SharePoint server) a new Console project in Visual Studio 2008 called "ClientTestCMIS.
Once the project created, right click on the project in Solution Explorer and select "Add Service Reference".

In the dialog box that opened, enter the address of your service, press "GO" and then select the named service, as illustrated in this screenshot:

Rename the namespace of the service and validate.
Now Visual Studio generated proxy that includes all services. Now we just have to implement our program:

Note the addition of the using ClientTestCMIS.CMISRefrence; it's in order to facilitate the use of intellisense.

And the result:

We were able to list all document library of SharePoint without using the SharePoint’s Web-services.

Remarque: if you fail to run, and you receive an exception on the "endpoints". * Check the App.config file * of your client. and Check the "address" attribute of the "endpoint" node. In our case we used the IP address because our SharePoint server is not part of the domaine.


Cmis4SharePoint

IP-Tech à l’avant-garde

Après deux années d’existence IP-Tech est une SSII tunisienne en plein essor et qui se donne les moyens de ses ambitions. Fondée par deux ingénieurs possédant une expérience d'une dizaine d'années sur le marché parisien. Ils sont très attachés au respect des valeurs du métier de l’informatique.

Aveccses valeurs (l'écoute, l'engagement, la qualité et le devoir de conseil.) ils ont su s’entourer d’une équipe hautement qualifiée réalisant des taches à hautes valeur ajoutée. Cela a valu à IP-Tech une notoriété et une reconnaissance auprès de plusieurs clients ( ici ).

Soucieux de se distinguer de la concurrence, IP-Tech accorde une grande importance à la veille technologique et à la participation active au sein de la communauté. IP-Tech a su déceler très tôt le rôle majeur que va jouer CMIS dans le marché des gestionnaires de contenus pour l’entreprise (ECM).
Ainsi IP-Tech a décidé d’implémenter la première version de CMIS pour le produit Microsoft SharePoint. Dans ce wiki vous trouverez plusieurs informations nécessaires à la compréhension de CMIS et particulièrement CMIS4SharePoint.

Services d’interopérabilité pour la gestion de contenus

CMIS est l’acronyme pour « Content Management Interoperability Services ». Ce qui se traduit par services d’interopérabilités pour les gestionnaires de Contenus.
C’est une prénorme établie par les trois ténors du marché:
Microsoft (avec son produit SharePoint), EMC (Documentum) et IBM (IBM Content Manager, IBM FileNet P8), qui à eux trois représentent la majeure partie du marché des ECM (Entreprise Content Management).

CMIS est en cours de validation par l’organisation « Organization for the Advancement of Structured Information Standards (OASIS)»
Le calendrier établi en février 2009 prévoit une version 1.0 en septembre 2009, mais les choses ne ce sont pas déroulées comme prévus et on constate un retard engendré par la multiplication des versions brouillons ( roadMap CMIS-OASIS ). La spécification est disponible maintenant sous la version 0.62c "brouillon".
CMIS rencontra rapidement le soutien des autres acteurs du marché des ECM comme : Alfresco, Oracle, Open Text, SAP, etc.
Ces acteurs constituent actuellement le comité de validation technique (Technical comitee) au sein de "OASIS".

La norme CMIS vise à offrir une couche de services haut-niveau, pour assurer une interopérabilité minimale entre les systèmes. Elle a pour but de fournir juste l’essentiel, et non pas une API exhaustive de toutes les capacités des ECM.
La raison d’être de CMIS est le résultat d’une étude de l’agence Forester, cette étude stipule, qu’il est commun de nos jours de trouver au sein d’une même entreprise divers systèmes de gestion de contenus. Par exemple le service des données travaille sur EMC Documentum, mais les autres départements tournent avec Microsoft SharePoint, ceci conduit à une multitude de produits incompatibles.

Or les entreprises ont tendance aujourd’hui à utiliser des outils pour essayer de centraliser au mieux l’information circulant en leur sein (utilisation des ERP et des CRM, etc.) et les ECM n’échappent pas à cette règle. Ceci conduit à la fabrication d’outils « Ad-hoc », souvent bricolés ou faisant appel à des intervenants étrangers, pour synthétiser l’information. Ces solutions sont donc non réutilisables et un changement mineur de l’architecture entraine des dépenses énormes. CMIS voulant assurer une interopérabilité minimale, son implémentation n’entrainera pas de grands changements dans le model de données des applications. Les Buts de CMIS sont les suivants :

Implémentations connues de CMIS

La version actuelle du standard CMIS est estampillée "Brouillon" (draft). Malgré cela, la communauté c'est rapidement intéressée à ce standard et plusieurs implémentations et outils ont vus le jour. Ces Développement permettent au comité de standardisation de tester les idées et de détecter les incompatibilités.

Serveurs CMIS

Outils CMIS

Clients CMIS

Microsoft et CMIS (l’Arlésienne)

Bien qu'étant l'un des instigateurs de CMIS et un des rédacteurs du document initial, il est important de souligner le mutisme de Microsoft quant à une éventuelle implémentation de CMIS. Microsoft a bel et bien annoncé sa participation à CMIS mais sans plus, d’ailleurs sur le blog officiel de l’équipe de développement SharePoint on ne trouve qu’un seul article , datant du 09/09/2008, et qui traite de CMIS.
Ce qui nous amène à nous interroger sur le sort que réserve Microsoft pour CMIS. De plus plusieurs interrogations concernent SharePoint et un support éventuel du standard.

SharePoint accumule du retard

Bien que vous ayez une certaine idée sur SharePoint il est bien de rappeler quelques fondamentaux :
SharePoint dans ses deux versions WSS 3.0 et MOSS 2007 sont la plateforme de gestion de contenu d’entreprise de Microsoft. Ils offrent des fonctionnalités de gestion de documents, de gestion de contenu web, de collaboration, de recherche d’entreprise et de Business Intelligence.
En réalité MOSS est construit autour de WSS. Qui est le noyau de l’ECM présent gratuitement dans chaque Microsoft Windows server. Il représente les fonctionnalités de base dans la gestion des documents, des contenus web et de collaboration.
Actuellement, SharePoint est la solution de gestion de contenu la plus utilisée en entreprise, avec plus de 1 milliards de dollars (US$) en licence vendues .

En raison du poids évident de Microsoft et de son produit, les analystes sont presque unanime (word-of-pie , Cmstrends), la réussite CMIS passera par une adoption du standard par SharePoint.

Mais les réactions de Microsoft tardent à venir et on constate que SharePoint se fait amplement distancer par ses concurrents dans l’implémentation de CMIS. Au moment ou ce wiki est écrit Microsoft à écrit un seul article se rapportant à une utilisation possible de CMIS. Cette article est paru dans MSDN et parle de la manière d' integrer une bibliothèque SharePoint à un ECM exposant des services CMIS .

Ce mutisme est peut être justifié par la préparation du lancement imminent de la nouvelle mouture SharePoint 2010. Or très peu d’informations ont filtré quant au possible support de CMIS par la version 2010 .

Et même si SharePoint 2010 intègre CMIS, il est important de signaler que la majorité des licences vendues sont relatives à MOSS 2007, et pour les entreprises qui ne veulent pas (ou ne peuvent pas) migrer vers SharePoint2010 ils ne pourront bénéficier des fonctionnalités de CMIS.

CMIS4SharePoint (100% made in Tunisia)

Le silence de Microsoft, quant'au sort de CMIS et de SharePoint, a poussé IP-Tech vers la réalisation de CMIS4SharePoint. Fruit des compétences 100% tunisienne d’IP-Tech, CMIS4SharePoint est aujourd’hui la première implémentation de CMIS compatible avec le produit Microsoft SharePoint.
Nous aborderons dans la suite de ce wiki les détails de l’implémentation de CMIS4SharePoint.

Implémentation de CMIS4MSS

SharePoint se caractérise par la richesse de son modèle objet accessible, ceci lui à permis d’acquérir le nom de « plateforme de programmation ». Cette richesse s’accompagne d’une modularité exceptionnelle. Ces deux éléments utilisés conjointement ont permis de mettre sur pied une implémentation de CMIS à destination de SharePoint. Cette implémentation, nécessita l’adjonction de nouvelles briques logicielles à celles déjà fournie par SharePoint. Ainsi nous avons mis sur pied une architecture basée sur le .net Framework 3.5 Sp1 et essentiellement WCF.

WCF trois lettres magiques désignant Windows communication fondation, fût un élément essentiel pour la mise en place de ce projet. Grace à sa séparation entre les moyens de communication et l’implémentation des services, WCF à permis de mettre en place des moyens de communication interopérable respectant les spécifications web services (WS-I et WS-*) et Atom publishing Protocol. De plus sa modularité nous à aussi permis d’adapter les messages échangés (tel les ajouts apportés par CMIS à la norme AtomPub) ainsi que d’exposer une certaine flexibilité d’utilisation grâce au contrôle du service à travers le fichier de configuration.

Au final l'architecture logicielle adoptée par CMIS4SharePoint est la suivante :

Pour utiliser CMIS4SharePoint vous devez disposer de la configuration matérielle suivante :

Ces different élément sont résumés dans le diagramme de déploiement suivant:

Conformité à la spécification

CMIS4SharePoint se veut conforme à la spécification CMIS dans sa version 0.5. Pour plus de détail quant aux choix effectué lors de l'implémentation de CMIS 4SharePoint pour illustrer les notions et les fonctionnalités de base de CMIS veuillez consulter la page suivante:

RoadMap

L'implémentation de CMIS4SharePoint n'est pas encore terminée. Ce qui suit détaille les opérations disponibles et ce qui reste à effectuer.
Pour rappel CMIS propose de consommer les services soit via SOAP soit via AtomPub.

N.B: Relationship Services et Policy Services ne sont pas implémenté,
en raison de la non correspondance entre ces notions et le modèle objet SharePoint

Installation de CMIS4MSS: Héberger un service WCF sur SharePoint

Afin de pouvoir beneficier de la puissance de wcf, qui n'est pas inclus par défaut dans SharePoint nous devons realiser le support de facon personalisée.
les etapes a suivre sont décrite sur le blog de Sahil Malik

Je vais essayer dans ce qui suit de reprendre ces étapes tout en y rajoutant celles spécifiques a IIS 7.0 et windows server 2008

étape1:Créer un répertoire WCF sous SharePoint
étape2:Créer une librairie WCF
étape3:Créer le fichier .svc
étape4:Ecrire un "WCF Virtual Path Provider"
étape5:Personnaliser les URL pour les services REST
étape6:Mettre le fichier CMIS4SharePoint.dll dans le GAC
étape7:Mettre les fichiers CMIS4SharePoint.svc et web.config dans le répertoire WCF sous SharePoint (voir étape 1)
étape8:Executer la commande console c:\>iireset

Exemple de consommation de services CMIS

Une fois CMIS4SharePoint bien installé (tester le bon fonctionnement avec un explorateur web), nous allons maintenant illustrer l'utilisation de CMIS, avec un client qui va lister le nom et l'URL de l'ensemble des bibliothèques de documents disponible dans le site SharePoint.
Pour commencer nous allons créer sur une machine cliente (autre que le serveur SharePoint) un nouveau projet Console sous Visual Studio 2008.Ce projet s'appellera "ClientTestCMIS".
Une fois le projet créé, faites un clique droit sur le projet dans explorateur de solution, et sélectionnez "Ajouter réference de services" (Add Service Refrence).

dans la boite de dialogue qui s'est ouverte, saisissez l'adresse de votre service, appuyez sur "GO" puis sélectionnez le service retrouvé, comme l'illustre cette capture :

Renommez le namespace du service et validez.
Maintenant Visual Studio a généré un proxy qui reprend tout les services exposé, il ne reste plus qu'a implémenter notre programme:

Notez l'ajout de la directive using ClientTestCMIS.CMISRefrence; et ceci afin de faciliter l'utilisation de l'intellisense.

Et voici le résultat:

Nous avons réussi à lister l'ensemble des bibliothèque de documents de SharePoint sans avoir recours aux Web-services propres de SharePoint.

Remarque: Si vous échouez à exécuter le programme, et que vous recevez une exception relative aux "endpoints". Verifiez le fichier App.config de votre client. et vérifiez l'attribut "address" du noeud "endpoint". Dans notre cas nous avons eu recours à l'adresse IP car notre serveur SharePoint ne fait pas partie du domaine.


Mapping CMIS-SharePoint

Repository Capabilities

Ceci expose les fonctionnalités de la bibliothèque de documents

Model Mapping

Ici nous exposerons la correspondance entre le modèle objet SharePoint et les objets CMIS.
Note 1: (*) – n’est pas supporté.
Note 2: Les « Relationship » ne sont pas implémenté

Object properties

« Item » est un objet « SPListItem ».

Document (inc. Object) Properties

« file » est un objet « SPFile ».

Folder (inc. Object) properties

« folder » est un objet « SPFolder ».

Relationship (inc. Object) properties *

Meta Model Mapping

Base Object Types

Object Type Definition

« myContentType » est un objet « SPContentType »

Property Type Definition

« field » est un objet « SPField »

Property Type Mapping

Permissions

Pour obtenir les permissions nous utilisons la méthode de la classe « SPItem » « DoesUserHavePermissions(SPBasePermissions masque) »

Document

Folder

Relationship *


Mapping CMIS-SharePoint

Repository Capabilities

This exposes the functionality of the document library

Model Mapping

Here we discuss the correspondence between the SharePoint object model and CMIS.
note 1: (*) - Not supporté.
note 2: "Relationship" is not implémenté

Object properties

« Item » is an « SPListItem » object.

Document (inc. Object) Properties

« file » is an « SPFile » object.

Folder (inc. Object) properties

« folder » is an « SPFolder » object.

Relationship (inc. Object) properties *

Meta Model Mapping

Base Object Types

Object Type Definition

« myContentType » is an « SPContentType » object.

Property Type Definition

« field » is an « SPField » object.

Property Type Mapping

Permissions

To get the permissions we use the class method "SPItem" DoesUserHavePermissions (SPBasePermissions mask) "

Document

Folder

Relationship *


Personnaliser les URL pour les services REST

Maintenant que notre service WCF est installé nous voulons supprimer le ".svc" lors de l'accès REST.
Ainsi au lieu de taper une URL de cette forme http://moss2007/_wcf/HelloWorld.svc/REST/&lt;paramètres&gt; nous utiliserons plutôt cette URL http://moss2007/_wcf/HelloWorld/REST/&lt;paramètres&gt;

Pour faire cela nous allons utiliser un module additionnel d'IIS7 et qui est l' IIS 7 Url Rewrite Module.

Après installation du module ouvrez le dossier contenant votre service WCF à l'aide de "IIS7 manager". Vous y trouverez le nouveau module.
Cliquez dessus et choisissez l'option d'ajout de règle "Add Rule". Nommez cette nouvelle règle "remove .svc" par exemple.
ensuite éditez la règle tel que le représente la capture d'écran ci-dessous:


Write "WCF Virtual Path Provider"

Once the file. Svc file is created and you try to access it through your web browser, you will receive an error of type "404-Not found."
This problem is due to a malfunction in VirtualPathProvider implemented in SharePoint class SPVirtualPathProvider, and it plants when parsing URLs that begin with the "~" character.

To resolve this problem simply create your own VirtualPathProvider. It is important to note that this implementation will not repeat all the work done by SPVirtualPathProvider, but it will be added after him through the "Previous" operation of VirtualPathProvider. Ultimately our provider will point to the SPVirtualPathProvider.

But first we must create a class that inherits from "System.Web.Hosting.VirtualPathProvider.
  public class WCFVirtualPathProvider : VirtualPathProvider
    {

        public override string CombineVirtualPaths(string basePath, string relativePath)
        {

            return Previous.CombineVirtualPaths(basePath, relativePath);

        }

         //...
         // Other methods are not mentioned because they do nothing but call the Previous attribute as above

        public override bool FileExists(string virtualPath)
        {

            string fixedVirtualPath = virtualPath;

            if (

                  virtualPath.StartsWith("~") &&

                  virtualPath.EndsWith(".svc")

               )
            {

                fixedVirtualPath = virtualPath.Remove(0, 1);

            }

            return Previous.FileExists(fixedVirtualPath);

        }

        protected override void Initialize()
        {

            base.Initialize();

        }

    }

So to go further in this class operation explanation, we will change the method "FileExists", it will undertake to remove the tilde "~" of the received path and will go for treatment in the SPVirtualPathProvider.
Now we must save our VirtualPathProvider and chain on to SPVirtualPathProvider. To do this we need to run the two lines of code below:
WCFVirtualPathProvider wcfVPP = new WCFVirtualPathProvider();

HostingEnvironment.RegisterVirtualPathProvider(wcfVPP);

Care should be taken to execute this code * once *, and this every time you run "iisreset" and / or modifie web.config. Because ASP.NET forgets the VirtualPathProvider he used after each IISRESET. The most elegant way to solve this problem is to place this code in an HttpModule, which has a static variable responsible for verifying the registration of our VirtualPathProvider. Here is the code of the HttpModule:
    public class WCFVPPRegModule: IHttpModule
     {

         static bool wcfProviderInitialized = false;

         static object locker = new object();

         public void Init(HttpApplication context)

         {

             if (!wcfProviderInitialized)

             {

                 lock (locker)

                 {

                     if (!wcfProviderInitialized)

                     {

                         WCFVirtualPathProvider wcfVPP = new WCFVirtualPathProvider();

                         HostingEnvironment.RegisterVirtualPathProvider(wcfVPP);

                         wcfProviderInitialized = true;

                     }

                 }

             }

         }

     }

Once our classes are ready we put them in the GAC (in our case we'll put them in a single module called "WCFSupport"), then we modify the Web.config file to add the HttpModule which in turn will reference the VirtualPathProvider.
  <add 

     name="WCFVPPRegModule" 

    type="WCFSupport.WCFVPPRegModule, WCFSupport, Version=1.0.0.0, Culture=neutral,PublicKeyToken=d4f7bd9e55b39661" 

  />

*For users of Windows Sever 2008*: In IIS7 Manager click on "Authentication Settings" target SharePoint site and select "anonymous authentication". This will allow access to service without corrupt Security of your SharePoint site.

Now everything is ready for the use of WCF in SharePoint to be sure you have done it right, open your web browser, at your service URL and if you get a page similar to the image so is everything all right: