Un Workflow (Flujo de Trabajo) tiene por objetivo ser un modelo de un proceso de negocio (o producción) e implica un conjunto de actividades (tareas) que se aplican y operan en forma progresiva. El Workflow describe el orden de ejecución y las relaciones de dependencia entre las distintas activdades para que estas trabajen progresivamente a través de un modelo desde un inicio a un fin. Estas son actividades realizadas por las personas en forma manual y/o con el apoyo de funciones del sistema. 

 El Motor de Workflow en “Tiempo de Ejecución” (Runtime)

Cada instancia de un workflow en ejecución es creada y mantenida en tiempo de ejecución por un motor que actúa en el domino de proceso de una aplicación determinada (in-process runtime engine) y que la da albergue. Pueden existir varios procesos en ejecución dentro del dominio de proceso de una aplicación, cada instancia del motor en ejecución puede soportar multiples instancias de workflow que se ejecutarán de modo concurrente y podrán orquestar un conjunto de tareas o actividades.

Cuando un módulo de workflow se compila, este puede ser ejecutado “dentro” de cualquier proceso Windows, incluyendo una aplicación de consola, aplicaciones basadas en formularios, Servicios Windows, Sitios Web de ASP.NET, y Servicios Web, entre otros, como por ejemplo, los workflows que podemos ejecutar dentro de los procesos de SharePoint (independientemente de su versión). A este proceso lo llamamos “hosted” (alojados) en proceso, la idea es que el flujo de trabajo pueda comunicarse facilmente con la aplicación que le da alojamiento.

Asi por ejemplo, un workflow asociado a una biblioteca de documentos de SharePoint puede comunicarse a través de eventos con la instancia de la biblioteca de SharePoint que le da alojamiento (con la que se vincula). Si el vinculo se pierde estas piezas de software ya no podrían comunicarse entre sí.

Estudiando la ilustración siguiente podemos comprender esquemáticamente como se realiza este proceso de alojamiento (hosting), cual es el orden en que se comunican y se determinan entre si las distintas piezas de software que los desarrolladores construimos. 

Aa349006.44c79d1d-178b-4487-87ed-3e33015a3842(en-us,VS.90).gifEn particular, respecto de SharePoint, podemos construir estas piezas de software básicamente con 3 herramientas.

1.- SharePoint Designer (una herramienta poderosa y muchas veces insustituible, seguramente con la versión 2010 lo seguirá siendo, es recomendable aprender a usarla, para un desarrollador que espera avanzar en profundidad y amplitud el peor error que puede cometer es despreciar su utilidad.)

2.- Visual Studio (2005, 2008 y ahora 2010, siempre mejorando e imprescindible a la hora de tener que satisfacer requerimientos sofisticados por parte de nuestros queridos clientes. Un programador no puede olvidar jamás esa máxima de la economía que dice: el cliente siempre tiene la razón. Y todo es posible, solo son horas sillas, algunos dolores de cabeza, pero siempre mas tiempo y costos más elevados..je..je.. cada quien paga su propio costo…je..je.je.., nosotros dispuestos a la esclavitud de la silla, y nuestros clientes a decidir entre tiempo y costos, ROI y TCO… en fin Anton Pirulero… cada cual atiende su juego.. es la moraleja.)

3.- Herramientas de Terceros. De estas hay varias en el mercado, distintas en funcionalidades y costos, la herramienta de mejor relación costo-funcionalidades es sin duda Kaldeera.

Un par de links al respecto.

Kaldeera Diseñador de Workflows.

Y el sitio de Tito… Aquí.

Para Workflow en el MSDN pulse acá.

Esperando que les sea útil, y por supuesto esperando quejas, contribuciones, insultos, etc…je..je..

Un abrazo

Rolando

Click on pen to Use a Highlighter on this page

Microsoft Visual Studio Learning Pack 2.0

Una muy importante herramienta que tenemos que tener a mano:

