New screencasts available

 

Project Description

Camelot Integration Toolkit simplifies integrations between SharePoint and other solutions, platforms and languages, e.g. PHP and Java. It provides a set of standards for querying and transferring list and library data using standard SQL syntax and CamelotXml via WCF services.

Please see the documentation for additional examples.

The toolkit is based on the Camelot .NET Connector for Microsoft SharePoint (http://www.bendsoft.com/net-sharepoint-connector/). It's a standard ADO.NET driver for SharePoint that makes it possible to query SharePoint lists and document libraries using standard SQL commands, such as SELECT, INSERT, UPDATE, DELETE, SHOW TABLES, SHOW FIELDS, etc. The great thing about the connector is that it allows anyone with basic SQL knowledge to work with SharePoint without any prior experience of sites, lists, views or document libraries.

The purpose with this toolkit is to speed up integration between SharePoint and other solutions and applications on any platform. The CamelotXml format is a simple, easily readable and editable format that can be parsed in any programming language.

Download full CamelotXml example (The Tasks list)

<?xml version="1.0" encoding="utf-8"?>
<List>
  <ID>17b10f8e-d61a-4cd8-bac2-8f5e51b07494</ID>
  <Title>Tasks</Title>
  <Description>Use the Tasks list to keep track of work that you or your team needs to complete.</Description>
  <Created>2011-02-28T04:29:35Z</Created>
  <Modified>2011-09-06T05:50:44Z</Modified>
  <LastDeleted>2011-02-28T04:29:35Z</LastDeleted>
  <ItemCount>3</ItemCount>
  <BaseType>0</BaseType>
  <Schema>
    <Field Name="Attachments">
      <ID>67df98f4-9dec-48ff-a553-29bece9c5bf4</ID>
      <DecodedName>Attachments</DecodedName>
      <DisplayName>Attachments</DisplayName>
      <Type>Attachments</Type>
      <Required>False</Required>
      <ReadOnly>False</ReadOnly>
      <PrimaryKey>False</PrimaryKey>
...

The Camelot WCF service

One of the main features of the toolkit is the self-hosted WCF service, which allows querying SharePoint (via the connector) from any remote host, You can build applications and tools that connect to this service from virtually any other platform (see Camelot PHP tools as example). There is no need for installing the Camelot .NET Connector on the remote machine.

Camelot WCF Service added as refernce in VS2010

WCF service methods

  • DownloadFile: download file from SharePoint document library
  • UploadFile: upload file to a SharePoint document library
  • ExecuteCamelotXml: executes SQL query and returns the results in CamelotXml format
  • ExecuteNonQuery: executes SQL query without returning any result (typically used with UPDATE, INSERT or UPDATE commands)
  • ExecuteScalar: executes SQL query and returns the value of the first column in the first row of the result set
  • GetListCamelotXml: same as ExecuteCamelotXml, but instead of providing the SQL query, this method only takes the name of a SharePoint list and view

Examples

The CamelotXml format makes it easier to store and transfer list and document library content. The toolkit contains methods for creating and reading such files.

Example #1 - Querying the list "Tasks" via the Camelot WCF service in .NET

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Camelot.SharePointIntegration.Client;

namespace ConsoleApplication1
{
    class Program
    {
        const string sharedKey = "MySharedKey";
        static void Main(string[] args)
        {
            var service = new CamelotService.CamelotServiceClient();
            var xml = service.ExecuteCamelotXml(
                "SELECT ID, Title FROM Tasks ORDER BY ID DESC", 
                "sharepoint_connection", false, sharedKey.MD5());

            var listData = CamelotXml.ReadXml(xml);

            foreach (System.Data.DataRow item in listData.Rows.Rows)
            {
                Console.WriteLine(item["ID"] + ", " + item["Title"]);
            }

            Console.ReadKey();
        }
    }
}

Example #2 - Querying the list "Tasks" via the Camelot WCF service in PHP using Camelot PHP Tools

require_once 'classes/class.camelot.soap.php';

$SharePointQuery = new SharePointQuery(
    array(
        'sql' => "SELECT * FROM `Tasks`",
        'compression' => true,
        'connString' => 'sharepoint_connection',
        'sharedKey' => constant("WSDL_SHARED_KEY")
    )
);

print_r($SharePointQuery);

Example #3 - Export information from a specified list and view to CamelotXml

using (var connection = new Camelot.SharePointConnector.Data.SharePointConnection(connectionString))
{
	connection.Open();

	var data = Camelot.SharePointIntegration.ListDataUtility.CreateListData("Tasks", "All Tasks", false, connection);
	var xml = CamelotXml.CreateXml(data);

	System.IO.File.WriteAllText(xmlFile, xml, Encoding.UTF8);
}

Example # 4 - Export information from the results of SQL query to CamelotXml

using (var connection = new Camelot.SharePointConnector.Data.SharePointConnection(connectionString))
{
	connection.Open();

	var data = Camelot.SharePointIntegration.ListDataUtility.CreateListData("SELECT id, title, Status 
FROM tasks where status = 'Not Started' ORDER BY priority"
, connection); var xml = CamelotXml.CreateXml(data); System.IO.File.WriteAllText(xmlFile, xml, Encoding.UTF8); }

For more information

If you have any questions at all regarding this toolkit or the Camelot .NET Connector for Microsoft SharePoint, don't hesitate to contact the Bendsoft team at codeplex@bendsoft.com.

Last edited Oct 29, 2011 at 2:54 PM by Bendsoft, version 19