query operation in microsoft sharepoint using mule esb

14
www.sanjeetpandey.com www.sanjeetpandey.com Prepared by – Sanjeet Pandey Query Operation in Microsoft SharePoint using Mule ESB

Upload: sanjeet-pandey

Post on 15-Jul-2015

143 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

www.sanjeetpandey.com

Prepared by – Sanjeet Pandey

Query Operation in Microsoft SharePoint using Mule ESB

Page 2: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Overview

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 2013 through its REST API.

Supported operations:

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

• Files and Folders API:

– Files: Add, retrieve content, retrieve metadata, delete, check out, undo check out, check in, publish, unpublish, approve, deny, recycle, and copy files.

– Folders: Create, delete, and retrieve folders.

Supported Microsoft SharePoint versions:

• Microsoft SharePoint 2013

• Microsoft SharePoint Online

2

Page 3: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Authentication

• The Microsoft SharePoint connector supports different authentication schemes based on whichMicrosoft SharePoint that you access:

• Supported Microsoft SharePoint authentication on-premise:

– NTLM

– Claims-based authentication

• Supported Microsoft SharePoint authentication online:

– Claims-based authentication

• Unsupported authentication: Kerberos

3

Page 4: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Prerequisites

• Username and password for users granted access to SharePoint

• Organization Service URL - usually in the

format:https://SharePoint.mycompany.com/MyOrganization/Services/2011/Organization.svc

4

Page 5: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Installation

To install:

• In Anypoint Studio, click Help > Install New Software.

• In the Work with drop down, click Anypoint Connectors Update Site.

• Expand Standard and click Microsoft SharePoint Connector.

• Click the checkbox on the left for the SharePoint connector you want to install, and click Next.

• Review the details of the item you selected, and click Next.

• Select I accept the terms of the license agreements and then click Finish.

• Click Restart Now to complete the installation.

5

Page 6: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule Connector

Step 1: Create a New Mule Project

• To configure:

• In Anypoint Studio, click File > New > Mule Project.

• Specify a Project Name and click Finish.

6

Page 7: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule MS SharePoint Connector

Step 2: Configure the Global Element

• To configure:

• In Anypoint Studio, click File > New > Mule Project.

• Specify a Project Name and click Finish.

• Click the Global Elements tab.

• Click Create.

• In the Search text box, type sharepont.

• Click Microsoft SharePoint and click OK.

• Choose the Global Type to configure:

7

Page 8: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule MS SharePoint Connector

Step 3: Configure the Global Element

Fill in the Username, Password, and Site URL.

• For authentication:

– To connect to SharePoint Online, leave NTLM and Claims inputs empty. Just specify a Username, Password, and Site URL.

• Click Test Connection to ensure the connection works correctly:

8

Page 9: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule flow

• From Anypoint Studio, click File > New > Mule Project.

• Specify a Project Name and click Finish.

• In the Search box, type http and drag an HTTP Endpoint from the Connectors section to the canvas.

• In the Search box, type sharepoint and drag a Microsoft SharePoint connector instance next to the HTTP Endpoint connector.

• In the Search box, type json and drag an Object to JSON transformer next to the Microsoft SharePoint connector.

9

Page 10: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule flow (Cont ..)

• Double-click the HTTP Endpoint. Make sure Host is set to localhost and Port is set to 8081. Set the Path to query. Click OK.

• Double-click the Microsoft SharePoint connector and click the green plus symbol.

• Update the following configuration values:

– From the Connector Configuration list, click the Microsoft SharePoint configuration that was previously created.

– From the Operation list, click List query.Note: The List query option only appears in the Operation list after you have successfully connected to a SharePoint instance.

– From the Language list, click DataSense Query Language.

10

Page 11: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Mule flow (Cont ..)

Click Query Builder:

- From the list of Types, click Documents.

- From the list of Fields, click ID, and Title.

- From Order By, click Title.

- From Direction, click DESCENDING

11

Page 12: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Running Mule Project

• In Package Explorer, right click on sharepoint2013-demo and select Run As > Mule Application.

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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+ Started app 'sharepoint2013-demo' +

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

• Open an Internet browser and visit http://localhost:8081/query

• The list of documents are ordered by descending title and returns in JSON format (results vary according to your SharePoint 2013 instance).

12

Page 13: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com

Running Mule Project (Cont…)

• Open an Internet browser and visit http://localhost:8081/query

• The list of documents are ordered by descending title and returns in JSON format (results vary according to your SharePoint 2013 instance).

13

Page 14: Query Operation in Microsoft SharePoint using Mule ESB

www.sanjeetpandey.com 14