Skip to content

Commit

Permalink
Merge pull request #868 from opengisch/oidtidnaming
Browse files Browse the repository at this point in the history
Name OID/TID strictly OID to avoid confusions
  • Loading branch information
signedav authored Dec 13, 2023
2 parents 82566ec + 1fc530f commit b5808b2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion QgisModelBaker/gui/panel/layer_tids_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def headerData(self, section, orientation, role):
if section == TIDModel.Columns.NAME:
return self.tr("Layer")
if section == TIDModel.Columns.OID_DOMAIN:
return self.tr("TID (OID Type)")
return self.tr("OID Type")
if section == TIDModel.Columns.DEFAULT_VALUE:
return self.tr("Default Value Expression")
if section == TIDModel.Columns.IN_FORM:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _set_tid_configuration(self):
result, message = self.tid_configurator_panel.set_tid_configuration()
if result:
self.workflow_wizard.log_panel.print_info(
self.tr("Stored TID configurations to current project")
self.tr("Stored OID configurations to current project")
)
self.workflow_wizard.log_panel.print_info(
self.tr("Stored the sequence value to current database")
Expand Down
2 changes: 1 addition & 1 deletion QgisModelBaker/qgismodelbaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def initGui(self):
"images/QgisModelBaker-tidmanager-icon.svg",
)
),
self.tr("TID (OID) Manager"),
self.tr("OID Manager"),
None,
)
self.__validate_action = QAction(
Expand Down
2 changes: 1 addition & 1 deletion QgisModelBaker/ui/tid_manager.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>TID (OID) Manager</string>
<string>OID Manager</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
Expand Down
Binary file modified docs/assets/oid_tid_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/background_info/oid_tid_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Often the models definition requires a cross-system unique identifier. The so ca
![oid physical data](../assets/oid_physical_data.png)

!!! Note
There are situations when that you can find the `t_id` as `TID` in your data. It's when there is no `t_ili_tid` available ili2db could use. But be aware those `TID`s are not stable then.
There are situations when that you can find the `t_id` as `TID` in your data. It's when there is no `t_ili_tid` available ili2db could use. But be aware those `TID`s are not stable OIDs then.

### OID Domains

Expand Down Expand Up @@ -110,13 +110,13 @@ In the QGIS Project the default value expression for `t_ili_tid` therefore is:
| City_V1.TypeID | <code>'_' &#124;&#124; uuid('WithoutBraces')</code> |
| not defined | <code>'_' &#124;&#124; uuid('WithoutBraces')</code> |

### TID (OID) Manager
### OID Manager

Since the user has to be able to edit those values, they are provided in the GUI.

Additionally to the [page implemented in the wizard](../../user_guide/import_workflow/#tid-oid-values) the configuration of the TIDs can be made on existing QGIS Projects.
Additionally to the [page implemented in the wizard](../../user_guide/import_workflow/#oid-values) the configuration of the OIDs can be made on existing QGIS Projects.

Find the **TID (OID) Manager** via the *Database > Model Baker* menu.
Find the **OID Manager** via the *Database > Model Baker* menu.

![tid manager](../assets/oid_tid_manager.png)

Expand All @@ -142,4 +142,4 @@ When the OIDs are not UUIDs but e.g. `STANDARDOID`s instead, it's not possible t

When resetting the T_Id (Sequence) value one needs to be careful, because it's used for the technical sequence id (used for foreign keys etc.) as well. This means it should not conflict with the `t_id`s of objects already existing. That's why it should only be decreased if you really know what you are doing.

The conflicts are handled differently depending on the database system. On PostgreSQL you would encounter a duplicate key violation while on GeoPackage it would take the next available autogenerated t_id, but since it's not known on creating the TID (OID) it would break those values (e.g. write to it `chMBakerAutogene` instead of e.g. `chMBaker00000042`.)
The conflicts are handled differently depending on the database system. On PostgreSQL you would encounter a duplicate key violation while on GeoPackage it would take the next available autogenerated t_id, but since it's not known on creating the OID it would break those values (e.g. write to it `chMBakerAutogene` instead of e.g. `chMBaker00000042`.)
6 changes: 3 additions & 3 deletions docs/user_guide/import_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ Choose your optimization strategy in the checkbox:

For more information about the optimization of extended models, see the [corresponding chapter](../../background_info/extended_models_optimization).

### TID (OID) Values
### OID Values

Often the models definition requires cross-system unique identificators. So called OIDs or TIDs, what are represented in the physical database as the `t_ili_tid` column. Find a clear definition and more details about them in the [corresponding chapter](../../background_info/oid_tid_generator).
Often the models definition requires cross-system unique identificators. So called OIDs, what are represented in the physical database as the `t_ili_tid` column. Find a clear definition and more details about them in the [corresponding chapter](../../background_info/oid_tid_generator).

On creating a QGIS Project with Model Baker, there are preset default value expression generated for the `t_ili_tid` field on the attribute form. But often those default value expressions need to be edited by the user (like e.g. the prefix in the `STANDARDOID`).

Expand All @@ -193,4 +193,4 @@ Here you can use the QGIS Expression Dialog to edit the default value expression

If you need a counter in the expressions, you can use the `t_id` field, that has a schema-wide sequence counting up. This sequence can be reset as well by the user, but be careful not to set it lower than already existing `t_id`s in your project.

This settings can be made on an existing QGIS Project as well. Find the [TID (OID) Manager](../../background_info/oid_tid_generator/#tid_(oid)_manager) via the *Database > Model Baker* menu.
This settings can be made on an existing QGIS Project as well. Find the [OID Manager](../../background_info/oid_tid_generator/#tid_(oid)_manager) via the *Database > Model Baker* menu.
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ nav:
- Tipps & Tricks:
- Repositories: background_info/repositories.md
- Basket and Dataset Handling: background_info/basket_handling.md
- OIDs and TID Generator: background_info/oid_tid_generator.md
- OID Generator: background_info/oid_tid_generator.md
- UsabILIty Hub:
- Model Baker Integration: background_info/usabilityhub/modelbaker_integration.md
- Technical Concept: background_info/usabilityhub/technical_concept.md
Expand Down Expand Up @@ -79,7 +79,7 @@ plugins:
Plugin Configuration: Plugin Konfiguration
Repositories: Repositories
Basket and Dataset Handling: Dataset und Basket Handling
OIDs and TID Generator: OID und TID Generator
OID Generator: OID Generator
Optimized Projects for Extended Models : Optimierte Projekte für erweiterte Modelle
Model Baker Integration: Model Baker Integration
Technical Concept: Technisches Konzept
Expand Down

0 comments on commit b5808b2

Please sign in to comment.