Skip to content

Commit

Permalink
Changes in DocuProject for the sake of the documentation site
Browse files Browse the repository at this point in the history
  • Loading branch information
annekekleppe committed Nov 28, 2024
1 parent 6fd5417 commit 9d47606
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 81 deletions.
30 changes: 30 additions & 0 deletions packages/samples/DocuProject/src/defs/editor-main-controls.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* This file contains the default editor definition. */

editor controls

BaseProduct {[
Base Products ${name} for ${theme radio}
is still under construction: ${self.isUnderConstruction switch}
is approved level1: ${self.isApprovedLevel1 radio [Sure | NoWay]}
is approved level2: ${self.isApprovedLevel2 inner-switch}
is approved level3: ${self.isApprovedLevel3 checkbox}
yields profit: ${self.yieldsProfit text [Plenty | Little]}
expected nr of use: ${self.nrOfUse}
range: ${self.range slider}


${parts}
]}

InsuranceProduct {[
Insurance Product ${name} ( public name: ${productName} ) USES ${basedOn horizontal separator[, ]}
Themes: ${themes checkbox}
Premium: ${advertisedPremium} per ${nrPremiumDays}
Insured risks:
${parts vertical terminator [;]}
Calculation
[? Risk adjusted by = ${riskAdjustment} ]
calculated premium: ${calculation}
[?Helper functions:
${helpers vertical}]
]}
14 changes: 3 additions & 11 deletions packages/samples/DocuProject/src/defs/editor-main-default.edit
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ editor default

global {
boolean inner-switch [YES | NO] // the strings used to display a boolean value, all booleans will default be displayed as an inner switch control
limited radio
limited[] checkbox
// limited radio
// limited[] checkbox
// number slider // you can use the slider control as default projection for numbers, but this will not often be the preferred option
referenceSeparator [:] // the string that separates the names in a path name, e.g. pack1:cls3:part
external {
AnimatedGif,
Expand All @@ -22,15 +23,6 @@ Product {[ ${self.product} ]}

BaseProduct {[
Base Products ${name} for ${theme}
is still under construction: ${self.isUnderConstruction switch}
is approved level1: ${self.isApprovedLevel1 radio [Sure | NoWay]}
is approved level2: ${self.isApprovedLevel2 inner-switch}
is approved level3: ${self.isApprovedLevel3 checkbox}
yields profit: ${self.yieldsProfit text [Plenty | Little]}
expected nr of use: ${self.nrOfUse}
range: ${self.range slider}


${parts}
]}

Expand Down
12 changes: 12 additions & 0 deletions packages/samples/DocuProject/src/defs/editor-named-proj.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
editor UsingComments

BaseProduct {[
/* In this projection 'self.parts' is always shown according to the projection */
/* defined for concept InsurancePart in the editor 'comments'. */
Base Products ${self.name} for ${self.theme}
${self.parts:comments}
]}

Entity {[
${self.isCompany [COMPANY | PERSON]} ${self.name}
]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file contains the table definition in a separate editor / projection group.
This enables the user to switch tables on and off. */

editor buttonedTables precedence 5

InsurancePart{
table [
Name | risk | pay out | is approved | action
${name} | ${statisticalRisk} | ${maximumPayOut} | ${isApproved} | [button boxRole="MyTableButton-role"]
]
}

BaseProduct {[
Base Products ${name} for ${theme}
${parts table rows}
]}

5 changes: 2 additions & 3 deletions packages/samples/DocuProject/src/defs/editor-tables.edit
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ editor tables precedence 4

InsurancePart{
table [
Name | risk | pay out | is approved | action
${name} | ${statisticalRisk} | ${maximumPayOut} | ${isApproved} | [button boxRole="MyTableButton-role"]
Name | risk | pay out | is approved
${name} | ${statisticalRisk} | ${maximumPayOut} | ${isApproved}
]
}

BaseProduct {[
Base Products ${name} for ${theme}
${parts table rows}
]}

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ expression InsurancePartRef base DocuExpression {
reference part: InsurancePart;
}

// Expression used to refer to the insurance parts of a product
// Expression used to refer to the risk adjustment of a product
expression RiskAdjustmentRef base DocuExpression {
name: identifier = "riskAdjustment";
}
Expand Down
7 changes: 5 additions & 2 deletions packages/samples/DocuProject/src/defs/language-main.ast
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ modelunit Product {
// used to create a marketable InsuranceProduct.
concept BaseProduct {
name: identifier; // internal name
theme: InsuranceTheme; // the 'kind' of insurance
parts: InsurancePart[]; // all parts of this product
isUnderConstruction: boolean; // defines whether this base product is still 'raw'
// The following properties are present to show the different options for displaying booleans.
isApprovedLevel1: boolean;
isApprovedLevel2: boolean;
isApprovedLevel3: boolean;
yieldsProfit: boolean;
// The following properties are present to show the different options for displaying numbers.
range: number;
nrOfUse: number;
// The following property is present to show the use of an external DatePicker component.
date: string;
theme: InsuranceTheme; // the 'kind' of insurance
parts: InsurancePart[]; // all parts of this product
}

// An InsurancePart defines a single aspect of an InsuranceProduct together
Expand Down
2 changes: 1 addition & 1 deletion packages/server/modelstore/DocuProject/Faulty.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"version": "2023.1",
"key": "-default-key-InsurancePart-isApproved"
},
"value": "true"
"value": "false"
}
],
"containments": [
Expand Down
14 changes: 7 additions & 7 deletions packages/server/modelstore/DocuProject/HomeAll.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@
"targets": [
{
"resolveInfo": "fire",
"reference": "ID-23"
"reference": "ID-96"
},
{
"resolveInfo": "breakingAndEntering",
"reference": "ID-20"
"reference": "ID-93"
},
{
"resolveInfo": "flooding",
"reference": "ID-26"
"reference": "ID-99"
},
{
"resolveInfo": "stormAndLightning",
"reference": "ID-29"
"reference": "ID-102"
}
]
},
Expand All @@ -163,7 +163,7 @@
"targets": [
{
"resolveInfo": "home1",
"reference": "ID-19"
"reference": "ID-92"
}
]
}
Expand Down Expand Up @@ -315,7 +315,7 @@
"targets": [
{
"resolveInfo": "fire",
"reference": "ID-23"
"reference": "ID-96"
}
]
}
Expand Down Expand Up @@ -403,7 +403,7 @@
"targets": [
{
"resolveInfo": "breakingAndEntering",
"reference": "ID-20"
"reference": "ID-93"
}
]
}
Expand Down
Loading

0 comments on commit 9d47606

Please sign in to comment.