This is for the usual case where only one sequence is requested.
When more than one sequence is requested, the suggested name comes out
as ${projectId}-${sequenceList}.${extension}, where `sequenceList` is
the list of sequence numbers separated by semicolons, e.g.:
eq21203-37;38;39.html.
Closes#116.
Resolve "Make event log entries for start and end of line upon import of final sequence, if the entries do not already exist"
Closes#57
See merge request wgp/dougal/software!11
These files contain the sequence of SQL commands needed to bring
a database or project schema up to date with the latest template
database or project schema.
These files must be applied manually. Check the comments at the top of
the file for instructions.
The reason why need to do it like this instead of relying on a trigger
is because the entry in final_lines is created first and the final_shots
are populated. If we first the trigger on final_lines it is not going
to find any shots; if we fire it as a row trigger on final_shots it
would try to label every point in sequence as it is imported; finally if
we fire it as a statement trigger on final_shots we have no idea which
sequence was imported.
Adds:
* label_in_sequence (_sequence integer, _label text):
Returns events containing the specified label.
* handle_final_line_events (_seq integer, _label text, _column text):
- If _label does not exist in the events for sequence _seq:
it adds a new _label label at the shotpoint obtained from
final_lines_summary[_column].
- If _label does exist (and hasn't been auto-added by this function
in a previous run), it will add information about it to the final
line's metadata.
* final_line_post_import (_seq integer):
Calls handle_final_line_events() on the given sequence to check
for FSP, FGSP, LGSP and LSP labels.
* events_seq_labels_single ():
Trigger function to ensure that labels that have the attribute
`model.multiple` set to `false` occur at most only once per
sequence. If a new instance is added to a sequence, the previous
instance is deleted.
* Trigger on events_seq_labels that calls events_seq_labels_single().
* Trigger on events_timed_labels that calls events_seq_labels_single().
Not sure if this helps much. It might help with avoiding
out of order notifications and reducing the rate at which
the clients get spammed when importing database dumps and
such, but that hasn't been tested.
This also implements a generic handler mechanism that can be
reused for other purposes, such as sending email / XMPP notifications,
doing real-time QC checks and so on.
Fixes#113.
If a final sequence file or directory name matches a pattern
which is recognised to indicate a ‘pending acceptance’ status,
the final data (if any exists) for that sequence will be deleted
and a comment added to the effect that the sequence has been
marked as ‘pending’.
To accept the sequence, rename its final file or directory name
accordingly.
Note: it is the *final* data that is searched for a matching
pattern, not the raw.
Closes#91.
If the survey configuration does not itself have a template
we will use the one in etc/defaults/templates/sequence.html.njk.
It is not very likely that the template will be changed all that
often and it avoids issues when people forget to copy it across
to a new survey, etc.
Replaces an existing element with a new one, or inserts it
if there is nothing to replace. The element may be deeply
nested inside a JSON object or array in the `info` table.
Works for both public.info and survey_?.info.
The following options are shown:
* Set line complete:
If a line has been partially shot and still has points
to be acquired.
This option marks remaining virgin points as NTBA=true.
* Set line incomplete:
If a line has been partially shot and remaining virgin
points have been marked as NTBA.
This option marks all points in the line as NTBA=false.
* Set line NTBA:
If a line has not been (successfully) shot at all, i.e.,
all points on the line are virgin.
This option marks the line itself as NTBA=true.
* Unset line NTBA:
If a line has been marked as NTBA.
This option clears the NTBA flag from the line.
`complete` is a boolean.
If true, any virgin points remaining on the line
will be marked as `ntba=true`.
If false, *all* points on the line will be marked
as `ntba=false`.