Skip to content

Ludo's LRT blog

just another Learning and Research Technologies weblog

Archive

Tag: xml

This is a “reprint” of an article originally published on a private wiki not open to the public by me in July 2009.

Add & Deploy
To install a SharePoint solution called solution.wsp from C:\MMU Web Parts\ on your SharePoint farm (you should be able to run these commands from any web server in the farm):

Add:
stsadm -o addsolution -filename "C:\MMU Web Parts\solution.wsp"

Now deploy it to the web application of your SharePoint site:

Deploy:
stsadm -o deploysolution -name "solution.wsp" -url "https://my.mmu.ac.uk" -immediate [-allowgacdeployment]

Enumerate current solutions

If you’d just like to see which solutions are installed on your SharePoint server farm:

stsadm -o enumsolutions

But this spits out a lot of XML that’s very difficult to read on the command line (or at all). Here’s a Perl script to run to get enumsolutions without all the surrounding flim-flam:

@o=split /</,`stsadm -o enumsolutions`;
while(<@o>){
chop;
print qq[$_\n] if /^Name=.*wsp/;
}

or on the Windows cmd line:

perl -e "@o=split /</,`stsadm -o enumsolutions`; while(<@o>){chop;print qq[$_\n] if /^Name=.*wsp/;}"

Retract & Delete

To uninstall a SharePoint solution from your farm run both of these commands:

stsadm -o retractsolution -name "solution.wsp" -url "https://my.mmu.ac.uk" -immediate

stsadm -o deletesolution -name "solution.wsp"

Lastly, here’s an improved Perl one-liner for taming the tidal wave of XML output from enumsolutions.

… in the SharePoint RSS feed web part, that is.

Colleagues at the Employability and Careers Service had asked us to syndicate their RSS news feed onto the student portal myMMU. We had set this up for them using the standard SharePoint RSS web part.

However, the hyperlink on the title text on the RSS web part linked to the Careers blog, which was the source of the RSS feed.  Careers staff were using the blog basically as a way to announce news and events rather than as a proper website vehicle for the department.  They requested that we link the RSS feed title instead to the main Employability and Careers website.

Fortunately, the RSS web part is highly customisable as the XSL file can be edited.

We edited the div element of class “groupheader item medium” simply to include an HTML link to the Careers website rather than the XML that returned the URL of the source.  Like so:-

<div class="groupheader item medium">
 <a href="http://www.mmu.ac.uk/careers/">Employability &amp; Careers Service</a>
</div>
old one:
<div>
<a href="{ddwrt:EnsureAllowedProtocol(string(channel/link))}">
<xsl:value-of select="channel/title"/>
</a>
</div>
<div class="groupheader item medium"> <a href="{ddwrt:EnsureAllowedProtocol(string(channel/link))}">  <xsl:value-of select="channel/title"/></a>
</div>