How to get all ‘Inherited Security’ sites in your SharePoint site collection

This article is nothing new to SharePoint developers. In fact, there are better options of getting a listing of all subsites in your site collection. However, for those who are not experienced developers, this article will give you an idea of what you can do with the SharePoint web services.

(more…)

How to get the logged on users name from a SharePoint page using javascript

Often I have wanted to get the user’s name, or other user properties, when a SharePoint user hits my site. Instead of writing code against the SharePoint object model within a custom web part, there are two additional methods to consider if you are trying to accomplish the same thing. One is to look at the source of the page to find the element that contains this information, or to query the SharePoint web services.

(more…)

How to add a new item to a SharePoint list using Javascript and the Lists.asmx web service

I had an idea at the beginning of the year. I am the Site Collection Administrator and am only responsible for administering and developing solutions for my SharePoint site collection in my office (about 2000 employees). I do not have access to the SharePoint servers to install WSP’s, use STSADM, or even PowerShell.

I am in charge of all development for my Site Collection but getting a custom SharePoint web part or WSP solution into production takes weeks….and sometimes months. So, i began working with the Content Editor Web Parts (CEWP’s) to see if I can use the SharePoint Web Services and Javascript as a “Poor man’s” web part. My “Poor man’s” web parts are only CEWP’s which don’t have to go thru a special code review and approval process before being moved into the production SharePoint farm.

If you are under these same kind of restrictions, maybe you’d like to consider this approach as well. However, this isn’t the best approach in that things can ‘break’ easily if someone modifies your code in the CEWP’s.
 
(more…)

Connecting to the SharePoint ‘Lists.asmx’ web service without having to manually create a Web Service Reference

Up until recently I have been manually adding a Web Service Reference to my WinForms and WPF projects. I have been connecting to the SharePoint Web Services to pull data from my sites because of the limitations of not having access to the server to use the SharePoint Object Model. In an ideal situation, I would much rather use the SharePoint Object Model to access SharePoint data because I can do more with it and it’s not as complicated as using the SharePoint Web Services.

I’ve often wondered how I can reference the ‘lists.asmx’ web service without having to manually add a Web Service Reference in Visual Studio. Following this approach, you can call a web service (any web service) from your WinForms, WPF, Javascript, ASP.NET, etc. applications. (more…)

Getting all items in all folders using the Lists.asmx Web Service

One of the oddest things i’ve seen recently (for me anyway) was the sudden inability to get all items in all folders on an old WSS 2.0 SharePoint Site Collection.

One of my smaller site collections contains around 2000 items, including Folder items. In order to prepare for a manual migration to MOSS 2007, i am having to inventory all items and properly move them to their correct location in the new MOSS environment.

My initial attempt to get all items in all these lists was to use the standard “GetListItems” method of the Lists.asmx web service, but for some reason not all items were being returned. (more…)

Parsing SharePoint List Items from Lists.asmx

I am almost certain there might be a better way of doing this, but this works for me and has been proven and tested in my own environment on multiple occassions.

I have a SharePoint list containing employee data that needs to be used in a Reporting Services report. The goal of this report is to display the number of employee turnovers for each satellite office location. On one specific occassion, i had a need to parse out the ugly XmlNode that was returned to me after querying my SharePoint list for employee ID’s.

First, i connected to my SharePoint list containing the employee id’s, then created my XmlDocument and XmlNode(s) to query my list. The XmlNode, “ndViewFields”, contains the fields i am interested in returning. You can leave this empty if you’d like to return every column in that list, but in my case, i’m only interested in the “ID” and “EMPLID” columns. (more…)