Friday, June 30, 2006

Workflow Developer Starter Kit for WSS v3

From Jan the man : Windows SharePoint Services V3 Starter Kit: Workflow Developer Starter Kit for Windows SharePoint Services V3 The Workflow Developer Starter Kit for Microsoft® Windows® SharePoint® Services V3 (Beta 2) contains Microsoft® Visual Studio® project templates for workflow in Windows SharePoint Services V3 (Beta 2) and a sample custom workflow.

Wednesday, June 28, 2006

SPSiteManager update coming soon

From Keith's blog :

As I noted in my previous post The Next Big Thing - The SharePoint Configuration Analyzer V.Next, we'll be combining the functionality of SPSiteManager with the SharePoint Configuration Analyzer, and incorporating SPUserUtil as well. In the mean time, we've found some immediate additions we need to make to SPSiteManager based on overwhelming customer requests and feature requests. Thus, I'm working on an update to SPSiteManager to include the following before moving forward. First I'll note what is complete, and then what is in progress to go into this version before I release it. This of course, is not an all encompassing feature request list :).

SharePoint Community Kit now live on CodePlex

From Lawrence :

I’ve been dreaming (and done lots of thinking and talking – mostly internally at Microsoft and with the SharePoint MVPs) about this for the past several months, so it’s immensely gratifying for me to see the project finally on CodePlex (at Of course, this is just the beginning. There’s still plenty of work (and thinking and talking) to do, but I believe that I’ve establish a grand enough vision and flexible enough framework to carry the project forward effectively. The most exciting thing to me is how the project will evolve based on feedback and contributions from the community at large. On another note, CodePlex was officially launched this morning! Of the 30 or so projects currently on CodePlex, I’m very proud of the fact that 5 of them are SharePoint specific. I expect many more in the coming months.

What's new webpart UPDATED!

Updated again? Yes again! Why you wonder.. well an user commented me about the fact that documents that are stored in folders (in a document library) didn't show up on the webpart. So therefore I have updated the source of Jan's great webpart (again). Here's the function that get's all the items from the current site and all it's subsites.

private ArrayList GetSubwebs(SPWeb web) { System.Collections.Hashtable listFieldsHashTable = GetListFieldHashTable(); System.Collections.Hashtable excludeListsHashTable = GetExcludeListsHashTable(); System.Collections.ArrayList items = new System.Collections.ArrayList(); web.Lists.IncludeRootFolder = true; foreach(SPList list in web.Lists) { if(list.Permissions.DoesUserHavePermissions(SPRights.ViewListItems)) { if(!excludeListsHashTable.ContainsKey(list.Title)) { SPQuery query = new SPQuery(); query.Query = ""; query.RowLimit = (uint)this.ItemsToDisplay; foreach(SPListItem listItem in list.GetItems(query)) { items.Add(listItem); } if (list.RootFolder.SubFolders.Count > 1) { foreach(SPFolder folder in list.RootFolder.SubFolders) { //In case of a Workspace template there is always a "1" folder if (folder.Name == "1") { foreach(SPFolder subfolder in folder.SubFolders) { items.AddRange(GetSubFolder(subfolder, list)); } } else { items.AddRange(GetSubFolder(folder, list)); } } } } } } foreach (SPWeb subweb in web.Webs) { items.AddRange(GetSubwebs(subweb)); subweb.Dispose(); } return items; }
And here is the (recursive) function that fetches all the items from folders:
private ArrayList GetSubFolder(SPFolder folder, SPList list) { System.Collections.ArrayList items = new System.Collections.ArrayList(); SPQuery subquery = new SPQuery(); subquery.Folder = folder; subquery.Query = ""; subquery.RowLimit = (uint)this.ItemsToDisplay; foreach(SPListItem listItem in list.GetItems(subquery)) { items.Add(listItem); } foreach(SPFolder subfolder in folder.SubFolders) { items.AddRange(GetSubFolder(subfolder, list)); } return items; }
btw.. i'll upload the complete solution soon so you can download it (since blogspot messes up some tags used in the query ;)

Tuesday, June 27, 2006

TechED Sharepoint 2007 DVD

Check this post from Arpan

If you didn't go to TechEd and want that DVD, ping your account team and ask them to give you one. We've set it up so they can easily order it for you!
Yeah baby! Don't you just love those guys? ;) Btw if you're wondering what's on it that makes me so happy.. it's following:
* A Beta 2 Office SharePoint Server 2007 & Office 2007 client Virtual Machine · Evaluation content including: o Evaluation Product Guides o Flash Demos o Developer “How do I” training videos o Customer Solution Briefs · UA Documentation including: o Planning, Deployment, Upgrade, Security Guides, Models, and Worksheets o CMS Assessment Tool w/ Documentation, Migration Whitepapers o Seven Development Projects for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services Version 3.0 (Beta Book) o SDKs, Office Resource Kit o Instructions and Samples: Excel Services, Forms Services, Business Data Catalog · Presentations from Office Dev Con and the SharePoint Conference · Developer Videos including architecture, security, file format, BI and workflow · Related Technologies content · Online Resources including links to the Office Preview Site, elearning content, Developer Portal, Community, Team Blog, Getting Started Guides, and various landing pages

Monday, June 26, 2006

Customizing MOSS 2007

Schupps @ The Sharingpoint posted Extreme SharePoint Design 2007: Introduction to Customizing Default Pages, which a nice short article what the difference is between 2003 and 2007 in terms of customizing the layout.

As you can see from the wireframe model, the page layout is not all that different from SPS2003, except that content is now separated from navigation by using two different file types. The beauty of this model is that changes to DEFAULT.MASTER are global; no more cutting and pasting code modifications into multiple site definitions.

Thursday, June 22, 2006

SP2 problems

Ok so I just installed wss & sps sp2 on a sharepoint environment (which was an default installation with no servicepacks or hotfixes) and it just went to smooth. It is a heavily customized environment with 4 portals and 240 teamsites and nothing was changed ! I suspected that the ows.css file was overwritten, that a couple of templates were missing, etc, etc. But it was all there! So i checked whether the virtual servers were upgraded and to my suprise, they were and so where the portals (checked via Control Panel > Add/Remove Programs > Sharepoint Portal Server 2003 > Click for support). Then I checked all the dll's and they were also upgraded. Then I checked the .aspx's that were supposed to be overwritten but they WEREN'T! After a couple of hours googling I still haven't found the problem/cause. Ok it is not that much of a problem but a couple of things were nice. For instance when you create a site via the portal and you deselected the 'list this site in the sitedirectory' you still have to fill in the 'description' and 'owner' field even when they are grayed out. This was fixed in SP1 if I'm not mistaken. Help anyone? :)

Wednesday, June 21, 2006

Presentation techniques

Don't you just hate it when you are presented by a slide that you can just barely read because there is just to much information on it? And then when you think the presenter is going to talk about it, you could't have be more wrong because then he/she asks "well it's basically all there on the slide so just read". Well for those presenters Shane at Graphical Wonder posted a good article about presentation techniques ;)

Below are the top 10 things I would have talked about in order to encourage a new way of thinking when delivering presentations:

1) The “presenter” should be the focus NOT the slide-deck, not the bullet points and not even the content. A good storyteller will keep your attention even when the content is dry. It’s funny because you almost always hear “We’ll get you the slide-deck” in the end - the truth of the matter is a really good presentation would usually be worthless without the presenter.

2) Visuals, Visuals, Visuals! You have all heard the expression - A picture is worth a 1000 words right? Why is it that 80% of the time when I look up during a technical presentation I see the 1000 words … which brings me to my next point

3) Minimize that content - I cannot count the number of times I look up to see a full page of text with 2-3 paragraphs. 30 bullet points, and they talk about it for 8 seconds.

4) While on the topic of bullet points, noone says you “have” to use them - in fact a good visual will draw a single picture when a bullet point allows your audience to draw 100 different variations. Take a look at this visual for example.

5) Dare to be different - People will remember the simple things that really stand out - Think Seth Godin and the Purple Cow. If you drive down the street and see 100 cows you probably won’t remember them, however if one of those are purple you certainly will.

6) Keep it simple - Especially with visuals. I often look up to see a chart that for all I know could potentially be describing the molecular structure of a snowflake. To quote Einstein - “Everything should be as simple as possible, but not simpler”.

