Moving My Blog from Live Spaces to WordPress

This post is copied from my Live Spaces blog, and was the last post I’ll make there.
I’m finally biting the bullet and moving this blog.  While I’ve had it parked at Live Spaces for over two years now, I’m just not seeing Live Spaces keeping up with the enhancements that others are offering.  After a highly scientific analysis (I found a good tool that would let me grab my posts from Live Spaces and move them to WordPress.), I chose WordPress as the new home.  The new URL is: http://sympmarc.com. (Note the ‘s’.)
WordPress seems to offer much more flexibility and real analytics, which Live Spaces just doesn’t have.  I wanted to stick it out with Microsoft’s attempt in this arena, but I decided that there were greener pastures.
For those who might want to do the same, here is how I did it.  There’s no easy way to get your blog content out of Live Spaces.  (Microsoft certainly doesn’t offer an export utility like many others do.)  Someone named Wei Wei has written and posted a Python script that will export your blog to an XML file which can be uploaded to WordPress.  The code is over at Google Code.  Be sure to follow his instructions well.  You do need to use versions close to what he recommends for his script to run: Python Runtime 2.5.2 and Beautiful Soup 3.0.6.  Python Runtime 2.5.2. wasn’t available for download, but 2.5.4 worked for me.
 
Well, so long Live Spaces.  I’m going to leave things here for a while, but all my new posts will be over at http://sympmarc.com.

SharePoint’s Content Deployment Engine

I recently went through the exercise of setting up Content Deployment in a client environment based on the information in an excellent post from Jackie Bodine.  (Looking at it with the Way Back Machine let me see the images, which were broken in the current post.)

For this client (as with almost all clients that I work with), we have a lot of Data View Web Parts (DVWPs) exposing content stored in lists of various types throughout the Site Collection.

What did I learn?  Well, for this client, it seemed like we had two pretty solid options.  Let me see if I can get them outlined well enough here:

Publish to Staging, Deploy to Production

This seemed to be the preferred method.  The way this would work is as follows:

  • Pages and structures would be developed on Development.
  • When things were ready, we would move them to Staging.  (This could be through Content Deployment or manually.  I think manually is the better idea in most cases, as you’d know exactly what you are moving.)
  • SharePoint Designer-based workflows would be built and run in Staging.  (There is no need for the workflows to deploy and run in Production, as all content contribution and management would happen in Staging.)
  • Users would publish content to Staging.  This would need to be ALL content for the Content Deployment process to work properly.
  • Once content is published and approved, Content Deployment would pick it up and deploy it to Production on a configurable schedule.
  • Production would be read only for all users (other than administrators).

Publish to Production

  • Pages and structures would be developed on Development.
  • When things are ready, we would move them to Staging.  (This could be through Content Deployment or manually.  I think manually is the better idea in most cases, as you’d know exactly what you are moving.)
  • Staging would be used for QA only.
  • Once things seemed OK, we would move them to Production.  (This could be through Content Deployment or manually.  I think manually is the better idea in most cases, as you’d know exactly what you are moving.)
  • SharePoint Designer-based workflows would be built and run in Production.
  • Users would publish content to Production.  No Content Deployment required.  However, we’d still have an approval process which would prevent content from being visible unless it was approved.
  • Production would be configured for the appropriate permissions based on user role.

In the end, we decided not to go with either version for a couple of reasons.  First, the out of the box Content Deployment engine didn’t give us enough granularity.  It wants to work on the site level.  Second, we were told by the hosting provider that we couldn’t touch Staging or Production with SharePoint Designer.

In the end, it was clear the Content Deployment is actually pretty good and not that hard to set up.  It would make good sense in situations where the number of contributors is very low and the content is mostly page-based.  However, where most of the content is list based, exposed though DVWPs, and everyone is a contributor, it makes less sense.

Technorati tags: ,

My Technology Arsenal: To Kindle or Not to Kindle

I inherited the early adopter gene from my father, who had a digital calculator in the early 70s that must have cost him hundreds of dollars.  He’s given me things over the years that were very cool: a briefcase stereo that played albums (remember albums?), tapes, and radio in the late 70s; a Canon XapShot digital camera in about 1985; and more.

Now that my technology junkie budget is my own, I try to be a bit more circumspect in my purchases.  So, what are the most important things in my technology arsenal?  You might think that I’m positively a Luddite, but here’s the list:

  • Dell Latitude D820 laptop running Vista — It’s a little old, it’s a little clunky, but it gets the job done.
  • Apple’s iPhone 3G — This is my most recent acquisition, and the latest "How did I live without this?" item.  It’s not really a phone: it’s a computer that fits in your pocket and makes phone calls.  I can surf the Web from anywhere, get directions, find out what song is playing by pointing it at a speaker, my son can manifest his love of light saber play, and on and on and on.
  • TiVo HD — This is my second TiVo platform, after my old Series 2.  If you don’t have TiVo, GET ONE.  It changes the way you think about the idiot box in a positive way.  We don’t just watch TV very often anymore, we watch TV we want to watch.  That ‘500 channels with nothing on’ complaint doesn’t totally go away, but it doesn’t come up as often.
  • iPod Touch 20Gb — Another old model, but, hey, it holds more music than I can listen to and it works.

What prompted me to write this post is that my wife "bought" me an Amazon Kindle for Christmas.  I put bought in quotes because you can’t actually buy one of these things. The current shipping delay listed on the Amazon site for the Kindle 1.0 is 8 to 10 weeks, almost an eternity in tech.  My wife presented it with the permission to say no if I didn’t think I’d really use it.