Descripción rápida
Microsoft Visual Studio Learning Pack 2.0
Microsoft Visual Studio Learning Pack 2.0 es un paquete de software creado por Microsoft para ayudar a los estudiantes a aprender programación.
Descargala Aqui.

Información general

Microsoft Visual Studio Learning Pack 2.0 es un paquete de software creado por Microsoft para ayudar a los estudiantes a aprender programación. Consta de los cinco componentes que se describen a continuación.
  • Control de Diseño de ordenamientos (Sort Designer) es una herramienta de enseñanza complementaria desarrollada para ayudar a los estudiantes a aprender los conceptos básicos, algoritmos e implementaciones de algoritmos populares de ordenamiento. Soporta burbujas y ordenamiento de inserción. El control genera valores iniciales automáticamente y demuestra estados intermedios en el proceso de ordenamiento. También genera código fuente de ordenamiento para Visual Basic y C#.
  • Control de Diseño de búsquedas (Search Designer) es una herramienta de enseñanza, desarrollada para ayudar a los estudiantes a aprender los conceptos básicos, algoritmos, e implementaciones de algoritmos de búsqueda de datos conocidos. Es compatible con búsquedas binarias y secuenciales. El control genera valores iniciales automáticamente y demuestra estados intermedios en el proceso de búsqueda. También genera código fuente para Visual Basic y C#.Mediante los controles de Diseño Visual de búsqueda y ordenamiento, los profesores pueden fácilmente desarrollar programas de ejemplo para demostrar los fundamentos de ordenamiento y búsqueda. También pueden personalizar la apariencia del control simplemente arrastrando el mismo en un formulario y estableciendo sus propiedades. Estas presentaciones visuales ayudan en la enseñanza de conceptos de programación y aumentan el interés de los estudiantes en el aprendizaje.
  • Diseñador Declarativo Visual (Visual Declarative Designer) es una herramienta de declaración de variables intuitiva, diseñada para programadores principiantes. Durante el proceso de codificación, el estudiante puede declarar variables de diversos tipos y generar el código fuente correspondiente. El diseñador Visual de declaraciones de variables ofrece un enfoque visual para la Declaración de variables. Los profesores en el campo de tecnología de información (IT) pueden utilizar este diseñador para enseñar a los estudiantes los conceptos básicos de la Declaración de variables y nombres, tipos de variables, modificadores de acceso y valores iniciales.
  • Assistente de Diseño de Clases (Assistant Class Designer) es un diseñador visual de clases para los programadores principiantes. Este diseñador guía a los estudiantes a través de los procesos de generar las clases, propiedades, métodos y eventos. El diseñador también genera el código fuente correspondiente de las nuevas clases. Mediante este diseñador, profesores y alumnos pueden fácilmente crear y configurar clases complicadas. El asistente de diseño de clases proporciona un método interactivo e intuitivo para diseñar las clases y ayuda a los estudiantes a comprender conceptos clave de programación orientado a objetos, como las clases de encapsulación, herencia y Ayudante de diseño de polimorfismo de clases.Genera código fuente sólo para C# .
  • Programación Visual de Diagramas de Flujo (Visual Programming Flow Chart) una herramienta de enseñanza complementaria que pretende ayudar a entender el programa de control de flujo. Se generan gráficos de flujo de funciones y se guardan en formato de imagen JPG. Esta herramienta se activa fácilmente desde el entorno integrado de desarrollo (IDE) de Visual Studio, simplemente haciendo doble clic en un nombre de función y seleccionando “generar diagrama de flujo” en el menú contextual. El diagrama resultante puede personalizarse cambiando sus colores y otros efectos. Esta herramienta visual ofrece una manera intuitiva para explorar el código fuente, examinar su flujo de control y para identificar los errores de lógica.

Requisitos del sistema

  • Sistemas operativos compatibles: Windows Vista; Windows XP

Instrucciones

Installation

