diff --git a/examples/business-document.yaml b/examples/business-document.yaml new file mode 100644 index 0000000..cd94744 --- /dev/null +++ b/examples/business-document.yaml @@ -0,0 +1,135 @@ +# Worked instance for Annex E (application to business document +# interchange): a purchase order expressed as a base BasicDocument. +# Trade identifiers ride the attribute register with ISO 6523 scheme +# keys; line items and totals are tables, with computed cells carried +# as formula blocks. A revision round against this document is shown +# by the twin ChangeSet examples/table-changes.{xml,yaml}. +# Validated against the LML model by `rake fixtures:yaml`. +document: + class: BasicDocument + attributes: + - key: class + value: [purchase-order] + - key: supplier-id + scheme: iso-6523 + value: "0060:9876543210" + - key: buyer-id + scheme: iso-6523 + value: "0060:4182738170" + - key: currency + value: EUR + identifier: + class: UniqueIdentifier + value: basicdoc-business-fixtures-1 + bibdata: + class: BibData + ext: + class: BibDataExtensionType + doctype: [document] + sections: + - class: ContentSection + id: po-header + title: [{ text: Purchase order }] + blocks: + - class: ParagraphBlock + id: po-p1 + contents: + - text: "Purchase order " + - class: ReferenceToVariable + name: po-number + - text: " issued on " + - class: ReferenceToVariable + name: issue-date + - text: " for delivery per " + - class: ReferenceToVariable + name: incoterm + - class: ContentSection + id: po-terms + title: [{ text: Terms }] + blocks: + - class: ParagraphBlock + id: po-p2 + contents: + - text: "The supplier shall deliver in accordance with the " + - class: EmphasisElement + content: [{ text: agreed schedule }] + - text: ", subject to the tolerances below." + - class: AdmonitionBlock + id: po-note + type: note + contents: + - class: ParagraphBlock + id: po-notep1 + contents: + - text: Quantities may vary within 5% of the ordered amounts. + - class: ContentSection + id: po-lines + title: [{ text: Line items }] + blocks: + - class: TableBlock + id: po-lines-t1 + name: [{ text: Ordered items }] + head: + - class: TextTableRow + th: + - class: TextTableCell + content: [{ text: Item }] + - class: TextTableCell + content: [{ text: Quantity }] + - class: TextTableCell + content: [{ text: Unit price }] + - class: TextTableCell + content: [{ text: Total }] + body: + - class: TextTableRow + td: + - class: TextTableCell + content: [{ text: Widget W1 }] + - class: TextTableCell + content: [{ text: "12" }] + - class: TextTableCell + content: [{ text: "9.50" }] + - class: ParagraphTableCell + content: + - class: FormulaBlock + id: po-lines-t1-f1 + stem: + class: StemElement + stemType: AsciiML + stemValue: + class: AsciiML + value: B2 * C2 + - class: TextTableRow + td: + - class: TextTableCell + content: [{ text: Gear G7 }] + - class: TextTableCell + content: [{ text: "3" }] + - class: TextTableCell + content: [{ text: "41.00" }] + - class: ParagraphTableCell + content: + - class: FormulaBlock + id: po-lines-t1-f2 + stem: + class: StemElement + stemType: AsciiML + stemValue: + class: AsciiML + value: B3 * C3 + foot: + - class: TextTableRow + td: + - class: TextTableCell + colspan: 3 + content: [{ text: Total }] + - class: ParagraphTableCell + content: + - class: FormulaBlock + id: po-lines-t1-f3 + stem: + class: StemElement + stemType: AsciiML + stemValue: + class: AsciiML + value: SUM(D2, D3) diff --git a/examples/table-changes.xml b/examples/table-changes.xml new file mode 100644 index 0000000..7562205 --- /dev/null +++ b/examples/table-changes.xml @@ -0,0 +1,100 @@ + + + + + + + inlineBasicElement + + + + + + + + + + + + Tier + + + + + + + + count(body rows) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (revised) + + + + + + + priced + + + + diff --git a/examples/table-changes.yaml b/examples/table-changes.yaml new file mode 100644 index 0000000..77b4831 --- /dev/null +++ b/examples/table-changes.yaml @@ -0,0 +1,143 @@ +# Twin reference instance of the change model: a ChangeSet applied to the +# line-item table (li1t1) of document.yaml, exercising every change +# operation — node insert/delete/move (with explicit position), content +# and attribute modification, row insert/delete/move, column +# insert/delete/move, cell update, cell merge and cell split — including +# a computed cell (a formula block inside a table cell). +# Twin of: table-changes.xml +class: ChangeSet +documentIdentifier: + class: UniqueIdentifier + value: basicdoc-fixtures-1 +changes: + # add a line-item row + - class: RowInsert + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-01 } + area: body + position: 1 + row: + class: TextTableRow + td: + - class: TextTableCell + content: [{ text: inline }] + - class: TextTableCell + content: [{ text: BasicElement }] + # append a column; every row gains an empty cell + - class: ColumnInsert + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-02 } + parentIdentifier: { class: UniqueIdentifier, value: chg-01 } + position: 2 + # header cell for the new column + - class: CellUpdate + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-03 } + parentIdentifier: { class: UniqueIdentifier, value: chg-02 } + row: 0 + column: 2 + cell: + class: TextTableCell + content: [{ text: Tier }] + # computed cell: a formula block inside a table cell + - class: CellUpdate + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-04 } + parentIdentifier: { class: UniqueIdentifier, value: chg-03 } + row: 2 + column: 2 + cell: + class: ParagraphTableCell + content: + - class: FormulaBlock + id: li1t1f1 + stem: + class: StemElement + stemType: AsciiML + stemValue: + class: AsciiML + value: count(body rows) + # merge the units header across both columns + - class: CellMerge + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-05 } + parentIdentifier: { class: UniqueIdentifier, value: chg-04 } + from: { class: CellCoordinate, row: 1, column: 0 } + to: { class: CellCoordinate, row: 1, column: 1 } + # split it back + - class: CellSplit + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-06 } + parentIdentifier: { class: UniqueIdentifier, value: chg-05 } + at: { class: CellCoordinate, row: 1, column: 0 } + # promote a body row to the footer + - class: RowMove + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-07 } + parentIdentifier: { class: UniqueIdentifier, value: chg-06 } + areaOld: body + positionOld: 2 + areaNew: foot + positionNew: 0 + # move the Tier column before the Construct column + - class: ColumnMove + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-08 } + parentIdentifier: { class: UniqueIdentifier, value: chg-07 } + positionOld: 2 + positionNew: 1 + # drop a body row + - class: RowDelete + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-09 } + parentIdentifier: { class: UniqueIdentifier, value: chg-08 } + area: body + position: 0 + # node insert at an explicit position + - class: NodeInsert + target: { class: ReferenceToIdElement, target: li1 } + identifier: { class: UniqueIdentifier, value: chg-10 } + parentIdentifier: { class: UniqueIdentifier, value: chg-09 } + position: + class: NodePosition + parent: { class: ReferenceToIdElement, target: li1 } + index: 2 + content: { class: Bookmark, id: chg-bm1 } + # node delete with integrity check + - class: NodeDelete + target: { class: ReferenceToIdElement, target: tdp1 } + identifier: { class: UniqueIdentifier, value: chg-11 } + parentIdentifier: { class: UniqueIdentifier, value: chg-10 } + hashValue: sha-256:2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 + # node move + - class: NodeMove + target: { class: ReferenceToIdElement, target: tdli1p1 } + identifier: { class: UniqueIdentifier, value: chg-12 } + parentIdentifier: { class: UniqueIdentifier, value: chg-11 } + positionOld: { class: ReferenceToIdElement, target: tdli1 } + positionNew: { class: ReferenceToIdElement, target: li1 } + # text edit by cursor range + - class: ContentModify + target: { class: ReferenceToIdElement, target: li1p1 } + identifier: { class: UniqueIdentifier, value: chg-13 } + parentIdentifier: { class: UniqueIdentifier, value: chg-12 } + actions: + - class: ContentChangeAction + action: insert + from: 39 + to: 39 + text: " (revised)" + length: 10 + # register entry update by cursor range + - class: AttributeModify + target: { class: ReferenceToIdElement, target: li1t1 } + identifier: { class: UniqueIdentifier, value: chg-14 } + parentIdentifier: { class: UniqueIdentifier, value: chg-13 } + actions: + - class: AttributeChangeAction + attributeId: class + action: insert + from: 0 + to: 0 + text: priced + length: 6 diff --git a/grammars/basicdoc-compile.rnc b/grammars/basicdoc-compile.rnc index e470aa0..06b60ec 100644 --- a/grammars/basicdoc-compile.rnc +++ b/grammars/basicdoc-compile.rnc @@ -1,5 +1,5 @@ grammar { include "../vendor/relaton-models/relaton/grammars/biblio.rnc" { } include "basicdoc.rnc" { } -start = document +start = document | changeset } diff --git a/grammars/basicdoc.rnc b/grammars/basicdoc.rnc index 3355d4c..4cafa94 100644 --- a/grammars/basicdoc.rnc +++ b/grammars/basicdoc.rnc @@ -1333,4 +1333,198 @@ dd = dd-no-id = element dd { BasicBlock* } +## Change models: operational changes applied incrementally to a document. + +## A collection of changes, specifying the document they should be applied to +changeset = + element changeset { + ## The unique identifier that identifies the document where this ChangeSet should be applied to + attribute document { text }, + change* + } + +## Specification of an update action to be performed incrementally on an element of a document. +## The target is an element of the document identified by the changeset, addressed by its +## register identifier (a plain string, not an in-document reference) +change = + element change { + ChangeAttributes, + ( node-insert | node-delete | node-move | content-modify | attribute-modify | + row-insert | row-delete | row-move | column-insert | column-delete | + column-move | cell-update | cell-merge | cell-split ) + } + +ChangeAttributes = + ## The identifier of the element that this action should be applied to + attribute target { text }, + ## A unique identifier of this change + attribute id { text }, + ## The unique identifier of a Change that this change is supposed to follow after; + ## a change with no parent is the root of a change sequence + attribute parent { text }? + +## Specification of the insertion of a data node, at an explicit position +node-insert = + element node-insert { + ## The position where the content is to be inserted + element position { + ## The identifier of the node whose child sequence the position refers to + attribute parent { text }, + ## Zero-based ordinal among the children of the parent node; omitted = end of the child sequence + attribute index { xsd:integer }? + }?, + TextElement + } + +## Specification of the deletion of a data node +node-delete = + element node-delete { + ## Hash value of the node to be deleted, for verification purposes + attribute hash { text }? + } + +## Specification of moving a node to another location within the same document +node-move = + element node-move { + ## Identifier of the node's current parent, to verify that the location has not changed + attribute old-parent { text }, + ## Identifier of the new parent or sibling of the node + attribute new-parent { text } + } + +## Container for multiple content change actions +content-modify = + element content-modify { + element action { + ## Text is to be inserted or deleted from the content + attribute type { "insert" | "delete" }, + ## Beginning cursor position of a textual change + attribute from { xsd:integer }, + ## Ending cursor position of a textual change + attribute to { xsd:integer }, + ## Characters removed (delete), or the length of the inserted text (insert) + attribute length { xsd:integer }?, + ## In the case of an insert, the string to be inserted + text? + }+ + } + +## Container for multiple attribute change actions +attribute-modify = + element attribute-modify { + element action { + ## Register key of the attribute where the attribute change applies + attribute key { text }, + ## Text is to be inserted or deleted from the attribute content + attribute type { "insert" | "delete" }, + ## Beginning cursor position of a textual change + attribute from { xsd:integer }, + ## Ending cursor position of a textual change + attribute to { xsd:integer }, + ## Characters removed (delete), or the length of the inserted text (insert) + attribute length { xsd:integer }?, + ## In the case of an insert, the string to be inserted + text? + }+ + } + +## The row container of a table that a row-level change applies to +TableAreaType = "head" | "body" | "foot" + +## Specification of the insertion of a row into a table +row-insert = + element row-insert { + ## The row container that the row is inserted into + attribute area { TableAreaType }, + ## Zero-based ordinal within the row container; rows at or after this position shift down by one + attribute position { xsd:integer }, + ## The row to be inserted; omitted = an empty row sized to the grid of the table + tr? + } + +## Specification of the deletion of a row from a table +row-delete = + element row-delete { + ## The row container that the row is deleted from + attribute area { TableAreaType }, + ## Zero-based ordinal of the row within the row container + attribute position { xsd:integer } + } + +## Specification of moving a row to another position, possibly another row container +row-move = + element row-move { + ## The row container that the row is moved from + attribute old-area { TableAreaType }, + ## Zero-based ordinal of the row within its old container + attribute old-position { xsd:integer }, + ## The row container that the row is moved to + attribute new-area { TableAreaType }, + ## Zero-based ordinal of the row within its new container + attribute new-position { xsd:integer } + } + +## Specification of the insertion of a column into a table +column-insert = + element column-insert { + ## Zero-based index of the grid column to insert the column at + attribute position { xsd:integer }, + ## A template cell used as the initial content of the created cells; omitted = empty text cells + ( td | th )? + } + +## Specification of the deletion of a column from a table +column-delete = + element column-delete { + ## Zero-based index of the grid column to be deleted + attribute position { xsd:integer } + } + +## Specification of moving a column to another grid position +column-move = + element column-move { + ## Zero-based index of the grid column to be moved + attribute old-position { xsd:integer }, + ## Zero-based grid column index the column is moved to + attribute new-position { xsd:integer } + } + +## Specification of the replacement of a single cell +cell-update = + element cell-update { + ## Zero-based index of the grid row of the cell's origin slot + attribute row { xsd:integer }, + ## Zero-based index of the grid column of the cell's origin slot + attribute column { xsd:integer }, + ## The cell that replaces the existing cell + ( td | th ) + } + +## Grid coordinates of a cell's origin slot +CellCoordinateAttributes = + attribute row { xsd:integer }, + attribute column { xsd:integer } + +## Specification of merging two adjacent cells +cell-merge = + element cell-merge { + ## The cell that absorbs the slots of the other cell + element from { CellCoordinateAttributes }, + ## The cell whose slots are absorbed; it ceases to exist + element to { CellCoordinateAttributes } + } + +## Specification of splitting a cell that spans multiple grid slots +cell-split = + element cell-split { + ## Zero-based index of the grid row of the cell's origin slot + attribute row { xsd:integer }, + ## Zero-based index of the grid column of the cell's origin slot + attribute column { xsd:integer }, + ## The resulting row span of the cell; omitted = one + attribute rows { xsd:integer }?, + ## The resulting column span of the cell; omitted = one + attribute columns { xsd:integer }? + } + } diff --git a/images/Changes.png b/images/Changes.png index 2ce7371..87f0ee2 100644 Binary files a/images/Changes.png and b/images/Changes.png differ diff --git a/images/TableChanges.png b/images/TableChanges.png new file mode 100644 index 0000000..6a71320 Binary files /dev/null and b/images/TableChanges.png differ diff --git a/models/change/NodeInsert.lml b/models/change/NodeInsert.lml index 89c6506..52bd828 100644 --- a/models/change/NodeInsert.lml +++ b/models/change/NodeInsert.lml @@ -8,5 +8,12 @@ of a data node in a BasicDocument. A data element conforming to _BasicElement_ to be inserted into the specified BasicDocument. } } + +position: NodePosition[0..1] { + definition { +The position where the content is to be inserted: a container node and +a zero-based ordinal among its children. When omitted, the content is +appended to the end of the child sequence of the target node. + } + } } diff --git a/models/change/NodePosition.lml b/models/change/NodePosition.lml new file mode 100644 index 0000000..7d26050 --- /dev/null +++ b/models/change/NodePosition.lml @@ -0,0 +1,18 @@ +class NodePosition { + definition { +Locates a position in a _BasicDocument_ as a container node and an +ordinal among its child sequence, so that node insertions are +deterministic. Ordinals are zero-based. + } + +parent: ReferenceToIdElement { + definition { +The node whose child sequence the position refers to. + } + } + +index: Integer[0..1] { + definition { +Zero-based ordinal among the children of the parent node. When omitted, +the position refers to the end of the child sequence. + } + } +} diff --git a/models/change/tables/CellCoordinate.lml b/models/change/tables/CellCoordinate.lml new file mode 100644 index 0000000..243d19b --- /dev/null +++ b/models/change/tables/CellCoordinate.lml @@ -0,0 +1,17 @@ +class CellCoordinate { + definition { +Locates a cell in the grid of a table by the grid row and grid column +of its origin slot, accounting for cells that span multiple slots. +Indexes are zero-based. + } + +row: Integer { + definition { +Zero-based index of the grid row of the cell's origin slot. + } + } + +column: Integer { + definition { +Zero-based index of the grid column of the cell's origin slot. + } + } +} diff --git a/models/change/tables/CellMerge.lml b/models/change/tables/CellMerge.lml new file mode 100644 index 0000000..9f429e5 --- /dev/null +++ b/models/change/tables/CellMerge.lml @@ -0,0 +1,20 @@ +class CellMerge { + definition { +Specification of merging two adjacent cells of a table: the cell at +`from` absorbs the grid slots of the cell at `to`. The cells shall be +adjacent on the same grid row (a horizontal merge, increasing the +column span) or in the same grid column (a vertical merge, increasing +the row span). The content of both cells is concatenated, in document +order, into the merged cell. + } + +from: CellCoordinate { + definition { +The cell that absorbs the slots of the other cell. + } + } + +to: CellCoordinate { + definition { +The cell whose slots are absorbed; it ceases to exist. + } + } +} diff --git a/models/change/tables/CellSplit.lml b/models/change/tables/CellSplit.lml new file mode 100644 index 0000000..f18165b --- /dev/null +++ b/models/change/tables/CellSplit.lml @@ -0,0 +1,24 @@ +class CellSplit { + definition { +Specification of splitting a cell of a table that spans multiple grid +slots. The cell's span is reduced to the given extents; the freed slots +are filled with empty text cells, and the original cell keeps its +content in its origin slot. + } + +at: CellCoordinate { + definition { +The cell to be split, by the grid coordinates of its origin slot. + } + } + +rows: Integer[0..1] { + definition { +The resulting row span of the cell. When omitted, the span becomes one. + } + } + +columns: Integer[0..1] { + definition { +The resulting column span of the cell. When omitted, the span becomes +one. + } + } +} diff --git a/models/change/tables/CellUpdate.lml b/models/change/tables/CellUpdate.lml new file mode 100644 index 0000000..90384f2 --- /dev/null +++ b/models/change/tables/CellUpdate.lml @@ -0,0 +1,23 @@ +class CellUpdate { + definition { +Specification of the replacement of a single cell of a table, +identified by the grid coordinates of its origin slot. The replacement +cell replaces the existing cell wholly: its specialization, content +and properties. + } + +row: Integer { + definition { +Zero-based index of the grid row of the cell's origin slot. + } + } + +column: Integer { + definition { +Zero-based index of the grid column of the cell's origin slot. + } + } + +cell: TableCell { + definition { +The cell that replaces the existing cell. + } + } +} diff --git a/models/change/tables/ColumnDelete.lml b/models/change/tables/ColumnDelete.lml new file mode 100644 index 0000000..d3dbaac --- /dev/null +++ b/models/change/tables/ColumnDelete.lml @@ -0,0 +1,13 @@ +class ColumnDelete { + definition { +Specification of the deletion of a column from a table. Cells that +originate in the deleted grid column are removed; cells that span it +have their column span decremented by one. Occupied slots after the +deleted column shift left by one in every row. + } + +position: Integer { + definition { +Zero-based index of the grid column to be deleted. + } + } +} diff --git a/models/change/tables/ColumnInsert.lml b/models/change/tables/ColumnInsert.lml new file mode 100644 index 0000000..19ff247 --- /dev/null +++ b/models/change/tables/ColumnInsert.lml @@ -0,0 +1,18 @@ +class ColumnInsert { + definition { +Specification of the insertion of a column into a table. Occupied grid +slots at or after the insertion column shift right by one in every row; +each row that has a slot at the insertion column gains a cell there. + } + +position: Integer { + definition { +Zero-based index of the grid column to insert the column at. + } + } + +cell: TableCell[0..1] { + definition { +A template cell used as the initial content of the cells created in the +new column. When omitted, empty text cells are created. + } + } +} diff --git a/models/change/tables/ColumnMove.lml b/models/change/tables/ColumnMove.lml new file mode 100644 index 0000000..242996f --- /dev/null +++ b/models/change/tables/ColumnMove.lml @@ -0,0 +1,18 @@ +class ColumnMove { + definition { +Specification of moving a column of a table to another grid position. +Cells move with their column; the affected cells of other columns shift +accordingly. + } + +positionOld: Integer { + definition { +Zero-based index of the grid column to be moved. Useful for verifying +that the location has not changed. + } + } + +positionNew: Integer { + definition { +Zero-based grid column index the column is moved to. + } + } +} diff --git a/models/change/tables/RowDelete.lml b/models/change/tables/RowDelete.lml new file mode 100644 index 0000000..41c78f8 --- /dev/null +++ b/models/change/tables/RowDelete.lml @@ -0,0 +1,17 @@ +class RowDelete { + definition { +Specification of the deletion of a row from a table. Rows after the +deleted position shift up by one position within the same row +container. + } + +area: TableArea { + definition { +The row container that the row is deleted from. + } + } + +position: Integer { + definition { +Zero-based ordinal of the row within the row container. + } + } +} diff --git a/models/change/tables/RowInsert.lml b/models/change/tables/RowInsert.lml new file mode 100644 index 0000000..ce1cb45 --- /dev/null +++ b/models/change/tables/RowInsert.lml @@ -0,0 +1,24 @@ +class RowInsert { + definition { +Specification of the insertion of a row into a table. Rows at or after +the insertion position shift down by one position within the same row +container. + } + +area: TableArea { + definition { +The row container that the row is inserted into. + } + } + +position: Integer { + definition { +Zero-based ordinal within the row container. Rows at or after this +position shift down by one. + } + } + +row: TextTableRow[0..1] { + definition { +The row to be inserted. When omitted, an empty row sized to the grid of +the table is inserted. + } + } +} diff --git a/models/change/tables/RowMove.lml b/models/change/tables/RowMove.lml new file mode 100644 index 0000000..c418727 --- /dev/null +++ b/models/change/tables/RowMove.lml @@ -0,0 +1,28 @@ +class RowMove { + definition { +Specification of moving a row of a table to another position, possibly +into another row container. Other rows shift accordingly in both the +old and the new container. + } + +areaOld: TableArea { + definition { +The row container that the row is moved from. + } + } + +positionOld: Integer { + definition { +Zero-based ordinal of the row within its old container. Useful for +verifying that the location has not changed. + } + } + +areaNew: TableArea { + definition { +The row container that the row is moved to. + } + } + +positionNew: Integer { + definition { +Zero-based ordinal of the row within its new container. + } + } +} diff --git a/models/change/tables/TableArea.lml b/models/change/tables/TableArea.lml new file mode 100644 index 0000000..5d27e20 --- /dev/null +++ b/models/change/tables/TableArea.lml @@ -0,0 +1,23 @@ +enum TableArea { + definition { +The row container of a _TableBlock_ that a row-level change applies to. + } + + head { + definition { +The table header rows. + } + } + + body { + definition { +The table body rows. + } + } + + foot { + definition { +The table footer rows. + } + } +} diff --git a/models/change/tables/TableChange.lml b/models/change/tables/TableChange.lml new file mode 100644 index 0000000..e770c6f --- /dev/null +++ b/models/change/tables/TableChange.lml @@ -0,0 +1,10 @@ +class TableChange { + definition { +Possible actions that modify the structure or the content of a table: +insertion, deletion and reordering of rows and columns, and changes to +individual cells, including merging and splitting. +The `target` attribute inherited from the _Change_ model indicates the +_TableBlock_ that the action applies to. Row and column ordinals index +the grid of the table, accounting for cells that span multiple slots. + } +} diff --git a/views/Changes.lml b/views/Changes.lml index 59b8d66..6bc14fe 100644 --- a/views/Changes.lml +++ b/views/Changes.lml @@ -14,6 +14,19 @@ diagram Change { include ../models/change/ContentChangeAction.lml include ../models/change/AttributeChangeAction.lml include ../models/change/ContentAction.lml + include ../models/change/NodePosition.lml + include ../models/change/tables/TableChange.lml + include ../models/change/tables/TableArea.lml + include ../models/change/tables/CellCoordinate.lml + include ../models/change/tables/RowInsert.lml + include ../models/change/tables/RowDelete.lml + include ../models/change/tables/RowMove.lml + include ../models/change/tables/ColumnInsert.lml + include ../models/change/tables/ColumnDelete.lml + include ../models/change/tables/ColumnMove.lml + include ../models/change/tables/CellUpdate.lml + include ../models/change/tables/CellMerge.lml + include ../models/change/tables/CellSplit.lml association { owner Change @@ -86,4 +99,59 @@ diagram Change { member NodeMove owner_type inheritance } + association { + owner NodePosition + member NodeInsert + member_type direct + } + association { + owner Change + member TableChange + owner_type inheritance + } + association { + owner TableChange + member RowInsert + owner_type inheritance + } + association { + owner TableChange + member RowDelete + owner_type inheritance + } + association { + owner TableChange + member RowMove + owner_type inheritance + } + association { + owner TableChange + member ColumnInsert + owner_type inheritance + } + association { + owner TableChange + member ColumnDelete + owner_type inheritance + } + association { + owner TableChange + member ColumnMove + owner_type inheritance + } + association { + owner TableChange + member CellUpdate + owner_type inheritance + } + association { + owner TableChange + member CellMerge + owner_type inheritance + } + association { + owner TableChange + member CellSplit + owner_type inheritance + } } diff --git a/views/TableChanges.lml b/views/TableChanges.lml new file mode 100644 index 0000000..92d3a30 --- /dev/null +++ b/views/TableChanges.lml @@ -0,0 +1,106 @@ +diagram TableChanges { + title "Table changes" + + include ../models/change/Change.lml + include ../models/change/tables/TableChange.lml + include ../models/change/tables/TableArea.lml + include ../models/change/tables/CellCoordinate.lml + include ../models/change/tables/RowInsert.lml + include ../models/change/tables/RowDelete.lml + include ../models/change/tables/RowMove.lml + include ../models/change/tables/ColumnInsert.lml + include ../models/change/tables/ColumnDelete.lml + include ../models/change/tables/ColumnMove.lml + include ../models/change/tables/CellUpdate.lml + include ../models/change/tables/CellMerge.lml + include ../models/change/tables/CellSplit.lml + include ../models/blocks/tables/TableBlock.lml + include ../models/blocks/tables/TextTableRow.lml + include ../models/blocks/tables/TableCell.lml + + association { + owner Change + member TableChange + owner_type inheritance + } + association { + owner TableChange + member RowInsert + owner_type inheritance + } + association { + owner TableChange + member RowDelete + owner_type inheritance + } + association { + owner TableChange + member RowMove + owner_type inheritance + } + association { + owner TableChange + member ColumnInsert + owner_type inheritance + } + association { + owner TableChange + member ColumnDelete + owner_type inheritance + } + association { + owner TableChange + member ColumnMove + owner_type inheritance + } + association { + owner TableChange + member CellUpdate + owner_type inheritance + } + association { + owner TableChange + member CellMerge + owner_type inheritance + } + association { + owner TableChange + member CellSplit + owner_type inheritance + } + association { + owner TableBlock + member TableChange + member_type direct + } + association { + owner TableArea + member RowInsert + member_type direct + } + association { + owner TextTableRow + member RowInsert + member_type direct + } + association { + owner TableCell + member ColumnInsert + member_type direct + } + association { + owner TableCell + member CellUpdate + member_type direct + } + association { + owner CellCoordinate + member CellMerge + member_type direct + } + association { + owner CellCoordinate + member CellSplit + member_type direct + } +}