Stuart Evans

This week I will be mostly using............

  Home  |   Contact  |   Syndication    |   Login
  4 Posts | 0 Stories | 31 Comments | 25 Trackbacks

News

Archives

Post Categories

BizTalk 2004

Solution Providers

In my existing project I wanted to be able to store my User Interface Process configuration data OUTSIDE of my standard application configuration file (i.e. appname.exe.config or web.config). I felt that I was going to have a significant amount of navigational and process configuration data and I personally would be far happier storing it away from the standard config file. 

Perhaps I gave up too soon with the documentation and I am sure there is probably a sweeter way of achieving this requirement, but anyway here goes. Feel free to correct me if there is a better solution.

If want to store your User Interface Process Application Block 2 (UIPAB2) configuration data outside of the your main application configuration file then one method of achieving this is could be by using the Configuration Management Application Block (CMAB) in conjunction with the UIPAB2.


Conditions Of Using This Method

a) This method assumes you have working knowledge of both the UIPAB2 and the CMAB
b) You have to make very minor changes to the UIPAB2 source code in order to utilize this functionality . To download the the source code go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/uipab.asp

The process of creating a UIPAB2 application is no different to normal. For tips on how to create applications using the UIPAB take a look at http://www.codeproject.com/dotnet/UIPAB1.asp and http://www.codeproject.com/dotnet/UIPAB2.asp for some great demos.

Incorporating the CMAB into your UIPAB2 project

STEP 1 - Add the Configuration Management Application Block and UIPAB2 to your solution. From the UIPAB2 project add a reference to it from the CMAB

STEP 2 - Add / amend you application configuration file to include the standard CMAB sections as shown in the sample below:

<configuration>
<!--The configSections and applicationConfigurationManagement sections are required for the CMAB-->
<configSections>
<section name="applicationConfigurationManagement" type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManagerSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
<section name="uipConfiguration" type="Microsoft.ApplicationBlocks.UIProcess.UIPConfigHandler, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"/>
</configSections>
<applicationConfigurationManagement>
<!--Implementation of the UIPAB as part of configuration management as opposed to using the standard config file readers-->
<!--Note that in this section we are pointing to an external configuration file, however we could be using any of the inbuilt CMAB functionality to hold the UIPAB configuration-->
<configSection name="uipConfiguration">
<configProvider assembly="Microsoft.ApplicationBlocks.ConfigurationManagement,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage" signed="false" refreshOnChange="true" encrypted="false" path="..\..\..\TestConfigFile.config" />
</configSection>
</applicationConfigurationManagement>
<!--Usually the UIPAB config sections would appear here in the Config file. -->
<!--Because we are delegating the task to the CMAB they have been moved out-->
<!--to a seperate file location called TestConfigFile.config-->
</configuration>

STEP 3 - Move / create your UIPAB2 configuration file as per the sample shown below. NOTE THE USE OF TWO uipConfiguration nodes. This is due to differences in the way that the standard configuration reader works compared to the CMAB readers.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<uipConfiguration>
<uipConfiguration>
<objectTypes>
<iViewManager
name="ViewManager"
type="Microsoft.ApplicationBlocks.UIProcess.WindowsFormViewManager, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"/>
<state
name="State"
type="Microsoft.ApplicationBlocks.UIProcess.State, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"/>
<controller
name="UIController"
type="InterfaceProcess.UIController, InterfaceProcess, Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
<statePersistenceProvider
name="MemoryStatePersistence"
type="Microsoft.ApplicationBlocks.UIProcess.MemoryStatePersistence, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"/>
</objectTypes>
<views>
<view
name="Explanation"
type="DemoWindowsFormsApplication.Explanation, DemoWindowsFormsApplication, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
controller="UIController"/>
<view
name="Thanks"
type="DemoWindowsFormsApplication.Thanks, DemoWindowsFormsApplication, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
controller="UIController"/>
</views>
<navigationGraph name="Nav"
startView="Explanation"
state="State"
statePersist="MemoryStatePersistence"
iViewManager="ViewManager">
<node view="Explanation">
<navigateTo navigateValue="Thanks" view="Thanks" />
</node>
</navigationGraph>
</uipConfiguration>
</uipConfiguration>
</configuration>

