Creating a Basic Edit Configuration

Table of Contents

Creating a Default Edit Configuration

A default edit configuration is one that directly interrogates the spatial table associated with an entity (via a mapper) for the information it requires, i.e., the attributes associated with the entity and what spatial geometries, point, line or polygon, the user is allowed to create.

The public.graffiti table used in this section is defined in Database Objects.

The graffiti entity and m.graffiti spatial mapper are defined in Weave Configuration.

The following default.edit config element shows how to implement a basic edit configuration for our entity.

<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:edit="urn:com.cohga.spatial.edit#1.0"> <edit:config id="default.edit"> <entity>graffiti</entity> <label>Graffiti (default)</label> <publish>true</publish> <description>Report graffiti for removal</description> </edit:config> </config>

This default edit configuration allows all attributes attached to the entity’s underlying spatial table to be edited. How the user will be able to edit those attributes will be determined by the underlying column type in the underlying spatial table. The editing is limited to simple types such as text fields for string and numbers, a calendar field for dates.

Setting the edit configuration publish setting to false will stop the edit from appearing in the list of edit configurations available for an entity. The edit will still be available but can only be initiated via code or a URL parameter, this provides for the creation of custom editing clients that do not have their edits listed in standard editing clients (see Starting Editing From a URL)

Viewing or Accessing an Edit Configuration

Edit configurations for an entity, such as default.edit, are accessed (or viewed) in a Weave client through use of the <view id="com.cohga.client.panel.edit"> client component.

This view panel provides the actions required to initiate editing, the tools required to perform the spatial edit operations, and the ability for a user to enter/change the attributes associated with the entity being edited.

This view is added to a client configuration as follows:

<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:client="urn:com.cohga.html.client#1.0"> <client:config id="Edit"> ... <perspective> ... <!-- Add TOC View Panel to the client --> <view id="com.cohga.html.client.map.tocView"> <label>Layers</label> <location>west</location> <contextmenu> <item action="weave.toc.zoomToLayer"/> <item action="weave.toc.selectLayer"/> <item action="weave.toc.clearSelection"/> </contextmenu> </view> <!-- Add the Edit panel to the client --> <view id="com.cohga.client.panel.edit"> <label>Edit</label> <location>west</location> </view> ... </perspective> ... </client:config> </config>

The edit panel, displaying the “Graffiti (default)” edit configuration, looks like this.

View Panel with Button Descriptions

The following table describes these buttons in detail.

Icon

Tool Tip

Description

Icon

Tool Tip

Description

 

Create a new entity

Creates a new entity.
Will be disabled if editing is in progress.

 

Edit the selected entity

Changes the currently selected entity.
Will be disabled if no entity is selected, if there is more than one entity selected, or if editing is in progress.

 

Delete the selected entity

Removes the currently selected entity.
Will be disabled if no entity is selected, if there is more than one entity selected, or if editing is in progress.

 

Reset the form fields

Resets the form fields back to their original values.
Will be disabled if editing is not in progress.

 

Submit changes.

Completes the edit process and saves the current changes.
Will be disabled when editing is not in process or if the current state is not valid, for example if a polygon geometry is required but hasn't yet been added.

 

Cancel changes.

Aborts the edit process and abandons the current changes.
Will be disabled when editing is not in progress.

Modify
Click on an entity to modify it.

Modifies an existing entity geometry.
Will be disabled if there is no entity selected. You can modify an existing entity (using the Update tool) or one that you are in the process of creating (using the Create tool). Modifications can be made by:

  • Using the centre node (shown as an orange circle): Click and drag the point, line or polygon to a new location.

  • Using the vertices and end points (shown as orange circles): Click and drag the vertex/end point to a new location. Or hold your mouse over the vertex/end point and press the Delete key to delete it. 

  • Using the edge mid-points (shown as faded orange circles in the middle of an edge): Click on new node to add and/or move node to a new location. 

 

Point
Add a point.

Will be disabled if the entity doesn't support a point geometry or if it only supports a single point and there already is a point attached to the entity.

 

Line
Add a line.

Will be disabled if the entity doesn't support a line geometry or if it only supports a single line and there already is a line attached to the entity.

 

Rectangle
Add a rectangle

In some versions of Weave a rectangle tool may exist.
The rectangle tool is an alternate way of creating a polygon.
So, this tool will be disabled if the entity doesn't support a polygon geometry or if it only supports a single polygon and there already is a polygon attached to the entity.

 

Polygon
Add a polygon

Will be disabled if the entity doesn't support a polygon geometry or if it only supports a single polygon and there already is a polygon attached to the entity.

Remove
Remove the currently selected entity.

Will be disabled if there is no geometry enabled or if the entity requires some geometry and this is the last piece of geometry related to the entity.

Import
Import geometry from another entity.

The entity must firstly be selected from the other entity/Active Layer.

This tool can be used to import an entity’s geometry and/or attributes from another entity.

Upload
Upload geometry from a file. 

Will be disabled if editing is not in progress.

This tool can be used to load spatial data from a supported spatial file format.

Create
Create geometry from text coordinates. 

Will be disabled if editing is not in progress.

This tool can be used to define an entity’s geometry from one or more coordinate pairs in a variety of formats.

Update
Update geometry from text coordinates. 

Is enabled when an Update feature action is in progress. 

This tool can be used to modify an entity’s geometry by editing the list of coordinate pairs that make up the entity’s point, line or polygon geometry.

Snapping
Toggle the snapping function on and off.

Toggles the snapping function on and off.

Snap Settings
Changes the snap settings.

Changes the snap settings.