Archive for December 2007

 
 

Performance Monitors for SharePoint

OK, people, this is all new to me.  The objective is to identify a couple of dozen performance metrics that can be monitored to indicate that our farm servers are healthy.

So we need to figure out this perfmon.exe program that's part of our operating system.  Perfmon.exe is an application that will start from a command prompt and then run inside your MMC.  Out of the box, it provides a way to chart system performance over time.  You really get to the lines move from left to right over time. 

Apparently, many commercially available programs will provide "performance objects" than perfmon.exe can count; after you instally the program, you can make perfmon count occurances of things that happen inside your new program.  SharePoint obviously provides a number of these objects and if you google it, you'll find that our friend, Ben, has provided a great reference of these SharePoint Performance Objects on his blog here.

So my presumption is that somehow I can use the objects and counters in Ben's list and make the perfmon.exe program track them.

Well, Microsoft gives us this explanation of how to add a counter to your perfmon mmc.

So I run the program by selecting Performance from my Control Panel's Adminsitrative Tools menu or by typing perfmon.exe in a DOS box.  There's already a couple of counters listed at the bottom of the screen and the little red bar starts moving from left to right.  I see I can adjust the scale to get the line to move more or less.  I can also delete a counter by clicking on it and pressing Delete.

To add a counter, I right-click and select Add Counters.  The Perfromance Object pulldown is where I see the list of objects from Ben's list.  Then, the Select Counters from List option lets me choose specific counters associated with the chosen object.

For example, I select the SharePoint Publishing Cache as my Performance Object and then the Publishing cache hit count and the Publishing cache hits/sec counters.

OK, maybe those weren't such great example because I can't get them to log any activity in the mmc.

So I thought I'd try the SharePoint Search Gatherer object and select the Admin Clients counter.  The explanation says it reports the number of currently connected administrative clients.  So that starts at 2 and stays there, but, then, for a second, it climbs to 3 and goes back down.

So now I'm wondering which of these counters should I focus on to measure my server's performance.

-robot

 

Expert Help on App Pools and the MOSS Install

Application Pools were one of the more confusing items for me when I first encountered them.  Here's a great explanation from Joe Oleson in SharePointLand.

The SharePoint Reporter gives us a great list of installation steps here.

This is a pretty comprehensive look at your portal intall.  He's set it in the context of a VPC install but much of it is is relevant to any install.

-robot

 

The Help Popup

So we did the blank page a few posts ago.

Now, try this: 

In a site called MySite, create a doc library called BlankDocs.  Create a web part page called MyBlankPage.aspx and put it in that library.  Put the CEWP that I decribe HERE on the MyBlankPage.aspx.

Now put this code in a Content Editor Web Part on MySite‘s default.aspx page:

<script type=”text/java*script” language=”Javas*cript” >
function LocalHelp(strHelpURL)

{
  var wndHelp = window.open(strHelpURL, “STSHELP”, “width=425,height=600,menubar=’false’,scrollbars,toolbar=’false’,resizable”);
  wndHelp.focus();
}</script>

 

<A onclick=”LocalHelp(‘/MySite/BlankDocs/MyBlankDoc.aspx’)” href=”java*script:” mce_href=”java*script”  ;>)”>
<IMG src=”/_layouts/images/helpicon.gif” BORDER=0>
</A>

Again, take the “*” characters out of the word “java*script.”  I only do that to keep my blog host from getting nervous.

Tell me what you think.

-robot

The KM Application Template

I'm having a go with the Knowledge Management Application Template.  I would strongly suggest that, before you deploy one of these, that you fix the typographical error in the description of the Keywords list.  I think it should say:

Use this list to manage the keywords used to tag items in your Knowledge Base

One thing, as software developers, we're stereotyped as having less than total command of our native language.  I've always thought stereotypes become stereotypes for a reason.

-robot

Blank Page

Drop this in a Content Editor Web Part on a web part page in a team site and see what happens:

<STYLE TYPE=”text/css”>
.ms-bannerContainer{Display:none}
.ms-bannerframe{Display:none}
.ms-bodyareaframe{Border:0}
.ms-bodyareapagemargin{Display:none}
.ms-globalbreadcrumb{Display:none}
.ms-globalleft{Display:none}
.ms-globalleft{Display:none}
.msgloballinks{Display:none}
.ms-globalright{Display:none}
.ms-globalTitleArea{Display:none}
.ms-navframe{Display:none}
.ms-pagebottommargin{Display:none}
.ms-pagebottommarginleft{Display:none}
.ms-pagebottommarginright{Display:none}
.ms-pagemargin{Display:none}
.ms-pagetitle{Display:none}
.ms-sitetitle{Display:none}
.ms-titlearea{Display:none}
.ms-titleareaframe{Display:none}
.ms-titlearealeft{Display:none}
.ms-titlearearight{Display:none}
.ms-titleimagearea{Display:none}
</STYLE>
<A href=”java*script:MSOLayout_ToggleLayoutMode()” mce_href=”java*script:MSOLayout_ToggleLayoutMode()”>Toggle Edit</A>