1. En primer lugar descomprima el archivo zip (VSLPSetup.en.zip) que descargó y busque el archivo VSLPSetup.en.msi. (En forma predeterminada, este paquete se descomprime en el directorio de VSLPSetup.en. Tenga en cuenta que las extensiones .zip y .msi pueden no aparecer en forma predeterminada para algunos usuarios.)
2. Ejecute el archivo VSLPSetup.en.msi, y complete la instalación. El directorio predeterminado es \Program Files\Microsoft Visual Studio Learning Pack 2.0\.

Agregando los diseñadores de Ordenamiento (Sort Designer) y de Búsqueda (Search Designer) en la caja de Herramientas

Debe agregar el diseñador de búsqueda (Search Designer) y diseñador de ordenamiento (Sort Designer) a la caja de herramientas para poder utilizarlas en aplicaciones.
1. Inicie Visual Studio.
2. Seleccione “Herramientas” en el IDE de Visual Studio.
3. Haga Clic en “Agregar elementos” en el menu contextual.
4. En el cuadro de diálogo, haga clic en el botón “Buscar” en la ficha “Componentes de Framework .NET”.
5. En el dialogo de Abrir archivo navegue al directorio de instalación (\Program Files\Microsoft Visual Studio Learning Pack 2.0\ en forma predeterminada) y haga clic en “Abrir”.
6. Abra el directorio “Visual Search Designer Control”.
7. Haga doble clic en el archivo SearchDesigner.dll, seleccione SearchDesigner vuelva a la opción “Agregar elementos”.
8. Haga clic nuevamente en el botón Abrir y navegue al direcgtorio del paso 5.
9. Abra el directorio”Visual Sort Designer Control”.
10. Haga doble clic en el archivo SortDesigner.dll, seleccione SortDesigner and vuelva a la opción “Agregar elementos”.
11. Haga clic en el botón “Aceptar”. Los controles de dciseño de búsquedas y ordenamientos estarán disponibles en la caja de herramintas.

Espero les sea de gran utilidad….
Un abrazo
Rolando
Click on pen to Use a Highlighter on this page
Tagged with:
 

Author: Tobias Zimmergren
http://www.zimmergren.net

Introduction

Alright. People have approached me lately and asked me if I could give them a brief introduction to the WSPBuilder extensions available for Visual Studio. Instead of taking all those discussions on one by one, I’ve decided to document some of the main features here. If I’m missing out on something, please let me know and I’ll fill it up.

Bil Simser did a survey with the SharePoint MVP’s and summarized the foremost favorite CodePlex projects in this article. 

In this article I will cover one of my favorite tools – WSPBuilder.

WSPBuilder background

A SharePoint Solution Package (WSP) creation tool for WSS 3.0 & MOSS 2007
No more manually creating the manifest.xml file
No more manually specifying the DDF file
No more using the makecab.exe application

Carsten Keutmann, an MVP and friend in Copenhagen is the brilliant mind behind this awesome application.

The idea behind the WSPBuilder add-in for Visual Studio is that it’s based on any normal “Class library” template – which means that you can easily copy your entire WSPBuilder project to a machine that doesn’t have WSPBuilder and still be able to open the project. – This is something you can’t do with a lot of other extension tools (say, the VSeWSS for example)

WSPBuilder Installation

Just download the latest release of the “WSPBuilder Extensions – Visual Studio Addin” and let the installation guide take you through the most simple process ever – clickety click.

Creating a WSPBuilder project

When you have installed the add-in to Visual Studio, you should now be able to create a new project based on the “WSPBuilder” template.

To kick this off, let’s create our WSPBuilder project:
image

Note: You don’t have to create a WSPBuilder template, you can create a normal Class Library as well. The only thing about a WSPBuilder template is that it will automatically create the “12″ folder along with a temporary strong-key so you don’t have to do that right now.

When you’ve created the project, you’ll see a structure like this one in your solution explorer:
 image

The WSPBuilder will create the 12-folder, since it’s good practice to start your projects from the 12-root. It will also add the file “solutionid.txt” which contains a GUID to be used on the .wsp package, for easy reference. You will also get a strong-key generated for you so you don’t have to worry about signing your project right now.

