Skipper - The ORM Designer Blog
  • Skipper - The ORM Designer
  • VsBuilds - Parallel building
  • Pulpo - Free Skipper CLI

Support of CakePHP validators in ORM Designer

Today we finished beta support of CakePHP validators in ORM Designer. Thanks to Stefano Manfredini for giving us the idea and testing this new feature. You will find this new feature in upcoming ORM Designer 1.4.0 version build 417 and later.

Screenshot of testing model with entered validators:

Detailed screenshot to all supported validators in ORM Designer:

How to use it

If you want to add a validator to any field in your model, follow next instructions:

  1. Select the field where you want to define new data validation.
  2. In ORM Property window click on Validator item ->  ”Add Item”.
  3. After clicking on “Add Item”, the window with all supported validators appear. Choose the required validator and press OK.
  4. After selecting validator from the list, you can add some additional parameters.  You can do this by selecting  added validator and entering value to the correspond property.

After you enter all required validators, you can “Export” them to base class.

And it’s done. No more complicated and confused array definitions, simple design it in ORM Designer ;-)

List of currently supported validators include their parameters:

  • alphaNumeric
  • between
    • minimum
    • maximum
  • blank
  • boolean
  • cc
    • type
    • deep
    • regex
  • comparison
    • operator
    • value
  • date
    • format
  • decimal
    • decimal
  • email
    • validate-host
  • equalTo
    • value
  • extension
    • value
  • ip
  • isUnique
  • minLength
    • value
  • maxLength
    • value
  • money
    • position
  • multiple
    • in
    • min
    • max
  • inList
    • values
  • numeric
  • notEmpty
  • phone
    • reg-ex
    • country
  • postal
    • reg-ex
    • country
  • range
    • minimum
    • maximum
  • ssn
    • reg-ex
    • country
  • url
    • strict
  • reg-ex
    • regex
  • own-function
    • name
    • params

All validators have folllowing commont properties:

  • name: Rule name used in definition array when field has multiple validators
  • required: Require flag, for more information follow CakePHP documentation.
  • allowEmpty: AllowEmpty flagfor more information follow CakePHP documentation.
  • on: Validator type. Can be NULL/create/update. For more information follow CakePHP documentation.
  • message: Error message for the rule.For more information follow CakePHP documentation.
  • last: Flag used when one field have multiple validators. More information about last flag in CakePHP documentation .
18 Jul 2010

Inheritance support in ORM Designer

One of other major features introduced in ORM Designer 1.4.0 is inheritance support. Currently supported frameworks are PHP Doctrine and Doctrine2.

There are several ways how to create inheritance between entities.

1) Inheritance tool

If you want to use inheritance tool, first select this tool on the ribbon window:

With this tool selected click on base entity from which you want to inherit.

Next click on entity that should be derived from base entity.

Once the inheritance is created, you can configure more parameters in the Property editor.

2) Inheritance wizard

If you want to use inheritance wizard, select entity in model and use “Create Inheritance”command from ribbon tab “Editing”.

In the Create New Inheritance wizard select base and derived entity from the list of entities in the combo boxes.

You can also select type of inheritance, discriminator field and discriminator value for created inheritance.  More information about additional parameters is at the end of this article.

3) Create inheritance in project tree

You can also create inheritance through project tree. Simply select entity (which will be used as the base entity for inheritance) in the project tree and select “Add Inheritance” in the context menu (right-click on the entity).  New inheritance wizard will be executed after this step (same wizard as in previous step).

4) Create inheritance in entity edit window

Another way how to start “New Inheritance Wizard” is through the edit entity window. Select “Inheritance” tab in the “Edit entity” window. In this tab select “Add Inheritance” from top tool bar to start “New Inheritance Wizard”. This tab also contains list of all extending and base entities.

Inheritance Additional parameters

Type of inheritance is ORM framework dependent. For PHP Doctrine framework is available Simple inheritanceConcrete inheritance or Column aggregation inheritance. For Doctrine2 is currently available Single table inheritance  and Class table inheritance.

Note: Mapped superclass isn’t currently supported, because there is no way how to define it in YAML or XML file format.

13 Jul 2010

Inheritance in ORM Designer – First screenshot

One week after first ORM Designer 1.4.0 public beta release we’re finishing full support of Model Inheritance. Inheritance will be available for Doctrine and Doctrine2 ORM frameworks. Within a few weeks we want to implement inheritance support also for the new version of Propel 1.5..

