Silverlight: Getting Started

Silverlight is not the easiest thing to get good at. In fact even if you are a seasoned .NET developer I would still call it a non trivial venture. Over at http://jesseliberty.com/2010/06/03/getting-started-with-silverlight-a-path-through-the-learning-material/ there’s a good short list on what to do if you want / or have to get into Silverlight development. Essentially he, Jesse Liberty, says:

“1. Go to the GetStarted page and download the components you need

2. Work your way through #1-5 in the “Start Learning Silverlight” section on that same page

3. Take a look at my Key Topic on Starting Silverlight (see the sidebar on the right)

4. Take a look at the Silverlight How-Do-I videos, picking subjects that seem interesting to you.

5. Join the forums, especially the Getting Started forum. They are the very best place to get fast answers. See my Note On Posting Questions On Forums.

Charting Data: Keeping it simple.

I see a lot on charting data in SharePoint, and out.

In my opinion it boils down to three things

  1. what have you got
  2. how did you get it
  3. how are you going to show it

The first two are data related and require some questions.

  • Is it flat data that can “just be charted”?
  • If not, what needs to be done?
  • Is it interactive?
  • If it is, in what way?
  • etc

The third can get complicated as it can delve into what one can only call, the aesthetics of the situation. Some people love pie charts with garish colours. Others simply cannot understand radar charts. One product that works very nicely, has lots of options, and has a nice cost at $0 under the GPL, is Visifire.

http://visifire.com/silverlight_charts_gallery.php

Visifire is a set of open source data visualization controls – powered by Microsoft® Silverlight™ & WPF. It is a multi-targeting control which can be used in both WPF & Silverlight applications. Using the same API, charts in both Silverlight & WPF environments can be created within minutes. Visifire can also be embedded in any webpage as a standalone Silverlight App. Visifire is independent of server side technology. It can be used with

  • ASP.Net
  • PHP
  • JSP
  • ColdFusion
  • Ruby on Rails
  • Simple HTML
  • Etc.
This control can be easily used to chart data in a list.

Let me show you how…

  • Upload the Visifire files to your SharePoint document library. Specifically, copy the VisiFire.xap and .js files into the document library that will hold your web part page.
  • Add a Data View web part for the list containing the data you wish to graph to the web part page using SharePoint Designer.
  • In the Code View, replace the line in the section with the following

Note:

  1. Columns in this example are @Budget and @Actual, update these if your list is different
  2. I have replaced “<" with "< " so that the code will get presented correctly in the browser

< type="text/javascript" src="Visifire.js" mce_src="Visifire.js">< /script>
< escaping="yes">< ![CDATA[ < type="text/javascript">
var xmlString =
‘ < vc="clr-namespace:Visifire.Charts;assembly=Visifire.Charts" theme="Theme2">‘
+ ‘ < text="Revenue">‘
+ ‘ < title="Month">‘
+ ‘ < title="$ Thousands">‘
+ ‘ < name="Budget" renderas="Column" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Budget">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < name="Actual" renderas="Line" color="Red" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Actual">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < /vc:Chart>‘;
< /script>
]]>< /xsl:text>
< !-- Create the div to hold the chart and then run -->
< !-- the JavaScript code to actually show the chart. -->
< id="myChart" style="width:500px;height:300px;">
< language="javascript" type="text/javascript">
var vChart2 = new Visifire(“Visifire.xap”);
vChart2.setDataXml(xmlString);
vChart2.render(“myChart”);
< /script> < /div>

Silverlight – What, when, where, how, and why

This is multi part post. Odds are I will just keep adding to it…

What
Microsoft Silverlight is a cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. I first noticed it appear via update in Q2 2008 on machines. It has an official site where you can learn and see what it can do here: http://silverlight.net/

When

Where