Alright, now that we’re up and running with a blank WSPBuilder project – we should start by adding something to the solution.

WSPBuilder Templates – Overview

In an ordinary fashion, right click on the project and choose Add – New item.
image

Choose the “WSPBuilder” node and you will see an overview over the available templates like this:
image

Let’s walk through each and every one of them! The joy! :-)

Blank Feature Template Overview

A blank feature does exactly what the name implies, it creates a blank feature for you!

I’m creating a blank feature, and naming it to “BlankFeature1” so we easily can distinguish it from the other folders created later on.

With WSPBuilder, when you create a new item based on a template, you’ll get a dialog asking you for some variables – and since this is a feature, it’s going to need a Title, Description and of course a Scope:
image

Your solution tree will be populated with a few new things, in this case the BlankFeature1 that we chose to create:
image

As you will see, you get not only the perfectly correct 12-hive structure – you will also get the feature.xml and elements.xml files created for you, and the feature.xml file can look like this:

<?xml version=”1.0″ encoding=”utf-8″?>
<Feature  Id=”8e039720-d7df-460a-8d65-c52e47417fdf”
          Title=”BlankFeature1″
          Description=”Awesome description for BlankFeature1″
          Version=”12.0.0.0″
          Hidden=”FALSE”
          Scope=”Web”
          DefaultResourceFile=”core”
          xmlns=”http://schemas.microsoft.com/sharepoint/”>
  <ElementManifests>
    <ElementManifest Location=”elements.xml”/>   
  </ElementManifests>
</Feature>

Event Handler Template Overview

With the Event Handler item template, you will not only get the correct 12-structure in your solution – you will also get the reference to “Microsoft.SharePoint.dll” added automatically, since an event handler requires some talking to the SharePoint Object Model.

We will get our feature.xml and elements.xml as normal – but this time the elements.xml is pre-populated with some tags to hook up our event handler:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
  <Receivers ListTemplateId=”100″>
    <Receiver>
      <Name>AddingEventHandler</Name>
      <Type>ItemAdding</Type>
      <SequenceNumber>10000</SequenceNumber>
      <Assembly>Zimmergren.SharePoint.Demo.WSPBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b7201b5590fd1fc0</Assembly>
      <Class>Zimmergren.SharePoint.Demo.WSPBuilder.EventHandler1</Class>
      <Data></Data>
      <Filter></Filter>
    </Receiver>
  </Receivers>
</Elements>

As you can see, the elements.xml file is referring to the assembly called Zimmergren.SharePoint.Demo.WSPBuilder and a class called EventHandler1.

With the magic of WSPBuilder, this class has of course also been created for us and will look something similar to this:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace Zimmergren.SharePoint.Demo.WSPBuilder
{
    class EventHandler1 : SPItemEventReceiver
    {
        public override void ItemAdded(SPItemEventProperties properties)
        {
            base.ItemAdded(properties);
        } 

        public override void ItemAdding(SPItemEventProperties properties)
        {
            base.ItemAdding(properties);
        } 

        public override void ItemUpdated(SPItemEventProperties properties)
        {
            base.ItemUpdated(properties);
        } 

        public override void ItemUpdating(SPItemEventProperties properties)
        {
            base.ItemUpdating(properties);
        } 
    }
}

Solution Installer Configuration

If you’ve ever used the SharePoint Installer from CodePlex, you know that when you want to use it with your own .wsp file you need to do some adjustments to the configuration xml.