7) Know your audience (before hand) - if you know who you are delivering too you are ahead of the game

8) Focus on “A super cool feature” rather than a full gamut, people love cool stuff. This really rings true with Demo’s. 9) Keeping them wanting more is never a bad thing howevergiving them too much, that’s a whole other story.

Monday, June 19, 2006

Pageviewer webpart customized!

Well this is a solution which i've built a couple of months ago and just want to share it with you. Thought that some people may find this interesting ;) Think of solutions where you have a custom build application on another webserver where only powerusers can view it. Now you want to configure the pageviewer that only powerusers will have the pageviewer on the page and users who are not in the powerusers group will not see the pageviewer.

protected override void OnInit(EventArgs e) { UserGroup.UserGroup usrgrpService = new UserGroup.UserGroup(); usrgrpService.Credentials = new System.Net.NetworkCredential("adminaccount", "password", "domain"); usrgrpService.Url = HostUrl + "/_vti_bin/UserGroup.asmx"; System.Xml.XmlNode ngCrossGroups = usrgrpService.GetGroupCollectionFromUser(@Context.User.Identity.Name.ToString()); XmlNodeList _nodes = ngCrossGroups.SelectNodes("*"); foreach (XmlNode node in _nodes) { foreach(XmlElement _item in node.SelectNodes("*")) { if (_item.Attributes["Name"].Value == Group) { breakiebreakie = true; break; } } if (breakiebreakie) { break; } } if (!breakiebreakie) { this.Visible = false; } }
Make sure you access the webservice with an admin account because otherwise you get access denied errors when you want to retrieve information about the users. Also, don't mind my variablenames ;) Then in the render of the webpart :
protected override void RenderWebPart(HtmlTextWriter output) { try { if (breakiebreakie) { output.Write("just put an iframe here with an URL"); } } catch(Exception error) { output.Write(error.Message.ToString()); } }
So there are three variables : Url = the url you want to display within the pageviewer Group = (cross)sitegroup you want to give rights to view the pageviewer HostUrl = url where the webservice will be referenced to

