Monday, May 25, 2009

from lurking within one of the blogs i have recently started to follow, i discovered this online university offering some free courses, sometimes also known as "clinics", about the many development tools, programming languages, databases, operating systems, collaboration tools and presentation frameworks Microsoft has made available to the IT world. all you need is a Windows Live ID in order to sign-up.

courses im enrolled in

most courses come with a price tag ranging from $30 to around $200, but some fortunately, are being offered for FREE. i signed up to a few which i thought would be beneficial to what i am trying to do: gain more knowledge about the MOSS 2007 platform which means understanding also the frameworks from which it was built upon (ASP.NET 2.0 and WSS 3.0) and the database system it uses for storing user content and application pages, the same system it relies upon in displaying more intelligent reports to the audience (MS SQL Server).

the online classroom

im currently taking "Clinic 5045: Inside Look at Developing with Microsoft® Windows® SharePoint® Services 3.0" and so far, im happy. i love that the content loads fast and are 80% narrated and that tool demos are available. the self-test makes the learning process exciting as well. i love that they are broken down into short-term, 2 to 6 hour courses making the completion of the course not too impossible. i love that the text can be copied from the transcripts. i love that the course teaches me the fundamentals and have an easy to follow format. i love that you can receive graduation awards upon course completion in the form of discounts on other e-learning courses and training kits. i love that its free!

Thursday, May 21, 2009

U2U for me

CAML (Collaborative Application Markup Language) is an XML-based query language that helps you in querying, building and customizing Web sites based on Windows SharePoint Services. i have used CAML in the past to add filters to my sharepoint views. today i have learned that it can be used together with SPQuery to for querying and updating lists via the SharePoint web service Lists.asmx.

CAML seems easy to learn at first, but when you work with real data and are presented with different data types having various inherent properties, the work becomes difficult. fortunately, CAML builders are available. the one i use mostly for my work is U2U CAML Query Builder.

U2U has helped me come up with nested filters having a slightly complex "where" clause (an AND and an OR). it has also helped me come up with a query that tells sharepoint to retrieve data where in "Assigned User = [Me]". lastly, it has helped me determine how the "approval status" column (used when content moderation is enabled) can be filtered. here's a sample query U2U has come up with in one of my programs:

referring to the above screenshot of U2U's UI, you can use U2U to build complex where clause by following these steps:

Select the field for which you want to add a second where condition. Click the Where checkbox. Immediately a combobox appears where you can select “And” or “Or”. Fill out or select a value and click the > button. Notice that a Where node is added to the CAML query.

Let me know if this helps!

Hashtables in a Flash

This is purely ASP.NET, but when creating custom MOSS features, this is something I have used more than a few times in order to temporarily store a subset of data coming from Sharepoint lists. Dont forget to add a reference to the System.Collections namespace beforehand.

There's nothing special about this article, just a quick reference for me.

Create a Hashtable
Hashtable objHash = new Hashtable();

Dim objHash As New Hashtable()

Add some data in it
objHash.Add("FirstName", "Asif");
objHash.Add("LastName", "Malik");
objHash.Add("Number", 1);

Dim objHash As New Hashtable()
objHash.Add("FirstName", "Asif")
objHash.Add("LastName", "Malik")
objHash.Add("Number", 1)

Search for a specific key:
if (objHash.ContainsKey("FirstName"))
   Console.WriteLine("Key is present");

Loop through the items:
foreach (DictionaryEntry entry in estformsHashTable)
   if (entry.Value.ToString()=="")
      //do something here

Dim objEntry As DictionaryEntry
For Each objEntry In objHash
   'Do something here