Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gioagu committed Mar 29, 2023
2 parents 95314fb + 19353d7 commit d15d2e8
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 26 deletions.
6 changes: 6 additions & 0 deletions cdb4/ddl_scripts/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Test whether it makes sense to add "hard-coded" bbox filter also to views.
Test whether it makes sense to add an update statement to delete trigger functions to reduce number of features in table layer metadata

2023-03-29
----------
Version 0.10.1
Fixed bug in function [qgis_pkg.grant_qgis_usr_privileges(...)]
Slightly reworked table qgis_pkg.enum_lookup_config

2023-03-20
----------
Version 0.10
Expand Down
4 changes: 2 additions & 2 deletions cdb4/ddl_scripts/postgresql/010_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ DECLARE
BEGIN
major_version := 0;
minor_version := 10;
minor_revision := 0;
minor_revision := 1;
code_name := 'International Day of Happiness';
release_date := '2023-03-20'::date;
release_date := '2023-03-29'::date;
version := concat(major_version,'.',minor_version,'.',minor_revision);
full_version := concat(major_version,'.',minor_version,'.',minor_revision,' "',code_name,'", released on ',release_date);

Expand Down
20 changes: 8 additions & 12 deletions cdb4/ddl_scripts/postgresql/020_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ ade_prefix varchar DEFAULT NULL,
source_class varchar,
source_table varchar,
source_column varchar,
target_table varchar, --
key_column varchar NOT NULL,
value_column varchar NOT NULL,
target_table varchar NOT NULL DEFAULT 'v_codelist',
key_column varchar NOT NULL DEFAULT 'value',
value_column varchar NOT NULL DEFAULT 'description',
filter_expression varchar,
num_columns integer DEFAULT 1,
allow_multi boolean DEFAULT FALSE,
Expand All @@ -184,15 +184,15 @@ CREATE INDEX enluc_source_class_idx ON qgis_pkg.enum_lookup_config (source_class

--TRUNCATE TABLE qgis_pkg.enum_lookup_config RESTART IDENTITY CASCADE;
INSERT INTO qgis_pkg.enum_lookup_config
(ade_prefix, source_class, source_table, source_column, target_table, key_column, value_column, filter_expression)
(ade_prefix, source_class, source_table, source_column, filter_expression)
VALUES
(NULL, 'CityObject', 'cityobject', 'relative_to_terrain', 'v_enumeration', 'value', 'description', 'data_model = ''CityGML 2.0'' AND name = ''RelativeToTerrainType'''),
(NULL, 'CityObject', 'cityobject', 'relative_to_water' , 'v_enumeration', 'value', 'description', 'data_model = ''CityGML 2.0'' AND name = ''RelativeToWaterType''');
(NULL, 'CityObject', 'cityobject', 'relative_to_terrain', 'data_model = ''CityGML 2.0'' AND name = ''RelativeToTerrainType'''),
(NULL, 'CityObject', 'cityobject', 'relative_to_water' , 'data_model = ''CityGML 2.0'' AND name = ''RelativeToWaterType''');

----------------------------------------------------------------------------------------------------------------
-- Additional entries must be added in this order:
--
--(ade_prefix, source_class, source_table, source_column, target_table, key_column, value_column, filter_expression)
--(ade_prefix, source_class, source_table, source_column, filter_expression)
--
-- And stand for:
-- ADE_PREFIX: If an enumeration is contained in an ADE, then this field contains the ade_prefix associated in the citydb to this ADE.
Expand All @@ -201,10 +201,6 @@ VALUES
-- SOURCE_COLUMN: The column to be associated to a codelist
--
-- The following values are needed to set up the "ValueReleatin" widget used in teh QGIS attribute forms.
--
-- TARGET_TABLE: The view containing all codelists values. Fixed value ('v_codelist').
-- KEY_COLUMN: fixed value ('value'), from view v_codelist
-- VALUE_COLUMN: fixed value ('description'), from view v_codelist
-- FILTER_EXPRESSION: Expression to filter the values of the desired codelist. Basically, it refers to two columns of view v_codelist.
----------------------------------------------------------------------------------------------------------------

Expand All @@ -222,7 +218,7 @@ source_class varchar NOT NULL, -- Building, etc...
source_table varchar NOT NULL,
source_column varchar NOT NULL,
target_table varchar NOT NULL DEFAULT 'v_codelist',
key_column varchar NOT NULL DEFAULT 'value',
key_column varchar NOT NULL DEFAULT 'value',
value_column varchar NOT NULL DEFAULT 'description',
filter_expression varchar NOT NULL,
num_columns integer NOT NULL DEFAULT 1, -- number of columns entries are distributed in the form
Expand Down
2 changes: 1 addition & 1 deletion cdb4/gui_admin/functions/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def exec_revoke_qgis_usr_privileges(dlg: CDB4AdminDialog, usr_name: str, cdb_sch
else:
msg: str = f"Revoking privileges of cdb_schema {cdb_schemas} from user {usr_name}"
gen_f.critical_log(
func=exec_grant_qgis_usr_privileges,
func=exec_revoke_qgis_usr_privileges,
location=FILE_LOCATION,
header=msg,
error=error)
Expand Down
4 changes: 4 additions & 0 deletions cdb4/gui_loader/functions/tab_layers_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,10 @@ def add_detail_view_tables_to_ToC(dlg: CDB4LoaderDialog) -> None:
# print(f"co_id of {detail_view_name} id {co_idx}")
dv_layer.setEditorWidgetSetup(index=co_idx, setup=QgsEditorWidgetSetup('TextEdit',{}))

# Set the layer as read-only if the current cdb_schema is read only
if dlg.CDBSchemaPrivileges == "ro":
dv_layer.setReadOnly()

# Add to layer tree node
detail_view_node.addLayer(dv_layer)
QgsProject.instance().addMapLayer(dv_layer, False)
Expand Down
1 change: 0 additions & 1 deletion cdb_tools_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ def run_admin(self) -> None:
- Executes the dialog
"""
from .cdb4.gui_admin.admin_dialog import CDB4AdminDialog # Admin dialog
from .cdb4.gui_admin.functions import tab_install_widget_functions as admin_ti_wf
from .cdb4.gui_db_connector.functions import conn_functions as conn_f

# Only create GUI ONCE in callback, so that it will only load when the plugin is started.
Expand Down
2 changes: 1 addition & 1 deletion cdb_tools_main_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Plugin current version
PLUGIN_VERSION_MAJOR: int = 0
PLUGIN_VERSION_MINOR: int = 8
PLUGIN_VERSION_REV: int = 0
PLUGIN_VERSION_REV: int = 1

# Paths
PLUGIN_ROOT_PATH: str = os.path.split(os.path.dirname(__file__))[0]
Expand Down
19 changes: 10 additions & 9 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name=3DCityDB Tools
qgisMinimumVersion=3.22
description=Tools to visualize and manipulate CityGML data stored in the 3D City Database
version=0.8
version=0.8.1
author=Giorgio Agugiaro, Konstantinos Pantelios
[email protected], [email protected],

Expand All @@ -29,15 +29,16 @@ repository=https://github.com/tudelft3d/3DCityDB-Tools-for-QGIS
hasProcessingProvider=no

# Uncomment the following line and add your changelog:
changelog= 0.8 Redesigned and extended attribute forms
changelog= 0.8.1 Detail View are set to ro/rw depending on user privileges
0.8 Redesigned and extended attribute forms
0.7.1 Added logic to deal with concurrent dialogs
0.7 extended Loader and Admin, added Deleter
0.6 further code cleaning and refactoring
0.5 major code cleaning and refactoring, moved to TUD GitHub
0.4 first public release (Konstantinos' MSc thesis @ TUD)
0.3 internal release: improved GUI, added dynamic ToC
0.2 internal release: added PostgreSQL/PostGIS back-end
0.1 first internal release
0.7 Extended Loader and Admin, added Deleter
0.6 Further code cleaning and refactoring
0.5 Major code cleaning and refactoring, moved to TUD GitHub
0.4 First public release (as MSc thesis @ TUD)
0.3 Internal release: improved GUI, added dynamic ToC
0.2 Internal release: added PostgreSQL/PostGIS back-end
0.1 First internal release

# Tags are comma separated with spaces allowed
tags=PostgreSQL, 3DCityDB, CityGML
Expand Down
Binary file not shown.

0 comments on commit d15d2e8

Please sign in to comment.