Friday, June 16, 2006

To dispose or not dispose that's the question

Well it ain't no question anymore since Keith Richie has publised an article on msdn (even though it states that it only applies to WSSv3 it also (imo) applies WSSv2)

After many weeks of composing, reviewing, editing, fact checking :) We've completed it and it is now available: Best Practices: Using Disposable Windows SharePoint Services Objects Hope this helps, as it's part of my daily mantra with folks when I discuss this. (Now I need to go an make sure I'm practicing what I preach in my tools :)) - Keith
Nice work mate ;) Update : From Matthew Cosier's blog :
Free Office SharePoint Server 2007 / WSS 3.0 development book! You can snag it here. (Right click the link, then save as) It's a 4.76meg PDF document.

Thursday, June 15, 2006

What's new webpart

Jan the man made the "What's new webpart" for WSS sites (it's a standard feature in SPS but due to an obscure and unknown reason not in WSS) more than two years ago (also Mike Fitzmaurice did the same) and I used this for a project I'm involved in right now. The architecture that we used is a WSS site with a lot of subsites (actually a portal without the need of SPS) and the requirement was that on a high level, the users could see an overview of the last modified items. Here is where Jan's webpart comes into view ;) Now I modified the code so that subsites are also shown in the summary.

private ArrayList GetSubwebs(SPWeb web) { System.Collections.Hashtable listFieldsHashTable = GetListFieldHashTable(); System.Collections.Hashtable excludeListsHashTable = GetExcludeListsHashTable(); System.Collections.ArrayList items = new System.Collections.ArrayList(); web.Lists.IncludeRootFolder = true; foreach(SPList list in web.Lists) { if(list.Permissions.DoesUserHavePermissions(SPRights.ViewListItems)) { if(!excludeListsHashTable.ContainsKey(list.Title)) { SPQuery query = new SPQuery(); query.Query = ""; query.RowLimit = (uint)this.ItemsToDisplay; foreach(SPListItem listItem in list.GetItems(query)) { items.Add(listItem); } } } } foreach (SPWeb subweb in web.Webs) { items.AddRange(GetSubwebs(subweb)); } return items; }
It all worked fine until testing with a group of readers. These readers were getting access denied errors. First thing I did was using the impersonation trick I learned a couple of weeks ago but that didn't do the job. Second thing I did was testing with a contributor group, that went fine. Thirdly was to check what the key difference was between these two groups (except for the most obvious reason that contributors can add stuff ;). Well the key difference was the ability to 'browse directories' So you might wonder (I know I do).. why can't readers browse directories. And what are directories in sharepoint anyway? :) Are directory's actually subsites?

