02
Nov

Here’s an interesting post (http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=305) from Maurice Prather on SharePoint 2010 Web parts.

It seems that now your web part will be stored against the page if check in/checkout is activated against the page library in a WCM site.

Sounds useful as in previous cases if you exported your site the web part settings were lost. Now hopefully your web part settings will stay with the page during export or the web part itself will reappear in a previous page version if inadvertently deleted from the current page version.

The one thing I’m curious to see is if the page differences / web part differences are visible to the user from the SharePoint UI, rather than having to revert to a version and manually check for differences Could be a useful WinDiff add on for SharePoint.

VN:F [1.9.2_1090]
Rating: 4.0/10 (1 vote cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
28
Oct

Found this new blog via the SharePoint Facebook group – http://blogs.msdn.com/vssharepointtoolsblog/ looks pretty good. The latest post has some info on SharePoint 2010 tools in Visual Studio 2010:

As you probably know, Visual Studio 2010 was announced earlier this week and it contains a lot of cool features and project templates for SharePoint developers. Below is a short overview for some of the SharePoint development related features and project templates.

Configurable deployment

With all new SharePoint project templates you can leverage new configurable deployment feature which lets you configure the way you want to deploy or retract your project. Besides using provided, out of the box deployment steps (Run Pre-Deployment Command, Run Post-Deployment Command, Recycle IIS Application Pool, Retract Solution, Add Solution, and Activate Features) you can use SharePoint extensibility to create your own, custom deployment steps and deployment configurations.

Sandboxed and farm solutions

Some SharePoint projects can be deployed either as sandboxed or farm solutions. Sandboxed solutions run in a secure and monitored process that has limited resource access and with farm solutions user must have SharePoint administrator privileges to run or deploy the solution. You can read more about SharePoint sandboxed solution here.

Extending SharePoint Tools

Even though Visual Studio 2010 contains a set of project templates you can also extend them. You can create extensions for projects, project items, define your own project item types and create deployment extensions. You can read more about extending SharePoint tools on MSDN.

Feature and Package Designer

Feature and package designers give you the ability to customize features in your solution and with packaging designer you can customize which features are getting deployed and how. More about feature and package designer is here.

SharePoint Explorer

SharePoint Explorer is a new tool window that gives you a view into your SharePoint server. You can get a hierarchical view of lists, sites and workflows on your SharePoint server.

SharePoint Project and Project Item Templates

The following SharePoint specific project templates and project item templates are available in Visual Studio 2010:

Project Templates
  • Empty SharePoint project
  • Visual Web Part project
  • Sequential and State Machine Workflow
  • Business Data Connectivity Model
  • Event Receiver
  • List Definition
  • Content Type
  • Module Project
  • Site Definition
Project Item Templates
  • Empty Element
  • Web Part
  • User Control
  • Application Page
  • Association Form
  • Initiation Form
  • Business Data Connectivity Resource Item
  • List Instance
  • List Definition From Content Type
  • Global Resources File

Besides above mentioned project templates, there are two import project templates for importing .WSP file contents and importing reusable workflows:

  • Import Reusable Workflow
  • Import SharePoint Solution Package
How to download, install and get started

If you are a MSDN subscriber, you can download Visual Studio 2010 from here. Download will be available to everyone on October 21st.

If you want to know how to download and install Visual Studio 2010 watch Channel9 video.

To get you started, head over to MSDN and read some of the walkthroughs on SharePoint Development in Visual Studio 2010.

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
21
Oct

I’ve come across this post from MVP Reza Alirezaei’s blog. In his post he lays out how you can build a VHD and basically boot to it natively. Gone are the days of partitioning a hard disk for multiple windows installs. Instead you can now go off, build your VM, Sysprep it, run a few commands and boot to it on start-up.

There’s good points and bad points about this. First off, Reza makes a very good point about the upcoming Visual Studio 2010, namely:

VS 2010 Beta 1 runs much faster in a native boot from vhd than a VM. It’s partly due to VS 2010 being heavily based on WPF and emulating the graphics card in VMs forces WPF to run into software rendering mode and kills the performance big time. So far, every time I’ve fired up VS 2010 in a VM its taken 5 mins to get frustrated with the performance and give up! Obviously VS 2010 is still in beta and lots of improvements will be made in future , but in the interim, native boot from vhd is pretty much the only way that allows me to evaluate VS 2010 dev experience without having WPF running into software rendering mode, frequent crashes and performance headaches.

I’ve tried running VS2010 beta in a VMWare (Server) machine running Windows Server 2k8 and it’s truly abysmal. CPU usage jumped to 100% so frequently it was unusable. I am really starting to think that it might be a problem for us to have a VM with VS2010 and SQL Server 2008 running on it, never mind SP2010 when it arrives.  By the way the host machine I tried this on was running 3gb with Windows 7 and it’s pretty well specced too.

Ultimately it doesn’t bode well for SharePoint 2010 seeing as SharePoint Foundation (formerly WSS)  states that 2-4gb is required and SharePoint Server (MOSS) needs 6-8 GB ram!

Is it then time to look at a paradigm shift for development in that we have a number of development VHD’s that we boot natively from, and from within them we virtualise our common applications, such as email, word etc? It might even be reasonably straightforward as new Online versions of the Office Suite could be used.

Obviously there’s good and bad points about this.

  • Overall performance will be better as the Development VM’s will utilise the machines hardware directly. VS2010 might even load before lunchtime.
  • You might need to reboot to switch between VM’s, but this is no different from shutting down 1 VM to start another. Might even be faster than VMWare shutting down.

I hope to play about with the native boot stuff over the next few days. Stay tuned for feedback.

[Update] Apparently you need Windows 7 Enterprise or Ultimate to enable Virtual HD booting

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
20
Oct

Interesting article on Computer World:

Microsoft is also creating two new versions of SharePoint 2010 aimed at Webmasters. These new offerings — one, an on-premises server for small to medium-sized companies, the other, a Web version hosted in Microsoft’s data centers — will cost half the price of existing versions, according to Kirk Koenigsbauer, general manager for the Microsoft Office Business Platform. He declined to release exact prices.

Koenigsbauer admits that getting SharePoint 2007-based sites to comply with WCAG required users to buy "partner-led" solutions. However, "in SharePoint 2010, we are doing a much better job and now fully support WCAG." He added that SharePoint 2010 also has "full XHTML compliance" to ensure Web pages don’t break or look different under different Web browsers.

Happy days. Ciaran and Nicky will be doing cartwheels.

Full text can be found here

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
19
Oct

 

I have recently asked to be put forward to do the MOSS developers certification. When I went to the Microsoft site it hadn’t previously crossed my mind that the study materials would cost (and cost so much) money to use. So, below I have taken the list of exam contents from the official exam site and added links to relevant training material for most sections \ subsections. I created this list to help myself while studying, but thought I would share it with everybody else because that’s the kind of nice guy I am :P I hope somebody else finds this useful!

 

Skills Being Measured This exam measures your ability to accomplish the technical tasks listed below. The percentages indicate the relative weight of each major topic area on the exam.

Managing Enterprise Content

· Enforce document storage business rules by using Document Policy.

http://vspug.com/tonstegeman/2007/02/01/moss-custom-policies-part-1-creating-a-custom-information-management-policy/

http://vspug.com/tonstegeman/2007/02/12/moss-custom-policies-part-2-creating-a-handler-to-submit-items-to-the-records-center/

http://vspug.com/tonstegeman/2007/02/15/moss-custom-policies-part-3-implementing-the-custom-policy/

o Create a custom document policy.

o Deploy a document policy by using a policy feature.

o http://msdn.microsoft.com/en-us/library/aa981572.aspx

o Specify logic for a document policy by using a policy resource.

o http://msdn.microsoft.com/en-us/library/ms545541.aspx

o Manage document retention rules by using the expiration feature policy.

o http://blah.winsmarts.com/2008-10-Authoring_custom_expiration_policies_and_actions_in_SharePoint_2007.aspx

o Launch a workflow when a document expires.

o http://office.microsoft.com/en-us/sharepointserver/HA101544241033.aspx

· Audit Windows SharePoint Services content by using a custom policy.

http://msdn.microsoft.com/en-us/magazine/cc794261.aspx

· Manage records by using Office SharePoint Server 2007 record management features.

http://technet.microsoft.com/en-us/library/cc263372.aspx

http://aroder.blogspot.com/2009/07/best-70-542-moss-2007-exam-guide.html

o Create a custom file plan.

o http://www.metataxis.com/exponent-0.96.5-GA/themes/metataxistheme/Metataxis%20-%20SharePoint%20Information%20Architecture.pdf

o Create a custom audit report.

o http://technet.microsoft.com/en-us/library/cc263514.aspx

o Create a custom file submission.

o Create a custom legal hold.

o http://office.microsoft.com/en-us/sharepointserver/HA101735981033.aspx

o

· Create content by using the Office SharePoint Server 2007 Web content management features.

www.mcmsfaq.com/sd/OFC216_Shah_German.ppt

o Extend the Page Authoring toolbar.

o http://blogs.msdn.com/ecm/archive/2007/03/04/customize-the-page-editing-toolbar-in-moss-2007.aspx

o Create pages dynamically.

o Modify page layout by using content placeholders.

o http://www.asp.net/LEARN/mvc/tutorial-12-cs.aspx

o Create a custom field control.

o http://msdn.microsoft.com/en-us/library/aa981226.aspx

o Localize a site by using resource lists.

o http://msdn.microsoft.com/en-us/library/fw69ke6f.aspx

· Deploy content between servers.

http://msdn.microsoft.com/en-us/library/ms549024.aspx

http://msdn.microsoft.com/en-us/library/ms496233.aspx

· Provide variations of Web content.

o Redirect a user to a variation based on profile settings.

o Launch a workflow when an event occurs in a primary variation.

· Provision multiple sites in a hierarchy.

Creating Business Intelligence Solutions by Using Office SharePoint Server 2007

· Display data from a Microsoft Excel workbook by using Excel Services.

· http://msdn.microsoft.com/en-us/library/ms519581.aspx

· Create a trusted workbook location by using the Stsadm.exe command-line tool.

· http://msdn.microsoft.com/en-us/library/ms562080.aspx

· Implement business logic by using an Excel Services user-defined function.

· http://msdn.microsoft.com/en-us/library/ms493934.aspx

o Process enterprise data from a Windows SharePoint Services list.

o Troubleshoot a user-defined function.

· Filter data in a workbook by using Excel Services.

· Provide parameters to a Report Viewer Web Part from a custom Web Part.

· http://technet.microsoft.com/en-us/library/bb326214.aspx

· Expose a data source by adding a data connection to a Report Center Web Site.

· Create a key performance indicator (KPI) Web Part by using data from a report data source.

· http://office.microsoft.com/en-us/sharepointserver/HA100800271033.aspx

Integrating Business Data with Office SharePoint Server 2007 by Using the Business Data Catalog (BDC)

http://msdn.microsoft.com/en-us/office/bb251754.aspx

· Create a BDC Application Definition.

o Create a line of business (LOB) system.

o http://apparchguide.codeplex.com/wikipage?title=Chapter%2021%20-%20SharePoint%20LOB%20Applications&ProjectName=apparchguide

· Describe an external application in the BDC Application Definition.

o Create an LOB system instance.

o Create an entity.

· Display data from an external data source.

o Create a Finder method.

· Enable indexing of data stored in an external data source.

o Create an IDEnumerator.

o http://msdn.microsoft.com/en-us/library/ms577629.aspx

· Enable searching on a BDC Application Definition.

· http://blah.winsmarts.com/2007-4-SharePoint_2007__BDC_-_Enabling_Search_on_business_data.aspx

o Enable a single item query by creating identifiers for entities.

o Enable a single item query by creating a SpecificFinder method.

o Add input and output parameters to a SpecificFinder method.

o Create a filter descriptor.

· Create a custom action on an entity.

· Create an association between two entities.

· http://www.lightningtools.com/bdc-meta-man/moss-business-data-catalog-getting-started.aspx

· Create a Web Part to browse data.

o Return an LOB system instance.

o Return an entity.

o Execute a finder on an entity.

o Execute a method on an entity.

o Execute a SpecificFinder on an entity.

o Execute a wildcard filter on an entity.

Accessing Office SharePoint Server 2007 Application Platform Services

· Process InfoPath data from within a workflow.

· Display an InfoPath Form from within an ASP.NET page by using the Form Services control.

· http://msdn.microsoft.com/en-us/library/ms772323.aspx

· Automate Office Forms Server administration tasks.

· http://technet.microsoft.com/en-us/library/cc197440.aspx

o Activate a previously uploaded form template.

· Manage credentials by using the single sign-on (SSO) credential store.

· http://support.citrix.com/article/CTX108095

o Create a custom SSO provider for use by the BDC.

o http://msdn.microsoft.com/en-us/library/ms566925.aspx

o Apply credentials to a Web service call by using SSO.

o http://www.baktek-web.com/en/topics/Authentication%20modes%20and%20Web%20SSO%20in%20WSS.aspx

· Convert documents by using the document converter.

o Convert a document from a document library by using an existing document converter.

o Increase the priority of a document in the conversion process.

o Transform a custom document format into another format.

o Publish a page by using the document converter.

· Display a user profile retrieved from an Office SharePoint Server 2007 Web service.

Searching Data by Using the Search Service

http://technet.microsoft.com/en-us/library/cc262700.aspx

· Programmatically enhance the search service.

o Access the search context for the Shared Services Provider (SSP).

o Associate a search term by creating a Best Bet.

o http://woodywindy.spaces.live.com/blog/cns!773832677F575173!408.entry

· Add a custom search page for searching the BDC.

· http://msdn.microsoft.com/en-us/library/ms584031.aspx

o Extend the user interface by adding a tab to the search page.

o http://msdn.microsoft.com/en-us/library/bb428855.aspx

· Provide custom search capabilities by creating an enterprise search Web Part.

· Customize the display of search results by modifying the Search Core Results XSLT.

· http://msdn.microsoft.com/en-us/library/ms584121.aspx

· Display results from a Windows SharePoint Services search Web service.

· Display the results of a keyword query.

· http://www.chakkaradeep.com/post/2009/06/23/Using-KeywordQuery-to-search-in-your-SharePoint-site.aspx

Targeting Content Based on Audience Membership

http://office.microsoft.com/en-us/sharepointserver/HA101690531033.aspx

· Create an audience.

· http://www.associatedcontent.com/article/228345/how_to_create_audience_in_microsoft.html

· Specify conditions for audience membership by using rules.

· Target a list item to an audience.

· http://office.microsoft.com/en-us/sharepointserver/HA011607461033.aspx

· Target a Web Part to an audience by using filters.

· Display all audiences to which a user belongs.

· http://msdn.microsoft.com/en-us/library/ms500775.aspx

· Display all users in a given audience.

Customizing Functionality by Using Profiles

· Import users into the user profile store from an LDAP store.

· http://msdn.microsoft.com/en-us/library/ms585156.aspx

· Create a profile in the user profile store.

· http://msdn.microsoft.com/en-us/library/bb847941.aspx

· Manipulate profile properties.

o Add a profile property to the user profile store.

o http://msdn.microsoft.com/en-us/library/ms519896.aspx

o Store a user’s attributes in the user profile store by creating a multivalue property.

o http://technet.microsoft.com/en-us/library/cc263448.aspx

o Retrieve a specific property from a user profile.

o http://msdn.microsoft.com/en-us/library/ms544366.aspx

o Map a BDC data item to a user profile property.

o Set the privacy policy for a user profile property.

· Display all colleagues for a given user.

· Add a distribution list to a new membership.

· http://support.microsoft.com/default.aspx/kb/825488

· Display results from the user profile change log.

· http://msdn.microsoft.com/en-us/library/ms549249.aspx

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: +1 (from 1 vote)
Comments Off
16
Oct

The video below is from a company called 10/GUI. The main guy behind it is Robert Clayton Miller and he’s a 2005 graduate of the design program at the School of Art at Northern Illinois University. Needless to say, I like it a lot.

This is how I want computing to be. At least until we can all shout ‘COMPUTERRRR!’ at them in a Scottish accent (yes, I did stick a StarTrek reference in there).

Video’s about 10mins long but definitely worth it.

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
12
Oct

Recently I have been working on an event handler for a SharePoint document library. This document event handler has 2 tasks:

1) Update 4 metadata fields with various pieces of information.

