[Packaging]Packaging

This chapter describes the way how modules (packages) are transferred between Zetbox installations.

[Packaging~C~ontent~o~f~ap~ackage]Content of a package

A package contains schema information, meta data, object instances and code. See [content~o~f~p~ackage] for details. A package can contain one or more modules. A package is a zip file that contains one or more XML files containing meta information and/or data and binary files like icons or assemblies.

[ht]

image [content~o~f~p~ackage]

[Packaging~S~chema]Schema

Schema contains all information needed by the SchemaManager [] to create or update the database. Schema objects are:

All object classes and structs except enumerations and interfaces. To be implemented!

All properties

All relations

All relation ends

All known default property values (IntDefaultValue, …)

All known constraints (NotNullable, …)

Schema is a subset of meta data. See [Packaging~M~eta]. Currently there is no way to extract schema information without meta information.

[Packaging~M~eta]Meta

Meta data contains all information needed to describe a Module. That are ObjectClasses, TypeRefs, Module informations, icons, ViewDescriptors and so on. Meta data is a superset of schema data [Packaging~S~chema]. These objects are:

The module object

All object class interface relations

All Methods

All parameter of a method

All method invocations

All property invocations (getter/setter)

All Assemblies (meta information only, not code)

All type references

All generic arguments of type references.

All Icons (descriptor only, no binary data)

All presentable model descriptors

All view descriptors

please add more GUI objects here. And please do it also in PackagingHelper.GetMetaObjects(…)

Additionally all unknown DefaultPropertyValues and Constraints belongs to meta data. Meta data can be extracted with the publish command [Packaging~P~ublish].

[Packaging~D~ata]Data

A package can also contain additional data. Only object classes that implements IExportable will be exported. N:M relations between object classes that implements IExportable are also exported. Currently all objects of a specific module are exported. Data can be extracted with the export command [Packaging~E~xport].

[Packaging~C~ode]Code

Finally a package consists of code in form of assemblies. These assemblies are referenced by Assembly objects.

[Packaging~P~rocesses]Processes

[Packaging~E~xport]Export

Exporting is the process of saving objects in XML files. Only object classes that implements IExportable will be exported. N:M relations between object classes that implements IExportable are also exported. Currently all objects of a specific module are exported.

Command line for exporting objects:

Zetbox.Server \<configfile.xml> -export \<destfile.xml> \<namespace> [\<namespace> ...]

The namespace is used to identify a module. TODO: Work in progress. This is not the best solution!

This example will export all objects of the project management module:

Zetbox.Server -export Export.xml Zetbox.App.Projekte

This example will export all meta data of all modules:

Zetbox.Server -export Export.xml Zetbox.App.Base Zetbox.App.GUI

This example will export the whole database:

Zetbox.Server -export Export.xml *

[Packaging~I~mport]Import

Importing is the inverse process of exporting [Packaging~E~xport]. Objects are imported by the following rules:

  1. If an imported object already exists in the target database then the object will be overridden

  2. New objects are added

  3. No object is deleted if it’s not contained in the package

Command line for importing objects:

Zetbox.Server \<configfile.xml> -import \<sourcefile.xml>

[Packaging~P~ublish]Publish

Publishing is a special case of exporting [Packaging~E~xport]. Only meta data [Packaging~M~eta] of a given module will be exported. Additionally only properties of the Zetbox.App.Base and Zetbox.App.GUI module are published.

Command line for publishing modules:

Zetbox.Server \<configfile.xml> -publish \<destfile.xml> \<namespace> [\<namespace> ...]

The namespace is used to identify a module. TODO: Work in progress. This is not the best solution!

This example will publish the project management module:

Zetbox.Server -publish Meta.xml Zetbox.App.Projekte

This example will publish all modules:

Zetbox.Server -publish Meta.xml *

[Packaging~D~eploy]Deploy

Deployment is the inverse process of publishing [Packaging~P~ublish]. It also has different rules (see importing [Packaging~I~mport]). These Rules are:

  1. If an imported object already exists in the target database then the object will be overridden

  2. Only properties of the the Zetbox.App.Base and Zetbox.App.GUI module are overriden.

  3. New objects are added

  4. Any object that is not contained in the packed will be deleted

Command line for importing objects:

Zetbox.Server \<configfile.xml> -deploy \<sourcefile.xml>

The database schema is not updated. Also no code is generated. This has to be done in an extra step.