SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH

Aug 312008

Installation, Deployment, Activation of Features

I get plenty of questions on how to add, deploy or activate a SharePoint Solution.

Solution

A SharePoint solution is a *.wsp file (which is a cab file) which contains at least one feature.

Feature

A feature adds new functionality to your SharePoint farm. It can be wrapped inside a solution file, or be deployed by adding files to your SharePoint servers.

Installing a Solution

To install a solution to your SharePoint farm, copy the wsp file to one of your SharePoint servers, and run "stsadm -o addsolution -filename yoursolution.wsp".

Because the installation process only includes the filename, every "-name" for updates etc. are identical to the filename. See below.

Upgrading a Solution

If you already have a solution installed and want to update it, simply update the solution with an updated wsp file and the stsadm command "stsadm -o upgradesolution -filename yoursolution.wsp -name yoursolution.wsp -immediate [-allowgacdeployment]".

You can schedule the deployment with -time instead of -immediate.

The allowgacdeployment parameter is necessary if the solution places assemblies (DLLs) into the global assembly cache (GAC).

Scopes

The scope of a feature defines on which object you can activate the feature. The scope can be "Farm", "WebApplication", "Site" or "Web".

Note from the SharePoint SDK:

For Web site scoped Features, a user must have the ManageWeb permission on the Web site to perform Feature activation or deactivation and property update through the object model or through the user interface (UI). For site collection scoped Features, a user must have the ManageWeb permission on the root Web site of the site collection to perform Feature activation or deactivation and property update through the object model, but to navigate to the Site Collection Features page and to activate or deactivate Features through the UI, the user must be a site collection administrator.

 Deployment

Before you can use a feature, you have to deploy it. If the feature was installed to your SharePoint farm, it will show up in the "Solution Management".

Clicking on a name of one solution will bring up the properties of the solution. You can see if it has been deployed and deploy it to other webapplications.

With the "Deploy Solution" Button, you can deploy the solution to one webapplication at a time.

Feature Activation

After a solution has been installed and deployed, you can activate the features containing the solution at the scope which it is designed for (see above).

Activation on Farm level

Activation on Web Application level

Make sure you choose the Web Application where you want to activate the feature!

Activation on Site Collection level

Some features require activation at the Site Collection level. This could be Webparts, which will put a .webpart file in the Webpart catalog, so you can easily add them to a page.

Activation on Web level

If the feature is designed to work on website level, you have to activate it in the "Site Administration" section of your "Site Settings".

 

I hope this post will clarify where to activate and how to install SharePoint Solutions J

Tags: SharePoint Feature Solution Deployment


Published: 8/31/2008  3:48 PM | 10  Comments | 0  Links to this post
Tagged as: SharePoint, Solution

Aug 272008

Implement an update check

You have developed a Webpart or some other program, and want the user to be able to check for updates?

In my case I want the user to check for updates for my Webparts.

If you click the "Check for updates" Button in the Webpart properties, the latest version from will be shown.

 

 

Set up an "Updates" list

To find the latest version, I have set up a SharePoint list with two fields. The title always exists. I renamed it to be "Assembly". The second column we need is the version. Here I store values which can be interpreted as a Version object.

This list has to be accessible for anonymous users. But how do we ask for the items in this list from "outside". My first thought was a webservice. SharePoint has its own build-in webservice. So let's just use the lists.asmx webservice, and get the item for our assembly.

Access the list from the internet

The problem is that the webservice cannot be used as an anonymous user. That is a shame. Because the items can be read by anonymous users without authentication (guess that is the most important point to anonymous users…).

So we write our own webservice. Or we can use the RSS feed from our updates list. This way we will not have to write a webservice, but can access the data anonymously from the internet.

Enable RSS

When we enable the RSS feed for our update list, we just check the "VersionNr" field to be included. The title will be included anyway. We will use a DataTable with ReadXml:

   1: public class Updates
   2: {
   3:     private readonly string _Assembly;
   4:     private readonly string _FeedUrl;
   5:     private string _ErrorText;
   6:  
   7:     /// <summary>
   8:     /// create updates class with an assemblyname
   9:     /// </summary>
  10:     /// <param name="assembly"></param>
  11:     public Updates(string assembly)
  12:     {
  13:         _Assembly = assembly;
  14:         _FeedUrl = "yourfeedurl";
  15:     }
  16:  
  17:     public Updates(string Assembly, string FeedUrl)
  18:     {
  19:         _Assembly = Assembly;
  20:         _FeedUrl = FeedUrl;
  21:     }
  22:  
  23:     /// <summary>
  24:     /// find lates version from rss feed
  25:     /// </summary>
  26:     /// <returns></returns>
  27:     public LatestVersion GetLatestVersion()
  28:     {
  29:         try
  30:         {
  31:             var ds = new DataSet();
  32:             ds.ReadXml(_FeedUrl, XmlReadMode.Auto);
  33:  
  34:             DataTable dt = ds.Tables["item"];
  35:             foreach (DataRow row in dt.Rows)
  36:             {
  37:                 if (Convert.ToString(row["title"]) != _Assembly) continue;
  38:  
  39:                 // we found our assembly
  40:                 string description = Convert.ToString(row["description"]);
  41:                 DateTime publishDate = Convert.ToDateTime(row["pubDate"]);
  42:  
  43:                 return new LatestVersion(description, publishDate, _ErrorText);
  44:             }
  45:             return new LatestVersion("No Versioninformation found.");
  46:         }
  47:         catch (Exception ex)
  48:         {
  49:             return new LatestVersion(ex.Message);
  50:         }
  51:     }
  52: }
 
The version is in the "description" column in our DataTable.
To get the latest version, we create an instance of the Updates class and call the GetLatestVersion function.
   1: var latest = new Updates("RH.MyAlerts");
   2: LatestVersion latestVersion = latest.GetLatestVersion();
 
That's it.

Tags:


Published: 8/27/2008  10:47 PM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint

Aug 242008

Hello, I am Nils

Saturday afternoon our son Nils was born. With 54cm and 3600g he is quite a boy. Mother and son are doing well.

 Nils


Published: 8/24/2008  4:57 PM | 2  Comments | 0  Links to this post
Tagged as: Sonstiges

Aug 162008

SharePoint and SQL Server 2008 support

Now it is official. Installing SharePoint with a SQL Server 2008 is supported (with the SharePoint Services SP1!)

See SQL Server 2008 Support for SharePoint Products and Technologies.

Technorati Tags: ,

Published: 8/16/2008  12:31 PM | 0  Comments | 0  Links to this post
Tagged as: SQL Server