Saturday, June 09, 2007
Pinned: New URL for The SharingPoint Blog
Friday, May 04, 2007
Securing Application Pages in SharePoint 2007
To work around this issue, add code to the individual application page(s) to check if the user is authenticated and, if not, redirect the user to the Access Denied page. Insert the following script at the top of the page (before or after the page declarations and registrations):
< runat="server">
protected void Page_PreInit(object sender, EventArgs e)
{
try
{ string sUserName = SPContext.Current.Web.CurrentUser.LoginName; }
catch
{ this.Response.Redirect("/_layouts/accessdenied.aspx"); }
}
< / script >
The above code attempts to assign the user login name to a string variable. If the operation fails, which it will if the user is not authenticated, the catch statement redirects the user to the default access denied page. Once the code is placed on a page in the /_layouts directory, it will effectively be hidden from anonymous users.
Anonymous Search Results in WSS v3
By default, viewing this page requires a user to be authenticated to the server. This can create a problem when your site definition includes the basic search control as it will attempt to render all search results on this page. To remedy this situation, locate the following text at the top of the file (inside the < % @ Page ... /> declaration) and remove it:
Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase"
This setting determines the inheritance of the page from the generic application page base class; however, it is not required for the page to function. Anonymous uers will be able to view the page without having to login and search results will continue to be security trimmed so users without proper permissions will be unable to view restricted items.
Thursday, May 03, 2007
SharePoint 2007 RSS Aggregator Web Part
There are several free utilities for performing RSS aggregation in SharePoint - inlcuding those that come out of the box with 2007 - but none of them work the way that I needed them to (in fact, I couldn't get the included web parts to work at all in WSS). So I put together a basic RSS Aggregation web part that fits the bill.
The functionality is really quite simple - supply the web part with a semi-colon delimited list of feed URL's, set a few parameters (like number of listings per feed, total number of listings, alternate stylesheet, etc.) and drop it onto a page. The web part will display a list of links from each feed source sorted by publish date in descending order. The formatting is controlled by a set of base and alternate styles that can be included in custom stylesheet or integrated with your base site definition styles.
You can download the RssAggregator web part here: http://www.binarywave.com/products/downloads/Free%20Utilities/BinaryWave.RssAggregator.zip. The zip file contains the Visual Studio 2005 solution with full source code (written in C#) and a readme file with setup and configuration instructions. Post any issues or questions as comments to http://www.binarywave.com/blogs/eshupps/Lists/Posts/Post.aspx?ID=3.
Note: I discovered while putting this together that there are quite a few differing feed formats depending on which source you are trying to access. Most RSS 2.0 and ATOM feeds should work but you may need to tweak the XML parsing methods in the source code if you are referencing a feed that uses non-standard or custom formatting in the source XML. If you do make modifications, please post them so everyone can benefit from your changes.
The SharingPoint Has A New Home!
For those of you that use the FeedBurner RSS link that will be redirected to the new blog address. Any troubles, post a comment and we'll figure it out.
Wednesday, April 11, 2007
Colligo Contributor v2.0 Review
This arrangement does, however, provide some challenges for frequent travelers such as myself. As I am often in transit from one location to another (usually across the Atlantic) it is commonplace to be without Internet connectivity for long periods of time. This makes it quite difficult to update project-related information, as I am unable to gain access to our SharePoint servers, a major roadblock in my role as project manager. To compensate, I had been relying upon a cobbled-together mish-mash of local files, Outlook folders, and a bit of slapdash code to keep things in synch which, to be honest, wasn't working very well at all.
Enter Contributor from Colligo. A month or so ago the folks from Colligo invited me to test drive version 2.0 of their Contributor product. Billed as an offline client for SharePoint, I had assumed that it's primary purpose would be to keep files in sync between my local folders and SharePoint document libraries. A fine utility, to be sure, but my experience with similar products was that they did a decent job of moving files back and forth but completely lacked any support for SharePoint lists, which is where I do the majority of my work.
I admit that I was pleasantly surprised by the product's capabilities in this regard. To set up Colligo to work with SharePoint, you first supply the URL of the site and your login credentials. The product then downloads the site contents and I was encouraged to see that list information was being collected along with document libraries. Once the content has been collected, the application presents the site information using the same basic layout as a WSS v3 Team Site - lists and libraries organized on the left, list contents on the right, with the same WSS list icon, headings, and breadcrumb at the top.
After modifying or updating the list contents, you can manually synchronize one or more sites to commit your changes. Alternatively, you can leave Contributor running the background and it will synchronize automatically (you can enable/disable this functionality by right-clicking on the synchronization message in the status bar but I was unable to find any way to modify the automatic synchronization interval).
Overall, I think the Colligo team has done an excellent job with version 2.0 of Contributor. I use it exclusively to update list content while on the road, letting it synchronize all of my changes the next time I'm connected to the Internet. This has allowed me to be more productive - especially when flying - and I often use when I am connected as I prefer the WinForms experience over the browser-based approach. If you travel often, or have limited connectivity (i.e. dial-up or second-generation WWAN) and need to interact with SharePoint lists, Contributor may be the answer you've been looking for.
Friday, April 06, 2007
The Trials and Tribulations of Being Your Own Boss
Sometimes you've just got to stop and post something because it makes you smile. Fellow SharePointer Extraordinaire Heather Solomon recently decided to take the plunge and strike out on her own as an independent consultant. Earlier this week she put up a post about how little time she's had since taking The Big Step. It brought a smile to my face as people are always asking me why I don't post more and work less, why it takes so long to return emails, why don't I do more speaking engagements, etc. Welcome to the gotta-get-the-project-done-no-time-to-chat-why-doesn't-my-phone-stop-ringing-my-God-is-it-midnight-already-where-are-my-slides-for-tomorrow-did-I-get-that-invoice-out-when-do-I-get-paid? club, Heather!
Now, if I can just find a way to sabotage her email for a day so I can get her to work on some projects for MY clients... :-)
Monday, April 02, 2007
UK SharePoint User Group Meeting in Manchester April 11th
Click here for info and directions.
Source Code for Hosting User Controls in Web Parts
We do a great deal of SharePoint user control development in our shop, for several reasons: 1) when you work on billable time, clients want the fastest, most effective solution to a problem not some esoteric argument on what is 'pure' SharePoint development and what is not, 2) It's easier to hire and get new SharePoint developers up to speed using .NET controls they are already familiar with, 3) it's far easier to turn over user controls to our clients for future code maintenance than try to give them a crash course in web part development, and 4) I don't know about you but I have absolutely no interest in hand-coding UI elements that I could otherwise drag-and-drop in the IDE (but then, I'm known to be a lazy programmer, so take that for what it's worth).
Because of this, we have developed our own web part wrapper for hosting user controls. Similar to the SmartPart, it's designed to be a low overhead control that can be deployed for rapid development scenarios but we needed a bit more flexibility than the SmartPart offers. We've been using it for quite a while and have had great success with it. We're releasing the source code to the community so everyone can do the same and also to see what kind of improvements and enhancements all you smart coders out there can come up with.
If you're looking for a way to host user controls in SharePoint and you would rather write and own the code yourself than use a third-party control, give it a try. Sean Skinner has posted the code over on his blog for you to download. Take it, make it your own, and let us know what kind of cool stuff you do with it.
Direct any questions to either Sean or myself via comments on these posts so everyone can participate in the discussion.
Enjoy!
Saturday, March 24, 2007
UK User Group Meeting in Glasgow, Scotland March 28th
BTW, the User Group meeting in London on the 22nd was an excellent affair. Tip o' the hat to Riaz Ahmed for doing a bang-up job presenting a Search deep-dive and accessibility overview (Riaz, if you're out there, post a comment with your blog URL so I can link you up). More than 75 people showed up (although how many were actually there for the free beer and pizza is impossible to determine). C'mon Dallas, we've some catching up to do - the UK gang is making us look bad!
Wednesday, March 21, 2007
SharePoint User Group Meeting in London March 22nd
In case you've never attended, the UK meetings are some of the best user group gatherings I've ever been to (and I've been to many in my time). Nick Swan does a great job organizing the event, the participation is high (200+ attendees at the last meeting in February), and the content is excellent. If you live or work in the UK and SharePoint is our thing (why else would you be reading this blog???), I highly recommend attending. And be sure to say "Hullo!" when you arrive - I'm easy to spot, just look above the crowd for the 6'5" Texan wandering about ;-)
Monday, February 26, 2007
WSS v3 Drop-Down Menus in Team Sites
While working with some custom site definitions based on the built-in STS (Team Site) definition I came across an annoying navigation issue that derailed me for a couple of hours. It turns out the the drop-down functionality in the top navigation bar, which works perfectly well in the Publishing and Collaboration Portal definitions, is disabled in the Team Site definition. After digging around in the object model for a while and trying a few different combinations, I found the solution in the menu settings contained within the default master page.
To enable drop-down menu functionality, locate the following block of code in the Default.Master page (/_catalog/masterpage/default.master in the site collection or \12\Template\Global\default.master on the file system):
< asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002" / >
This sets the data source for the menu control and its associated parameters. Each Site Map Provider is defined in the < Providers > section of web.config. The SPNavigationProvider entry looks like this:
< add name="SPNavigationProvider" type="Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" / >
If you locate this entry in web.config you will notice another entry for "SPSiteMapProvider" immediately below it. After much trial and error I discovered that this is the data source that is required for the drop-down menus. To enable it, change the SiteMapDataSource settings in default.master (or your custom master page) to the following:
<asp:SiteMapDataSource
ShowStartingNode="True"
SiteMapProvider="SPSiteMapProvider"
id="topSiteMap"
runat="server" />
The navigation menu will now use the SPSiteMapProvider data source which contains all the nodes in the current site collection. Depending upon your requirements, you may also wish to modify the settings for the default number of static and dynamic levels (flyouts) the navigation control displays. To do that, adjust the following settings within the < SharePoint.AspMenu / > control:
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
Adjusting these values up or down will increase or decrease the number of levels. Be advised that setting the levels to a higher value may impact performance, as the control will need to fetch the relevant information from the database and build the complete menu structure before the page can finish loading.
Saturday, February 17, 2007
Multilingual Scenarios
During the European SharePoint Conference this week I spent some time in a workgroup focused on multilingual scenarios in SharePoint and talked a great deal about these issues with other attendees. As you may already be aware, Microsoft's solution for portals supporting multiple languages is Site Variations, a process that allows for content duplication between source and target sites and automatic redirection based on browser localization settings.
Essentially, Variations act as an advanced form of replication. A publishing site is created and assigned as the source (the base language is irrelevant). Whenever a subsite is created, the administrator selects the site language pack and localization (such as US or UK English) and the site is then provisioned as a target. Whenever content in publishing controls on the source site is modified, the content is replicated to the target sites and, once approved, published for viewing.
While this is a good first step, there are a number of shortcomings to the Variations model. For one, it only applies to content in publishing controls - no lists, web parts, or other content is replicated. In addition, there is no translation performed during the replication process - it is incumbent upon a human being to at some point perform content translation into the target language. Finally, it does not provide a single portal - by which I mean a single, unified URL - to be presented in multiple languages; visitors are simply redirected to a target site (for example, from www.example.com to www.example.com/en) if one exists that matches their localization settings; if not, no redirection takes place.
In the multilingual working group we identified these as the top three items of concern out of a list of maybe ten or eleven issues (including search optimization, metadata translation, post-provisioning language reassignment, and more). From this, the group formulated some ideas on how to introduce features in the next version, or provide add-on solutions in the interim, to address these problems. As this is an important area of concern for our customers, we are giving serious consideration to developing our own suite of tools and utilities for multilingual portals. Before we go down this path, though, we need more information from the SharePoint community. We'd like to know how you are dealing with multilingual issues, what your top pain points are, and what form you'd like to see potential solutions take (web parts, custom site definitions, a packaged set of features, etc.). So talk to me - post some feedback (in the language of your choice, of course) and let me know what we can do to make your (multilingual) life easier.
Thursday, February 15, 2007
European SharePoint Conference Final Thoughts
The European SharePoint Conference in Berlin concluded with another full day of presentations. Previous commitments had me traveling back to the UK on Wednesday so I can't give a recap of day three (see here and here for a rundown on days one and two), which is really a shame as Ben Robb was scheduled to give a couple of good presentations on Internet-facing web sites and profiling/personalization that I would have liked to have attended. So instead here are my final thoughts on the conference as a whole.
Organization
The overall event organization was quite good. Check-in was a breeze, there were big signs in each area detailing the day's events, and if you got a bit lost all you had to do was grab hold of one of the ubiquitous orange-shirted emissaries to point you in the right direction. The sessions were a bit spread out due to the configuration of the facilities but you had plenty of time between sessions to wander to and fro and numerous opportunities to grab some refreshments on the way. There were some glitches with invoicing and payment that had a few people (including myself) scrambling a bit but I understand that was due to some EMEA regulations regarding credit-card bookings that were out of the organizer's control.
Content
I was quite pleased by the content presented in the break-out sessions. There was a distinct division between developer, IT and partner sessions, and quite a bit to choose from in each track. Naturally, the developers wanted to see more code and the IT people wanted more numbers, but that's always how it is. Aside from a few last-minute speaker substitutions most of it went off without a hitch.
Venue
The Hotel Estrel is a nice facility with lots of space but it wasn't laid out that well, especially for the vendor booths, forcing participants to walk back and forth across the hotel quite a bit. Guest rooms booked up quickly so a lot of people stayed at hotels scattered around Berlin (I chose the Upstalsboom Friedrichshain which was quite nice but, like everywhere else, had no WiFi to speak of). The staff were very good, exhibiting the renowned German efficiency - you could barely set an empty plate down before someone came and whisked it away. The food was mostly standard conference fair but I must say that the sweets were top notch - I had way more of them than I should have.
Speakers
There was quite a good mix of speakers for this event, even though some, like Patrick Tisseghem and Ben Robb, presented multiple sessions (which is fine by me because I like listening to them both). Speakers seemed to be matched well to their topics and generally provided good domain knowledge. The slide decks were fairly uniform (excepting Patrick, who seems to be as addicted to PowerPoint SmartArt as he is to Belgian beer) but there were lots of demos and code samples to keep things interesting. In fact, it will be a bit of a letdown when we get the final slide decks as most of the good content was in the demos.
Vendors
There was in impressive number of vendors at the event from all over Europe as well as the UK and America. Some were promoting general offerings - like HP and AMD - but there were a large number of SharePoint-specific solution providers in attendance. I didn't hang around the booths much so I don't know how good their conversion ratios were but there were a lot of people carrying literature and chatting up the vendors. The best venue for them was probably the vendor breakout sessions, of which there were quite a few, and which seemed to have pretty good attendance.
Participation
Quite frankly, I was amazed at the turnout for this event. Official figures were somewhere north of 2,300 participants. Considering all the other products that Microsoft has launched in the last year and the fact that SharePoint is marketed as part of the overall Office product line, this is really and astounding level of interest. If there were any doubts that SharePoint should be taken seriously this should dispel them entirely.
Conclusion
Like any event of this type, it wasn't perfect, but I think overall I'd give it a B+. The location was a bit difficult to reach for a lot of attendees (Paris, London or Rome would have been easier) but it wasn't too bad. The organization and content were good and the participation was excellent. I hope that next year will see an even greater number of attendees and more focused breakout sessions (and, of course, more in-depth developer content).
Wednesday, February 14, 2007
European SharePoint Conference, Day 2
After the previous night's entertainment we were all a bit bleary eyed come Tuesday morning (I probably looked the worst as I stayed up late blogging and then fought with the worst pillows ever created in the history of mankind in a losing battle for even a few hours of sleep). But with a healthy dose of coffee and a can-do attitude (or, more accurately, an I'm-awake-so-I-may-as-well-make-the-best-of-it attitude) I dived back into the conference.
Designing, Deploying and Managing Workflow in SharePoint Sites (Christian Stark)
The toughest part of a conference like this is choosing which sessions to attend. There were a large number of presentations from partners and ISV's that I would have liked to have taken in but I concentrated on the Development track as best I could since that is our core business. Unfortunately, this presentation was just a click-n-show overview with no code and I think I dozed off somewhere in the middle. From the parts I do remember, I recall Christian pointing out that while you can author workflows for WSS sites you have to buy MOSS to get any built-in workflows or workflow templates (I wasn't aware of that). He also said that there will be a workflow SDK coming out soon that will have a bunch of workflow templates included with it. Hallelujah!
I realized later, after talking with Dr. Ulrich Knechtel of AMD, that I should have gone to his presentation about their search optimization project with Microsoft. The two companies are teaming up to create hardware/software configurations optimized for large-scale search optimization. If you've ever worked with search in a big deployment you know how resource-intensive this process can be so this new initiative looks very promising (post a comment if you want more information - they're looking for customer projects that might serve as good POC's).
Developing Visual Studio Workflows and Activities for SharePoint Sites (Steve Heaney)
Now this is what I came for. Steve got down and dirty and showed us how to code up workflows from scratch in Visual Studio. It was one of the most amazing demos I've ever seen - Steve hand-coded a five step WF, including two custom InfoPath forms, in a half-hour, without making a single mistake. In fact, he never even used Intellisense - just whipped out some classes, slapped in some methods, banged the code in and pressed F5. Build succeeded the first time! Unbelievable. Obviously, Steve had done this presentation many times before but it was still bloody impressive.
If you haven't played with it yet, the workflow designer in VS 2005 is really quite good. There are a bunch of built-in workflow objects that you can drop in from the toolbox and creating your own is almost as simple as whipping up a Visio diagram. What Steve didn't cover (due only to time restrictions, I think) was coding custom actions and activities, which is the real meat of VS and WF. In most cases, designers will create the workflows in SharePoint Designer with custom activities supplied by developers, as the VS method is much too complex for your average front-end person. That said, you can do a lot with it and it's very flexible and extensible.
Capacity and Performance Planning (Steve Smith)
The Combined Knowledge booth was the unofficial UK gathering point at the conference. We joked about hanging a Union Jack from one of the columns and I think we would have done it had anyone thought to bring one. Steve Smith, MVP with Combined Knowledge, gave several presentations but this was the first I one I could fit into my agenda. Steve derived a great deal of his content from Joel Oleson's blog and put up some useful figures from this post. Although I dispute some of his assumptions (he uses a 10% utilization baseline for concurrency which I believe is way too low - but it really depends on how each portal is used) and conclusions (40% of latency issues are at the client? I really don't think so - better check those capture stats one more time, mate), Steve did quite a good job painting a realistic picture of scalability issues and areas to look for performance issues.
At one point, Steve illustrated the issues regarding list rendering as it relates to item count by showing a line graph (shaped like a hockey-stick) of the per-transaction completion time of a document add operation in a library. The more documents you add (I think the tipping point was around 2,000) the worse the performance gets - way worse, in fact. I couldn't have asked for a better visual describing the limitations of using the object model for repetitive operations (he didn't say but I'll bet my hat they used the OM to do it). I can't wait to get my hands on that slide so I can demonstrate the stark difference in performance when executing the exact same operation using web services or FrontPage RPC's.
Speaking of slides, Steve hit us with so many statistics that I can't possibly hope to reproduce them all here (and I was scribbling like a madman so I probably got most of them wrong anyway). As soon as Steve uploads the presentation I'll post them all here - they really are important data points to consider when planning your farm deployment and/or expansion. For example, one thing that never occurred to me when troubleshooting performance is the relationship between your MOSS server farm and Active Directory. If you have several thousand users on a portal the new security-trimming features require a lot of authentication procedures; enough to overload that poor old AD box sitting all by itself in a forgotten corner of the data center. One more place to look when your users suddenly start complaining about how long it takes to login to SharePoint in the morning...
Building and Branding SharePoint Sites Using New Web Content (Arpan Shah)
Ok, so this one really didn't include much development content (unless you consider SharePoint Designer to be a development tool) but it was good nonetheless. Unfortunately for Arpan, he had just returned from vacation and it seemed like parts of his demo were still on holiday - Designer didn't want to cooperate and his MOSS site was a bit flaky but Arpan's an excellent presenter and what he couldn't show he explained rather well. He did a fair job introducing site variations to the audience but it wa really only a warmup for the next Dev session.
Multilingual Portal and Public-Facing Web Applications (Aku Heikkerö)
It was fitting (and somewhat amusing) that the presenter for Multilingual solutions had a Finnish accent so heavy I could barely understand him. Where's that universal translator from the Tardis when I need one? In any event, you should know by now that this is an important area of interest for me, and Aku did a good job of digging into the ins and outs of site variations. He was also very explicit on what variations can and can't do (and even though they can do some good things they are just a small step towards solving this problem). One thing I didn't know (just because I haven't had time to play with the new MySites much) is that users can now pick the language they want to see their MySite in. That's very cool. After the presentation I mapped out some ideas on how to improve site variations to make them more usable in real-world scenarios (more on this in a future post) with my new friend Razvan-Petru Radu from Luxembourg. And no, in case you're still wondering from yesterday, no word yet on that Redneck language pack for MOSS.
Shared Emotions
I don't think I was the only one who thought this was an odd name for the after-conference party. Even more odd was being shipped by bus halfway across Berlin to a big warehouse on some island for a dinner party when we had a huge hall at our disposal right there at the Estrel (we all fit in there the night before, didn't we?). Thankfully, there were no celebrity impersonators, just a really lukewarm jazz band. Personally, I would have liked to see the guy who did the Louis Armstrong bit on Monday night do another set just to liven things up (I poke fun at the lookalike entertainers but they really were very talented). Rob Gray from Microsoft UK managed to secure the upstairs lounge for our lot so we enjoyed feeling superior to everyone else from on high. The food was spectacular, especially if you are a fan of creme brulee, and the beer and wine were free. Can't beat that!
Internet Access
Let's tell the truth here - trying to get to the Internet in Berlin was like trying to find a place to stand in the conference common areas where someone wasn't smoking. First of all, there was no free WiFi at the convention center. Only hotel guests could access the WiFi and they had to pay for it - not even the conference speakers had access to the Internet. Think about that for a second - a Microsoft conference about a purely browser-based product and no WiFi? Uh, pardon me for pointing out the elephant in the middle of the room, that's just plain ridiculous. My hotel and the airport were no better, with either weak signals that were all but useless or pay-as-you-go services that wanted upwards of 10 euros for 30 minutes of blissful connectivity. I know the Germans pride themselves on their efficiency but they've got a lot to learn from us Yanks on this score.
Notes on Berlin
It's a shame really that I didn't get to see much of Berlin at all on this trip. Being a history buff I could probably spend days wandering around the museums and such. I did learn that the airport that I flew into (Flughafen Tempelhof) was central to the Berlin Airlift operation and used to be a US Air Force base (it was the Americans, in fact, who built the current concrete runways). There's a statue out front dedicated to the US and British pilots who died during that operation - very cool. East Berlin is still a bit grim but there is a fair amount of new construction intermixed with some really old structures. There's a strange statue on the river of three figures fighting or wrestling - I'm not sure which - that I never did figure out and none of the cab driver spoke enough English to explain it to me. The real travesty of this visit was that I had precious little time to sample any German beer. That's almost a crime, I think, to visit Berlin and never set foot in a Biergarten.
Monday, February 12, 2007
European SharePoint Conference, Day 1
Today was the first day of the European (EMEA) SharePoint Conference in Berlin, Germany. As we have recently expanded into the UK, we are now officially a 'global' company (there's a scary thought for you) so we took this opportunity to join our mates from jolly ol' England on a jaunt across the Old Country. I have to say that I am quite impressed by the overall experience - if there were any doubts that SharePoint is a serious application around the world, let them be dispelled here and now. With more than 2,300 attendees (that's nearly twice as many as we managed to cobble together in the States last year) from 40 countries and 90 partners and vendors, it was quite a show. Read on for a summary of the day's events.
BTW, Southwest could learn a few things from SN Brussels Airlines. Like, how about some free chocolates on each trip instead of crappy peanuts, eh Mr. Kelleher?
Opening/Keynote
The Microsoft team kicked off the conference with a five-minute introduction in German (to the delight of the local audience, I might add) which left most of us scratching our heads and saying 'Was is das?'. The 'Wow is Now' video has long since jumped the shark, but the first speakers were energetic enough to make up for it. The catchphrase of the day was 'Ich bin ein SharePointer'. Say that a few times after a couple of Hefeweizen!
Derek Burney
There were quite a few Redmondites around - especially on stage and in the ubiquitous orange speaker shirts - and Derek Burney was first up (with an able assist from Mike Fitzmaurice). He laid some good numbers on us, like license count now exceeding 80 million worldwide and the official size of the internal Microsoft SharePoint deployment: 325,000 portals, sites and subsites comprising more than 12TB of data (who gets to back that up, I wonder?). It was interesting to note that on his slide promoting 'major' companies who had adopted SharePoint, three of the ten are based in Dallas :-)
Mike revealed publicly what had heretofore been confidential, so I can now tell you that sometime next month MS will unveil the official SharePoint Community Portal. Lawrence Liu gave us a rundown of this last week at the UK SharePoint User Group meeting (what, you weren't there?) and it's plenty slick. Just a beta right now but it will be live soon.
They closed with the most ridiculous commercial I've ever seen - a takeoff on those Total cereal ads where they claim that everything and the kitchen sink is in 'just one bowl'. It came complete with a corny jingle and sleazy used-car-salesman actor. Ok, I get the message, but was this really a good use of marketing dollars? Really?
Patrick Tisseghem, Part Eins
I always enjoying listening to Patrick as 1) he knows his stuff, and 2) he's a good presenter. And you just gotta like a guy whose every demo has something to do with beer. Patrick gave the standard rundown on using the object model, talked about garbage collection and good coding practices, and highlighted a bit about working with web services. He covered impersonation pretty well, which I think was lost on most everyone present, and even talked a bit about CAML and SPSiteDataQuery. Although he gave an explicit warning about using the DataQuery object to collect list data instead of looping through the SPListCollection, he did not voice similar concerns about using the object model to loop through SPWeb objects. In fact, he showed us how to do it (albeit briefly) and moved quickly past it.
I suppose I'm destined to be the lone voice in the wilderness on this issue, so let me state it once again in case anyone missed it the first thousand times - DON'T DO THIS! EVER! Unless you know for a fact that you'll never have more than a hundred or so sites in a site collection, this is bad, bad, bad. The overhead of GetSubwebsForCurrentUser and its equivalent(s) is tremendous and should be avoided like the plague. I know that's how it's shown in the SDK but you don't believe everything you read, do you?
Multilingual Working Group
Aside from the bizarre evening entertainment (see below) this was the highlight of the day. We don't think much about it in the States but this is a real pain point for many customers, especially throughout Europe where they often have to support three, four, five or a half-dozen languages at once. Hats off to Microsoft for realizing the severity of the issue and soliciting feedback and advice from partners and users. A couple of partners and myself gave 'em an earful for an hour (I also harped on Lawrence about this last week, so if you're reading this Al, that one's for you!). We came out with some good ideas and even a few suggestions for the workgroup sponsors to take back to Microsoft. We also agreed that since C# seems to be a universal language we are all now adding it to our resumes (CV's) immediately. And no, in case you're wondering, there is no Redneck Language Pack forthcoming in this or any future release, so y'all will have to just go on scratchin' yer heads at my vocabillary.
Content Types and Metadata
Good topic, wrong audience. This was supposed to be on the developer track and although Dustin Friesenhahn gave a good presentation it was all foam and no beer. There were only a couple of slides that even showed a smattering of code - the rest was all point and click. Nice for the IT guys but not what we hardcore OM types were looking for. General disappointment was expressed by all.
Patrick Tisseghem, Part Zwei
After that letdown, we needed some real code to perk us up, and Patrick didn't let us down. Some genius assigned him the topic of Templates, Definitions and Solution Deployment and only gave him an hour - now that's just plain wrong. I could talk for an entire day on any one of those subjects and I don't have all of Patrick's demos and SmartArt. He did an admirable job walking the group through custom site definitions and deployment - not an easy topic even for intermediate coders. Lots of great code samples and the ever-present Beer Team site.
Dinner and Entertainment
The Hotel Estrel Convention Center is reminiscent of Vegas-style auditoriums - lots of multimedia and light shows. After Patrick's final presentation a swarm of worker bees descended upon the room and cleared more chairs in five minutes than were on the entire deck of the Titanic. There's something to be said for German efficiency. While we all wandered off for a beer or two (konnte ich Schofferhofer bitte?) they turned out the 'rounds and we piled back in for some free victuals. I can't say much for the food - it was typical bland conference style fare meant not to offend anyone - but when the lights went down after the meal things go interesting.
Turns out the Estrel is the home of a popular Vegas-style musical review called Stars on Stage. Before we knew what was happening, a pre-Bobby Brown Whitney Houston was belting 'em out on stage, complete with scenes form her music videos and the requisite clips from Bodyguard during 'I Will Always Love You' on the big screens. Without a chance to catch our breath (or keep from falling over with laughter) were were hit in succession with Madonna, Boy George, Louis Armstrong, Tina Turner (who looked awfully like Whitney in a different wig) and finally, as you would expect, Elvis himself. I'll give 'em this - they were pretty damn good, especially considering they didn't have the best acoustics to work with and a stage with no Vegas flair (but some might fine-looking backup dancers). Louis Armstrong was simply amazing - right down to his facial expressions and the gap in his front teeth, this guy has it down, you dig? And all of this with a gigantic Office SharePoint Server 2007 sign in the background. Now don't that beat all?
So that's a wrap for day one. I'll post pictures as soon as I can get a reliable WiFi connection (don't even get me started on Internet access over here). And before I collapse for the night, a hearty "Salut!" to my new friends from Romania, Reka and Marius, and "Moien" to David and Razvan from Luxembourg.
Gute Nacht!
Friday, February 02, 2007
Creating a Basic Site Definition in SharePoint 2007
Creating a site definition from scratch in SharePoint 2007 is no easy task; easier, certainly, than it was in 2003, but in some ways even more complex. Perhaps the most confusing new element to creating site definitions is the use of FEATURES. There are some great articles on what FEATURES are and how to use them (see here, here, and here) so do a little homework before you get started.
Unfortunately, the built-in WSS templates don't use the time-saving and oh-so-handy Publishing features of the portal definitions, so you'll have to create your own definition if you want to apply any customizations beyond basic style overrides. To get you going in the right direction, here's a handy little guide on creating a very basic site definition from scratch. Let's first assume that you want a custom Team Site - nothing fancy, just something you can style and modify without impacting the default definitions.
Begin by performing the same steps you would have done in 2003. Navigate to the \12\Template\SiteTemplates directory (the 60 hive is dead; long live the 12 hive). Copy the 'Sts' folder and rename it - say 'CUSTOMSITE' for this example. Next, find the WEBTEMP.XML folder in \12\Template\1033\Xml. Open it in Notepad and add a new Template node to the end, like so:
< Template Name="CUSTOMSITE" ID="1001" >
< Configuration ID="0" Title="Custom Web Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="Customized site definition for My Team Site" DisplayCategory="Collaboration" > < /Configuration >
< /Template >
* Note: The same numbering conventions apply in 2007 as in 2003 - set your Template ID to something greater than 1000 and the first Configuration node should always start with '0'.
Save the file and do an IISRESET at the command prompt. This is all you really need for a basic site definition but, as you will discover if you create a new Site Collection using this new definition and open it in SharePoint Designer, there are some things missing. Some very important things, actually, like the DefaultLayout.aspx page (look in /_catalogs/masterpage and you'll notice that only the default.master page is present). Without DefaultLayout.aspx you'll be able to modify the master page but not the central content area of your site. Oops. What happened?
As I said at the beginning, it's all about the Features. In this case, not only does the ONET.XML file determine what Features are provisioned as part of the site, there are also Features which determine what goes into a site that have nothing to do with the site itself - they are system Features that SharePoint uses when provisioning all sites.
To make sure that your new Site Definition has all the right pieces and parts, navigate to the \12\Template\Features\BaseSiteStapling folder and open BaseSiteStapling.xml in Notepad. It should look something like this:
< Elements xmlns="http://schemas.microsoft.com/sharepoint/">
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="STS#0" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="STS#2" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="MPS#0" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="MPS#1" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="MPS#2" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="MPS#3" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="MPS#4" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="WIKI#0" / >
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="BLOG#0" / >...
Take note of the first child node - it defines a Feature (in this case, the BaseSiteFeatureTitle) to be included with the site identified by the TemplateName setting. Does this setting look familiar? It should, as it's the same as the STS (WSS Team Site) < Template > node in WEBTEMP.XML. The #0 after it refers to a specific < Configuration > child node. Since your new Site Definition needs to behave exactly as the STS definition does, you must create a < FeatureSiteTemplateAssociation > for each Feature that STS is associated with, like so:
< FeatureSiteTemplateAssociation Id="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" TemplateName="CUSTOMSITE#0" / >
Simply go through BaseSiteStapling.xml and each time you see an ID associated with STS#0 add an entry for CUSTOMSITE. But wait, you're not done. You now have to do the same thing in the PremiumSiteStapling.xml file located in \12\Template\Features\PremiumSiteStapling folder and, if you want the included workflows, do the same in FeatureStapling.xml in \12\Template\Features\StapledWorkflows folder.
Perform another IISRESET and create a new Site Collection based on your custom Site Definition. Now, when you edit the site in SharePoint Designer, you will see all the right files in /_catalogs/masterpage, such as DefaultLayout.aspx, AdvancedSearchLayout.aspx, SearchMain.aspx, etc.
As an aside, you can mimic some of the Publishing functionality of the Portal Site Definitions by create your own Style and Images libraries, uploading your files, and referring to them from your customized master and layout pages by relative URL (such as ../../images/myhomepageimage.gif or ../../styles/custom.css). See this post for information on how to override CORE.CSS using this method.
Thursday, February 01, 2007
Overriding Default Stylesheets in SharePoint 2007
Heather Solomon posted a detailed explanation on her site regarding the inheritance of styles in MOSS; specifically, the various methods for overriding CORE.CSS in master pages and site definitions. After defining the various options, Heather recommends the following for applying custom styles:
My recommendation is to store styles in the master page itself in a set of STYLE tags. If your master page design has variations for assorted subsites, store the CSS differences in a file and reference it via the Master Page settings, or if you need CSS changes for a single page, store it in an HTML file and reference it in a hidden Content Editor Web Part.
I wasn't at all comfortable with this approach, not so much because there is anything wrong with it (there isn't and Heather should get an award for incurring the brain damage required to sort through it all), but mostly because I don't like the idea of SharePoint forcing a default style onto my customized pages, thereby making me jump through hoops to correct a deficiency that never should have been there in the first place. I thought we'd been through this enough with 2003 and the design team would have learned their lesson but apparently not.
So after playing around with a few alternatives, I went old school and found the solution. Instead of using one of the new < SharePoint:CssRegistration / > tags to register your override style in the header, simply place it in a classic ASP < link > tag in the same location, like so:
< link rel="stylesheet" type="text/css" href="../../Style Library/en-us/Core Styles/core_override.css" / >
This procedure will circumvent whatever the parser is doing in the background to throw CORE.CSS into the mix at all the wrong places. The beauty of it is that CORE.CSS is called before your override stylesheet so you can inherit all the default styles and only override the styles you need. Be sure that the relative path is correct for the site definition you are working with. An alternative would be to place your override into the same folder as CORE.CSS and use a fixed path, which would make working with different site definitions much easier, as each master page can point to its own override file (this can also be done programmatically).
UPDATE: As Shane points out in his comments on this post, using the alternate style setting in the site collection settings IS a reliable method for overriding CORE.CSS; however, there are some things you should consider if you are using this approach:
1) The alternate CSS setting is GLOBAl for the site collection. This means that all pages, including _layout pages, will inherit this style. That may work for one implementation and not another; you might want different styles for the Admin pages (my term for all the pages found in _layouts), content pages, or subsites.
2) The Alternate CSS setting applies to all subsites in the collection, making it more difficult to assign those styles programatically. If you want to mix and match styles in your subsites you will have to find a method to override both CORE.CSS AND the alternate style.
3) The alternate setting must be done AFTER the site is provisioned. This obviously won't work for custom site definitions. A better approach would be to put the style in the master page settings, the PlaceHolderAdditionalPageHead, or, as I have suggested, use a <> tag.
Saturday, January 20, 2007
SharePoint 2007 and the .NET 2.0 Object Data Source
You cannot have an Object Data Source running on MOSS and it have a parameter (insert, update or otherwise) with a type of 'object'. This appears to be the type assigned for GUIDs (database fields of type 'unique identifier'). When you do, as soon as I would bind the formview I would get a generic MOSS error page. You know the one, 'A web part is causing a problem....'By changing the type on the parameter to 'string' everything started working...
(BTW, when he refers to ASP:Table elements junking up otherwise working code inside of SharePoint, what he really means to say is "Eric screwed up my perfectly functional code by filling it up with server-side elements that we didn't need". Now you know the rest of the story...)
There'll be a whole lot more where that came from when we get all of our blogs moved over to the new MOSS site so stay tuned - and if you don't read Sean's blog already, you're missing out. Add it to the 'ol blogroll, pronto!
Tuesday, January 16, 2007
Tag, I'm It!
I was harboring secretive dreams that the recent spate of tagging would leave me unscathed but my hopes have been shattered. Friend and fellow powerblogger Heather Solomon got me at last. So what are five things that people don't know about me that aren't either a) embarrassing or b) still subject to a statute of limitations? How about these:
- My primary intellectual hobby is ancient Egyptian history. I've read dozens of books on the subject, seen every documentary ever created, visited nearly every major museum with an Egyptian exhibit, and can even read and write some hieroglyphs. As an offshoot, I've also studied a tremendous amount of early Judaic and Christian history as well. If you value your sanity, don't ever get caught near the British Museum with me around or you'll end up losing an entire day of your life to my endless chattering about the proper pronunciation of Tutuanhkamun and why I think Zahi Hawass is an idiot. Unfortunately, I've never had an opportunity to visit Egypt in person but it's on my list of first things to do when I eventually take a vacation (yeah, right).
- My favorite activity is training and hunting with my Labrador Retriever. If you're not an animal person, you just won't get this, but there is nothing more rewarding than the bond between human and dog when engaged in a singular activity. Cheyenne, my 100-pound black Lab, is an amazing creature - watching her do what she was bred to do is a wonder to my eyes. I spent two years learning about training hunting retrievers before I got her and I trained her myself from the time she was five weeks old. I took a chance and didn't buy her from a breeder (no reason to invest that kind of money if you're not sure of your own skills) but boy did I get lucky - she can hold her own against any of those pedigreed wondermutts you see on TV. One thing I've learned from her that has served me well is that a good dog doesn't need to be trained to work with a person - the person needs to be trained to work with the dog. The dog was born knowing what to do, it's us humans that get things all screwed up. Take that for what it's worth.
- I'm part Scottish and part Native American (Mescalero Apache). My mother's family is Scottish down to their kilts. My uncle used to be one of the premier bagpipe instructors in the country and my cousin has played the pipes live for Rod Stewart on several occasions. Our line goes back to one of the oldest highland clans, the Atholl Murray's, and one of our ancestors came over on the Mayflower. My paternal grandmother is full-blooded Apache Indian. Unfortunately, all her birth records were lost in a fire years ago so we can't trace back our heritage on that side. And yes, I can drink me some whisky, in case you were wondering :-)
- I play the harmonica. Or, rather, I did, then I gave it up, then I picked it up again, and now I can barely play the thing anymore. I keep threatening to take it up again but the rolled eyes around my house indicate that I may need some serious refresher courses before I'm allowed to blow any riffs around the 'ol campfire.
- I used to sell floorcovering. At one point when I was living in California I got burned out on the technology business and went to work selling carpets, wood floors and tile. I did pretty well and actually had a good niche doing custom wood floors and high-end commercial projects. I even learned how to tear it up, install it, do finish work, everything. About as far from high-tech as you can get but at the time that was the whole point. It was fun but I don't think I was cut out for it - I kept finding excuses to play with company's computers and not rearrange my samples on the sales floor. Ah well, once a geek, always a geek!
So there you have it - more than you ever wanted to know about this humble SharePointer. Everyone on my list has already been tagged, so I guess I'm a 'dead end', so to speak. Hey, the chain had to end somewhere, didn't it???
UPDATE: Turns out there are a couple of people who have been flying under the tag radar and need a good one slapped on 'em:
You're it!!!
Tuesday, January 02, 2007
Happy New Year!
To all my readers around the world, I want to wish you a safe and prosperous New Year.
First, I'd like to thank everyone who reads and contributes to this blog. I started blogging in 2005 to share my thoughts with other SharePointers and I never dreamed that I'd be collaborating with people all over the world would. Last year more than 23,000 visitors read this blog and more than 60,000 pageviews were generated for readers in more than 20 countries. Sure, Bil and Jan and AC get more traffic but it's not bad for a country boy from Texas.
Second, my apologies to those very same readers for not posting more often in 2006. Business exploded this last year, leaving me with little time to sleep or eat, much less post regularly. I plan to correct that this year by setting (and sticking to) a regular blogging schedule.
Finally, the new year brings new changes. The eGroup started as a one-man SharePoint consultancy but has now grown by leaps and bounds, with some great new team members coming on board, new offices opening in the UK, and lots of other positive developments. To reflect these changes, we'll be changing our name and launching a new site soon (built on MOSS, of course). With more exposure comes more responsibility, so we'll be releasing more products, tools and utilities throughout the year and participating in events and conferencese throughout the US and Europe (I'll finally get a chance to meet many of you face to face for the first time - hoorah!).
As part of these changes, this blog will be moving to our MOSS web farm and off of Blogger. Not that Blogger hasn't done its job but with the new blog templates in MOSS there's just no reason not to switch. The good news is that all of our consultants and developers will be blogging on the new site so there will be lots of fresh new ideas and solutions. Links to all the new blogs and sites will be posted soon.
I look forward to a very exciting 2007.
Happy SharePointing!!!