Tuesday, June 13, 2006

Beta2 thingies again!

Jan the man has posted another YASR (Yet Another Sharepoint Relief) and this time it's about alerts! He comes to the conclusion that now you can also set alerts not only for yourself but also for other users. This was a feature that a lot of 2003 powerusers/siteowners really wanted to have. The question I have however is, will all users be able to subscribe other users to alerts or is it a poweruser/admin feature-only?

Monday, June 12, 2006

Reporting in Sharepoint 2003

ok.. so the question was "Robin, can we have some figures to see the growth of the number of teamsites. And if it possible also to see how fast the database is growing" I naturally replied "Ofcourse that is possible!" ;) Not knowing if such webparts or other functionality available I went searching and discovered the following options : - Install Reporting Server on the database server and install an information gathering tool (DEP) to fill the Sharepoint Report Pack database - Install the Sharepoint Reporting tool Well I began with the second solution because that did not require a change of the database server. This solution provides you with a XML file with all sorts of information about the Sharepoint environment. The 'problem' of this solution is that you always get an overview of the way 'it is' so you cannot see any grow or something like that. You have to manually do this. So we had the information we wanted but we had to manually make our own reports by using the information we got. The other solution required a change of the database server. First Reporting Server for SQL Server had to be installed (including installation of IIS). After that a staging and a reporting database were created. To get information into the database the data extraction tool DEP was installed on the front-end servers of our Sharepoint environment. A scheduled job was created to have this extraction take place everyday. The standard reports that were installed were fine and give the information we want. These reports could also be accessed with the use of the webparts that are installed with Reporting server. Conclusion If you want information about what the status of your Sharepoint environment is right now and you don't want to install IIS on your database server than the Sharepoint reporting tool is the tool for you. Otherwise, if you want to see trends about sizing and the growth of the number of teamsites then you are better of using Reporting Server with the Sharepoint report pack.

Wednesday, June 07, 2006

Usefull new beta2 thingies

Bart was on a roll last sunday with spamming the world with new blogposts ;) Check them @ Bart Bultinck's Blog [MOSS2007]-[WSSV3] - Host Header Mode on multiple web applications is now possible!

Host header mode, a new feature in both Windows SharePoint Services version 3 and Office SharePoint Server 2007, allows you to create multiple domain-named sites in a single Web application.
[BETA2] How do I enable search over Adobe PDF, Microsoft Office Visio and other files that require the installation of IFilters?
In beta 2, special steps are required. After installing the filters in the normal way, the work around is: The following registry paths must be added. In this example, the registration is for the pdf file extention, enabling the Adobe PDF IFilter from Adobe.
Windows SharePoint Services Beta 2 IT Pro Documentation
This download contains documentation for IT pros and administrators to install and deploy Windows SharePoint Services Beta 2.
Also from Lawrence Liu's blog came the following:
The C9 video of the SharePoint Group Program Managers that I mentioned in my previous post is now online at Although I’m sure that you’d enjoy the entire 55 minute video, here are some timestops for you to jump around within the video in case you are in a hurry. 4:12 – My Site and People features 11:17 – Business Data Catalog concepts and functionality 18:07 – Quick Part feature that makes BDC data available in Word (and other Office 2007 client apps) 23:02 – Business Application Search and Business Data Actions enabled by the BDC 53:10 – Walkthrough of a BDC Application Definition file 27:50 – Relationship between Microsoft Content Management Server, Office SharePoint Server, Windows SharePoint Services, and ASP.NET – great discussion 33:50 – SharePoint Server’s Web Content Management features (master pages, inserting reusable content, site/page management, etc.) 41:51 – Very cool “content by query” Web Part 44:00 – Content Deployment feature 48:07 – Web content authoring/publishing from Word 2007 50:45 – Windows SharePoint Services as a platform And thanks to Duncan Mackenzie for jumping in at the last minute to take over for Scoble, who had to be with his ill mother. Duncan did a fabulous job as our videographer and interviewer, and I just loved how he added the link to at the end of the video! More videos of other SharePoint Program Managers to come very soon. Bookmark, so you can see them all!
So go check it out I say! Update: Going trough al my favorite bloggers I stumbled upon Serge's post about the navigation in 2007. He came to the following conclusion :
SharePoint 2007 contains a very powerful navigation system that allows you to completely configure the way your site navigation is presented. I did only scratch the surface however. In a upcoming posts I will dive into the following topics: Navigation Editing and Sorting – this functionality allows you to add custom additional navigation items and to show or hide sites and pages in the navigation (but not the default page in the Pages library!) Navigation under the hood – which navigation controls are used by SharePoint, what are their possibilities and how can you for example change the current depth of 2 that is currently shown in the hierarchy. Custom navigation providers – how can you utilize the SharePoint navigation controls with custom navigation information?
And there a lot of screenshots as well! What more could you want! ;)

