New Posts New Posts RSS Feed: Cabana App with a different database schema
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Cabana App with a different database schema

 Post Reply Post Reply
Author
gussabina View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Nov-2007
Location: United States
Posts: 22
Post Options Post Options   Quote gussabina Quote  Post ReplyReply Direct Link To This Post Topic: Cabana App with a different database schema
    Posted: 11-Dec-2007 at 10:32pm

Hi:

I tried to create a new Cabana App using my own database...The solution does not compile, as there is some code that expect certain classes (AuditableEntity) and some tables (SecurityUser, AuditValue, etc).

Do I have to create all these, in order to have an application running? 

Regards;

Gus

Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 14-Dec-2007 at 4:53pm

The application wizard creates a sample model project based on the IdeaBlade tutorial database, but place in a namespace you specify (default is <company>.<app>.Model.  This project also contains some common files that need to be present in any Cabana model.  Our intention is that you would remove the tutorial-specific entities from this project and replace them with your own data model.  This is a little tricky but here are some beginning steps:

  1. In your application solution, start the IdeaBlade object mapper.  Verify that it connects properly to the tutorial database.
    1. Select all a classes EXCEPT BaseEntity and User.
    2. Click delete (the red minus button) and confirm.
    3. Save the model and exit the object mapper 
  2. In the Model project:
    1. Delete or exclude TitleOfCourtesy.cs.
    2. Delete or exclude AuditArgs.cs, AuditConfig.cs, and AuditConfigService.cs (in the Common folder)
    3. Edit MainPm.cs and delete these two lines in the Initialize() method:

msManager.DefaultSaveOptions.ExcludeFromPostSaveRefetch =

new List<Type>(new Type[] { typeof(AuditValue) });

  1. Edit Source\Foundation\Services\ListConverterService.cs:
    1. In the method CreateServiceItemCore() comment or remove all cases except default.
    2. Comment or remove all five regions below this method. 
  2.  Again start the object mapper.
    1. Change the data source to point to your application database.
    2. Add classes to map to your database tables, adjust properties as necessary.  Be sure to map your “User” table that will be used to authenticate or authorize users.
    3. Save the model and exit the object mapper. 
  3. In your  model project, Edit your “User” entity:
    1. Provide an object (might be the “User” entity itself) that implements IUser.
    2. Provide static methods GetUserByCredential() and GetUserByUserLogin() that return an instance of your IUser object.  The SecurityUser.cs file from the sample model (still around but excluded from the project) provides an example.

  1. In your model project, edit LoginManager.cs:
    1. In the two methods GetUserPasswordIdentity and GetWindowsIdentity(), invoke the appropriate GetUserBy… methods on your “User” entity.

These steps may not be complete, but this should get you pretty close to being able to build and run with your model.  Obviously, we have some restructuring work to do in the next version of Cabana.

I’ll be happy to help you through this process.

Hope this helps.
 
BIll Jensen
IdeaBlade
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down