Thursday, September 18, 2008

Set Path for stsadm.exe

Another one from Jonathon J. Frost's blog, this post demonstrates how to set the path for stsadm, so that you do not have to type the full path or keep it in your build scripts. The basic gist is setting something called an environment variable on the machine that the script is running (dev machine, server, etc.). Just one of those things that makes life just a little easier.

SharePoint - Getting More Meaningful Error Messages

One of the first things I noticed when I started SharePoint development was the error messages disappearing. In a regular .NET app, one merely needs to ensure the custom error handling is off, like so:



Of course, in production this should be turned on so that the end user gets a friendly error page, giving them a nicer experience, and perhaps an email form or some help desk phone numbers. This also prevents malicious users from getting more info than you want them to have.

However, in sharepoint, something else must be done in order to get helpful error messages.




Again, when going live, these settings should be changed to "false", but having them set to true will give you some of the same error messages you would see if you are working .NET.

On a side note, another resource for error messages are the SharePoint Logs, located in the 12 hive in the Logs directory. An additionally handy thing about the logs is that they can be opened with excel, which makes them a bit more readable, and also sortable.

Restarting the app pool, vice IIS restart

Jonathon Frost posted about how to recycle the app pool from the command line, vice restarting IIS, which takes 80% longer. This saves you a few seconds of waiting, which might sound trivial, but when you are doing backend SP development and continually GACing the dll on which you are working and restarting iis it can really add up.

cscript c:\windows\system32\iisapp.vbs /a "[App_Pool_Name]" /r

Friday, August 29, 2008

SP Shortcut to get Using Statement

Little Red Underline Helper
When you have referenced a dll in your project and try to use one of it's objects that are not included in the using statements, Visual Studio will provide a red underline, per usual when something is screwed up, but it will also provide a little red underline at the end. Clicking . will provide two options: fully qualify, or add to using statements. Either one gets you what you want in order to use the object.

SP Limited Read Permissions

If a user is set to limited read permissions, they will only see the latest approved major (e.g. 1.0, 2.0, etc.) and will not see minor versions (0.0, 1.1, 1.2, etc.). We were having a problem seeing changes in the style library because we didn't realize that they were all set to minor versions.

Thursday, August 28, 2008

More thoughts on Menu Control

A requirement of the customer is to be able to control the order of menu items. Using one of the built in providers, such as the one used by the built in menu control that is edited via the "site navigation settings". This will enable control of which subsites are displayed, link order, and title. However, this does not enable control of such things for the top level site collections. To do this, I plan to store a list of site collections in a document library, and start the menu build process by looping through those items to create top level links.

Additionally, a workflow might be able to be kicked off every time a site collection is created, tasking the creator to make an entry in the document library. However, the top level sites are fairly static and our created by the dev shop.

Tuesday, August 26, 2008

Locator Brainstorm

SharePoint-ize the Locator application:
  • Continue to use SSIS to retrieve xml from the web service, transform, and populate the SQL database with information from existing AD-like system.
  • Develop a solution for then putting that information into a custom list.
  • Incorporate the use of a custom list for editing bio information that does not come from the web service.
  • Develop a workflow for approval
  • Develop a workflow that enables users to give other users permission to edit their bios
  • Use of a custom SharePoint form for viewing both information from the web service and bio information that is approved.
  • Use of word templates to populate word documents from the custom list in order to provide a word document (pdf as well??) view of all information.

Saturday, August 23, 2008

Dynamic Menu Created from Sharepoint Content

I have been tasked with creating a custom menu that is generated based on site content. This would be similar to the out-of-the-box menus with which Sharepoint is shipped. However, the following requirements apply:
  • The menu will only be 3 levels deep
  • Top level links will link to the top level sites of the SPCollections
  • Link order can be specified by site owners
  • Hover the top level link will display a flyout
  • The fly out will be divided into two columns
  • Column 1 will include the top ten recently updated pages of the top level site of the hovered site collection
  • Column 2 will include links to all other sites in the hovered site collection
  • Hovering over site links will display another flyout that will include links to the site (to be defined).
  • The menu will be driven from actual sharepoint content, not statically created
