Author Archive

This blog has moved

Wednesday, April 16th, 2008

Check out my new blog on SharePoint 2007 on the SharePoint 2007 platform:

http://www.thesug.org/blogs/MOSSMania/default.aspx

For my subscribers, update your readers, here is my new RSS Feed Url:
http://www.thesug.org/blogs/MOSSMania/_layouts/listfeed.aspx?List={3f7d7b8a-a822-409c-97ed-d4367160f6d7}

MCTS – Too Many Certifications

Saturday, July 21st, 2007

Too many certifications is never a bad thing.  I was playing around with Microsoft's logo builder after Pearson VUE finally got my microsoft profile updated, a month after I passed the tests and I noticed that if I tried to create a logo with all 4 of my WSS/MOSS certifications, I received an error telling me to remove one.  I worked hard for all four, so I would want them all displayed.

 Microsoft's site says that "Due to design and branding requirements, a logo may only display up to four or six lines."  If they moved Configuration up, that would allow for two more lines.  Also, why is MOSS 2007 Application Development on one line and WSS 3.0 Application Development is on two lines? 

 

On the usage guide page, it does not say that the certifcation list is limited to 4 to 6 lines, but to 4 to 6 certifcation areas:
The right side of the bar can accommodate 4-6 certification areas depending upon the credential.  I also have other problems with this since when I will go to upgrade my MCAD/MCSD, I will be getting more MCTS certs, which won't be able to be all listed together.  I still think these certifications should have been MSCS (Microsoft Sharepoint Certified Specialist) since MCSS is already taken by Microsoft Certified Security Specialist instead of MCTS.

Overriding the Content Query Web Part

Friday, June 29th, 2007

Out of the box, the content query web part can only get items from one content type, but what happens if you want it to display items from more than one content type?  You don't have to write a custom web part to do this thanks to Microsoft adding overrides in their content query web part. 

First, build the CQWP (Content Query Web Part) with everything how you want it, including the query, then you will need to export it to a location on your drive.  To export the web part, navigate to the page that contains the web part.  Open up the page in edit mode and on that page, click on the edit drop down menu for the web part and click "Export."

Save the file locally.  Once you have exported the web part as a .webpart file, open it with notepad and edit the ListsOverride property.

If you want to get everything based on a Generic List (BaseType = 0), you would use the following property:

 <property name="ListsOverride" type="string"><![CDATA[ <Lists BaseType="0"> </Lists>]]></property>


 
If you want to get everything based on a document library (BaseType = 1), you would use the following property:

 <property name="ListsOverride" type="string"><![CDATA[ <Lists BaseType="1"> </Lists>]]></property>

 Once you have finished editting the webpart, save the file.  Now we have to import the new .webpart file.  To do this, go to "Site Actions" -> "Site Settings" -> "Modify All Site Settings" on the top level site.

 Under "Galleries", click on "Web Parts".  Now click the "Upload" button.

Click on the "Browse" button and select the .webpart file that you made changes to.

Now set all of the properties for the webpart and click "OK" when finished.

Now browse to the page you want to add the web part to.  Open up the page in edit mode and in the web part zone where you want to add the web part, click on "Add a web part" and select your new webpart and then click "Add."

How to: Customize the Content Query Web Part by using Custom Properties
http://msdn2.microsoft.com/en-us/library/aa981241.aspx

 

 

 

Development Tools and Techniques for Working with Code in Windows SharePoint Services 3.0

Friday, June 22nd, 2007
Patrick Tisseghem has posted a two part article on the MSDN library about development tools and techniques for coding in WSS.  These are very great articles and I encourage you to look into them.
 

Summary: Learn the skills you need to develop for Windows SharePoint Services 3.0, about the differences from traditional ASP.NET development, about the required development environment, and the steps to build a Windows SharePoint Services solution with Visual Studio 2005 Extensions for Windows SharePoint Services 3.0. This article is part 1 of 2. (33 printed pages)

Patrick Tisseghem, U2U

June 2007

Applies to: Windows SharePoint Services 3.0, Visual Studio 2005 Extensions for Windows SharePoint Services 3.0

Contents

Summary: Explore Windows SharePoint Services solutions, solution architecture, and techniques for creating, deploying, maintaining, and upgrading Windows SharePoint Services solutions. This article is part 2 of 2. (26 printed pages)

Patrick Tisseghem, U2U

June 2007

Applies to: Windows SharePoint Services 3.0, Visual Studio 2005 Extensions for Windows SharePoint Services 3.0

Contents

SPSiteDataQuery – The query cannot be completed because the number of lists in the query exceeded the allowable limit

Saturday, June 2nd, 2007

Today I learned a hard lesson.  A single letter was causing a big problem for me: The query cannot be completed because the number of lists in the query exceeded the allowable limit. For better results, limit the scope of the query to the current site or list or use a custom column index to help reduce the number of lists.MaxListsLimit vs MaxListLimit

After a while of researching, I found out that the original example that I had been using for the basis of my SPSiteDataQuery had used MaxListsLimit where MaxListLimit should have been for the Lists property of my SPSiteDataQuery
I was using

"<Lists BaseType='1' MaxListsLimit='0'/>"

When what I needed was just:

"<Lists BaseType='1' MaxListLimit='0'/>"

This made the error go away as it let me search all of the lists in the entire site.  Not specifying a MaxListLimit would only search 1000 lists, but seems to throw an error if there are more than 1000 lists, instead of just searching the first 1000 that it finds.  I would recommend always using '0' if you are not sure that the client will have less than 1000 lists. 