OS/browser IE 6 SP1 IE 6 SV1 IE 7 IE 8 Firefox SeaMonkey Safari Konqueror Opera Google Chrome
Windows Vista/2008 N/A N/A 1.0, 2.0, 3.0 1.0, 2.0, 3.0 1.0, 2.0, 3.0 1.0, 2.0 1.0, 2.0 N/A Unofficially 2.0
Windows XP/2003/Home Server N/A 1.0, 2.0, 3.0 1.0, 2.0, 3.0 1.0, 2.0, 3.0 1.0, 2.0, 3.0 N/A 1.0, 2.0; via N/A Unofficially 2.0
Windows 2000 2.0 N/A N/A N/A 2.0 Unofficially N/A 2.0; via N/A Planned N/A
Windows Mobile 6 2.0 N/A N/A N/A N/A N/A N/A N/A N/A N/A
Mac OS 10.4/10.5 PowerPC N/A N/A N/A N/A 1.0 N/A 1.0 N/A Planned N/A
Mac OS 10.4/10.5 Intel N/A N/A N/A N/A 1.0, 2.0 N/A 1.0, 2.0 N/A Planned N/A

How

Why

How solution deployment has changed development with SharePoint technologies

Background:

Anyone who is familiar with development & deployment of custom solutions on SharePoint Portal Server 2003 or Windows SharePoint Services will probably agree when I say there are certain areas lacking in the end to end process.

For example, here is a high level generic step by step process that usually happens:

  1. Spec written (some people seem to think this step is optional)
  2. Developer develops code etc… Usually on a stand-alone, single server SharePoint environment. (I personally use a VPC for all development these days)
  3. Developer packages code into an installer if you are lucky
  4. Testing
  5. Hand off to production people who go and install it on the server(s).

This would normally be really easy right? Well, in SharePoint land there are many areas where “things” need to be done during an installation. Some of these are (but not limited to):

  • Assembly deployment. GAC or BIN
  • Web.config changes. Additions to the safe controls list, CAS security policies,
  • Resource files like images,
  • Dwp files
  • Site definitions (list definitions etc…)

Depending on how your development team packaged these would depend on how much work you had to do to deploy them.

To make matters worse, depending on your physical SharePoint farm you might need to do install steps on each server. This brought in complexity around what servers had what versions at what time etc… A nightmare if you were managing a large farm with many servers.

How we make this better in MOSS and WSSv3:

In MOSS we have a good solution to all of this called the Solution Framework. Here is a little summary about what this is:

“The Windows SharePoint Services (WSS) solution framework provides a way to bundle together all of the components for extending SharePoint in a new file called a solution file (a CAB-based format with a WSP extension). A solution is a deployable, reusable package that can contain a set of features and site definitions, templates, Web Parts, and assemblies that you can apply to a site, and individually enable or disable.” – WSS SDK

Not only this but the Solution Framework takes care of deploying the solution to ALL front end web servers in the farm without the admin having to go to each box to do this manually!

You can:

  • Deploy the Solution package to the farm
  • Retract the Solutions package
  • When a new web server is added, automatically deploy the solution to it
  • Deploy new versions of the Solution

Practical example:

In the system I talked about in “Application Development on MOSS & WSSv3” we are using a Solution package to deploy:

  • A custom Site Definition
  • 6 Feature Definitions (another new MOSS technology) that are:
    • Custom Workflows x2
    • Timer Job
    • Content Type
    • Custom List definition
    • Custom Site Columns definition
  • Web part
    • SafeControls list entry

Note: I won’t talk about Features or how to create them; Todd has a good post on that subject here: http://www.sharepointblogs.com/tbaginski/archive/2006/06/02/8062.aspx

[Updated] This means when we want to deploy this solution to a new farm we simply use the STSADM -addsolution -filename to upload the solution to the farm. Once uploaded you can simply to into the “Solution management” section under the “Operations” tab in the Central Administration Site, and deploy that solution.

Once it is uploaded we can then choose to Deploy that solution.

This gives you options on when you want the deployment to take place and to what web applications. (In the shot above I had an assembly being deployed to the GAC, hence the warning)

Although all this will be/is documented in the WSS SDK, I thought I quickly go over how to make a solution file.

Consists of:

  • A CAB file containing
    • A Manifest.xml file
    • All the files for the Features etc… that make up your solution

