Sometimes when you build a large Internet facing site you need to push or pull make pleased to or from other systems. It may possibly be that you are working with external make pleased providers who will provide for instance daily news articles. Or possibly you have to send out e-mail campaigns and you want to pull make pleased from your site into your newsletters. In these cases you force wonder if it is possible to use for instance the new RESTful services which uses HTTP to get or send information to your pages libraries.
In this article I will perform a small POC to see if that is possible and what the alternatives are.
The ListData.svc WCF web service
The ListData.svc web service did not exist with SharePoint 2007. You can access it through the _vti_bin virtual directoy like:
So what does it provide:
- It provides an ATOM feed of all the lists and links to URL’s that provide more data. As you can see not more than it will show you for instance a list of collections. The pages library would be one of them. Now, if you would attach the HFRD attribute to your query it would give you access to all of the make pleased within the pages library.

- Next to that you can Query the make pleased by appending your query to the URL, including filtering, sorting and paging. An example would be something like:
http://.../_vti_bin/ListData.svc/Pages?$filter=(Country eq 'Netherlands')
- But that is not all! You can really add, delete or update make pleased. So if your HTTP Header contains the verb DELETE you may possibly delete the second item by calling the same URL but then with:
- And even better, caching and security has been taken care of as well.
- And if you use ASP.NET Ajax 4 you can query WCF Data Services like the ListData.svc natively and it will give you the benefit of by templates.
Publishing page returned by ListData
Now, what about the information you get back from the ListData.svc when querying a pages library?
Imagine you make pleased type is called Company News and is inheriting from the out of the box make pleased type article page.
If you would query the page through the ListData web service it would give you any the ATOM XML feed or the JSON data feed (depends on your type of request).
Have a look at the columns not more than. As you can see some of the columns are “system” columns like Make pleased Type ID, some of the are from the article page like “Page Make pleased” and some are defined by yourself like “Publisher”.
| ContentTypeID | 0x01000C568D50A14D9…… |
| Name | MyNews.aspx |
| Title | Company X has announced new campaign |
| PageLayout | http://www.company.com/_catalogs/masterpage/mynewslayout.aspx |
| Publisher | Reuters |
| Now it was announced that Company X has ….. |
Not everything will be returned
You have probably already noticed that Page Make pleased as shown in the table above, has been removed and colored red. To me it was a small surprise that it was not being returned by the ListData web service. After doing some tests I learned that:
- Site columns of type Publishing HTML are not returned by ListData
- Site columns of type Publishing Image are not returned by ListData
- possibly more columns are being omitted (haven’t check all of them yet) that are publishing point
Can I use ListData with Publishing pages
The answer is probably: Yes in a limited way. As you don’t have the ability to exchange for instance the Page Make pleased, you may possibly still update the list item fields like the Title, Publishing Date, or custom fields like the Number of Times Read and so forth. It depends if you have need for that.
To give you a real world example: if you would to add something like “Did this article answer your question” you may possibly add a counter to your article called “Usefulness” and increase that by one if someone clicks on a button “yes”, entirely through Javascript by calling the ListData web service.
Are there alternatives?
- CMIS: CMIS stands for Make pleased Management Interoperability Specification. It is an “interoperability specification for interacting with document-centric make pleased repositories via HTTP-based protocols.”.
It is a new standard driven by Alfresco, Day, EMC, Fatwire, IBM, Microsoft and Open Text.
Now, Microsoft has released a connector for CMIS for SharePoint 2010. Is it vital? Yes! As we can more easily integrate SharePoint 2010 with other systems through an official standard. This comes with the connector:
· A CMIS Producer for SharePoint that makes SharePoint lists and document libraries available to other systems by the CMIS interfaces.
· A CMIS Consumer Web Part, enabling make pleased from other CMIS supported repositories to be showed and edited within SharePoint. The downside is that CMIS does not support WCM in its first release.
- Client side object model: this does not support Publishing webs to make a page
- ListItemCollection.asmx: this would allow you to make a make pleased type with Publishing HTML site columns but you cannot get Rich markup across the wire.
- Your own custom wrapper. It would basically mean that you make your own web service that allows for pushing make pleased into SharePoint and your code would take care of making the publishing page.
Your own code may possibly be something like this:
SPSite site = new SPSite(Properties.Settings.Defaulting.rootSiteUrl + Properties.Settings.Defaulting.targetURL);SPWeb web = site.OpenWeb();PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);PublishingPage newPubPage = pubWeb.GetPublishingPages().Add(pageName, GetPageLayout());SPListItem newPage = newPubPage.ListItem;SPList PagesLibrary = newPage.ParentList;newPage["Title"] = pageTitle;newPage["Page Make pleased"] = Microsoft.SharePoint.Utilities.SPEncode.HtmlDecode(pageContent);newPage["Article Date"] = articleDate;newPage.Update();newPage.File.CheckIn("");newPage.File.Publish("Published on creation");newPage.File.Approve("Approved on creation");
Summary
Working with SharePoint 2010 Publishing Pages through the ListData.svc is very limited, hence may possibly be useful in some cases. Most of the publishing related site columns are not being returned by the web service. Other methods fail for the same reason. It looks like a custom web service is the only solution.
Any feedback or working solution is appreciated!
Check it out:Serve’s Sharepoint Blog











Answers Rating