GIS administrator#
Installation#
Database#
The plugin is using a schema in PostgreSQL.
- If you just installed the plugin in a new organization, you must use the install database structure
- If the
pgmetadata
schema is already existing in your database, you may need to upgrade it after a plugin upgrade using the upgrade database structure
Warning
With the administration project, it's only possible to add metadata for tables which are stored in the same PostgreSQL database. For now, it's not possible to reference tables which are stored in another database. The use of the foreign schema might work but has not been tested yet.
Administration project#
The GIS administrator can generate a QGIS project using create metadata project. You need to open the generated project and use the normal QGIS editing tools.
In the group called Information Warnings
:
Orphan metadata
displays table not existing in the database itself, but the metadata exists in thedataset
table.Orphan tables
is the reverse. It displays tables existing in the database but in thedataset
table.
Editing metadata#
Before creating metadata for your layer/table, you need to implement some table. To edit this table you need to open the attribute table, switch on Edition mode and add a new row.
Switching to edit mode:
Adding a new row:
Switching to the form view: You can access the form view in the bottom right corner of the attribute table.
-
On the
Theme
table you can add many theme corresponding to different theme of your layers. You need to enter a code e.g. "A01", and a label corresponding at the name e.g. "Naturals area". Example adding theme: -
On the
Contact
table you can add contacts that can later be associated with your metadata layer. Example new contact: -
The
Dataset
table is the metadata table. You can add many rows and one added line corresponds to a metadata of a layer. You need to fill a row with these minimum information :- Table name,
- Schema name,
- Title,
- Abstract,
- Etc
Example to add a new metadata for a layer: On the second picture you can see the theme.
-
Now you can add a contact to a dataset row with the
Dataset
table. You can click on a tab calledcontact
. You need to allow edit mode in this tab because you implement another table. Example: -
You can add some
Link
to a dataset row with theDataset
table. It's same that to add a contact, you have a link tab. Don't forget to allow edit mode. Example:
When you stop editing a table, don't forget to save your change with clicking on the save icon et leave the edit mode. To save:
To leave the edit mode you need to click on the same button that to enter the edit mode.
HTML Template#
Principle#
The metadata panel is showing all information using HTML templates. These are stored in the database itself. The layer named html_template is displayed in the legend in the administration project.
There are 3 rows in the table :
- One template for the metadata sheet without contacts and links.
- One template for a single link.
- One template for a single contact.
These last two templates will be generated many times for each link and incorporated in the first template.
Edit or translate these templates#
You can customize the HTML template by opening the attribute table of that layer and switching editing mode. Either you might want to translate some hardcoded strings in the HTML or you want to change the HTML layout.
- Use
[% "name_of_field" %]
to display a specific field, egabstract
. - use
[% meta_contacts %]
to display all contacts related. It's using the template calledcontact
. - use
[% meta_links %]
to display all links related. It's using the template calledlink
.
Tip
If you want to reset to default the HTML templates, you can use the Processing algorithm in the toolbox.
Tip
Check the video tutorial at 13 minutes 05 secondes covering the HTML templates.