STEP 4 - In the UIPAB2 Project open the Configuration\UIPConfiguration.cs file and add the following using directive :

using Microsoft.ApplicationBlocks.ConfigurationManagement;

STEP 5 - Modify the following line of code: (located in the public static UIPConfigSettings Config declaration)

Old Code

_currentConfig = (UIPConfigSettings)ConfigurationSettings.GetConfig( UipConfigSection );

New Code

_currentConfig = (UIPConfigSettings) ConfigurationManagement.ConfigurationManager.Read(UipConfigSection);

Sample Code Available For Download

Sample code is available for downloand from http://www.appsolutions.co.uk/samples/CombiningUIPABwithCMAB.zip

Post is provided as is. No guarantees are made as to its ability to function in a production environment.

posted on Monday, January 10, 2005 11:37 AM

Feedback

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 5/13/2005 2:40 PM Rohan Cragg
This looks very useful, thanks for the post. Hopefully I'll get a chance to try it and provide some feedback...

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 5/31/2005 10:09 AM Daniel
Thanks for this post.

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 6/1/2005 12:10 PM MD
Hi,

This post is quite helpful. I tried using it but it is giving error: "Error using storage provider - uipConfiguration". I've set the configurations properly.

Pls help ASAP to resolve the error.


Thanks



# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 6/1/2005 12:27 PM Stuart Evans
I'll need more information in order to help you.

First Check ....Did you manage to get the sample download application working correctly?

Pleae post a contact url so I can communicate via email



# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 6/28/2005 3:32 PM Tom
Hello,

the solution you provided is just what i need. The only problem is i'm using the configuration application block which is a newer solution part of the enterprise library. I cant get it to work with this newer block.

I was hoping you could give it a shot?

thx!

tom

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 9/1/2005 6:34 AM Aparna
hi,
Can u tell me whats the advantage of combining UIPAB and CMAB?

regards aparna

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 10/11/2005 9:00 AM Ashley
Did you manage to find a fix for "Error using storage provider - uipConfiguration"?

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 5/12/2006 12:50 PM Tony
We have succsessfully implemented the CMAB with the UIPAB2 using theprocess as described above - thanks.
The issue is now that CMAB is deprecated. I would like to find out if there is a method for using the new .Net 2.0 recommended System.Configuration.ConfigurationManager with the UIPAB2 so that the navigational and process configuration data can be moved to different config file? Any help would be appreciated. Regards, Tony.

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 7/12/2007 12:38 PM Roberth Meregildo Gómez
HELLO:
Sorry, I don't speak english.

El User Interface Process Applications Blocks, es un Framework excelente, sin embargo desde hace algún tiempo pretendo implementarlo en el .NET Framework 2.0 y no lo consigo.
Desde este sitio http://www.microsoft.com/downloads/details.aspx?familyid=98C6CC9D-88E1-4490-8BD6-78092A0F084E&displaylang=en
he desacargdaod el User Interface Process Application Block - Version 2.0, pero está escrito en la versión 1.1
Anteriormente he utilizado el User Interface Process Application Block - Version 1.1, con Visual Basic .NET 2003 y es muy bueno, es por eso que quiero implementarlo con el .NET Framework 2.0.
He compilado la solución desde Visual Studio 2005, pero no me corre, ¿hay algún aspecto que debo considerar para utilizar con éxito éste Application Block?
Sé que algo estoy haciendo mal, me puedes ayudar por favor. Te estaré muy agradecido.
Disculpa mi ignorancia.
Saludos cordiales.

# re: Using the User Interface Process Application Block 2 in conjunction with the Configuration Management Application Block 10/8/2008 6:45 PM sudar
Go through this User interface and fallow this.......

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 4 and 1 and type the answer here: