Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Microsoft SharePoint 2010 Connector

Select

Latest version: 1.0.4

Introduction

Microsoft SharePoint is a web application platform for content and document management, intranet portals, collaboration, extranets, websites,and enterprise search. The Microsoft SharePoint connector for Anypoint platform enables integration with SharePoint 2010 through its SOAP API.

Supported Operations

  • Lists and List Items API: Create, delete, retrieve, and update lists and list items.

  • Files and Folders API: Create, delete, retrieve folders. Add, retrieve content, retrieve metadata, delete, check out, undo check out, check in, publish, unpublish, approve, deny, and copy files.

Installing the SharePoint 2010 Connector in Anypoint Studio

  1. Under the Help menu in Anypoint Studio, select Install New Software.

  2. From Work with drop down, select Anypoint Connectors Update Site.

  3. Find and select Microsoft SharePoint 2010 Connector and click Next.

  4. Review the details of the item you selected, then click Next.

  5. Select I accept the terms of the license agreement and then click Finish.

  6. Click Restart Now to complete the installation.

  7. After Studio restarts, expand the Connectors palette group to see your recently added Microsoft SharePoint 2010 Connector.

Example Use Case

Step 1: Create a New Mule Project

Once Anypoint Studio has launched, create a new project:

  1. From the menu, select File > New > Mule Project.

  2. In the New Mule Project window, enter sharepoint2010-demo as the Project Name.

  3. Click Finish.

Step 2: Create and Configure a New SharePoint Global Element

Configure the connector to connect to a SharePoint 2010 instance:

  1. Click the Global Elements tab.

  2. Click  Create to bring up Global Type dialog box.

  3. In the Filter text box, enter sha.

  4. Select Microsoft SharePoint 2010 and click OK.

  5. Fill in the required parameters. Refer to Connection Configuration for details.

  6. Click Test Connection to make sure the connection works correctly.

  7. Once the connection is successful, click OK.

Step 3: Create a Flow to Query SharePoint 2010

Create a Mule flow to query the "Shared Documents" List.

image

To create the Mule flow, follow these steps:

  1. Click the Message Flow tab.

  2. Search for http and drag an HTTP connector onto the canvas. This creates a new flow.

  3. Search for sharepoint and drag Microsoft SharePoint 2010 next to the HTTP connector, on the Process area.

  4. Search for json and drag an Object to JSON transformer next to the Microsoft SharePoint 2010.

  5. Double-click the HTTP connector. Click the + beside the Connector Configuration list.

  6. In the HTTP Listener Configuration window, set Protocol to HTTPHost to All Interfaces [0.0.0.0] (Default) and Port to 8081. Click OK.

  7. Under Basic Settings, set the Path to /query.

  8. Double-click the Microsoft Dynamics SharePoint 2010 and update the following configuration values:

    1. From the Connector Configuration list, select the Microsoft SharePoint 2010 configuration that was previously created.

    2. From the Operation list, select List Item query.

    3. From the Language list, click DataSense Query Language.

    4. Click Query Builder…

    5. From the list of Types, select Shared Documents.

    6. From the list of Fields, select ID and Title.

    7. From Order By list, select Title.

    8. From Direction list, select DESCENDING.

    image

  9. Click OK.

Step 4: Running the Flow

  1. In Package Explorer, right-click sharepoint2010-demo and select Run AsMule Application.

  2. Check the console to see when the application starts. You should see the following message if no errors occurred:

    
                 
              
    1
    2
    
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Mule is up and kicking (every 5000ms)                    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++org.mule.module.launcher.StartupSummaryDeploymentListener:***              - - + DOMAIN + - -               * - - + STATUS + - - ** default                                       * DEPLOYED           ** - - + APPLICATION + - -            *       - - + DOMAIN + - -      * - - + STATUS *** sharepoint2010-demo               * default                       * DEPLOYED     **
  3. Open a browser and visit  http://localhost:8081/query

  4. The list of documents ordered by descending file name should be returned in JSON format (results vary depending on your SharePoint instance).

    
                 
              
    1
    2
    
    [{"_ModerationStatus":"0","Editor":{"id":"8","lookUpListName":"User Information List"},"MetaInfo":"vti_parserversion:SR|14.0.0.7015\r\nvti_modifiedby:SR|i:0#.w|mule\\\\muletest\r\nListOneRef:IW|1\r\nvti_folderitemcount:IR|0\r\nvti_foldersubfolderitemcount:IR|0\r\nContentTypeId:SW|0x01010003DD4D13EF6C8446AB329E6FC42FE7BE\r\nvti_title:SW|\r\nvti_author:SR|i:0#.w|mule\\\\muletest\r\n","owshiddenversion":"2","lookUpListName":"Shared Documents","FileLeafRef":"error.txt","UniqueId":"{F0F6C9B9-6942-4866-B254-063EE8B70D59}","_Level":"1","PermMask":"0x7fffffffffffffff","ProgId":"","Last_x0020_Modified":"2015-04-09 16:21:35","Modified":"2015-04-09 16:21:20","DocIcon":"txt","ID":"1","FSObjType":"0","Created_x0020_Date":"2015-04-09 14:57:18","FileRef":"Shared Documents/error.txt"}]