With the Solution Installer Configuration template you will get this configuration automatically created and hooked up with your project. The Setup.exe.config file might look like this:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<configuration>
  <appSettings>
    <add key=”BannerImage” value=”Default”/>
    <add key=”LogoImage” value=”None”/>
    <add key=”EULA” value=”EULA.rtf”/>
    <add key=”SolutionId” value=”6e23b11d-8460-49a0-b2f1-b8aa78d7c58d”/>
    <add key=”FarmFeatureId” value=”bb1586eb-3427-483b-baa5-ae5498c47d69″/>
    <add key=”SolutionFile” value=”Zimmergren.SharePoint.Demo.WSPBuilder.wsp”/>
    <add key=”SolutionTitle” value=”Zimmergren.SharePoint.Demo.WSPBuilder”/>
    <add key=”SolutionVersion” value=”1.0.0.0″/>
    <add key=”UpgradeDescription” value=”Upgrades {SolutionTitle} on all frontend web servers in the SharePoint farm.”/>
    <add key=”RequireDeploymentToCentralAdminWebApplication” value=”true”/>
    <add key=”RequireDeploymentToAllContentWebApplications” value=”false”/>   
  </appSettings>
</configuration>

Web Part Feature

This is by far one of the most popular templates, as it crates a generic template for your web part and also creates the feature for provisioning the Web Part to the Web Part Gallery.

You will get the elements.xml file configured something like this:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
  <Module Name=”WebPartPopulation” Url=”_catalogs/wp” RootWebOnly=”TRUE”>
    <File Url=”WebPartFeature1.webpart” Type=”GhostableInLibrary”>
      <Property Name=”Group” Value=”MyGroup”></Property>
      <Property Name=”QuickAddGroups” Value=”MyGroup” />
    </File>
  </Module>
</Elements>

and you’ll get the required .webpart file configured something like this:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<webParts>
  <webPart xmlns=”http://schemas.microsoft.com/WebPart/v3″>
    <metaData>
      <type
        name=”Zimmergren.SharePoint.Demo.WSPBuilder.WebPartFeature1,
        Zimmergren.SharePoint.Demo.WSPBuilder,
        Version=1.0.0.0,
        Culture=neutral,
        PublicKeyToken=b7201b5590fd1fc0″ />
      <importErrorMessage>
            Cannot import WebPartFeature1 Web Part.
      </importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name=”Title” type=”string”>WebPartFeature1</property>
        <property name=”Description” type=”string”>
            Description for WebPartFeature1
        </property>
      </properties>
    </data>
  </webPart>
</webParts>

and you will get the WebPartFeature1.cs file created automatically (or whatever you choose to name it) and it usually look like this:

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;

namespace Zimmergren.SharePoint.Demo.WSPBuilder
{
    [Guid("a043d73d-7418-4918-baed-828a2bc77019")]
    public class WebPartFeature1 : Microsoft.SharePoint.WebPartPages.WebPart
    {
        private bool _error = false;
        private string _myProperty = null; 

        [Personalizable(PersonalizationScope.Shared)]
        [WebBrowsable(true)]
        [System.ComponentModel.Category("My Property Group")]
        [WebDisplayName("MyProperty")]
        [WebDescription("Meaningless Property")]
        public string MyProperty
        {
            get
            {
                if (_myProperty == null)
                {
                    _myProperty = “Hello SharePoint”;
                }
                return _myProperty;
            }
            set { _myProperty = value; }
        } 

        public WebPartFeature1()
        {
            this.ExportMode = WebPartExportMode.All;
        } 

        /// <summary>
        /// Create all your controls here for rendering.
        /// Try to avoid using the RenderWebPart() method.
        /// </summary>
        protected override void CreateChildControls()
        {
            if (!_error)
            {
                try
                { 

                    base.CreateChildControls(); 

                    // Your code here…
                    this.Controls.Add(new LiteralControl(this.MyProperty));
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }
        } 

        /// <summary>
        /// Ensures that the CreateChildControls() is called before events.
        /// Use CreateChildControls() to create your controls.
        /// </summary>
        /// <param name=”e”></param>
        protected override void OnLoad(EventArgs e)
        {
            if (!_error)
            {
                try
                {
                    base.OnLoad(e);
                    this.EnsureChildControls(); 

                    // Your code here…
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }
        } 

        /// <summary>
        /// Clear all child controls and add an error message for display.
        /// </summary>
        /// <param name=”ex”></param>
        private void HandleException(Exception ex)
        {
            this._error = true;
            this.Controls.Clear();
            this.Controls.Add(new LiteralControl(ex.Message));
        }
    }
}

Web Service Template

The following files will be automatically created for you:

