Silverlight + Virtual Earth = Genial!

Ich hab mal ausnahmsweise ein bisschen Zeit gehabt um ein paar neue / nicht mehr ganz so neue Technologien anzusehen und auszuprobieren.

Da ich ja nun doch schon seit einiger Zeit meine halbwegs aktuelle Position per Virtual Earth auf woist.mwiedemeyer.de visualisiere und es seit kurzem ein Virtual Earth Silverlight Control gibt, ist es wie geschaffen, um endlich einen ernsthafteren Einstieg in Silverlight 2 zu starten.

Das interactive SDK ist wirklich genial und die Bedienung ist super einfach. Zumindest dann, wenn man bereits ein wenig WPF oder Silverlight Erfahrungen gesammelt hat.

Beispiel:

Man möchte in einer Silverlight Anwendung einfach nur die gesamte Karte darstellen. Dazu reicht es das Map Control zur Seite hinzuzufügen:

<UserControl x:Class="VirtualEarthSilverlightTest.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:m="clr-namespace:Microsoft.VirtualEarth.MapControl;assembly=Microsoft.VirtualEarth.MapControl"
    Width="800" Height="600">
    <Canvas x:Name="LayoutRoot" Background="White">
        <m:Map Name="MyMap"></m:Map>
(...)

Um per code einen Pin (oder jedes andere UIElement, z.B. auch Bilder, Videos, etc.) auf der Karte an einer bestimmten Position anzuzeigen, reicht folgender code:

// Neuen MapLayer hinzufügen um Elemente an Locations anzuzeigen
MapLayer mapLayer = new MapLayer();
MyMap.Children.Add(mapLayer);
// Beliebiges UIElement (Canvas, Border, etc) an der Position latitude, longitude anzeigen
mapLayer.AddChild(anyUIElement, new Location(latitude, longitude));

Ich habe für einen ersten Versuch mal den letzten Urlaub in die Silverlight Karte eingefügt. Hier gibts das ganze nun zu sehen:

http://woist.mwiedemeyer.de/silverlight

UPDATE:

Was ich an der Stelle noch vergessen habe zu erwähnen: Es funktioniert nicht nur im Internet Explorer, sondern auch in Opera (und natürlich auch Firefox…)!

SharePoint Designer ab sofort kostenlos

Der SharePoint Designer 2007 wird seit dem ersten April (nein kein Aprilscherz) kostenlos angeboten!

Kunden, die den SharePoint Designer gekauft haben, dürfen nun kostenlos auf Expression Web upgraden.

Auch wenn ich übrigens durchaus der Meinung bin, dass der SharePoint Designer einen der oberen Plätze bei Dreckstool.de verdient hätte, ist er manchmal ja leider doch ganz nützlich. ;-)

K2 blackpearl: Command-line deployment hangs

I tried to deploy a K2 blackpearl process (developed and tested on server DEV in domain A) to a test environment (server TEST, domain B) via the command line, but it freezes at some stage.

Normally you could deploy a process from within Visual Studio with a click on “Deploy”. Then you will get a wizard to choose your environment. If your environments are not on the same domain, K2 blackpearl supports the deployment through the command line.

In Visual Studio right click on the process and select “Create Deploy Package”. After it finishes, you will find some files in the obj\Debug folder. One file is a .msbuild file.

I copied all files, as mentioned in the K2 docu, to the target machine and fired up:
msbuild MyProcess.msbuild /p:Environment=Test

First, it looks good, because my InfoPath form was deployed to the SharePoint site, then the console showed the following lines:

Deploy Processes: Task Started (26.02.2009 17:00:00)
Adding Process : MyProcess\Demo1

Nothing more! I waited about 30 minutes, but nothing happened, no error messages, nothing.