Below is a cut down sample XML manifest.xml file for the example I used above (highlighted text is comments):

< ?xml version="1.0" encoding="utf-8" ?>
< xmlns="http://schemas.microsoft.com/sharepoint/" solutionid="{79d1a62e-3627-11db-963e-00e08161165f}" resetwebserver="TRUE">

<>
< deploymenttarget="GlobalAssemblyCache" location="Foo.Sharepoint.WebpartsFoo.SharePoint.WebParts.dll">
<>
< assembly="Foo.Sharepoint.Webparts, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=63cce650e8605f5d" namespace="Foo.Sharepoint.Webparts" typename="*">
< /SafeControls>
< /Assembly>
< deploymenttarget="GlobalAssemblyCache" location="Foo.Sharepoint.Timer/Foo.Sharepoint.Timer.dll">
< /Assemblies>

<>

< location="Foo.Sharepoint.TimerFeature.xml">

< location="Foo.CustomTypeFeature.xml">

< location="Foo.FooLibraryFeature.xml">

< location="Foo.ColumnsFeature.xml">

< location="Foo.Workflow.ProcessFooFeature.xml">

< location="Foo.Workflow.ProvisionFooFeature.xml">

< /FeatureManifests>

<>
< location="FOO">
< location="1033XMLWEBTEMPFoo.XML">
< /SiteDefinitionManifest>
< /SiteDefinitionManifests>
< /Solution>

Then you package this up along with all your Feature files into a CAB file with a “.wsp” extension. In short each feature goes into a sub-dir in the CAB that matches the path you have in the Manifest.xml file. You can use cabmake.exe to do this, or any other tool you like.

Then you are ready to go and deploy!

Although this is probably a little more work to begin with, your deployment team will thank you for it immensely.

WSRP Toolkit for SharePoint: Aka render SharePoint data natively from BEA AquaLogic Portal, IBM WebSphere Portal, SAP NetWeaver Enterprise Portal etc.

The WSRP Toolkit for SharePoint provides sample code for producing WSRP conformant data from SharePoint lists and libraries. External portal platforms (e.g. BEA AquaLogic Portal, IBM WebSphere Portal, SAP NetWeaver Enterprise Portal etc.) can then render SharePoint data natively through their WSRP consumer portlets. The Toolkit is available now for download from the MSDN Code Gallery.

Specifically it consists of

  1. Visual Studio sample projects that demonstrate two different approaches to producing WSRP conformant output from SharePoint lists and libraries
  2. A whitepaper that provides details on the different architectural approaches of the two WSRP producer samples
  3. Screen casts showing the two WSRP producer samples in action

Of course WSRP is just one of many options available to support portal interoperability and Microsoft continues to invest in open standards for interoperability including XML based web services, CMIS, Office Open XML, RSS and REST. Microsoft is also investing heavily in Silverlight, designed to deliver rich user experiences and applications across multiple platforms. For more details on the SharePoint interoperability story, visit the TechNet Office SharePoint Server Interoperability TechCenter.

DeepEarth: Silverlight 2.0 + Virtual Earth + DeepZoom / Seadragon

DeepEarth, a new Silverlight 2.0 mapping control, provides developers with the ability to use the Virtual Earth mapping elements in their own web applications. So what you ask? Well tt has been combined with DeepZoom, essentially Microsoft’s Seadragon technology converted for use across multiple browser and platforms… For those not in the know, Seadragon aims to make browsing images, no matter how large or how many, a speedy, seamless, and smooth experience. Deep Zoom has been put to use by a few companies, like the Hard Rock Café Memorabilia webpage.

Version 1.0 of DeepEarth was recently released with the following:

  • Fully implemented map control with property and event model
  • Fully templated set of map navigation controls
  • Layers for inclusion of Points, LineStrings and Polygons (OGS)
  • Conversion library for geography to screen coordinate systems
  • Geocoding (find an address)
  • Reverse Geocoding (getting an address from a point on the map)
  • Routing (Directions)
  • Marque zoom selection (default Ctrl-click and drag or from menu toggle)
  • Map rotation
  • Provides imagery as tile layers, a robust Virtual Earth implementation supporting the
  • official token-based tile access and web services