So this should be fun. In my view this includes a few major tasks
  1. Generate a menu statically. In other words, how to make the flyouts flyout, the styling of the thang, etc.
  2. Get the information (traverse SPSites, SPWebs, and content??, leverage one of the menu datasources, or one of the menus themselves?)
  3. Generate the menu from code based on the data. (create an data bindable user control?, generate by looping?)
  4. Deploy to the portal (user control/web part?, package as a feature or on the master page?)
I need to do a little more research to see if anyone has done this and there are one or more things out there I can use as a starting point or just start from scratch. However, thus far I have come up with a couple things I could use. First of all the telerik rad menu control looks promising for a starting point for the GUI. It looks like one could create such a menu using the control.

Secondly, I was checking out the navigation settings and noted that the site collection navigation can be administered through the site settings, including what links to show, custom titles, and most importantly, defining the order. That data has to be persisted somewhere, so it can likely be used as a basis for the menu data.

Quering a List... good stuff

The need to query data from a list is inevitable. When I was new to Sharepoint, this, among just about everything non-out-of-the-box seemed daunting. Not really knowing where to start, I found a lot of useless info. However, after gaining some Sharepoint development experience, I was able to find this two-part post by Chris O'Brien:
Had I ran into it first, rather than some other things that are out there, I would have been much better off. It discusses using the object model to query info and then delves into the SPDatasource. Part two shows how to pass parameters.

SPAdvice

I am only on my first SPProject, so I still consider myself a newb. However, I have a little advice for any developers not yet that familiar with Sharepoint that are SPMesmerized and are being SPPushers, attempting to get their organization to purchase Sharepoint. Be ware... and all of this is my opinion, based on limited experience... while it can be an out-of-the-box panacea for many needs, it can also quickly become a nightmare. That being said, I suggest that when trying to push the product, that you don't get crazy with the SPCheeseWiz and promise too much. Don't talk about customization like it will happen on the first deployment. Sharepoint is very powerful out-of-the-box and pretty easy to deploy, administer, etc. However, once you start to customize things, even the look at feel more than just a little bit, it quickly gets complex.

What's that you say? You have the power of google at your finger tips. While that's true, this stuff is pretty new, quickly changing, not that well documented, and the net has not yet sifted through the info to bubble the best stuff to the top.

That being said, I suggest first deployments be done completely through the SPAdmin and the site interfaces. Get things going out of the box first and keep control of EVERYTHING. Let the end user create content, but hold on to the power of site collection and site creation, until you figure out how to properly control it and the exposure of such sites. Once you have a handle on that, start think about customization, doing research on how various things work, etc.

Doing things in this manner will help you avoid an SPNightmare that I am enjoying. Don't get me wrong, I like doing things on fire, but I feel the client has been cheated. While we have gotten great on the job training, we have spent the last year doing so, and they do not yet have anything useful. Okay, there have been other factors slowing things down, such as the loss of control of our production servers due to a consolidation of a infrastructure of a very large organization, to be left unnamed, and what seems to be inadequate resources to do so, but that has only accounted for a part of our inability to get something out there.

In my opinion, what has really slowed things down is stupid crap like promissing some crazy menu that reads from the web app to dynamically show sites, complete with flyouts of links of the latest updated pages, etc., and the complete customization of site look and feel, and other very low value crap. Now if I worked for a marketing firm, these things might be more important. However, an organization that merely needs a better way to collaborate, who gives a crap if things are flashy?

Microsoft did a real good job of providing options of look and feel and out of the box features that do what most people need. Use what they have worked so hard to produce first, make sure you can get your client productive, and then give them the bells and whistles. Either that or be real sure you have a SharePoint expert at your direct disposal, as in on the team, not just someone you can call. I am pretty darned sure that my organization would be highly impressed and very grateful with Sharepoint off the shelf.

Anyway... take it or leave it, but that is my SPTwoCents.

SPIntroduction

I am starting this blog as a location to possibly start documenting how to get past SPDragons and maybe a place to vent about them. Just now getting into the nitty gritty of beyond-out-of-the-box needs, including custom development, deployment, etc., that there are many, many such obstacles and I can see quickly losing track of my SPSlayers.
Publish Post

I am not sure I will use this or keep up with this or if it will be helpful to me, much less others if I do, but I might as well start somewhere.