The Kindle promises to revolutionize reading in the same way that the iPod revolutionized music.  I’m a big reader, so it seems to make good sense, but am I ready to give up paper?  I look at my book collection (along with my CD collection) as a sort of journal.  I remember when and where I bought many of my books, whether they be shallow "airport books" or tomes that changed my thinking in some way.  Can that happen with a digital file?

The Kindle 2.0 is expected anytime, too.  So should I wait for it before taking the leap?  From the pictures I’m seen and reviews I’ve read, it isn’t significantly different, but isn’t the new model always better in some way?  And what about generation next?  One of the big content areas is magazines, but would magazines read well in black and white or is it worth waiting for a color version?

I’m not sure what my answer is going to be, but on the assumption that there are people out there reading my musings, I’d be interested in thoughts about the Kindle.

Technorati tags: , ,

SPSecurityTrimmedControl – Possible Values for PermissionsString

I’m working on an Intranet where virtually everyone will be a Contributor.  We’ve built custom navigation paths to customized forms for the content input, so we want to hide the “View All Site Content” links on every page.  We want to hide it from everyone except the users who have Full Control.

The master page, by default, shows this link as follows (formatted for readability):

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="FullMask">
  <div>
    <SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
  </div>
</SharePoint:SPSecurityTrimmedControl>

Easy to find in the master, but what values are available for PermissionsString?  Not an easy thing to find, but if you look at the bottom of this MSDN page at the Community Content, you’ll see the available values.  Thanks to Zac Smith in NZ for posting this!  (Here’s a link to his original blog post.  The one in the MSDN page is no longer valid.)  We’ll experiment with what value works best in our situation.

List Permissions Site Permissions Personal Permissions
ManageLists
CancelCheckout
AddListItems
EditListItems
DeleteListItems
ViewListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CreateAlerts
ViewFormPages
ManagePermissions
ViewUsageData
ManageSubwebs
ManageWeb
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
CreateGroups
BrowseDirectories
CreateSSCSite
ViewPages
EnumeratePermissions
BrowseUserInfo
ManageAlerts
UseRemoteAPIs
UseClientIntegration
Open
EditMyUserInfo
ManagePersonalViews
AddDelPrivateWebParts
UpdatePersonalWebParts

Setting Multi-Select Widths in a SharePoint EditForm.aspx Using JavaScript

<UPDATE date=”2009-01-25″>
I now have a function in my jQuery Library for SharePoint Web Services called SPSetMultiSelectSizes which accomplishes this in a more robust way, taking into account the font, font size, etc.
</UPDATE>

When you have a multi-select lookup column in a list, SharePoint provides you with a control that shows two select boxes next to each other on EditForm.aspx.  There are two buttons (‘Add >’ and ‘< Remove’) that let you move values between the two, selecting or deselecting the values.

By default, the select boxes are a fixed width and, in many cases, not wide enough to let your users see the values very well.  The following JavaScript will set the widths of the select boxes based on the length of the longest value available in the lookup.  It isn’t fully multipurpose, as I wrote it for a specific instance with a particular set of branding (font size, spacing, etc.) but it ought to give you a very good start to use it yourself.  (With the fonts that I was using, I found that 7 times the number of characters in the longest value worked well to calculate the right width.  You’ll probably need to experiment.)  Pass in the name of the column you want to adjust.

// setSelectWidth: Set the width of a lookup column's select box based on the values it contains
// Arguments:
// columnName: The name of the column which is being displayed in the select box
//
function setSelectWidth(columnName) {

  var charFactor = 7; // Approximate pixels per character

  // Left side
  leftColumnSelect = getTagFromIdentifierAndTitle("select","",columnName + " possible values");
  if(leftColumnSelect != null) {
       leftColumnSelectDIV = findParentElement(leftColumnSelect, "DIV");
  }

  // Right side
  rightColumnSelect = getTagFromIdentifierAndTitle("select","",columnName + " selected values");
  rightColumnSelectDIV = findParentElement(rightColumnSelect, "DIV");

  // Find the longest value
  var longestValue = 0;
  for (var i=0; i  leftColumnSelect.options.length; i++) {
    if(leftColumnSelect.options[i].text.length > longestValue) {
      longestValue = leftColumnSelect.options[i].text.length;
    }
  }
  for (var i=0; i < rightColumnSelect.options.length; i++) {
    if(rightColumnSelect.options[i].text.length > longestValue) {
      longestValue = rightColumnSelect.options[i].text.length;
    }
  }

   // Set the widths of the two selects and their containing DIVs
   var newWidth = charFactor * longestValue;
   leftColumnSelectDIV.style.width = newWidth;
   leftColumnSelect.style.width = newWidth;
   rightColumnSelectDIV.style.width = newWidth;
   rightColumnSelect.style.width = newWidth;
}

This function builds on the getTagFromIdentifierAndTitle function provided in an excellent blog post I’ve referenced before over at the Microsoft SharePoint Designer Team Blog.  I’ve also created a findParentElement function you’ll see called above, which finds a specific parent element for a tag.  The code for this is below:

// findParentElement: Find an object's specified parent element
// Arguments:
// thisElement: The element you want to search from
// parentTag: The parent tag you want to find
//

function findParentElement(thisElement, parentTag) {
  var currentElement = thisElement;

  while(currentElement.tagName != parentTag) {
    currentElement = currentElement.parentNode;

    //alert(currentElement.tagName);
    if(currentElement.tagName == parentTag) {
      //alert('HIT:' + currentElement.tagName);
      return currentElement;
    }
  }
  return null;
}