  • 12\LAYOUTS\WebService1.asmx
  • WebServiceCode\WebService1.cs

WebService1.asmx may look like this:

<%@ WebService Language=”C#”
Class=”Zimmergren.SharePoint.Demo.WSPBuilder.WebService1,
Zimmergren.SharePoint.Demo.WSPBuilder,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=b7201b5590fd1fc0″  %>

WebService1.cs may look like this:

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace Zimmergren.SharePoint.Demo.WSPBuilder
{
    [WebService(Namespace = "http://schemas.microsoft.com/sharepoint/”>
  <ElementManifests>
    <ElementManifest Location=”elements.xml”/>
  </ElementManifests>
</Feature>

FeatureWithReceiver1.cs might look like this:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace Zimmergren.SharePoint.Demo.WSPBuilder
{
    class FeatureWithReceiver1 : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            throw new Exception(“The method or operation is not implemented.”);
        } 

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            throw new Exception(“The method or operation is not implemented.”);
        } 

        public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        {
            throw new Exception(“The method or operation is not implemented.”);
        } 

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {
            throw new Exception(“The method or operation is not implemented.”);
        }
    }
}

Sequential Workflow Feature and State Machine Workflow Feature Templates

Creates the necessary files to get started with your Sequential Workflow code.

  • 12\TEMPLATE\SequentialWorkflowFeature1\elements.xml
  • 12\TEMPLATE\SequentialWorkflowFeature1\feature.xml
  • WorkflowCode\SequentialWorkflowFeature1.cs
  • WorkflowCode\SequentialWorkflowFeature1.designer.cs

The same routine applies to the State Machine Workflow Feature template.

 

Web Part Without Feature

Finally, you can create a Web Part without the feature – basically just creating the .webpart file and the .cs file.

  • 80\wpcatalog\WebPart1.webpart
  • WebPartCode\WebPart1.cs

Solution tree overview

Since I’ve been bashing all kinds of templates in here, you’ll see that there’s a huge tree of files – all automatically created in less than 1 minute.

image

Template Overview Summary

Alright, the templates I’ve been mentioning before are great to get rolling with a new SharePoint project. But what about deployment of this solution? How do we create our .wsp file, and how do we choose where the files should land (Global Assembly Cache – GAC – or the /bin folder?)

That’s what the next section is all about – bringing some clarification to how the WSPBuilder creates your packages.

WSP Creation and Deployment with WSPBuilder

So, when we’re satisfied with our awesome project and want to build a .wsp package from it – we can simply choose to right click the project -> WSPBuilder -> Build WSP and it will automatically create the .wsp for us:
image

This will create a .wsp file in your project folder like so:
image

Now, if you want to check the contents of the .wsp package, you simply rename the .wsp file to .cab and open it, like so:
image

Manifest.xml

In the cabinet (.wsp package) you will find the file called Manifest.xml - this is the file that tells SharePoint where to actually deploy the solution – GAC or BIN.

If you don’t do any changes at all, this file will look something like this:
image

As you can see, the DeploymentTarget is set to “GlobalAssemblyCache  and your dll will go into the GAC.

Now, in this particular case we can not deploy to the /bin folder anyway – as we have types in our assembly that MUST go into the GAC (Workflows and EventReceivers are two of those types).

But if we were to have a Web Part project or what not – and we want to deploy it only to the /bin folder, follow along with the next few steps.

Scoping the assembly for BIN instead of GAC (including Code Access Security generation)

Okay. So you don’t want it in the GAC, but in your BIN folder instead. That’s okay, just follow along with these few simple steps:

  • Remove your /bin/debug folder entirely from your solution (make sure the .dll gets wiped)
  • If the 80-folder in your project root isn’t created – create it
    • Create a folder called “bin” folder in the 80 folder
    • Your solution tree should look something similar to this:
      image
    • Right click your project and choose “Properties
    • Choose the “Build” tab
    • Change the Output path from “bin\Debug” to “80\bin\“:
      image

When you build your project now, your .dll should pop into the “80\bin\” folder in your solution tree like this:
image

Ready to Rock – Scoping the assembly for the /bin folder

If we go about building our .WSP package again (right click project – WSPBuilder – Build WSP) and rename the .wsp to .cab and check the manifest.xml file – we should see two things done different:

  • DeploymentTarget is set to WebApplication (any chosen WebApp, e.g. /bin)
    image
  • Some general CAS (Code Access Security) permissions has been automatically added to make your assembly run:
    image

Deployment with WSPBuilder

Okay. So we’ve created our project, scoped it either for GAC (do nothing) or for /bin (make the changes in the previous section) – and we want to deploy it. What do we do?

  • Right Click the Project -> WSPBuilder -> Deploy
    Your output window will show something like this:
    image

Check your Solution Management in Central Administration under the tab “Operations” and make sure it’s successfully deployed:
image

Conclusion and Summary

This post simply walks through some of the more popular features of the WSPBuilder created by my pal Carsten Keutmann in Copenhagen.

If there’s any questions or comments – please add them in the comments section below.

Thanks

http://www.zimmergren.net/archive/2009/04/08/wspbuilder-walkthrough-of-the-visual-studio-add-in.aspx

Click on pen to Use a Highlighter on this page
Tagged with:
 

En conjunto, Silverlight y SharePoint son dinamita. Aquí les dejo la lista de herramientas y programas necesarios (o recomendados) para poder crear una máquina virtual en donde tengan todo un ambiente de desarrollo adecuado para la construcción de aplicaciones con dichas plataformas.  Tomen en cuenta que aquí estoy considerando WSS 3.0 y no MOSS 2007, el cual requerirá sus propios componentes de instalación, pero prácticamente es el mismo escenario.  Espero les sea de utilidad.