Migration Center

On MSDN there is a (new) page available where a lot of information is gathered to use for migration scenarios concerning SPS2003 and CMS2002.

STSADM in 2007... yeah baby

Steve posted that the following commands are new next to 2003 version:

activatefeature addalternatedomain addcontentdb addpermissionpolicy addsolution addzoneurl authentication backuphistory blockedfilelist canceldeployment changepermissionpolicy copyappbincontent creategroup databaserepair deactivatefeature deletealternatedomain deletecontentdb deletegroup deletepermissionpolicy deletesolution deletezoneurl deploysolution deploywppack displaysolution enumalternatedomains enumcontentdbs enumdeployments enumgroups enumservices enumsolutions enumzoneurls execadmsvcjobs export getsitelock geturlzone import installfeature managepermissionpolicylevel migrateuser provisionservice registerwsswriter renameserver retractsolution retractwppack scanforfeatures setapppassword setsearchserver setsitelock setworkflowconfig spsearch syncsolution uninstallfeature unregisterwsswriter updateaccountpassword updatealerttemplates updatefarmcredentials upgradesolution It looks like the SMIGRATE.EXE util has been replaced with STSADM -o export|import.
Thanks Steve! ;)

MOSS Architecture & Shared Services

Martin Kearn posted a nice article about the new architecture in 2007 and concludes that

MOSS architecture is very similar to SharePoint 2003 in some ways but different in a few crucial areas. These area's are : - Search - Index - Audience compilation - User profiles database - My Sites - Business Data Catalogue - Excel Services
Read the whole article here

MOSS ECM Starter Kit

Andrew posted that a starter kit is available for download that includes :

Code Sample: Document Converter Workflow: Custom WCM activities Workflow: Hello World sequential workflow Workflow: State based approval workflow Workflow: Collect feedback workflow Workflow: Multi-stage workflow VS Project Templates: SharePoint sequential workflow library VS Project Templates: SharePoint state machine workflow library 2007 Office System Starter Kit: Enterprise Content Management Starter Kit
If you are confused (like I am) about the whole new approach on that CMS integrated in Sharepoint, you should definatly download this!

Friday, June 02, 2006

New Sharepoint MSDN

From Maurice Prather's blog :

Check out the new Windows SharePoint Services Developer Center on MSDN. :)
Aahh it looks nice doesn't it, it already contains how-to's to develop webparts :)

New challenge! pt2

Well, I told you before about the challenge I was faced with (migrating users from a foreign domain to an existing domain in Sharepoint) The luck I had was that the usernames were the same, so that only the domainnames were different. First I had to discover if a user existed on a site and if so, what is the role that this user has. Then I had to add the new user to the site. So I designed four functions : 1. GetAllWebs (loop through all the portals and sites) 2. GetUser (look for the user) 3. GetGroups (get's the role from the users (eg. reader/contributor) 4. MigrateUser (add the new account with the same securitysettings) Since I don't have the rights on the frontend server, I could only use webservices. Thus I was confronted by the lack of support to enumerate through all the sites that belong to a portal. The "Webs" webservice only collects the area's from a portal. So if anyone knows how to get the webs from a portal, I'm all ears ;) GetAllWebs