2) Update the header and footer of the document with the value of one of that metadata fields.

 

So I worked on this piece of code and eventually thought I had successfully completed it. However, it was pointed out to me that after uploading a document for the first time the version number was appearing incorrectly. a newly checked in document should have a version number of 0.1, all the documents I was checking in had a version number of 0.3. The reason for this was obvious enough. The event handler is triggered when the item is checked in. The way this piece of code works means the document must be checked out and back in for 1) the metadata update AND 2) the header / footer update. so, with the event’s own checkin and the 2 custom code checkins the document version had become 0.3.

I spent a lot of time making very large code changes in my attempts to solve this problem. In the end (after having rewritten large chunks of code with no success) a colleague pointed out a much easier way to set the correct version number. I had been checking in the document every time using:

 

SPFile.CheckIn(“Check In Document”);

 

However, I was unaware that there was another additional parameter that could be set to keep the same version number throughout the event handler:

 

SPFile.CheckIn(“Check In Document”, SPCheckInType.OverwriteCheckIn)

 

By overwriting the document version for the 2 custom code checkins the version number will not increase now until the user wants to create a new version. 

VN:F [1.9.2_1090]
Rating: 7.7/10 (3 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
02
Oct

Summary:

If you want to customise the default forms that come with SharePoint lists (DispForm.aspx, EditForm.aspx, NewForm.aspx) then you should deploy the list as a feature so you can modify the actual file in the 12 hive instead of the unghosted version in the database. This saves you reconfiguring the list in every environment you deploy to which is fantastic for a Dev –> UAT –> Production transition.

Preamble:

SharePoint features are great for many reasons I won’t go into here  but one that i will.

Most people are already using the SharePoint solution deployment approach but if you’re one of the unconverted, there’s plenty of information out there in google land on how Solutions + WSPBuilder + Powershell = Win.

Setting the Scene:

I recently had to develop a custom SharePoint list. The project structure consisted of:

  • List template Feature
  • Content Type Feature
  • Content Type association feature (to join the dots). [Note 1 – if you’re already lost then see Andrew Connell’s blogs on feature deployment]

What i wanted to do then was to change the list ‘EditForm.aspx’ and ‘NewForm.aspx’ to be completely custom. So I fired up SharePoint designer and added a DataView webpart.

[Note 2 – there’s many ways to make a hash of this – the way that i find works is this one: http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/06873fe5-19a9-4b32-91a9-31164afdd4bb – i.e. don't delete the ListView webpart, just hide it]

So now i can implement my custom forms in any way i like and add in all kinds of extra functionality. That’s a blog post for another time though.

The issue:

As the form is now unghosted (i.e. it has been customised from the list definition [filesystem] so it exists in the database), all form changes need to be done in SharePoint Designer and will have to be repeated every time you redeploy the list.

There’s other reasons why you shouldn’t unghost pages – performance (not precompiled), potential upgrade problems, etc..

Is using SPD in each environment so bad?

It’s not terrible, it just takes a lot longer, is easier to make a mess of and I don’t like the SPD development environment either. i just find it slow and annoying. After all, it is doing round trips to the database every time you call or save a page. And it often attempts to nanny you by ‘cleaning up’ your HTML behind the scenes. The most obvious example of this is the removal of the ‘~’ character in relative URLs as it attempts to resolve these as absolute.

So I’d rather work in a proper code editor environment and have my changes directly applied.

The Solution:

As you’ve probably worked out by now, it’s by making sure your pages never get unghosted.

The key to this is to deploy your list feature as normal, but make changes to the EditForm.aspx directly in the list definition feature in the 12 hive.

How to do this is to use SPD on your dev environment, get the page exactly how you want it and then go deploy the feature.

As SharePoint feature GUIDs are non-deterministic (sigh) the instance of the list you create will have a random GUID which you won’t know at this point. It simple become a cut and paste exercise to get the new list GUID and insert it in your EditForm to replace the existing one.

The easiest way to get the list GUID is:

Site Actions –> Site Settings –> Audience Targetting Settings

The URL will now show you the list GUID in a non-html encoded format:

image

And voila! You can now deploy this list to any environment as many times as you like and the only manual work is to replace the GUID once the list instance has been created! 2 words – AweSome.

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
30
Sep

Recently a client asked us if we could link the metadata for a SharePoint search result (which is the green text at the bottom of every search result) to bring the user to the document library / folder where the document is held.

clip_image002[51]

At first this looked like quite a trivial task, edit the xslt to remove everything after the last forward slash:

Turning:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo/document.doc

Into:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo

This unfortunately proved not to be possible. This is because SharePoint uses xsl 1.0 which doesn’t have as much functionality as xsl 2.0.

The eventual solution involved:

1) Two templates:
•    countTokens: a template used to count the number of a given symbol within a string, in this case /.

  <!– Function to count the occurences of a string within another string –>
  <xsl:template name="countTokens">
    <xsl:param name="string" />
    <xsl:param name="token" />
    <xsl:param name="result" />

    <xsl:choose>
      <xsl:when test="contains($string, $token)">
        <xsl:call-template name="countTokens">
          <xsl:with-param name="string"
select="substring-after($string, $token)" />
          <xsl:with-param name="token" select="$token"/>
          <xsl:with-param name="result" select="$result + 1"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$result" />
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

•    Reverse: A template to reverse a string

  <!– Function to reverse a given string –>
  <xsl:template name="reverse">
    <xsl:param name="input"/>
    <xsl:variable name="len" select="string-length($input)"/>
    <xsl:choose>
      <!– Strings of length less than 2 are trivial to reverse –>
      <xsl:when test="$len &lt; 2">
        <xsl:value-of select="$input"/>
      </xsl:when>
      <!– Strings of length 2 are also trivial to reverse –>
      <xsl:when test="$len = 2">
        <xsl:value-of select="substring($input,2,1)"/>
        <xsl:value-of select="substring($input,1,1)"/>
      </xsl:when>
      <xsl:otherwise>
        <!– Swap the recursive application of this template to
                    the first half and second half of input –>
        <xsl:variable name="mid" select="floor($len div 2)"/>
        <xsl:call-template name="reverse">
          <xsl:with-param name="input"
              select="substring($input,$mid+1,$mid+1)"/>
        </xsl:call-template>
        <xsl:call-template name="reverse">
          <xsl:with-param name="input"
              select="substring($input,1,$mid)"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

2) Changes to span class="srch-URL", which resides within p class="srch-Metadata"

