catarsa.com
English čeština Deutsch English (United Kingdom)
Story

User: NotSigned (NotSigned)

Logon: Logon

Language: en-US

How to install Catharsis Guidance

The Catharsis framework Guidance prerequisites and installation overview. 
HOW TO install the guidance, create new solution, run the application.

The Catharsis Guidance installation

The following steps will guide you through the process:

  1. Prerequisites
  2. Creating the database
  3. Creating a new solution - running the Catharsis framework Guidance wizard
  4. Creating the database tables
  5. Setting the StartUp project
  6. Running Catharsis

Prerequisites  

top

The following prerequisites will be needed:

  • .NET Framework 3.5 SP1
  • Visual Studio 2008 (e.g. Team System 2008)
  • Support for both C# and VB.NET (For LinqToXML)
  • MS SQL Server 2005 (With SQL Server Management Studio)
  • GuidanceAutomationExtensions.exe (Download from Microsoft)
  • The Catharsis Guidance (Download from http://catarsa.com/Articles/Download/Catharsis)

ASP.NET MVC

top

This is not a prerequisite, but it will work if you already have it installed as long as it is the latest version. If in doubt and you do not need ASP.NET MVC for any other projects use ControlPanel to remove it from your computer before installing Catharsis. The catharsis framework contains the ASP.NET MVC assemblies so you do not actually need to have it installed.  

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_001.png

GuidanceAutomationToolkit

If you intend to expand the functionality of the Guidance (source-code) you will also need this GAT.

Creating the database

top

Open Microsoft SQL Server Management Studio. When installing MS SQL Server 2005 you will have been asked if you want to install the server as a named instance. Using a named instance is good practice because it allows multiple servers to run on the same machine. In the example below the name of the computer is AP325373 and the name of the named instance is MSSQL2005. Using Windows authentication is the best option for our purposes. Select the named instance if you have one (otherwise select the default) and click Connect:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_004.png

Now right click on Databases and select Add Database:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_005.png

Give the database a name, we will use MyApplicationDB in this case:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_006.png

Now click on the Options tab:

Select Recovery model: Simple (allows the log file shrinking, which is a good choice for development)

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_007.png

Click Okay and your new database will appear in the list on the right:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_008.png

Creating a new solution - running the Catharsis framework Guidance wizard

top

Click on the File -> New -> Project

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_002.png

Select ProjectBase.Guidance.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_003.png

Give your application a name and create a file location for it. It is a good practice to use a naming convention like MyCompany.MyApplication.

When you click okay in the New Project dialog and a new one will appear asking for information about the database. Change the name of the database to match the database you created in the last step:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_009.png

Click Next. On the next wizard page you can decide if the Services entities (User, Localization, Documentation), which are built in the framework, will be persisted in the Database or in XML files (AppData) folder. The usual scenario is to use the default option.

But there are cases, when you have to create the application and do not have any choice to change the DB Schema (e.g. tables are not visible and the only interfaces are stored procedures). In such scenarios, it is very handy to still have the Catharsis Services Entities - persisted in .XML files.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_009b.png

Now click Finish and wait for the framework to create a skeleton architecture for your project.

When this completed a popup is displayed which outlines what needs to be done next:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_010.png

A window with some information on the creation of the skeleton code might remain on the screen, this is not important now so just close that window.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_011.png

Creating the database tables

top

So according to the instructions in the popup we will now run some SQL scripts to create tables which are required by the framework.

In VS2008 find the DBSQLServer folder and open the first script:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_012.png

Select all of the text and copy it to the clipboard.

Go back to MS SQL Server Management Studio. Right-click on your database and select New Query.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_013.png

Now paste the text from the SQL script into the window. Change the name of the database which the script will be run on from the default ‘Product’ to the name of your database, MyApplicationDB in this case. Click the Execute button and the script will run to create the database tables that you need.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_014.png

Now run the next scripts in the same way. This script will populate the tables with some data. Remember again to change the database name.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_016.png

There is an insert script which contains the user information. Change the values to your Login, first and last names:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_015.png

This will grant you Admin rights for the first application run. In the future you can manage users and rights directly from the application.

If you've selected to use the XML as the persistence for the Services Entities, change the

Web project > App_Data > User.xml file the similar way:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_015b.png

Setting the StartUp project

top

Now we need to deal with the remaining items listed in the ToDo list pop-up which Catharsis displayed.

Right click on the web project and select ‘Set as Startup Project’.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_017.png

Also do this for the Default.aspx file inside that project.

Checking the config files  

Now we need to make some changes so the framework knows how to access our database. Open the web.config file:

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_018.png

Find the code for the connection string:

Collapse

  <connectionStrings>
    <add name="ProjectDB" connectionString="Data Source=.\SQL2005;Database=MyApplicationDB;Trusted_Connection=yes;"/>
  </connectionStrings>

Check that the database name is correct. This should be taken care of automatically if you created your database before running the Guidance as outlined in the steps above.

The same needs to be done in the App.config file in the test project.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_019.png

Running Catharsis

top

Now we are ready to test the new solution MyCompany.MyApplication.

Click on the menu Window -> Close All Documents

Now try debugging the solution. Click on the output window by selecting the Output tab in the bottom pane in VS2008 (This is good practice because it allows you to see what is happening during the build) and then select ‘Rebuild Solution’ as shown. We use rebuild instead of build as this ensures that every part of the application will be built.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_020.png

It is possible that some references will appear to be broken before the rebuild is carried out but the rebuild will take care of this.

Now click on Debug or press F5 and run the application.

/files/Catharsis-Guidance-Installation/catharsis_tutorial_01_021.png

The Catharsis Guidance is working - new solution was created

top

If no problems have occurred it should be possible to do this in ten minutes. The result is that you have a complete multi-tier architecture on which to base your application without the considerable difficulties of planning and writing the architecture from scratch.

If any users have problems with their installation please let me know and we will work on finding a solution, it is obviously important to supply information on your system and the status of all the prerequisites listed above.

The next step

Now that you have installed Catharsis it's time to see what you can do with it. In the next tutorial we will look at the Catharsis example solution where you will see how the Catharsis framework handles entities.

Enjoy Catharsis

Comments
Name
Hung Tran, Sr.
Inserted
4/1/2010 10:31:00 AM

Thanks for share

Name
Sidney da Silva Alves
Inserted
8/22/2010 11:42:00 AM
No have acess for user

I followed all procedures as recommended, but I get this message: The user Sidney-PC\p  does not have an access to the entity/controller "Home" action "Index"

I'm using integrated connection. What´s wrong?

Name
Radim Köhler
Inserted
8/23/2010 1:40:00 PM
Access

Hi Sidney

Check the Web project AppData/User.xml file if you are using .xml files (this option you can select during the creation of a new solution in the Wizzard)

Or check the table ServicesUser. Chnage the first record that LOGIN column will contain your Windows 'login' without any domain (e.g. 'sidney')

Both approaches will grant you as an Administrator of the application. New users can be appended then directly, from the Application UI.

Enjoy Catharsis

Name
Jem
Inserted
9/28/2011 3:19:00 PM
Student

Im facing the following error:

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.

Is that a IIS problem?

Name
Jem
Inserted
9/28/2011 6:54:00 PM
Error when compiling the application

Sorry for the mistake when writing down the title. Ok, I figured out that needed to run Visual Studio as Administrator (ups!), but now I have a new error with the example.

Error: The user ________ does not have an access to the entity/controller "Membership" action "SelectRole"

I have no idea what to change to make it work, any help?

Name
Radim Köhler
Inserted
9/29/2011 10:18:00 AM
Access rights I.

Hi Jem

Catharsis uses standard role provider pattern (authorization). There are also two types of authentications available out of the box: The first is based on windows tokens. Second uses forms authentication.

I suggest to you, to use firstly the windows authentication (this is the default one, and is turned on when the default web.config is used)

<!-- web.config -->
<system.web>
    ...
    <authentication mode="Windows" />
    <roleManager enabled="true" defaultProvider="ProjectRoleProvider">
        <providers>
            <clear />
            <add name="ProjectRoleProvider" type="YOURPROJECT.Common.Providers.ProjectRoleProvider, YOURPROJECT.Common" />
            </providers>
    </roleManager>
    <identity impersonate="false" />
</system.web>

So, if you have the default web.config, you will be authenticated via your windows login.

This login is passed to Catharsis built in RoleProvider, which uses the

  • SQL (tables) or
  • XML files (stored in App_Data).

Which persistence is used depends on the mapping in the Infrastructure project,

StructureMapFactoryProvider.cs

Name
Radim Köhler
Inserted
9/29/2011 10:19:00 AM
Access rights II.

I. SQL RoleProvider persistence

In case that you are using the SQL persistence, this is the setting for StructureMap

// StructureMapFactoryProvider.cs
public static readonly IEnumerable<Type> TypesToSkip = new List<Type>
{
    ...
    // skip NHiberante - services implementation
    // typeof (Data.Services.UserDao),

    // skip XML - services implementation
    typeof (Data.Services.Xml.UserDao),
    ...
skipped for mapping will be XML implementation... used (not skipped) will be the NHibernate - SQL version

Then go to your SQL server and adjust the table

ServicesUser

And change to login to your windows account (e.g. 'Radim') without any domain

II. XML RoleProvider persistence, /App_Data

In case that you are using the XML persistence, that would be the setting for StructureMap

// StructureMapFactoryProvider.cs
public static readonly IEnumerable<Type> TypesToSkip = new List<Type>
{
    ...
    // skip NHiberante - services implementation
    typeof (Data.Services.UserDao),
    // skip XML - services implementation
    // typeof (Data.Services.Xml.UserDao),
    ...
skipped for mapping will be XML implementation... used (not skipped) will be the NHibernate - SQL version

Then go to your WEB project and locat the User.xml file in the /App_data folder

Change the first entiy (user) to have your login, e.g.:

<data>
  <User ID="1" Login="YOUR_LOGIN_WITHOUT_DOMAIN" FirstName="FirstName" LastName="LastName" CurrentRole="Developer">
    <role name="Developer" />
    <role name="Administrator" />
    <role name="PowerUser" />
    <role name="Importer" />
    <role name="Cleaner" />
    <role name="Viewer" />
  </User>
</data>
Name
Radim Köhler
Inserted
9/29/2011 10:21:00 AM
Access rights III.

III. Authorization - role access mapping

Catharsis uses role based access. That means that when user is authenticated (in our sample via Windows login) and authorized (via RoleProvider, SQL or XML) then comes to play the third setting:

Config/Menu.Config

In this file, you can find mapping: which role, can access which Controller/Action

e.g. to grant the user in role PowerUser access to Controller Membership to any action, append this setting:

<!-- Menu.config -->
    <controllerOrNode name="Membership">
        <roleGranted name="PowerUser"/>
        ...
    </controllerOrNode>

IV. IIS

If you are using the windows IIS, and would like to use windows authentication, please do not forget to correctly set the authentication for your project. Windows authentication must be enabled

I believe that this would help

Have a nice day

Enjoy Catharsis

Radim Köhler

Name
Jem
Inserted
9/29/2011 4:44:00 PM
Thank you!

Thank you Radim, that was of help.

Name
Rob von Nesselrode
Inserted
3/8/2012 5:31:00 AM
Title

OK after a BATTLE that shouldn't be required I've completed installation. Here's some things that I stubbed my toe on:

1. The installation instructions are a tad out of date. With extra steps present in the guidance and extra scripts in the SQL.

2. This web site gets my Lets make this thing really hard to find/follow/understand with a menu that doesn't display the options fully, missing links to examples (part 1 for instance) and a print mechanism that doesn't work. Images don't print for starters.

Other than that - things are looking ok'ish....

Regards

Rob

Name
Radim Köhler
Inserted
3/8/2012 1:31:00 PM
a bit out-dated

You are right, I am sorry... really. But I can not promise lot of improvements now.

Radim Köhler

PS: If you would like to help... let me know (add an comment and fill in email box)

Add Comment
Comment
* (required field)
Detail view Printable view