private void GetAllWebs(string url) { ArrayList list = new ArrayList(); Webs.Webs web = new WebApplication5.Webs.Webs(); web.Url = url + "/_vti_bin/webs.asmx"; web.Credentials = new System.Net.NetworkCredential("username", "password", "domain"); try { XmlNode subwebs = web.GetAllSubWebCollection(); foreach(XmlElement item in subwebs.SelectNodes("*")) { GetUsers(item.Attributes["Url"].Value.ToString()); } } catch(Exception) { Response.Write(url + " does not exist"); } }
private void GetUsers(string url) { ArrayList users = new ArrayList(); UserGroup.UserGroup usgrp = new WebApplication5.UserGroup.UserGroup(); usgrp.Url = url + "/_vti_bin/usergroup.asmx"; usgrp.Credentials = new System.Net.NetworkCredential("username", "password", "domain"); XmlNode node = usgrp.GetUserCollectionFromWeb(); foreach(XmlElement item in node.SelectNodes("*")) { foreach (XmlElement items in item.SelectNodes("*")) { if (items.Attributes["LoginName"].Value.IndexOf("OLDDOMAIN") > -1) { Response.Write("

" + url + "

"); Response.Write("
" + items.Attributes["Name"].Value.ToString()); Response.Write("  " + items.Attributes["LoginName"].Value.ToString()); Response.Write("  " + items.Attributes["Email"].Value.ToString()); GetGroups(items.Attributes["LoginName"].Value.ToString(), url, items.Attributes["Name"].Value.ToString(), items.Attributes["Email"].Value.ToString()); } } } }
private void GetGroups(string loginname, string url, string username, string email) { UserGroup.UserGroup usgrp = new WebApplication5.UserGroup.UserGroup(); usgrp.Url = url + "/_vti_bin/usergroup.asmx"; usgrp.Credentials = new System.Net.NetworkCredential("username", "password", "domain"); try { XmlNode node = usgrp.GetRoleCollectionFromUser(loginname); foreach(XmlElement item in node.SelectNodes("*")) { foreach (XmlElement items in item.SelectNodes("*")) { Response.Write("  " + items.Attributes["Name"].Value.ToString()); MigrateUser(items.Attributes["Name"].Value.ToString(), username, loginname, email, url); //users.Add(items.Attributes["LoginName"].Value.ToString()); } } } catch(Exception error) { Response.Write("
" + error.Message.ToString()); } }
private void MigrateUser(string role, string username, string loginname, string email, string url) { UserGroup.UserGroup usgrp = new WebApplication5.UserGroup.UserGroup(); usgrp.Url = url + "/_vti_bin/usergroup.asmx"; usgrp.Credentials = new System.Net.NetworkCredential("username", "password", "domain"); if (loginname.IndexOf("OLDDDOMAIN") > -1) { loginname = loginname.Replace("OLDDOMAIN","NEWDOMAIN"); try { usgrp.AddUserToRole(role, username, loginname, email, ""); Response.Write(username + " is added with " + role + " right"); } // catch (Microsoft.SharePoint.SoapServer.SoapServerException soaperr) // { // //Response.Write("User cannot be added to the site"); // Response.Write("
" + soaperr.InnerException.Message.ToString()); // } catch (Exception error) { Response.Write("
" + error.Message.ToString()); } } }
If all the users are migrated succesfully then I have to write another function to remove the old accounts. Btw if you are wondering why I haven't used the SPUserUtilSuite from Keith Richie, it required (although I think it did) to execute the files on the front-end server of the farm. Unfortunatly I did not have that luxury.. Btw.. todo's are : instead of using Response.Write's is to write the results in a nice xml file and have a webservice that collects all the webs from a portal (instead of the areas) :)


Ok.. this has nothing to do with Sharepoint but I found this cool site that has every thinkable connection string available (Sql2k, sql2k5, odbc, oledb,etc) Check !