Now if the above video fails to sway you scoot over to the working version of DeepEarth that you can try out if you have Silverlight installed. The DeepEarth bits are available on Microsoft’s open source website, CodePlex. You’ll also need a Virtual Earth Developer Account and, if you want to get rid of the “Staging” watermark, you’ll need to send an e-mail to the Virtual Earth Licensing Team. Version 2.0 is slated for a February 2009 release.

Microsoft BizSpark – Starting up Start-Ups

Recently Microsoft announced BizSpark, a new program targetted at start-ups. It gives you access to the latest and greatest versions of SQL, VS, and Microsoft Support for a very good price. Zero dollars. In order to stem abuse there is a need for “sponsorship”. Specifically you need to belong to one of the organizations listed during signup. Other than that requirement it is a suprisingly easy process. Once in you get for three free, yes 3 and free, years:

Software

  • All the software included in the Visual Studio Team System Team Suite (VSTS) with MSDN Premium subscription Expression Studio (Version 2), plus VSTS Team Foundation Server Standard Edition – for the entire development team
  • Production license use rights, to deploy, host and support Startup’s “software as a service” applications for delivery over the Internet, using the following products: Windows Server (all versions), SQL Server (all versions), BizTalk Server, and Office SharePoint Server for hosting; and Systems Center for managing hosting server operations.

Support

  • Guidance, resources and mentoring provided by Network Partners, active members of the global software ecosystem who are qualified to provide support and advice to Startups
  • Access to MSDN Premium: managed newsgroups, online library, online concierge, etc.
  • Two technical support Incidents per Startup

Visibility

  • Each BizSpark Startup will have the opportunity to profile their company in the BizSparkDB, an online Startup directory, hosted on the Microsoft Startup Zone web site. Startups will get exposure to potential investors, partners and customers around the world.
  • Opportunity to be highlighted on the BizSparkDB as a featured company and be promoted as BizSpark Company of the Week on the Microsoft Startup Zone website.

    How to qualify?
    If you meet these three simple criteria, you can sign-up today:

  • Actively engaged in development of a software-based product or service that will form a core piece of its current or intended business[1],
  • Privately held, and in business for less than 3 years[2], and
  • Less than US $1 million in annual revenue[3].

To get in follow these steps:

1) Go to http://www.microsoft.com/bizspark/ and click “Join BizSpark now!”

2) Sign in with your Live ID or create a new Live ID

3) Click the “I Accept” check boxes, and enter your enrollment code (If you don’t already have a sponsor, contact Bill and he’ll help you get started! Btw, that’s where these steps came from!!!)

4) Provide some basic information about your start-up

5) Identify your primary contact

6) You’re done!!! Now you can manage your BizSpark account from here. Note your BizSpark Subscription ID, one of the things you’ll want to do next is activate your MSDN subscription using this ID. You’ll need to do this in order to start downloading the software.

7) To activate your MSDN subscription, visit https://msdn.microsoft.com/en-us/subscriptions/add/default.aspx and enter your name, email and the BizSpark subscription ID from the previous page, click the “I acknowledge and accept” checkbox and submit ‘OK’. (Note, it may take 4-6 hours for your MSDN subscription to become available after signing up for your BizSpark account. If MSDN doesn’t find your subscription, check back later.

8) Once you’re up and running you may want to find a Windows hoster who can work with you and your production use licenses to offer your low-cost, discounted hosting services. Through the BizSpark Start-up page you can click the “Manage Hoster Relationship” and find hosters in your country which are part of the program.

SmartTools.Charts

Jan Tielens posted a rather nice example for charting with Silverlight in SharePoint 2007 over at: http://weblogs.asp.net/jan/archive/2008/12/04/3d-silverlight-charts-in-sharepoint-smarttools-charts.aspx

In essence he created a component that contains a web part that can show charts rendered by making use of the open source Silverlight control created by Visifire


SmartTools.Charts from Jan Tielens on Vimeo.