mapbender / data-manager
Mapbender data manager
Installs: 6 822
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 20
Forks: 1
Open Issues: 3
Language:JavaScript
Requires
- php: >=5.3.3
- blueimp/jquery-file-upload: 9.*
- doctrine/dbal: ^2.11 || ^3
- doctrine/persistence: ^1.3.0 || ^2
- mapbender/data-source: ~0.1.24 || ^0.2
- mapbender/mapbender: ^3.2.6
- dev-master / 2.0.x-dev
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7.1
- 1.0.7
- 1.0.6.4
- 1.0.6.3
- 1.0.6.2
- 1.0.6.1
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-customer-A1020
- dev-feature/enableDBSIMMSupport-prepareForMerge
- dev-develop
- dev-feature/enableDBSIMMSupport
- dev-local/debug
- dev-release/1.2
- dev-feature/60329-mb32x
- dev-release/1.1
- dev-release/1.0
- dev-feature/adapationsToDigitizerCooperation
- dev-feature/multi-data-manager-connection
- dev-withDigitizer
- dev-ol4
- dev-feature/transferMethodFromDigitizerToDataManager
This package is auto-updated.
Last update: 2024-11-22 09:10:01 UTC
README
This repository is deprecated. Its functionality will be integrated into the mapbender digitizer repository in version 2.0 and the code has already been ported to the develop branch. Propose any changes there.
Old description: Mapbender Data Manager element
List and edit database table contents in a Mapbender application.
Data listings are displayed as (HTML) tables. Individual items can be edited or created in customizable forms.
Designed for use in a sidepane.
Data is organized into "schemes" to support multiple tables with differing data and form structures.
If multiple schemes are defined, Data Manager will display a dropdown to allow schema switching.
Each schema separately defines how data is listed and the structure of the form used for editing and creating items.
For spatial data integration, see Digitizer.
For database connection / table selection, please refer to the Data Source documentation.
Connection and table configuration may either be inlined into the Data Manager schema configuration directly, or reference an existing global configuration placed into a Symfony container parameter.
Configuring tabular item listing
Each schema configuration contains an object under key table
with the following structure:
Configuring forms
Each schema configuration contains a list of (potentially nested) objects under key
formItems
, defining the contents and structure of the form shown
when an item is created or edited. Note that this form will also be
used purely as a detail display vehicle even if editing is disabled.
Additionaly, the popup
object in the schema controls properties of the
the popup itself. It supports the following values:
Form input fields
Form input fields come in a multitude of different types, controlled by the type
value. All inputs share a common set of configuration options:
Input field type
is one of
- "input" for a regular single-row text input
- "textArea" for a multiple-row text input
- "select" for a dropdown offering predefined choices
- "radioGroup" for an expanded list of predefined choices
- "checkbox" for an on / off choice
- "date" for a specialized input selecting a calendar day (produces standard SQL date string format "YYYY-MM-DD")
- "colorPicker" for a specialized input selecting a color (produces CSS-like hash + 6 hex digits string format)
- "file" for allowing file attachments
Many common customizations for inputs can be performed purely with the attr
object.
E.g. type "input" can be restricted to allow numbers only by overriding
its HTML type attribute; all inputs can be made required or readonly.
<...> formItems: - type: input name: strictly_formatted_column title: Strict input pattern demo attr: pattern: '\w{2}\d{3,}' placeholder: Two letters followed by at least three digits required: true - type: input name: numeric_column title: Numbers only attr: type: number min: 10 max: 200 step: 10 required: true - type: textArea name: text_column title: Very large text area attr: rows: 10
Choice input option formats
Types "radioGroup" and "select" require a list of objects under key
options
to specify the available choices. Option objects contain:
<...> formItems: - type: select options: # Allow user to explicitly (re)select ~nothing in particular - label: '' value: '' - label: First option text # displayed value: v1 # value in database column - label: Second option text (disabled) value: v2 attr: disabled: true - label: Third option text value: v3
Selects (NOT radioGroup items) can alternatively specify sql
and connection
(Doctrine DBAL connection name) to generate choices
dynamically. The sql
should generate label
and value
aliases
for clarity. If it does not, the first column of each
row is used as the option label and the last column as the submit value.
Static option
definitions and sql
can also be combined.
<...> formItems: - type: select options: # Allow user to explicitly (re)select ~nothing in particular - label: '' value: '' - label: Static option a value: a sql: SELECT CONCAT("label_prefix", ': ', "name") AS label, "id" AS value FROM "some_table" connection: name_of_some_connection
If sql
is defined but connection
is omitted, the "default" DBAL connection
is used for the query.
File uploads
Files uploaded through type: file
form items will be stored in the
server's file system. The mapped database column will only store a file path as a string.
The default storage path for uploads is determined by Mapbender, but
can be reconfigured on the "dataStore" / "featureType" level, individually
for each database column. This is done via a files
object in the
"dataStore" / "featureType" configuration.
E.g.
schemes: items_with_customized_upload_location: dataStore: connection: dm_connection_name table: items_with_file_attachments ## Customization per column here files: - field: attachment_path_column path: /var/mapbender-attachments/dm/items_with_customized_upload_location/attachment_path_column
The starting point for a relative path
(no leading slash) is the web server document root.
For image attachments, you may link a type: img
item that will automatically display a preview of the current attachment.
<...> formItems: - type: file title: Attached image name: img_path_column attr: accept: 'image/*' - type: image name: img_path_column # Link to input established by matching "name" value src: attachment-placeholder.png
Structural / misc form elements
Type "tabs"
Complex form dialogs can be organized into multiple tabs by inserting an object with type: tabs
into the formItems
list, and assigning it one or more tab specifications, which
consist of title
(text displayed on the tab) and children
(contents of the tab).
<...> popup: title: 'Multi-tab form dialog' formItems: - type: tabs children: - title: 'First tab' children: # First tab form item specifications - type: input title: Input in first tab <...> - title: 'Second tab' children: # First tab form item specifications - type: input title: Input in second tab
Misc container tags "div", "span", "p"
Inserts HTML <div>
, <span>
or <p>
tags. May specify text
(encoded, inserted first) and children
(list of more items to insert).
Supports adding free-form HTML attributes via attr
object and custom cssClass
.
<...> formItems: - type: p text: This is an introductory paragraph. # Arrange inputs in Bootstrap grid row + columns - type: div cssClass: row children: - type: input title: Input in left column cssClass: col-xs-4 col-4 - type: input title: Input in middle column cssClass: col-xs-4 col-4 - type: input title: Input in right column cssClass: col-xs-4 col-4
Type "html"
Inserts custom HTML content (no escaping), wrapped into an extra div. May specify attr
and cssClass
to be added onto the containing div.
<...> formItems: - type: html html: 'This will <strong>not</strong> go through any HTML escaping.' cssClass: added-on-wrapping-div
Type "breakLine"
Inserts a single HTML <hr>
element. Supports adding free-form HTML attributes via attr
object and custom cssClass
.
Configuring access
Each schema may also limit the possible interactions users can perform:
Example configuration
schemes: a_demo_schema: label: Demo # displayed in schema selector, if multiple schemes configured dataStore: connection: dm_connection_name table: dm_items uniqueId: id allowEdit: true # Can edit existing items allowCreate: true # Can create new items from scratch allowDelete: false # Can not delete anything allowRefresh: true # Enable item refresh button table: columns: - data: id title: ID - data: name title: Item name popup: title: 'Edit dialog title' width: 50vw # half screen width formItems: - type: p text: This is a non-interactive introductory paragraph. - type: input name: name infoText: This will show up in a tooltip next to the label. title: Item name attr: placeholder: 'Entry required' required: true - type: textArea name: description title: Longer description text attr: rows: 4 - type: radioGroup title: Choose one name: choice_column_1 options: - label: Option 1 value: v1 - label: Option 2 value: v2 value: v2 # Pre-select second option by default for new items - type: select title: Select at least one (multiple choice) attr: required: required multiple: multiple name: choice_column_2 options: - label: Option 1 value: v1 - label: Option 2 (disabled) value: v2 attr: disabled: disabled - label: Option 3 value: v3 value: v1,v3 # use comma-separated values for default multi-select value