April 2008 Entries
Last Thursday I got "the call" that all employees dread - "you're no longer needed". Our company went through yet another round of layoffs and this time my number was called. I had survived so many of these over the 14 1/2 years of my career - with the same company (very rare, I know). It caught me by complete surprise. I was their number one "MOSS" man, they told me just days before. Then came "the call".
I guess I've been very fortunate in my career. I've only experienced two layoffs in 20 years. I do not recommend it to...
[via AC]
Andrew Connell has two more WSS 3.0 HOW-To videos published up on MSDN:
MSDN Visual How To: Adding Code-Behind Files to Master Pages and Content Pages in Windows SharePoint Services 3.0
Learn how to use code-behind files in custom content pages in Windows SharePoint Services 3.0.
MSDN Visual How To: Creating, Deploying, and Debugging Custom Timer Jobs in Windows SharePoint Services 3.0
Learn how to harness the power of custom timer jobs in Windows SharePoint Services 3.0.
You can find the links on his posting by going to:
http://andrewconnell.com/blog/archive/2008/04/08/Two-new-WSS-3.0-MSDN-Visual-How-Tos-Published.aspx
[via John Holliday]
John has an in-depth video demonstrating how to build custom Content Types for SharePoint 2007 in Visual Studio. By way of Reflection he shows how to integrate content types 'your way' and staying within the best practice boundaries. I found it very helpful.
Check it out here:
http://johnholliday.net/screencast.aspx?name=SPRF-ContentTypes
This is in the code behind of the InfoPath 2003 Visual Studio 2005 Template. When calling the web service (covered in a previous posting) it looks like the following:
Private Sub RefreshCategories()'Set the Credentials of the web services proxy My.WebServices.Service.Url = getCurrentServiceEnvironment() My.WebServices.Service.Credentials = getUserCredentials() Dim myTempwsNode As Xml.XmlNode = My.WebServices.Service.GetCategories() Try RemoveAllFromDropDownList(thisXDocument.DOM.selectSingleNode("//my:groupCategory/my:categorycollection")) PopulateDropDownList3(myTempwsNode, _ "//my:groupCategory/my:categorycollection", _ "//my:categorydescription", _ "//my:categoryid", _ "//my:categorystatus", _ "Category", _ "CatID", _ "Active") Catch ex As Exception thisXDocument.UI.Alert(CommErrorMessage) End Try End Sub
Private Sub RemoveAllFromDropDownList(ByVal node As IXMLDOMNode) Try Dim ParentNode As IXMLDOMNode = node.parentNode 'exit routine if only one (empty) child exists If ParentNode.childNodes.length < 4 Then...
Let's say you would like to add an item to a SharePoint List. This is where CAML (Collaborative Application Markup Language) comes in. It may seem whacky at first glance, but once you get the hang of it you'll feel comfortable. Use the following code as a template and apply your personal needs:
<WebMethod()> _Public Function SubmitSharepointListItem(ByVal ListLocation As String, ByVal SharepointListID As String, _ByVal id As Integer, ByVal title As String, ByVal owner As String, _ByVal category As String, ByVal topic As String, _ByVal projecttype As String, ByVal areaofresponsibility As String, _ ByVal purpose As String, ByVal takenote As String, ByVal documentstate...
In order to pull specific column data from a SharePoint List you must structure the XML query properly. In this example, I am querying for the Category column. I have defined the SharePoint List Location and List GUID inside the Web.config file. Here is how the web method is laid out:
<WebMethod()> _Public Function GetListItemCategories(ByVal ListLocation As String, ByVal ListName As String) As XmlDataDocument If ListLocation Is Nothing Or ListLocation.Length = 0 Then ListLocation = ConfigurationManager.AppSettings("SharepointListLocation") End If If ListName Is Nothing Or ListName.Length = 0 Then ListName = ConfigurationManager.AppSettings("SharepointListGUID") End If Dim url As Uri = New Uri(New Uri(ListLocation), "_vti_bin/Lists.asmx") ...
When pulling data into InfoPath 2003 you must build it to be in a compatible format. Here's an example of a web service method providing said format from a MS SQL Server Source.
<WebMethod()> _Public Function GetCategories() As XmlDataDocument Dim conn As New SqlConnection(GetConnectString) Dim ds As New DataSet Dim cmd As New SqlCommand() cmd.Connection = conn cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "sl_Category" Dim adapter As New SqlDataAdapter(cmd) Dim result As Boolean = False Dim previousConnectionState1 As ConnectionState = conn.State Dim errMessage As String = Nothing Try If conn.State = ConnectionState.Closed Then conn.Open() End If adapter.Fill(ds) result = True Catch ex As...