  1. Windows 2003 R2 con Service Pack 1
  2. SQL Server 2005 Express
  3. Windows SharePoint Services 3.0 con Service Pack 2
  4. Windows SharePoint Services 3.0 SDK (Abril 2009)
  5. Visual Studio .NET 2008 con Service Pack 1
  6. Extensiones de Visual Studio 2008 para Windows SharePoint Services 3.0 versión 1.3 (Marzo 2009 CTP)
  7. Silverlight 3 SDK
  8. Herramientas de Silverlight 3 para Visual Studio .NET 2008 Service Pack 1
  9. Silverlight 3 Toolkit (Octubre 2009)
  10. Microsoft Expression Blend 3 con SketchFlow Trial
  11. Redgate .NET Reflector
  12. Fiddler 2
  13. Notepad++

 

http://rdiazconcha.com/2009/11/mquina-virtual-para-el-desarrollo-de-aplicaciones-silverlight-3-y-windows-sharepoint-services-3-0/

Click on pen to Use a Highlighter on this page
Tagged with:
 

The built-in validation in Silverlight 3.0 is a great new feature that can be used on essential Silverlight controls such as TextBox. Using this feature, it is possible to nicely display an error message and highlight the TextBox that has bad value.

In this post I will only cover validating data in TextBox controls, which are simply used in most forms to receive basic information such as Name, Surname and Email address. The completed and working version of this project can be downloaded from CodePlex from here. I will explain and provide solution on how to validate ComboBox, Radio Button controls or etc in another post soon, so please keep yourself updated on new posts here.

1. Create a basic form with a few TextBox controls in the xaml

2. Create a class, call it CustomValidation
Add the following code to your CustomValidation class:

private string message;
public CustomValidation(string message)
{
    this.message = message;
}
public bool ShowErrorMessage
{
    get;
    set;
}
public object ValidationError
{
    get
    {
        return null;
    }
    set
    {
        if (ShowErrorMessage)
        {
            throw new ValidationException(message);
        }
    }
}

 

3. Create an Extension class (Extensions)
To understand what is an Extension class and for more information about them visit my tutorial post “Extension methods in Silverlight and C#”.

In brief: Extensions will be your Extension class to extend any object of type FrameworkElement like TextBox controls within your application framework. It means you can use the public methods within this class as a “built-in” method for your TextBox.

Create a static public method and call it SetValidation. This method receives an instance of a FrameWorkElement and a string value, and returns nothing:

public static void SetValidation(this FrameworkElement frameworkElement, string message)
{
    CustomValidation customValidation = new CustomValidation(message);
    Binding binding = new Binding(“ValidationError”)
    {
        Mode = System.Windows.Data.BindingMode.TwoWay,
        NotifyOnValidationError = true,
        ValidatesOnExceptions = true,
        Source = customValidation
    };
    frameworkElement.SetBinding(Control.TagProperty, binding);
}

 

CustomValidation is the class we defined earlier.

“Binding” is a class in System.Windows.Data assembly which gets or sets a value that indicates whether to raise the error attached event on the bound object.

What are we doing? Here we have a CustomValidation class that has one property (“ShowErrorMessage”) and one public methods (“ValidationError”). “ValidationError” is our source binding object and what we want to be able to do in the future is to bind our frameworkElement, which is a TextBox, to ValidationError. We are in simple words binding the CustomValidation class to our TextBox once we call this method on our TextBox.

For more information on Binding and BindingExpression visi msdn article here.

Create another two methods for displaying validation error and also for clearing validation error when the error was corrected:

public static void RaiseValidationError(this FrameworkElement frameworkElement)
{
    BindingExpression b =
    frameworkElement.GetBindingExpression(Control.TagProperty);
    if (b != null)
    {
        ((CustomValidation)b.DataItem).ShowErrorMessage = true;
        b.UpdateSource();
    }
}

public static void ClearValidationError(this FrameworkElement frameworkElement)
{
    BindingExpression b =
    frameworkElement.GetBindingExpression(Control.TagProperty);
    if (b != null)
    {
        ((CustomValidation)b.DataItem).ShowErrorMessage = false;
        b.UpdateSource();
    }
}

 

By creating a new BindingExpression you will be creating an instance of your binding so you can control the properties and public methods of your binding source/target. In above case, we are casting the BindingExpression.DataItem as CustomValidation. This enables us to access the properties of this class, “ShowErrorMessage” in this case.

4. RaiseValidationError() and ClearValidationError()
So now we have our TextBox, a method in our Extension class to bind the TextBox to our CustomValidation class and passes our error message, and a method in our Extension class that fires throw new ValidationException(message); from the CustomValidation class.

All we need to do now is to check if a specific TextBox is valid or not. If the TextBox was not valid we can simply use the RaiseValidationError() and ClearValidationError() methods, which should now be available from the intellisense in Visual Studio, to throw the validation exception and display a suitable error message and we do that by following code when the submit button was pressed:

Name.ClearValidationError();
bool isFormValid = true;
if (Name.Text == “”)
{
    Name.SetValidation(“Please enter your name”);
    Name.RaiseValidationError();
    isFormValid = false;
}

 

use isFormValid variable to check if you have to submit the form or not. The Name.ClearValidationError() makes sure you clear the form everytime you press submit, so if the form was valid the error message had already been cleaned.

I have some extra validation extensions on this project and have organised the code in different class files. Download the project from here.

http://www.silverlighttips.com/post/2009/10/08/SilverlightValidationTextBox.aspx

Click on pen to Use a Highlighter on this page
Tagged with:
 

Skype Online Status 

Contáctanos por Skype Call me! - Rolando Escobar: Offline
» Get Skype, call free! Servicios en Línea
 
 
Servicios Interdata Ltda. Colaboración e Inteligencia de Negocios, SQL Server 2008, Analysis Services, SharePoint, Excel Services, Reporting Services

Switch to our mobile site