Authentication Schemes

The Microsoft SharePoint 2010 connector supports the following authentication schemes:

  • NTLM Authentication

  • Kerberos Authentication

  • Claims-based Authentication

NTLM Authentication

image

The NTLM Authentication scheme has the following parameters:

Parameter Description

Username

User to authenticate with.

Password

Password for the user to authenticate with.

Domain

Domain of the SharePoint instance.

Site URL

The path to the Microsoft SharePoint Site (https://sharepoint.myorganization.com/site).

Disable Cn Check

When dealing with HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an exception. To prevent this it is possible to disable the CN (Common Name) check. Note: This is not recommended for production environments.

Kerberos Authentication

image

The Kerberos Authentication scheme has the following parameters:

Parameter Description

Username

User to authenticate with.

Password

Password for the user to authenticate with.

Domain

Domain of the SharePoint instance.

Site URL

The path to the Microsoft SharePoint Site (https://sharepoint.myorganization.com/site).

Disable Cn Check

When dealing with HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an Exception. To prevent this it is possible to disable the CN (Common Name) check. Note: This is not recommended for production environments.

Service Principal Name (SPN)

The SPN looks like host/SERVER-NAME.MYREALM.COM

Realm

The Domain that the user belongs to. Note that this value is case-sensitive and must be specified exactly as defined in Active Directory.

KDC

This is usually the Domain Controller (server name or IP).

Advanced Kerberos Scenarios

If the environment is complex and requires further settings, a Kerberos configuration file has to be created manually and referenced in the connector’s connection configuration.

The following parameters are available for advanced scenarios:

  • Login Properties File Path: Path to a customized Login Properties File. You can tune he Kerberos login module (Krb5LoginModule) with scenario-specific configurations by defining a JAAS login configuration file. When not specified, default values which usually work for most cases are set up. There are two options for setting this property:

    • Place the file in the class path (usually under src/main/resources) and set the value of the property to classpath:jaas.conf.

    • Provide the full path to the file as in C:\kerberos\jaas.conf.

  • Kerberos Properties File path: Path to a customized Kerberos Properties File. There are two options for setting this property:

    • Place the file in the class path (usually under src/main/resources) and set the value of the property to classpath:krb5.conf.

    • Provide the full path to the file as in C:\kerberos\krb5.conf.

JAAS Login Configuration File

Following is a sample of the JAAS login configuration file for the Kerberos login module:

Kerberos {
    com.sun.security.auth.module.Krb5LoginModule required
    debug=true
    refreshKrb5Config=true;
};

For more information on how to create the JAAS login configuration file for the Kerberos login module , see http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html.

Kerberos Configuration File

Following is a sample of the content of a Kerberos configuration file:

[libdefaults]default_realm = MYREALM.COM[realms]MYREALM.COM = { kdc = mydomaincontroller.myrealm.com default_domain = MYREALM.COM}[domain_realm].myrealm.com = MYREALM.COMmyrealm.com = MYREALM.COM

Important: Realm and default_domain are case-sensitive and must be specified exactly as defined in Active Directory. Receiving an error during Test Connection stating "Message stream modified (41)" is an indication that the domain name is not correctly formed.

More information on how to create the Kerberos configuration file can be found at  http://web.mit.edu/kerberos/krb5-devel/doc/admin/conf_files/krb5_conf.html

Claims-Based Authentication

image

The Claims-Based authentication scheme has the following parameters:

Parameter Description

Username

User to authenticate with.

Password

Password for the user to authenticate with.

Domain

Domain of the SharePoint instance.

Site URL

The path to the Microsoft SharePoint site (https://sharepoint.myorganization.com/site).

Security Token Service URL (STS URL)

The STS endpoint that accepts username and password for authenticating users and understands the WS-Trust 1.3 protocol. When the STS is Microsoft’s ADFS (Active Directory Federation Services), this URL usually is: https://youradfs.com/adfs/services/trust/13/usernamemixed

Security Token Service (STS) App Identifier (Scope)

This string that identifies the SharePoint site in the STS. It is also known as Relying Party IdentifierClient IdentifierScope or Realm. When the STS is Microsoft’s ADFS, this value can be discovered in the AD FS Management console under AD FS > Trust Relationships > Relying Party Trusts > (SharepoinP Site’s relying part properties) > Identifiers tab.

Disable Cn Check

When dealing with HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an Exception. To prevent this it is possible to disable the CN (Common Name) check. Note: this is not recommended for production environments.

Note: The  Sts App Identifier  can be obtained by logging into the SharePoint site that want to be accessed by opening the Site URL in a web browser. If there is more than one authentication provider configured for the site, a drop-down lists the options. Selecting the desired STS redirects to the STS’s login page. At this point, the address bar of the web browser contains a URL that includes the following query parameters wa=wsignin1.0&wtrealm=uri%3amule%3asp80. The parameter wa  tells the STS that a sign in is being initiated. The wtrealm contains the URL-encoded value STS App Identifier. In the example, uri%3amule%3asp80  is  uri:mule:sp80. The unencoded value is the parameter for the connector’s configuration.

Operations

Lists and List Items API

List Create

Creates a list in the current site based on the specified name, description, and list template ID.

List Get

Returns a schema for the specified list. 

List Get All

Retrieves all SharePoint lists.

List Delete

Deletes the specified list.

List Update

Updates a list based on the specified list properties. 

List Item Create

Creates a new item in an existing SharePoint list.

image

List Item Delete

Deletes an Item from a SharePoint list.

List Item Update

Updates an Item from a SharePoint list.

image

List Item Query

Executes a query against a SharePoint list and returns list items that matches the specified criteria.

Aditionally to the selected fields, the following fields are always returned:

  • PermMask

  • _ModerationStatus: Moderation Status of the file if it belongs to a Library that has moderation enabled

  • Created: Creation date of the item

  • Modified: Modification date of the item

  • owshiddenversion

  • MetaInfo

  • FSObjType

  • FileRef: Relative URL of the file, if it is a Documents or Picture Library

  • UniqueId

  • _Level

Folder create

Creates a folder in a Document or Picture library.

Folder delete

Deletes a folder from a Document or Picture library.

Folder Query

Retrieves all folders that matches the specified criteria.

Additionally to the selected fields, the following fields are always returned:

  • PermMask

  • _ModerationStatus: Moderation Status of the file if it belongs to a Library that has moderation enabled

  • Editor: A user

  • Created: Creation date of the item

  • Modified: Modification date of the item

  • owshiddenversion

  • MetaInfo

  • FSObjType

  • FileLeafRef: Name of the folder

  • FileRef: Relative URL of the folder

  • UniqueId

  • _Level

  • ProgId

  • Last_x0020_Modified

  • Created_x0020_Date

File Add

Adds a file to a Document or Picture library.

File Get Content

Retrieves the content of a file.

File Get Metadata

Retrieves the metadata of a file.

File Delete

Deletes a file from a Document or Picture library.

File Check Out

Checks out a file from a document library.

File Undo Check Out

Reverts an existing checkout for a file.

File Check In

Checks in a file to a document library.

File Publish

Submits the file for content approval.

File Unpublish

Removes a file from content approval or unpublish a major version.

File Approve

Approves a file submitted for content approval.

File Deny

Denies approval for a file that was submitted for content approval.

File Copy To

Copies the file to the destination URL.

File Query

Retrieves all files from a folder that matches the specified criteria.

Aditionally to the selected fields, the following fields are always returned:

  • PermMask

  • _ModerationStatus: Moderation Status of the file if it belongs to a Library that has moderation enabled

  • Editor: A user

  • Created: Creation date of the item

  • Modified: Modification date of the item

  • owshiddenversion

  • MetaInfo

  • FSObjType

  • FileLeafRef: Name of the folder

  • FileRef: Relative URL of the folder

  • UniqueId

  • _Level

  • ProgId

  • Last_x0020_Modified

  • Created_x0020_Date

  • DocIcon

Reference Objects

In case a SharepointListReference or SharepointListMultiValueReference is selected to be returned by a query, the returned value of the field depends on the value of the Retrieve full objects for reference fields parameter:

  • Not checked: A summary object containing the reference object’s ID and the reference object list’s ID:


          
       
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "Title": "A title",
    "LookupField":
        {
            "id": "1",
            "lookupListName": "aaaa-1111-bbbb-2222"
        },
    "MultiValueLookupField":
        {
            "ids":
                [
                    "1",
                    "2",
                    "3"
                ],
            "lookupListName": "cccc-3333-dddd-4444"
        }
}

Resolve Method

Both summary objects, SharepointListReference or SharepointListMultiValueReference, make available a method called resolve.

Once this method is called, it returns the fully referenced object and replaces the summary object in the item with this resolved reference.

For example, calling resolve method on the "LookupField" of the above item returns the item with ID "1" of the list with title "aaaa-1111-bbbb-2222" and the item contains:


           
        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "Title": "A title",
    "LookupField":
        {
            "ID": "1",
            "lookupListName": "aaaa-1111-bbbb-2222"
            "Title": "Another title",
            "Property": "A property",
            ...
        },
    "MultiValueLookupField":
        {
            "ids":
                [
                    "1",
                    "2",
                    "3"
                ],
            "lookupListName": "cccc-3333-dddd-4444"
        }
}
  • Checked: The full object graph retrieves. In case there is a cycle, the summary reference object is shown:


           
        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"Title": "A title",
    "LookupFieldId":
        {
            "Title": "Another title",
            "Id": "1",
            Property1": "A value",             ...         },     "MultiValueLookupFieldId":         [             {                 "Title": "Another title",                 "Id": "1",                 "Property1": "A value",                 ...             },             {                 "Title": "Another title",                 "Id": "2",                 "Property1": "A value",                 ...             }         ] }

Note: Checking this option may cause large items with many reference fields to take a long time to retrieve.