Long story short: The solution is, that the value of the “SharePoint Target Site” environment field MUST end with a “/” (e.g. “http://mossServer/targetSite/”)! You can change this within Visual Studio in the Environment Browser or directly in the .msbuild file.

No more comments…

Windows 7 und OpenSearch

Eine sehr coole Neuerung in Windows 7 ist, dass OpenSearch in den Explorer integriert ist.

So kann man eine einfache Textdatei erstellen und diese in *.osdx umbenennen. Der Inhalt ist einfaches XML. Hier das ganze mal für mein Blog: marcos blog search.osdx

Nach dem download einfach die OSDX Datei doppelklicksen und schon hat man mein blog in die Windows Search integriert. Und so siehts aus wenn man nach “sharepoint” sucht:

osdx search

Das ganze kann man natürlich leicht anpassen und für diverse Seiten einbauen.

Chris Pirillo hat das ganze schon mal für Amazon, eBay, etc hier gemacht, dort gibts auch ein ZIP file mit einigen search connectors.

AutoHistory for Word 2007

I’ve created a new little tool, which is called AutoHistory (for Word 2007).

I got the inspiration from Visual Local History for Visual Studio. This tool automatically creates a backup every time you save a file.

AutoHistory now provides the same functionality within Word 2007. Everytime you save your document (and something has changed), a backup is created.

From now on you will never lost important information. You can restore every version you’ve ever saved, even if you do not use a version control system (like Team Foundation Server or Subversion).

This tool is fully integrated in Word 2007 within the View Ribbon:

 image

If you check the checkbox you will see all saved versions of the current document:

image

Within this taskpane you can easily view and restore every version.

You can download the setup from here: http://mwiedemeyer.de/downloads/AutoHistory/AutoHistorySetup.zip

Please feel free to drop me a line, if you have any questions or suggestions: mail at mwiedemeyer dot de.

The file is not checked out. You must first check out this document before making any changes.

If you ever got this message and don’t know where it came from, here is the solution.

I got it if I click on “Edit Page” on a publishing page. So after some investigation it seems to be a problem with the web parts on the page.

My page layout contains some EditModePanels, so the user have different views in display and edit mode of the page. Therefore we also have one web part in a web part zone which is in one of the EditModePanels for display only.

<PublishingWebControls:EditModePanel PageDisplayMode="Display">
  <WebPartZone ID="zone1" ...>
      the web part added through the onet.xml site definition

The same web part zone “zone1” does not exists for editing, because I do not want the user to edit the web part. There is another web part zone “zone2” which lives outside of any EditModePanel.

Now comes SharePoint.

If you check out the page and then click on “Edit Page”, everything is working. Except of, that the web part from zone 1 has moved to zone 2! Automatically! Thank you SharePoint…

It seems that SharePoint think it has to show the web part in edit mode. And because the original web part zone is not visible, SharePoint moves the web part to the next available zone which is visible also in edit mode.

So remember:

Never put a web part zone in an EditModePanel which is only visible in display mode.

Maybe the solution is to make the web part not editable, but I didn’t tested this. My fast workaround hack is to create a div instead of the EditModePanel and makes it “runat=server” and give it an ID. Then I wrote this code on top of the page:

<script runat="server">
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    this.navleftdiv.Visible = (this.SPWebPartManager1.DisplayMode == WebPartManager.BrowseDisplayMode);
}
</script>

Now it works like a charm.

Publish a page with onet.xml as “published”

If you ever tried to publish one or more pages with your site definition (by onet.xml), you see in Visual Studio (with the SharePoint XSD schemas selected) only one valid value for the “Level” attribute which is “Draft”:

image

But for this attribute you can choose between every value of the SPFileLevel enum. So for publishing the page automatically, set the Level to “Published”. Thats it.

If you already know how to enable XSD schema validation and IntelliSense support stop reading here.

Enable Schema Validation:

  1. Open your xml file, e.g. onet.xml (works with all SharePoint related xml files)
  2. In the property pane, click the ellipsis next to the “Schemas” property
  3. Add the wss.xsd. This file is located in the 12\Template\XML directory
  4. Now add the following xml Namespace attribute to the root element (here Project in onet.xml):
  5. <Project xmlns="http://schemas.microsoft.com/sharepoint/" Title="" [...]
    

Now you should have IntelliSense and schema validation enabled.

SharePoint Page Version History without Web Parts

Today I found a version history “bug” in SharePoint publishing pages:

The version history system of SharePoint covers only Page Fields, but not Web Parts.

In detail:

  • Create a new page (e.g. “Blank Web Part Page”) within a publishing web.
  • Now add text and a Web Part. Save changes and check-in.
  • Check out and change the text and some properties of the Web Part.
  • After that, check-in again, and open the “Version History”

If you now try to recover the first version, it seems to work, but only the page fields are recovered. The Web Part is always the latest version, because the Web Parts are saved in a totally different location, so they are not covered by the version history system.

Lets have a look on a cool solution:
Garry Lapointe created a web feature which replaces the version history system and saves a whole page with all Web Parts on every check-in through an Event Receiver on the Pages list.
The version is Alpha 0.0.1 but it is working very well, so download it from codeplex.

Telerik RadEditor for SharePoint: Problem with custom tools

The RadEditor for MOSS 2007 version 4.5.3.0 has a Bug, which is very annoying...

You create a new custom tool in the ToolsFile.xml and set the “showtext” property.

<tool name="CustomToolName" showtext="true" /> 

Then you create a corresponding javascript method in the RadEditorCommandList.

RadEditorCommandList["CustomToolName"] = function(commandName, editr, oTool)
{
  (...)
}

If you now click on this new Tool Button, the RadEditor shows the message “Could not find the command xxx. Please update your command list.”

radeditor_error

The solution for that: Remove the “showtext” property from your tool in the ToolsFile.xml and everything is working as expected.