Exhibition-Workflow: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 5: | Zeile 5: | ||
We use the module "Users" as example | We use the module "Users" as example | ||
* Create a metadata description: lib/meta/users_meta.dart | * Create a metadata description: lib/meta/users_meta.dart | ||
< | <syntaxhighlight lang="dart"> | ||
import 'module_meta_data.dart'; | import 'module_meta_data.dart'; | ||
Zeile 28: | Zeile 28: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
* Create some source files: (for example: the module "Users") | * Create some source files: (for example: the module "Users") | ||
< | <syntaxhighlight lang="dart"> | ||
# precondition: the current directory is the base folder of the dev-app. | # precondition: the current directory is the base folder of the dev-app. | ||
mkdir -p lib/meta/users | mkdir -p lib/meta/users | ||
Zeile 40: | Zeile 40: | ||
# show the SQL table definition: | # show the SQL table definition: | ||
meta_tool print-table | meta_tool print-table | ||
</ | </syntaxhighlight> | ||
* Create all source files: | * Create all source files: | ||
< | <syntaxhighlight lang="dart"> | ||
# precondition: the current directory is the base folder of the dev-app. | # precondition: the current directory is the base folder of the dev-app. | ||
# The following call works without meta data. It works without recreation of the tool: | # The following call works without meta data. It works without recreation of the tool: | ||
Zeile 49: | Zeile 49: | ||
./ReCreateMetaTool | ./ReCreateMetaTool | ||
meta_tool update-modules | meta_tool update-modules | ||
</ | </syntaxhighlight> |
Version vom 24. Januar 2022, 17:19 Uhr
Links
Workflow
We use the module "Users" as example
- Create a metadata description: lib/meta/users_meta.dart
import 'module_meta_data.dart';
class UserMeta extends ModuleMetaData {
static UserMeta instance = UserMeta.internal();
UserMeta.internal() : super('Users',
[
PropertyMetaData('id', DataType.reference, ':primary:', 'combo'),
PropertyMetaData('name', DataType.string, ':notnull:', '', size: 64),
PropertyMetaData('displayName', DataType.string, ':unique:notnull:', '', size: 32),
PropertyMetaData('email', DataType.string, ':unique:notnull:', '', size: 255),
PropertyMetaData('role', DataType.reference, ':notnull:', ''),
PropertyMetaData('created', DataType.datetime, '', ''),
PropertyMetaData('createdBy', DataType.string, '', '', size: 32),
PropertyMetaData('changed', DataType.datetime, '', ''),
PropertyMetaData('changedBy', DataType.string, '', '', size: 32),
],
tableName: 'loginusers',
);
factory UserMeta(){
return instance;
}
}
- Create some source files: (for example: the module "Users")
# precondition: the current directory is the base folder of the dev-app.
mkdir -p lib/meta/users
# The following call works without meta data. It works without recreation of the tool:
meta_tool print-modules Users >lib/meta/modules.dart
# Now we need a new instance of the meta_tool (to realize the meta data changes):
./ReCreateMetaTool
meta_tool print-data Users >lib/page/users/user_data.dart
# show the SQL table definition:
meta_tool print-table
- Create all source files:
# precondition: the current directory is the base folder of the dev-app.
# The following call works without meta data. It works without recreation of the tool:
meta_tool update-modules-list
# Now we need a new instance of the meta_tool (to realize the meta data changes):
./ReCreateMetaTool
meta_tool update-modules