Take the “*” characters out of the word “java*script and don’t forget the colon after the word “java*script”.

Also, be sure to set the chrome on your CEWP to none.

I find this Interesting.

 -robot

WSS and RSS

If we're only running WSS and not the MOSS components, we don't get the RSS Viewer web part.

So we have to build our own out of the XML viewer web part and then we have to have an XSLT to render the feed's XML on screen.

So, I'm have a little trouble with this.

First, I've got a custom list called MyList with just an Item Title column and a Description column.

Now, under List Settings I check the RSS Settings.  If RSS isn't allowed at the Site, Site Collection or WebApp level in Central Admin, you won't see the RSS Settings for the list.

So RSS is allowed and I'm checking Select All columns and click OK.

I'm back at my list and I click on the Actions menu.  I select View RSS Feed and I get the pretty rss feed page with a URL that looks like: http://MyServer/_layouts/listfeed.aspx?List=<some guid>.

So, I copy the URL to the feed to my clipboard and I move to a web part page and add an XML Viewer web part.  I open the tool pane and paste my URL in the XML Link field and click OK.

What I end up with is a style-free version of the pretty rss feed page inside my web part.  So, at this point, I simply need to transform my XML with and XML Style Sheet also called an XSLT.

OK, the simplest XSLT I've been able to come up with looks like this:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:for-each select="rss/channel/item">
<a href="{link}">
<xsl:value-of select="title"/></a>
<BR/>
<xsl:value-of select="pubDate"/>
<BR/><BR/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

So, since my problem is that I get the pretty rss feed page instead of the real XML, I now have to guess what's going on.  And my guess is this:

  1. For some reason, I have to browse out to http://www.w3.org/1999/XSL/Transform and get version "1.0".  I don't get that part but it's required.
  2. Then I do this xsl:template thing that matches "/".  I guess I'm going to build within this template something related to the root of my XML file.
  3. Next, I do this xsl:for-each thing that selects "rss/channel/item" which, I suppose, lives at the root of my XML file.  Inside, this for each, I'll get code repeated each time an "item" is encountered.
  4. Inside this for-each node, I'm going to create an anchor tag with a magical {link} href and use the "title" column to provide the text for the link.  Then, I'm going to insert a line break and add the contents of the "pubdate" field as text.  Then, I'm going to do two line breaks to skip a line between items.

The text in my webpart looks like this:

Item Four
Thu, 13 Dec 2007 16:28:49 GMT

Item Three
Thu, 13 Dec 2007 16:28:40 GMT

Item Two
Thu, 13 Dec 2007 16:28:31 GMT

Item One
Thu, 13 Dec 2007 16:28:21 GMT

Perfect.

Except for two things.

First, I'd like to get my description to appear.

Second, I don't have a "title" or a "pubdate" column in my list.

The description is easy.  I just add this to my XSLT:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:for-each select="rss/channel/item">
<a href="{link}">
<xsl:value-of select="title"/></a>
<BR/>
<xsl:value-of select="description">

<BR/>
<xsl:value-of select="pubDate"/>
<BR/><BR/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

So this works, but not as expected.  Apparently, the rss feed generates all the content into the "description" node. because I get four items that look like this:

Item Four
<div><b>Description:</b> Description for Item Four</div> <div><b>Content Type:</b> Item</div> <div><b>Created:</b> 12/13/2007 11:28 AM</div> <div><b>Created By:</b> MyServer
obot</div> <div><b>Item Title:</b> Item Four</div> <div><b>Modified:</b> 12/13/2007 11:30 AM</div> <div><b>Modified By:</b> MyServer
obot</div> <div><b>Version:</b> 1.0</div>
Thu, 13 Dec 2007 16:28:49 GMT

I also note that it matters that I use the "description" selector and not the "Description" selector; apparently it's case sensitive.

So, even though I included all my fields, I can't get my Description field and I can't seem to get any of the other fields like "Created" or "Modified By".  I usually end up with a blank line there, given that I used a <BR/> tag.  In fact if I try a field with a space in too, like "Modified by" the XSLT blows up completely giving me the helpful bit of advice:

The XSL specified by the XSL property or XSL Link property is not valid, or the XSL file cannot be accessed. Make sure you have specified a valid XSL style sheet for this Web Part, or if the XSL file is linked that it can be accessed by the server. For assistance, contact your site administrator. More about making XSL files accessible

Needless to say, I do not recommend you try the "More about" link.

It seems like, if I could see the XML that the rss feed generates instead of that pretty rss feed page, if i could see the raw XML, I'd be able to figure out how to work down the nodes to the item node and then get the values out of the my columns.

