1.4.6 Build 488

visual editor for ORM frameworks

Pricing information Free download

Testing ORM Designer import and export

This article is from article serie about developing for ORM Designer.

Command line params

List of supported command-line program params together with their description:

First of all it is required to instruct ORM Designer not to run common application but launch unit tests for import/export. This can be done by the following switch:

-unit-test-import-export

Then it is necessary to select where unit test should load input data. We can choose :

  • one or more files of concrete ORM format,
  • a directory with a project based at existing ORM,
  • a file with project created at ORM Designer.

This can be done by the following switches :

-input-files-orm <file-type> file1 file2 ... -input-orm <orm_name>
-input-dir <directory_path> -input-orm <orm_name> -input-framework <fw_name>
-input-project <project_file_name>

In the case we use the switch -input-files-orm it is important to enter the file type defining its format. Next it is necessary to enter the ORM type by the switch -input-orm.

In the case of using the switch -input-dir it is needed to define the ORM and framework type by using switch -input-orm and -input-framework. Framework type is important because of automatic searching of definition file, when each framework has its own structure and different definition file names.

The third alternative is to use the switch -input-project by which we load an existing ORM Designer Project. In this case it is not necessary to enter any other switch because information about ORM and framework is saved directly in the project.

Warning: If you want to run export from ORM Designer project, the project have to be created with appropriate framework and ORM type!

Next step is to choose the type of output. There are three possibilities. We can export the imported project back to the format of certain ORM to single ORM file. Or we can save the whole project as one-file in ORM Designer file. Or execute project export by internal project settings. The third option do same action as when user click "Export" button in ORM Designer application. The following switches serve to this purpose:

-output-orm-file <file_name>
-output-project-file <file_name>
-output-export

The last switches serving for setting additional params:

-input-orm <orm_name>
-input-framework <framework_name>
-unify-output
-show-log

The first two switches are intented for setting the ORM and MVC framework type at data import as shown above.

Next switch allows to unify output file after finishing the export. This unification (XML or YML) consists in lining up all elements on single levels in alphabetical order. This is useful for exact files comparison because during the transformation the object order do not have to be accurately kept and the results could be different.

show-log switch serves to open console window where all script operations are traced

Example of command-line usage

Import YML files from Doctrine project and export them to one unified output YML file.

-unit-test-import-export -input-files-orm DoctrineYml file1.yml file2.yml -output-orm-file file.out.yml -input-orm Doctrine -unify-output

Import YML files and export them to ORM Designer one-file project. Output file (XML) will be unified.

-unit-test-import-export -input-files-orm DoctrineYml file1.yml -output-project-file proj.out.ormdes.xml -input-orm Doctrine -unify-output

Import project from selected directory and then export to the ORM Designer one-file project.

-unit-test-import-export -input-dir c:\test -output-project-file proj.out.ormdes -input-orm Doctrine -input-framework Symfony

Import project from selected directory and export them to the one unified output YML file.

-unit-test-import-export -input-dir c:\test -output-orm-file proj.out.yml -input-orm Doctrine -input-framework Symfony 

Open existing ORM Designer project and export it to the YML file

-unit-test-import-export -input-project project.ormdes -output-orm-file project.out.yml

Open existing ORM Designer project and export it to the default location

-unit-test-import-export -input-project project.ormdes -output-export

Conclusion

This article is from article serie about developing for ORM Designer. More informations about this topic you can find in article How ORM Designer performs import and export model schema files or How to create support for new ORM and MVC framework

Author: Ludek Vodicka

ORM Designer on Twitter

Feed from our blog

Missing field-type icons in ORM Designer

Propel ORM Behaviors support!

Propel ORM validators support!

How to change export format (schema.yml / schema.xml)

How to import model from MySql Workbench

New visual symbols for NULL/NOT NULL column types

Execute another application from ORM Designer import/export script

Forum topics

ORM Designer forum: http://forum.orm-designer.com/

About ORM Designer

ORM Designer is a tool for modelling entity relationship diagrams (ERD). The biggest advantage is full support of any ORM framework which has its definitions stored in a markup language or other structured file.

Currently supported ORMs are PHP Doctrine, PHP Propel and CakePHP frameworks, but more will be added in close future.

Inventic s.r.o. - PayPal verified

Real Time Web Analytics

Clicky

Legal notice: The name CakePHP and the cake icon are trademarks of the Cake Software Foundation Inc., and used with permission. "symfony" is a trademark of Fabien Potencier.

© 2009-2012 Inventic s.r.o. all rights reserved