<span class="srch-URL">

        <!– Get number of slashes in URL –>
        <xsl:variable name="numberofslashes">
          <xsl:call-template name="countTokens">
            <xsl:with-param name="string" select="$url" />
            <xsl:with-param name="token" select="string(‘/’)" />
            <xsl:with-param name="result" select="0" />
          </xsl:call-template>
        </xsl:variable>

        <!– Reverse the URL –>
        <xsl:variable name="reversedurl">
          <xsl:call-template name="reverse">
            <xsl:with-param name="input" select="$url" />
          </xsl:call-template>
        </xsl:variable>

        <xsl:variable name="newurl">
          <xsl:choose>

            <!– If it contains 3+ slashes, we can remove what’s left after the last one –>
            <xsl:when test="number($numberofslashes) &gt; 3">
              <xsl:call-template name="reverse">
                <xsl:with-param name="input" select="substring-after($reversedurl, ‘/’)" />
              </xsl:call-template>
            </xsl:when>

            <!– Otherwise just reverse it back –>
            <xsl:otherwise>
              <xsl:call-template name="reverse">
                <xsl:with-param name="input" select="$reversedurl" />
              </xsl:call-template>
            </xsl:otherwise>

          </xsl:choose>
        </xsl:variable>

        <a href="{$newurl}" id="{concat(‘CSR_U_’,$id)}" title="{$url}" dir="ltr">
          <xsl:choose>
            <xsl:when test="hithighlightedproperties/HHUrl[. != '']">
              <xsl:call-template name="HitHighlighting">
                <xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="url"/>
            </xsl:otherwise>
          </xsl:choose>
        </a>
      </span>

This code works by reversing the string original string to give the string backwards:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo/document.doc

Would become:

cod.tnemucod/owtredlof/enoredlof/yrarbiLtnemucoD/etisbuS/etiSleveLpot//:ptth

If there are more than 3 forward slashes in the string, we take the substring after the first slash of the reversed string:

owtredlof/enoredlof/yrarbiLtnemucoD/etisbuS/etiSleveLpot//:ptth

and then reverse it back:

http://topLevelSite/Subsite/DocumentLibrary/folderone/foldertwo

if there are less than 3 slashes:

etiSleveLpot//:ptth

Just reverse the string back:

http://topLevelSite.

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
30
Sep

I never remember numbers and version numbers are a good example of figures I can’t keep in my head! 

I found this post on a blog which give a comprehensive list of SharePoint versions and updates. 

 http://www.sharepointdesignerstepbystep.com/Blog/Articles/How%20To%20find%20the%20SharePoint%20version.aspx

It lists all of the updates for MOSS and WSS 2007 along with what version number the update is.   Very useful for those days I can’t remember if an update had been installed or not.

VN:F [1.9.2_1090]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.2_1090]
Rating: 0 (from 0 votes)
Comments Off
-->