So, if you're follwoing along, you know we can just save our pretty rss feed page as an XML file and I've opened mine in FrontPage and see that all I will ever get from my list is the title, pubdate, author and such while the real data, like my item's Description (with a capital "D") is all rolled into an XML "description" node that uses a ![CDATA operator and parses all my item data into a single field that looks like HTML but it's really just text.  So, really, any hope of having an RSS feed generate something intelligent like an item and it's description are looking pretty remote.

grrrr…

-robot

 

Importing SharePoint Sites

We've had a few reps through the export routine and we can stuff a site into an export file pretty easy with the stsadm.exe program and a command like this:

stsadm.exe -o export -url http://MySharePointHost/MySite -filename \MySharePointHostexportsExportFile.exp

But, on a MOSS server, when I try to import the site to a new URL, I use this command:

stsadm.exe -o import -url http://MySharePointHost/MyOtherSite -filename \MySharePointHostexportsExportFile.exp

And I get this error:

The site http://MySharePointHost/MyOtherSite could not be found in the Web application
SPWebApplication Name=MyWebApplication Parent=SPWebService

So I'm wondering ,huh?  And so I create a web site at the URL I'm using but I use a different template so I can tell the difference and try again getting this error:

Cannot import site.  The exported site is based on the template MySiteTemplate but the destination site is based on the template MyOtherSiteTemplate.  You can import sites only into sites that are based on the same templaqte as the exported site.

I rework my import command one more time to use a URL under my /SiteDirectory/ folder of my portal like this:

stsadm.exe -o import -url http://MySharePointHost/SiteDirectory/MyOtherSite -filename \MySharePointHostexportsExportFile.exp

And this time it works.  It seems odd but I guess SharePoint has better control over that SiteDirectory folder.

hth

-robot

The template you have chosen is invalid or cannot be found.

Site templates are great ways to support a business process because you can write all of the documents and instructions into one place and then install it where ever it's needed.

But, sometimes site tempates are not perfectly portable and SharePoint makes it hard to figure out what the problem is.

So, under my My Site in a MOSS environment, I created a site using the blank site template.  I exported the site as a template and copied the .stp file to my hard drive.  Then I uploaded it into a different WSS server site template gallery. 

So I cerate a new site, select the new site tempate and, rats:

The template you have chosen is invalid or cannot be found.

The good news is get that link that says:

Troubleshoot issues with Windows SharePoint Services.

What is the point of that POS?  It's just there to make it take longer for new people to figure out what their problem is.  Does anyone ever click that link?

One thing I did was check the site's features.  Originally, the site had a translation feature that's not installed on the target host but I disabled that feature and now I just get the error noted above.

Seems like we'll be working on this for a while.

So, just the blank team site won't migrate via template from my MOSS to my WSS.  It will, on the other hand, migrate via template from my WSS to my MOSS.

However, when I look at my site in MOSS and click on Site Actions | Edit Page I get:

An unexpected error has occurred.

And the same Troubleshoot link.

So I can see the site, I just can't edit the page.

Okay, so this wasn't just a blank team site.  It had a goofy XML web part on it that decoded some goofy RSS feed.

So I drop the page into Web Part Maintenance mode by added ?contents=1 to the URL.  I delete the web part and now the page will open just fine.

So, since I really need to get this site moved, I try export and import.  Initailly, the import fails saying:

Fatal Error: Could not find Feature TransMgmtLib

I fix this by looking at the site features under settings.  I guess, this feature is on by default.

On my second try, I get:

Fatal Error: Could not find feature DataConnectionLibrary

Which is a little more difficult to find.  It's in Central Adminsrtation | Operations | Manage Farm Features.

I deactivate it and the import runs without a hitch.

 

-robot 

MOSS Backup, Recovery, Import, Export Operations

I made a this spreadsheet that composes the stsadm.exe commands for backup, recovery, import, export commands.

And working throug this task, I've figured out a couple of curious things.

When you import a site that had previously been exported, it looks like you lose modifications to the "Current View" on web part pages.  These are the ones that you make in the web part itself where you're not selecting a view shown in the list settings but changing the view in the web part itself.

This is one reason to be sure your list web parts are attached to views that actually exist.  On the other hand, the summary view, which is good for link lists becasue it minimizes the list's footprint on screen and gives you the cute little bullet, cannot be filtered any other way.

For example, I've got a link list with a link type column that chooses either internal or external  And on my web part pages, I just want to show the internal ones so I filter on link type.  But, since you can't create a summary view in the lists's settings that's filtered, you have to filter it inside the web part itself.  When you export the site and then import it, that filter setting is lost.

Rats.

The other thing is the backup operation for a multi-server farm where the database server is different from the web server.  Since the backup files will have to be written to one or the other, it's a good idea to not use "Local System" to run your database.  If that was a domain account, you'll have an easier time of establishing the correct permissions for the target location for your backup files.

 -robot