Bellow is a screenshot of simple model with inheritance and association. On the right side of the screen is a detail of inheritance editor.

05 Jul 2010

How to start with Doctrine2 in ORM Designer

The simplest way how to start using ORM Designer with your current Doctrine2 model is to use an import doctrine2 model function. Currently is available only import from Doctrine2 XML schema files. If you have your model defined in anotation or using YAML files, please convert it to XML files. After that, follow next step-by-step instructions.

Import a new project from ORM

In a ribbon menu select Import New… and then Import Project from ORM.

In Import Project Wizard choose your project name and a root directory of your project where are your Doctrine2 XML files stored. As MVC framework choose Without Framework and as ORM choose Doctrine2 as shown on this screenshot.

After an import confirmation ORM Designer starts searching for your files and import them to new ORM Designer model.

In our example we import unit-testing model from Doctrine2 repository called CMS. When import procedure is over, you will see model like this.

After that you can start enjoying ORM Designer in your work with Doctrine2 model.

## More details about using ORM Designer with Doctrine2

Using of Doctrine2 in ORM Designer is very similar to using ORM Designer with PHP ORM Doctrine framework. For more information please look at ORM Designer and Doctrine framework page.

Supported Doctrine2 properties

Currently ORM Designer supports all properties from Doctrine2 except inheritance, which will be implemented during next months. All supported properties are based on official Doctrine2 XML schema. You can edit all properties simply by selecting the object and enter value to correspond field.

There are lot of properties which can be edited for every type. Here are screenshots of property editors for entity, field, association, many to many association.

Download ORM Designer with Doctrine2 support

If you want to download ORMD with Doctrine2 support, please download latest version from our site http://www.orm-designer.com/download-orm-designer. If you find any inconsistency or bug, please let us know.

Appendix: Supported Doctrine2 properties and behaviors

Supported Doctrine2 core properties

Object Property
Project Name, CodeName, Description
Module Name, Description
Entity Name, Description
Field Name, Type, Size, Required, Unique, Primary key, Auto increment, Default value, Enum values, Description
Association (1:m ) Name, Reference columns, Owning alias, Inverse Alias, Association type, Parent required
Index Name, Unique, Indexed columns
Many to Many associtaion M:N Entity, First and second entity, Alias to first and second entity

Supported Doctrine2 ORM properties

Object Property
Module namespace
Entity db table,schema,repository-class,inheritance-type,export-file-name,change-tracking-policy,lifecycle-callbacks
Field db column,version,scale,precision,column-definition,generator, generator strategy,sequence-generator,sequence-name,allocation-size,initial-value
Associtaion (1:m) on-delete,on-update,owning side/inverse side, fetch,orphan-repoval,cascade,order-by
Many to Many Association join-table-schema,fetch,on-delete,on-update,cascade,order-by
cascade-types cascade-all,cascade-persist,cascade-merge,cascade-remove,cascade-refresh

Appendix: Currently unsupported features for Doctrine2

ORM Designer currently doesn’t support inheritance in any level of designing (visual, editing, import, export). Iheritance for Doctrine2 and other ORM frameworks will be implemented in next few months.

Currently not supported XML tags from Doctrine2 schema:

  • discriminator-column
  • discriminator-mapping
  • discriminator-map
  • mapped-superclass
28 Jun 2010

Posted by: Ludek Vodicka

Skipper tips #features #doctrine

Updated Doctrine association property editor

ORM Designer 1.4.0 is almost here and we want to give you yet another peek of what is coming. ORM property editor is the core feature since the first release of ORM Designer but it can be sometimes hard to use and understand which values to fill. Especially association configuration (“alias” / “foreignAlias”, “type” / “foreignType”, “cascade” / foreignCascade”) was one of these cases. Some of these association properties were side-dependent and others were  same for both sides (in Doctirne ORM for example database attribute “onDelete”). From now on you’ll find side-dependent properties grouped by owning-side and inverse-side with destination table hint for better orientation.

ORM Designer screenshots

On the left side is old version, on the right side new one.

ORM Designer 1.3.x

New property editor in ORM Designer 1.4.x

On the left side is old version, on the right side new one.

Detailed screenshots of side-dependent groups with selected direction assistant:

26 Jun 2010

New Doctrine 2 object properties editor

When we started implementing Doctrine 2 support we had to deal with many new ORM framework features. Doctrine 2 has many new associations and the association definition is more descriptive than before. To solve this problem we hacked the powerful ORM property editor. Bellow you can see some of the new features. You get direct configuration of object properties with predefined values and validators. And as you are used to from Doctrine 1, Propel and CakePHP you get inline help on the places that might be confusing.

ORM property editor object and field:

Doctrine 2 object property editor

Doctrine 2 field property editor

Property editor example of one-to-many association and many-to-many association:

Doctrine 2 association properties

Next step before releasing public version is ORM and ERD terminology unification. It’s a bit confusing in current versions when you are editing ORM application model and all model components are named as you are used in ERD (e.g. on the first screenshot is “object” still called “table”. Relation is called “foreign-key”,…).

21 Jun 2010

Posted by: Ludek Vodicka

Skipper features #orm designer

First ORM Designer Doctrine 2 project screens

After serveral weeks of intensive work on ORM Designer we’re almost done finishing Doctrine 2 support. You can find two new screenshot bellow with correctly imported Doctrine 2 model. Used models can be found in Doctrine 2 unit tests.

First alpha version is almost ready to be released, we have to do some final touches to the user interface.

Screenshot of CMS testing project:

Screenshot of Navigation testing project:

Screenshot of import project screen in ORM Designer:

18 Jun 2010

Problem with execution application - side-by-side configuration problem

Were you having troubles finding the solution when you received this message? “The application has failed to start because its side-by-side configuration is incorect. Please see the application event log for more detail.” This error message may look different depending on the MS Windows version:

These error messages don’t tell you much and you have to dig deeper to get the information you need. Open event viewer:

  1. Manage computer
  2. Computer Management ->System Tools ->Event viewer ->Windows Logs ->System
  3. Click on the error log row

You should see something similar to this:

Activation context generation failed for "\\192.168.0.10\e$\Microsoft Visual Studio\prog.all\OrmDesignerCore\Release\OrmDesignerCore.exe". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.

Solution:

First of all, you need to download right version of Microsoft redist pack. Latest version (currently 8.0) can be found at:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2

You will recognize correct version by the “Version” item on the page. In our case we need version 8.0.xxxx. Unfortunately you can’t see full version number on the page, you need to open “Knowledge Base (KB) Articles:” to see full version name. This version name must match the version needed by your application. Once the redist pack is installed the problem should be solved. In some cases you need to restart the computer for the changes to take effect.

18 Jun 2010

Posted by: Ludek Vodicka

Skipper tips #c++

Updated property editor in ORM Designer 1.4.x

In this post I want to show you one of the new features to be released in ORM Designer 1.4.x. ORM Designer works differently with core properties and ORM framework dependent properties. This is due to different features provided by ORM frameworks. For example column core properties are name, type, length, description etc. and ORM properties scale and unsigned in Doctrine ORM.

With the coming release of ORM Designer with Doctrine 2 we have to do refactoring of many windows. Also some of the properties previously located under ORM dependent properties would be moved to the core properties. As a result you should be able to faster and easier define foreign and local alias of relationship/association and other common tasks. As this would be a change in the way you were used to work before we wanted to make sure you’ll find what you are looking for. We’ve merged core properties and ORM dependent properties into a single window so you could see all applicable properties at the same place.

Here are some screenshots:

First screenshot shows editing module in Doctrine ORM project, second screenshot is active property editor editing objects column.

08 Jun 2010

Posted by: Ludek Vodicka

Skipper features #features #orm designer

New error handlers in ORM Designer 1.4.x

One of new features in upcoming ORM Designer 1.4.x will be updated error handlers. No more old unmeaning error boxes with short message. New handlers will have intuitive gui with well arranged controls.

ORM Desginer exception - summary

Log Output

The main change will be a new Log output tab where user will found detailed information about raised exception. This tab will contain more detailed information about the error or raised exception. When user will work with new ORMD script system and running script will cause the error, this tab will contain the log of script execution with all variables and their values.  (Script system is also developed for 1.4.x version, more about it in next post).

ORM Desginer exception - show log

02 Jun 2010

Posted by: Ludek Vodicka

Skipper features #features #orm designer

Page: 8 of 9