December 2007 - Posts

Merry Christmas and Happy New 2008...My gift is some great SharePoint articles to read over the holidays

First of all Merry Christmas to everyone who reads this blog and happy upcoming New 2008 from me and my family!! (.... I mean my family and me)

This blog post is just a selection of awesome recent blog posts from some cool people that will be nice to read if you want to get away for couple of minutes and have some peace during this busy festive season.

Posts from Michael Gannotti (http://sharepoint.microsoft.com/blogs/mikeg/)

Video: Building a Simple "Workflow" Application Without Using Workflow - Custom List Form and Alerts in SharePoint

//yeah great, but why would you do that?

Bill Gates on the Skills You Need to Succeed

//words of the great Bill himself, not to be missed. Well if anyone knows about success, I would say it's him

Creating Custom Wikis in SharePoint

//why would anyone really want to customise a Wiki..... I guess some people do, and some of your clients might (branding is the first reason), so check this out.

Super Search - Tafiti Released!

//all the bells and whistles Enterprise Search could ever imagine

Will SharePoint and Tafiti Walk Down the Aisle?

//I really really hope so

Two New Public Sites On Microsoft Office SharePoint Server 2007 As Well As Filter Pack Release for SharePoint Search

//check out Ministry of Sound using SharePoint 2007 site (http://club.ministryofsound.com/club/)!!!! That is just a proof how cool MOSS 2007 really is.

Posts from Joel Oleson (http://blogs.msdn.com/joelo/)

SharePoint Server Topology - Server Roles and Services on Server

//the essential not so basic "basics"

Default Web Application Policies and Determining Number of Service Accounts

//best practices

10 Things To Optimize your SharePoint Server Indexing

//more important best practices

12 Things to do over the Holidays

//awesome and interesting homework for all of us from Joel

Brian Jones - Open XML battle news from the front, the war continues... (http://blogs.msdn.com/brian_jones/)

IBM's Rob Weir makes it clear... he wants war

//hah!! The war he's surely going to lose (well that's if all of us can help it).

Over halfway there... including some positive changes to the Open XML standard

//some great progress.....

Why all the secrecy?

//hmm maybe a bit of paranoia in Ecma

500+ national body comments posting today

//latest update on the progress

What happened to the DoD 5015.2 Add-on Pack for SharePoint 2007 Records Management

Still no news of the DoD Add-On pack for SharePoint 2007 Records Management, although it was promised that it will be released before the end of this year (http://blogs.msdn.com/sharepoint/archive/2007/05/30/dod-5015-2-certification-for-moss-2007-we-ve-passed-the-test.aspx).

Here we are, it's Christmas and still nothing, I must say I'm really really disappointed in Microsoft, I was hoping that I will do a follow up on my Records Management series and blog about all the new cool features from the Add-On pack.

For those of you that haven't had chance to look at it here are the links:
Doing Records Management in SharePoint 2007 Part 1 (Intro)

Doing Records Management in SharePoint 2007 Part 2 (Creating a Records Repository and Configuring the Retention Schedules)

Doing Records Management in SharePoint 2007 Part 3 (Sending Content from SharePoint Server 2007 to the Records Repository site)

I was also hoping that will get to implement and utilise early next year the features from the pack that are eagerly anticipated by some of our clients and a lot of people in the community.

Features like:

  • Supplemental Marking
  • Access Control Columns
  • Enhanced Search Capabilities
  • Metadata Propagation
  • Email Records Declaration
  • Records Relationships
  • Cutoffs and Retention Schedule Processing
  • File Plan Builder
  • Closing of records folders
  • Vital Record Review
  • Folder Holds
  • Enhanced Multi-cycle Disposition
  • Records Screening and Reporting
  • Many more...

But hey....

Meanwhile for those of you that also participated in a great chalk and talk session headed by JP Horne of Microsoft at TechEd 2007, but didn't get the slides or even those of you that didn't, you can download the slide deck here (http://dotnet.org.za/blogs/zlatan/OFC205%20-%20DoD%205015.2%20Add-on%20Pack%20-%20Horne.zip) which shows what can be expected in the new DoD 5015.2 add -on pack.

Also some of you have asked me if there's any documentation on SharePoint 2007 online resources on how to use SharePoint 2007 Records Management for Physical Objects, here's the link (http://technet2.microsoft.com/Office/en-us/library/eb612d78-8f84-4600-8cc8-b8826201e6311033.mspx?mfr=true)

Also check this Downloadable book: Records Management Guide for Microsoft Office SharePoint Server 2007 (http://technet2.microsoft.com/Office/en-us/library/eb612d78-8f84-4600-8cc8-b8826201e6311033.mspx?mfr=true)

Getting Roles and Permissions on a List/Document Library Level in SharePoint 2007 (or WSS 3.0)

So let’s say you’re building a web part or a custom SharePoint (server/services) page and you need to know what roles are there on a particular list or even object so that you control what is being showed to the user, hide or show relevant information etc (example: http://blogs.msdn.com/modonovan/archive/2005/07/07/436394.aspx).

If you’re a seasoned SPS veteran you’ll first go for the SPRole (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sprole.aspx) and SPRoleCollection (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sprolecollection.aspx) which you’ll soon learn, as your trusty VS 2008 will inform you, has become obsolete, but it will let you use it.

So you probably would’ve used it like this:

                    SPWeb currentWeb = SPControl.GetContextWeb(Context);

                    foreach (SPRole role in currentWeb.Roles)

                    {

                        //I guess you would put your code here

                        Console.WriteLine(role.Name);

                    }

Then you remember how limiting is was and you wonder, well if this is obsolete, what has replaced it?

Well this is what:

SPRoleAssignment (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sproleassignment.aspx )

SPRoleAssignmentCollection (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sproleassignmentcollection.aspx)

Examples of RoleAssignments:

            using (SPSite site = new SPSite("http://yourspsite/"))

            {

                using (SPWeb web = site.OpenWeb())

                {

                    SPList yourList = web.Lists["Your List Name"];

 

                 

                    foreach (SPRoleAssignment role in yourList.RoleAssignments)

                    {

                        //role.Member gives you the SPPrincipal type object, which is a user or a group, .Name gives you the Name of the User/Group

                        Console.WriteLine(role.Member.Name);

                        //here you can add your code which might include Add() and Update() of the RoleAssignments Collection (yourList.RoleAssignments)

                    }

                }

            }

            using (SPSite site = new SPSite("http://yourspsite/"))

            {

                using (SPWeb web = site.OpenWeb())

                {

                    SPList yourList = web.Lists["Your List Name"];

 

                    //the output will look something like this :

                    //<permissions><permission memberid='33' mask='9223372036854775807' />

                    //<permission memberid='34' mask='1856436900591' />

                    //<permission memberid='35' mask='756052856929' />

                    //</permissions>

                    // this gives you users and/or groups and their security masks

                    Console.WriteLine(yourList.RoleAssignments.Xml);

 

                    //you can use LINQ to parse and iterate through the xml

                    XElement listGroupIDs = XElement.Parse(yourList.RoleAssignments.Xml);

 

                    foreach (XElement x in listGroupIDs.Elements("permission"))

                    {

                        //extract the values and use them to find and/or instantiate the values of groups and objects and even manipulate them

                        Console.WriteLine(x.Attribute("memberid").Value);

                    }

                }

            }

Although the following two classes are considered to be obsolete:

SPPermission (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sppermission.aspx)

SPPermissionCollection (http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.sppermissioncollection.aspx)

 There is one really cool thing about SPPermissionCollection in particular which is its XML property which is a bit more descriptive then the same property from the SPRoleAssignmentCollection class.

Example:

            using (SPSite site = new SPSite("http://yourspsite/"))

            {

                using (SPWeb web = site.OpenWeb())

                {

                    SPList yourList = web.Lists["Your List Name"];

 

                    //the output will look something like this :

                    //<Permissions>

                    //<Permission MemberID="33" Mask="-1" MemberIsUser="False" MemberGlobal="True" GroupName="Processes Owners" />

                    //<Permission MemberID="34" Mask="1011028719" MemberIsUser="False" MemberGlobal="True" GroupName="Processes Members" />

                    //<Permission MemberID="35" Mask="138612833" MemberIsUser="False" MemberGlobal="True" GroupName="Processes Visitors" />

                    //</Permissions>

                    //which gives you Group/UserNames and not just MemberIDs,

                    Console.WriteLine(yourList.Permissions.Xml);

 

                    //you can use LINQ to parse and iterate through the xml

                    XElement listGroupIDs = XElement.Parse(yourList.Permissions.Xml);

 

                    foreach (XElement x in listGroupIDs.Elements("Permission"))

                    {

                        //extract the values and use them to find and/or instantiate the values of groups and objects and even manipulate them

                        Console.WriteLine(x.Attribute("GroupName").Value);

                    }

                }

            }

 

Should we use Windows, Mac or Linux as our Operating System

After reading a great blog post by codingsanity (http://dotnet.org.za/codingsanity/archive/2007/12/14/review-windows-xp.aspx) I say it’s a great blog post because it was entertaining to read, and even more entertaining to read the comments, but I can’t say that I agree with it (and some of the anti-windows comments) in any way. As far as bugs go Windows XP was by far the buggiest of Microsoft’s offerings, even more then Windows (Me) Millennium (anyone remember this?), this is maybe because I mainly use proprietary SDKs in my Dev Environment for many server application systems (not all Microsoft) that I’ve worked with for past couple of years, and maybe those have been responsible for the fact that my installation of XP only lasted for ± 2 days before it started blue-screening waaay to often. So my upgrade path (as far as operating systems go) was the following:

Windows 2000 Professional -> Windows 2003 Server Enterprise -> Windows 2003 Server R2 Enterprise -> Windows Vista Ultimate. The last one runs surprisingly stable and besides running standard applications on it together with Office and Visual Studio 2008 I basically use it to run VMs of my different Dev Environments (there might be the key, as before, when XP came out, they all were on that same operating system, no virtualisation).

 

But for most of you that are quick to judge Microsoft Operating Systems (not that you should not, as I believe they should kept on their toes) before you start with your bashing, consider how really really dodgy the other alternatives are?

Do you want to work on Mac OS X Tiger (or something) AKA Free BSD with a cool skin J .... puhhleaaseee (http://youtube.com/watch?v=iEAGmBRC1dc&feature=related)

Linux...... hmm if I had something to use it for, or if I wanted to make my life a living hell I would probably use it. It was only until SUSE 9 and 10 that Linux had a distribution which could be called a proper Enterprise Server.

I mean the only reason why I had to keep my Linux, actually SUSE skills up to scratch is because some time ago some clients came out of the woodworks requiring their applications and systems to rather run on Linux then a Windows Server operating system. Although implementations were really good and stable, but very soon the client started requiring little changes and add-ons to the operating system.  Soon after they realised that Linux skills are scarce and expensive to continuously do this so they opted for the Microsoft alternative.

 

And if your worry was vulnerabilities check this article from Slashdot.org http://it.slashdot.org/it/07/12/18/170241.shtml

 

What is also weird is that most of the people that I personally know who bash Windows in favour of Linux or Mac, if not at home, definitely at work they still use Windows Operating Systems, even when they have the option to use something else.

 

All in all, be careful what you’re bashing, because one day you might be forced to use some real rubbish instead.

Posted by Zlatan | 2 comment(s)
Filed under: ,

When CopyTo() and CopyFrom() just don't cut it anymore

When it come to copying of items to and from different locations (in SharePoint) by means of using SharePoint object model, first obvious methods you find (and try using) are CopyTo() and CopyFrom(). They all seem nice and dandy if you’re simply just copying an item, but when it comes to some slightly more complex cases, such as, copying an item that contains major/minor versions, with check in/check out functionality or even copying to a folder where an item like this already exists, you soon realise that the above mentioned methods are sooo rubbish/useless. You don’t believe me?? Use a Reflector tool to find out, it will be far clearer.

In my case, one small part of the required functionality as per our design of the SharePoint 2007 solution required copying of a file to a document library where that file might already exists and the copied file must then be version on top of that existing file, we’re using major versions here only (confused, I apologise, try and read it again slowly, I’m too lazy to re-phrase). Anyway so basically what needed to be done is to first CheckOut the item if the item exists (and if it requires checking out) and then copy a file from the origin to a destination file as a new version (one would expect this to be done by default).

Then I started exploring all the alternatives, until my friend Rupert pointed out the OpenBinary and SaveBinary functionality and it worked, just as expected, I never turned back.

Here’s pretty much what the code looked like:

//getting the list object of the target list

                SPList nextList = web.Lists[destinationListNameValue]; //web is SPWeb web

               

                SPListItemCollection newListItems = nextList.Items;

                foreach (SPListItem newListItem in newListItems)

                {

//looking for a list item that is named the same way as the document name of the document that is being copied (documentName) 

                    if (documentName == newListItem["Name"].ToString())

                    {

//impersonatedItem is the impersonated (I had my reasons for needing to use impersonation here, you probably won’t have to) SPListItem of the document that is being copied and newListItem is the SPListItem of the target document 

                        Byte[] fileContent = impersonatedItem.File.OpenBinary();

                        newListItem.File.SaveBinary(fileContent);

                    }

                }

(Please Note that you need to have Microsoft.SharePoint referenced in your project and include – using Microsoft.SharePoint)

 

Here’s someone else also dealing with the whole CopyTo() and CopyFrom() issue:

 

http://k2distillery.blogspot.com/2007/10/copy-version-history-with_5.html

 

While on this topic, here’s also a useful article on Copying over a SharePoint list from source site to destination site:

http://blah.winsmarts.com/2007-5-Copying_over_a_SharePoint_list_from_source_site_to_destination_site.aspx

By the way, don’t get me wrong, the versatility given by CopyTo() in which you can just copy a file in a SP system  by giving full url of the file can be quick/easy and useful in some cases, but still very few.

Posted by Zlatan | with no comments

Complete Office SharePoint Server 2007 training available for download

Finally.... comprehensive training for SharePoint 2007 has been released by Microsoft complemented with many videos tutorials and articles (http://office.microsoft.com/en-us/sharepointserver/HA102488011033.aspx). This is invaluable for your colleagues, departments and companies that require comprehensive SharePoint training on the following MOSS 2007 topics:

Collaboration

  •  Finding your way around a team site
  •  Understanding permissions
  •  Customizing a team site
  •  Linking calendars to Outlook
  •  Adding Web Parts
  •  Collaborating in libraries, lists, and workspaces
  •  Using blogs and wikis to share information

Enterprise Content Management

  •  Document management
  •  Protecting files
  •  Using workflows
  •  Records management
  •  Creating and publishing Web pages
  •  Improving compliance and support litigation discovery

Search

  •  Finding files, Web sites, information, and people

Portals and personalization

  •  My Sites
  •  Targeting content to specific audiences
  •  Managing access to your My Site

Business processes and forms

  •  Streamlining business processes with forms and workflow
  •  Gathering information with browser-compatible forms
  •  Designing custom workflows using SharePoint Designer

Business intelligence

  •  Sharing Excel workbooks as interactive reports
  •  Working with a Report Center site
  •  Using dashboards to drive decisions
  •  Understanding Filter Web Parts
  •  Integrating external data

You can more about in this post (http://sharepoint.microsoft.com/blogs/mikeg/Lists/Posts/Post.aspx?ID=769) from Michael Gannotti.

KB 941955 Update for SharePoint 2007 AJAX Web Part Development

For those of you that have used this post of mine (http://dotnet.org.za/zlatan/archive/2007/10/12/developing-ajax-web-parts-in-sharepoint-2007.aspx) to create your own AJAX web parts here's an important KB 941955 (http://support.microsoft.com/kb/941955) article that will help with what your potential bug might be. It refers to an issue with:

"A Web Part that contains an ASP.NET AJAX 1.0 UpdatePanel control that uses the _doPostBack() function does not work when the URL of the hosting SharePoint Web site contains international characters"

Also while you're there check out Daniel Larson's ASP.NET AJAX Extensions Toolkit for SharePoint project on Codeplex (http://www.codeplex.com/sharepointajax), it's quite cool.

If you're about to start developing AJAX WebParts for SharePoint 2007, wait for the release of Service Pack 1 (SP1) on 11th of December 2007.

Preview into WSS 3.0 SP1 and SharePoint Server 2007 SP1

Here's the preview of what to expect in the new Service Pack from Joel Oleson.

The most exciting news to me is that with this service pack we will finally have proper AJAX support for building asynchronous postback WebParts.

Here's the link:

http://blogs.msdn.com/sharepoint/archive/2007/11/29/preview-into-wss-3-0-sp1-and-sharepoint-server-2007-sp1.aspx

Posted by Zlatan | with no comments

Office 2007 and MOSS 2007 Service Pack 1 (SP1) will be released on December 11th 2007

Make sure you plan for this properly and well in time for all your Sharepoint and Office deployments.

Also this gives you an opportunity to schedule applying SP1 in your organisation well before the release!

I will post the link to it as soon as it comes out.

Business Productivity Infrastructure Optimization University (BPIO U) Online

This is invaluable for your sales people. Since Microsoft decided to, not just tap, but actually make a strong presence in the Enterprise Content Management and Performance Management (Business Intelligence) Market, and for some Partners here locally that were more infrastructure and some Web Content Management (old SP 2003) orientated this practically happened over night. Although now more and more of the MS Partners are trying to venture into this space and have done great job of skilling up their development and technical people to get there, understand the concepts and deliver brilliant solutions to their clients, but some of the people were left behind when it came to skilling up and those people are sales people. This presents a real challenge as without them knowing how to sell these solutions and approach the customers with these concepts, as well as correctly position these solutions with the same customers, SharePoint 2007 and PerformancePoint Server 2007 solutions can't be deployed and used to its full potential.

So Microsoft stepped up with Business Productivity Infrastructure Optimization University (BPIO U) Online to help the "poor" sales people out (Michael, thanks for the announcement).

Here's the write up:

We are pleased to announce the launch of Business Productivity Infrastructure Optimization University (BPIO U) Online: http://www.msbpio.com/online

BPIO U Online is a collection of web-based sales and technical readiness courses designed to help you increase 2007 Microsoft Office system services revenues and demonstrate the value of the BPIO platform to your customers.

BPIO U Online is a condensed version of the BPIO U 2008 instructor-led sales workshop content. It is ideal for partners who aren't able to attend the instructor-led workshops and/or need to deliver training internally. Partners have access to online BPIO U course materials in a variety of formats delivered by Microsoft subject matter experts. BPIO U Online includes:

  • Selling strategies for market opportunity
  • Access to sales and technical materials to help you engage with customers
  • Information on how to sell with Microsoft
  • Streaming video presentations of each BPIO Capability

BPIO U Online course modules include:

  • BPIO Overview
  • Engaging the Microsoft Field with BPIO
  • Business Intelligence
  • Collaboration
  • Enterprise Content Management
  • Enterprise Search
  • Unified Communications
  • Enterprise Project Management

BPIO U Online provides a fast and simple way to get up to speed on BPIO to drive 2007 Microsoft Office system business. Enroll today!

Registration and Enrollment

To access BPIO U Online courses, visit http://www.msbpio.com/online. From here you can find more information on each module as well as links to the courses on the Partner Learning Center