Building your first AJAX web part

Monday, May 14th, 2007

The CodeProject now has an article about building an AJAX web part from scratch that calculates two numbers.  It includes step by step instructions for setting up web.config to support AJAX.

 

Creating an XSLT DataView for a sharepoint list

Monday, May 14th, 2007

Sharepoint Tips and Tricks has posted an article about how to create an XSLT DataView for a sharepoint list to use as a web part.

 

Using AND/OR in a SPSiteDataQuery

Thursday, May 10th, 2007
A quick note about using AND/OR in a SPSiteDataQuery:
You can only have 2 conditions below an AND/OR element in the query.
Examples:

Valid:
<And>
 <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
 <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
</And>

<Or>
 <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
 <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
</Or>

Invalid:
<And>
 <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
 <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
 <Eq><FieldRef Name=”Field1″><Value Type=”Text”>Value</Value></Eq>
</And>

<Or>
 <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
 <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
 <Eq><FieldRef Name=”Field1″><Value Type=”Text”>Value</Value></Eq>
</Or>

You can wrap AND/OR nodes in other AND/OR's.  If you need three conditions, you would do the following:

Valid
:

<And>
 <And>
  <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
  <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
 </And>
 <Eq><FieldRef Name=”Field1″><Value Type=”Text”>Value</Value></Eq>
</And>

<Or>
 <Or>
  <Eq><FieldRef Name=”Title”><Value Type=”Text”>Value</Value></Eq>
  <Eq><FieldRef Name=”ContentType”><Value Type=”Text”>Product</Value></Eq>
 </Or>
 <Eq><FieldRef Name=”Field1″><Value Type=”Text”>Value</Value></Eq>
</Or>

If you need more conditions, you need to get creative with your wrapping, but it can be done.

Getting an SPListItem by it's Unique ID

Wednesday, May 9th, 2007
So you have an item's Unique ID from the SPListItem.UniqueId property.  How would you go about getting that item?  I haven't found an easy way to do this through the API without already knowing the ID of the Web and List that it is in.  A way around this is to use the SPSiteDataQuery to search the entire site for that item.  As you will notice, I am running the search inside of the Elevated context to make sure that the item will be returned no matter what permissions the end user has.  You will also notice that I am not passing any ViewFields to the SPSiteDataQuery.  These are not required as WebID, ListID, and (int)(item)ID are returned automatically.  You don't need to loop through all of the DataRows, since there is only one.
     Guid g = {GUID};
     SPSecurity.RunWithElevatedPrivileges(delegate()
     {
         using (SPSite site = new SPSite(SPContext.Current.Site.Url))
         {
             SPSiteDataQuery query = new SPSiteDataQuery();
             query.Webs = "<Webs Scope='SiteCollection' />";
             query.Query = string.Format("<Where><Eq><FieldRef Name="UniqueId" />" +
		+ "<Value Type="Text">{0}</Value></Eq></Where>", Convert.ToString(g));
             query.RowLimit = 1;

             using (DataTable dt = site.RootWeb.GetSiteData(query))
             {
                 foreach (DataRow dr in dt.Rows)
                 {
                     Guid webId = new Guid(Convert.ToString(dr["WebID"]));
                     Guid listId = new Guid(Convert.ToString(dr["ListID"]));
                     using (SPWeb web = site.AllWebs[webId])
                     {
		          SPList list = web.Lists[listId];

		          SPListItem li = null;
		          try
		          {
		              li = list.Items[ g ];
		          }
		          catch { }
		          if (li != null)
		          {
		              // Now you have your item, do what you need to do
		          }
		          list = null;
                     }
                 }
             }
             site.RootWeb.Dispose();
         }
     });

IE7Pro makes IE7 work like a real browser

Wednesday, May 9th, 2007

IE7Pro is a free add-on for IE7 that finally makes up for some of IE7's flaws.  The biggest fix is the one that when IE7 crashes, which it does often, it will load your pages back in instead of closing, re-opening and taking you back to your homepage, nice!  The site also says it is compatible with IE6.

These are the features listed on their site:

Enhance Internet Explorer's Tabbed Browsing Capabilities
1. Double click to close tab.
2. Open new tab from address bar.
3. Enable/disable tab browse history manager.
4. Enable/disable crash recovery
5. Move the IE menu bar above the address bar
6. Hide search bar.
7. Modify the maxium number of parallel connections to the web server.
8. Select the external program to view page source 

AD Blocker
Blocks all forms of advertising, including Flash ads, rich media, fly-ins, slide-ins, pop-ups, pop-unders, spyware and adware ads, and messenger ads.

Super Drag and Drop
With 'Super Drag and Drop' enabled, you can open new links by simply dragging and dropping the link on the page. You can also Drag and Drop to search selected words with the default search engine or save the selected photo when Shift is held down.

Mouse Gesture
Mouse Gesture allow the user to execute commonly performed tasks (open/close a tab, go back, go forward , print , scrolling page etc.) by drawing a simple symbol on the screen.

Crash Recovery
Crash Recovery automatically restores all opened pages after a crash happened.

Save Page to Image
Flexible and easy-to-use tool that converts html page from any URL to image. It captures the whole web page's content into JPG, BMP , GIF , PNG or TIFF on the fly.

Quick Proxy Switcher
Different internet connections do often require completely different proxy server settings and it's a real pain to change them manually.

Greasymonkey alike User Script
IE7Pro Script is to Internet Explorer7 as Greasemonkey is to Firefox. It lets you remix the Web via scripts.