Expand/Collapse Web Parts in WSS v2

While I was working on some customizations for a client’s Business Portal v3 (for Dynamics SL) installation yesterday, I needed to save some real estate within the Timecard Entry screen. We moved and customized the tmtce30.asp file to display the timecard selection blocks horizontally, and moved the web part above the Timecard Entry screen.
 
Now that we had more real estate to work with on the timecard, I also was looking for a way to minimize the Timecard List web part, without using the Minimize feature of the web part.
 
After a bit of searching, I came across this great post at the Path to SharePoint blog: http://pathtosharepoint.wordpress.com/2008/10/25/expandcollapse-buttons-for-your-web-parts/, which was built for 2007, but, I could find a way to do this in v2, as with v2, we do not have the _spBodyOnLoadFunctionNames.push() function available to us.
 
What I came up with is attached at the bottom of this post. A few changes were made, and there is also some commented out code in there from my attempts to get this to work. In this time card screen, we are specifying a width of the web parts on the page, so utilizing an image is not an option, as it creates a two-line (and ugly) title header for each web part.
 
The functionality that I had modified in the original code, is to push this into the onload events, without overwriting any onload code (I found that code somewhere, but unfortunately did not save the URL… once I get it, I will update this posting with the proper props!). Also instead of using the built-in _layouts/images/[plus|minus].gif images, the function is incorporated into a SPAN around the title, so clicking on the tile itself will expand and collapse the web part.
 
As for usage, just drop this file anywhere on the web part page (via importing the web part), and you should be good to go.
 
Hope this helps, and let me know if you have any issues.
 

http://cid-b06529fd3fc75473.skydrive.live.com/embedrowdetail.aspx/SharePoint/Expand|_Collapse|_Web|_Parts|_v2.dwp

 

December Cumulative Update Packages Release for WSS v3 and MOSS 2007

Yesterday, the SharePoint Product Group announced the release of the December Cumulative Update Packages for WSS v3 and MOSS 2007. This post, as well as further information, installation instructions, and download links can be found here:

http://blogs.msdn.com/sharepoint/archive/2008/12/17/announcing-december-cumulative-update-for-office-sharepoint-server-2007-and-windows-sharepoint-services-3-0.aspx

 

Free Date Picker for Advanced Search in MOSS/WSS from BA-Insight

Just received a notification that BA-Insight is offering a free AJAX based date picker extension for the Advanced Search web part in MOSS/WSS.

Go here for more information and to download: http://www.ba-insight.net/datepickerregistration.aspx

“Local Drafts” folder location

I’ve been asked this question a lot, and thought I would post a quick note about it. When you are editing a file within SharePoint, and asked if you want to save it in your local drafts folder, this is what it means – in your user profile directory, under your documents, there is a folder, or one that will automatically get created, called SharePoint Drafts. For example, my local drafts folder on my Vista machine is:

C:\Users\gvarosky\Documents\SharePoint Drafts

Today’s Most Helpful Link…

After prancing around Google for what has seemed like hours, trying to get a definitive list of all field types, so I can configure some additional fields within a Content Query Web Part, I finally found one. Kartic – you are my hero for the day.

http://kartickapur.wordpress.com/2007/11/01/content-query-web-part-customisation-and-adding-custom-fields/

 

Increase the ‘Save as Template’ size limit for Lists and Sites

The default size limit for the ‘Save as Template’ function in SharePoint is limited to 10MB. This however, can be changed easily using stsadm. To do so, go into the 12 Hive bin folder (Drive:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\) and run the following command:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000

This command, exactly as entered above, will increase that limit to 50MB. If you would like to make this number higher, than just adjust the propertyvalue argument to the size that you need.

 

WSS v2 Email Configuration Gotcha – Spaces in SMTP server names

This morning I was working on an issue for a client, to track down why alerts were not being sent out to subscribers within their WSS v2 environment. I checked all of the well known issues, such as making sure the SharePoint Timer Service was running, and also restarted it just for kicks. And that the accounts were the same for the Timer Service as well as the content database for the WSS server as well, so that the Timer Service can actually connect to the database and process alerts… and everything was just fine, however, alerts were still not being sent out.

Since we have an external server here which we use to process mail, I added in a few rules to allow my client’s server to relay mail through, so I can control every aspect of the process, and that is when I found the issue.

image

When highlighting the server name in the Outbound SMTP server configuration box to remove and replace with our server, there was an extra space on the end of the server name. This was the case for both the virtual server and central configuration SMTP settings. I dropped the space from both, and alerts were finally making it out of SharePoint, and onto their subscribers.

The environment which this occurred in was WSS v2 running with SP2. I will look to see if I can find a hotfix for this issue or if this is fixed in WSS v2 SP3.

 

Resources for SharePoint Usage Analysis Processing

I have been looking into usage analysis processing options for a client, and thought I would share my findings with the rest of the world…so without further ado – below are some links that you may find useful for usage analysis processing in v2/v3 versions of SharePoint

http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=129

http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=8

http://blogs.msdn.com/joelo/archive/2007/09/28/sharepoint-reporting-solution.aspx

http://blogs.msdn.com/joelo/archive/2007/11/06/web-usage-reporting-tools.aspx

 

Technorati Tags: ,,

Programmatically Set a Text Field Default Value

Just a quick code snippet on setting the Default Text Value of a Single Line of Text field in SharePoint to a specific value.

   1: // update Shared Documents list "Customer Name" field
   2: SPList repDocs = childWeb.Lists["Shared Documents"];
   3: SPField clientName = repDocs.Fields["Customer Name"];
   4: clientName.DefaultValue = "foo";
   5: clientName.Update();
 

Access Denied error when activating the Publishing Infrastructure features on a site collection

When working with a client yesterday, rolling out a new site collection, we needed to activate the Office SharePoint Server Publishing Infrastructure feature on the site collection, as we needed the Summary Link Web Part, among others.

However, when activating this feature, we received an "Access Denied" error. Intriguing…

After a little research, I determined that the Publishing Resources were not activated at install time, thus giving us that error.

Never fear however, stsadm can ease your woes, just run the following command:

stsadm -o activatefeature -name PublishingResources -url http://site.collection.url

Then, go into the Site Collection Features, and activate the publishing resources, and you should be good to go!