Skip to content

Commit

Permalink
Merge pull request #956 from AmpersandTarski/development
Browse files Browse the repository at this point in the history
Release 3.17.0
  • Loading branch information
hanjoosten authored May 10, 2019
2 parents ee22d20 + d4d906f commit 65f4d89
Show file tree
Hide file tree
Showing 41 changed files with 726 additions and 365 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ cabal.sandbox.config
/dist-newstyle
.idea

# Temporarily disable ampersand.cabal (See issue #931)
/ampersand.cabal

StaticFiles_Generated.hs
BuildInfo_Generated.hs

Expand Down
30 changes: 30 additions & 0 deletions AmpersandData/SystemContext/Interfaces.adl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CONTEXT PrototypeFramework IN ENGLISH

CONCEPT PF_Interface ""
REPRESENT PF_Interface TYPE OBJECT

RELATION label[PF_Interface*PF_Label] [UNI,TOT]
REPRESENT PF_Label TYPE ALPHANUMERIC

RELATION pf_ifcRoles[PF_Interface*Role]
MEANING "This relation contains the roles for which an interface is available"

RELATION isPublic[PF_Interface*PF_Interface] [PROP]
MEANING "This property states that an interface is accessible for all roles (i.e. public)"

-- Cannot enfore this rule yet, because ExecEngine is still required to add missing roles
-- RULE "Public interface integrity" : isPublic;V[PF_Interface*Role] |- pf_ifcRoles

-- EQUIVALENCE pf_ifcRoles[PF_Interface*Role] == isPublic;V[PF_Interface*Role]
ROLE ExecEngine MAINTAINS "Equivalence - InsPair pf_ifcRoles"
RULE "Equivalence - InsPair pf_ifcRoles": isPublic;V[PF_Interface*Role] |- pf_ifcRoles
VIOLATION (TXT "{EX} InsPair;pf_ifcRoles;PF_Interface;", SRC I, TXT ";Role;", TGT I)

ROLE ExecEngine MAINTAINS "Equivalence - DelPair pf_ifcRoles"
RULE "Equivalence - DelPair pf_ifcRoles": isPublic;pf_ifcRoles |- isPublic;V[PF_Interface*Role]
VIOLATION (TXT "{EX} DelPair;pf_ifcRoles;PF_Interface;", SRC I, TXT ";Role;", TGT I)

RELATION isAPI[PF_Interface*PF_Interface] [PROP]
MEANING "This property states that an interface is meant as API (machine-2-machine)"

ENDCONTEXT
18 changes: 18 additions & 0 deletions AmpersandData/SystemContext/Interfaces.ifc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONTEXT PrototypeFramework IN ENGLISH

INTERFACE "List all interfaces" FOR Administrator: "_SESSION";V[SESSION*PF_Interface] cRud BOX <SCOLS>
[ "Interface" : I cRud
, "Label" : label cRud
, "Is public" : isPublic cRud
, "Is API" : isAPI cRud
, "Nav items" : ifc~ cRud
]

INTERFACE "Edit interface" FOR Administrator : I[PF_Interface] BOX
[ "Interface" : I
, "Is public" : isPublic cRud -- do not allow editing, access control of interfaces is not dynamic (yet)
, "Is API" : isAPI cRud -- do not allow editing this property, because non-APIs require a design time generated UI
, "For roles" : pf_ifcRoles cRud -- do not allow editing, access control of interfaces is not dynamic (yet)
]

ENDCONTEXT
76 changes: 76 additions & 0 deletions AmpersandData/SystemContext/Navbar.adl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
CONTEXT PrototypeFramework IN ENGLISH

--[NAV MENU ITEMS]-----------------------------------------------------------------------------
CONCEPT PF_NavMenuItem ""
REPRESENT PF_NavMenuItem TYPE OBJECT

RELATION label[PF_NavMenuItem*PF_Label] [UNI,TOT]
MEANING "The human readable text that represents the navbar item and is shown to the user"
CONCEPT PF_Label ""
REPRESENT PF_Label TYPE ALPHANUMERIC

RELATION isVisible[PF_NavMenuItem*PF_NavMenuItem] [PROP]
MEANING "A navbar item can be visible or not"

RELATION ifc[PF_NavMenuItem*PF_Interface] [UNI]
MEANING "A navbar item can direct to an interface"
CONCEPT PF_Interface "Representation of an Ampersand interface"

RULE "Do not allow references to API interfaces" : ifc;isAPI |- -V
MESSAGE "A navbar item can not reference an API interface"

RELATION url[PF_NavMenuItem*PF_URL] [UNI]
MEANING "A navbar item can direct to an (external) url. This can also be used for extensions like the excelimporter"
CONCEPT PF_URL "a uniform resource locator as defined by RFC3986"
REPRESENT PF_URL TYPE BIGALPHANUMERIC

RELATION seqNr[PF_NavMenuItem*PF_SeqNr] [UNI]
MEANING "A navbar item has a seq nr (default 0) which determines the position of the item"
CONCEPT PF_SeqNr ""
REPRESENT PF_SeqNr TYPE INTEGER

RELATION isSubItemOf[PF_NavMenuItem*PF_NavMenuItem] [UNI,IRF,ASY]
MEANING "A navbar item can be a sub item of another item"

RELATION pf_navItemRoles[PF_NavMenuItem*Role]
MEANING "A navbar item is accessible for a role"

-- Add/remove menu items based on interface roles
ROLE ExecEngine MAINTAINS "Add navItemRoles for interfaces"
RULE "Add navItemRoles for interfaces" : ifc;pf_ifcRoles |- pf_navItemRoles
VIOLATION (TXT "{EX}InsPair;pf_navItemRoles;PF_NavMenuItem;", SRC I, TXT ";Role;", TGT I)

ROLE ExecEngine MAINTAINS "Remove navItemRoles for interfaces"
RULE "Remove navItemRoles for interfaces" : (I /\ ifc;ifc~);pf_navItemRoles |- ifc;pf_ifcRoles
VIOLATION (TXT "{EX}DelPair;pf_navItemRoles;PF_NavMenuItem;", SRC I, TXT ";Role;", TGT I)

-- Add/remove parent menu items if needed
ROLE ExecEngine MAINTAINS "Add navItemRoles for parent items"
RULE "Add navItemRoles for parent items": isSubItemOf~;pf_navItemRoles |- pf_navItemRoles
VIOLATION (TXT "{EX}InsPair;pf_navItemRoles;PF_NavMenuItem;", SRC I, TXT ";Role;", TGT I)

ROLE ExecEngine MAINTAINS "Remove navItemRoles for parent items"
RULE "Remove navItemRoles for parent items": (I /\ isSubItemOf~;isSubItemOf);pf_navItemRoles |- isSubItemOf~;pf_navItemRoles
VIOLATION (TXT "{EX}DelPair;pf_navItemRoles;PF_NavMenuItem;", SRC I, TXT ";Role;", TGT I)

--[NAV MENUS]----------------------------------------------------------------------------------
CONCEPT PF_NavMenu ""
CLASSIFY PF_NavMenu ISA PF_NavMenuItem
REPRESENT PF_NavMenu TYPE OBJECT

RELATION isPartOf[PF_NavMenuItem*PF_NavMenu] [UNI,TOT]
MEANING "A navbar item is part of a certain navmenu"

ROLE ExecEngine MAINTAINS "Fix TOT for isPartOf[PF_NavMenuItem*PF_NavMenu]"
RULE "Fix TOT for isPartOf[PF_NavMenuItem*PF_NavMenu]": I[PF_NavMenuItem];isSubItemOf;isPartOf |- isPartOf
VIOLATION (TXT "{EX}InsPair;isPartOf;PF_NavMenuItem;", SRC I, TXT ";PF_NavMenu;", TGT I)

ROLE ExecEngine MAINTAINS "Automatically designate root of PF_NavMenItem tree as PF_NavMenu"
RULE "Automatically designate root of PF_NavMenItem tree as PF_NavMenu": I[PF_NavMenuItem] - isSubItemOf;isSubItemOf~ |- I[PF_NavMenu]
VIOLATION (TXT "{EX} SetConcept;PF_NavMenuItem;PF_NavMenu;", SRC I[PF_NavMenuItem])

ROLE ExecEngine MAINTAINS "De-assign non-root PF_NavMenItems as PF_NavMenu"
RULE "De-assign non-root PF_NavMenItems as PF_NavMenu": I[PF_NavMenu] |- I[PF_NavMenuItem] - isSubItemOf;isSubItemOf~
VIOLATION (TXT "{EX} ClearConcept;PF_NavMenu;", SRC I[PF_NavMenu])

ENDCONTEXT
33 changes: 33 additions & 0 deletions AmpersandData/SystemContext/Navbar.ifc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
CONTEXT PrototypeFramework IN ENGLISH

VIEW "PF_NavMenuItem" : PF_NavMenuItem DEFAULT { label : label } ENDVIEW

--[ADMIN INTERFACES to adapt the menus]--------------------------------------------------------
INTERFACE "Edit navigation menu" FOR Administrator: "_SESSION";V[SESSION*PF_NavMenu] INTERFACE "Edit menu item"

INTERFACE "Edit menu item" FOR Administrator: I[PF_NavMenuItem] cRud BOX
[ "Label" : label
, "Parent" : isSubItemOf cRUd
, "Items" : isSubItemOf~ CRuD BOX <SCOLS>
[ "Item" : I LINKTO INTERFACE "Edit menu item"
, "# " : seqNr cRUd
, "Visible" : isVisible cRUd
, "Label" : label cRUd
, "Roles" : pf_navItemRoles cRud
]
, "Interface ref": ifc cRUd
, "Url" : url cRUd
, "Roles" : pf_navItemRoles cRUd
]

--[SYSTEM INTERFACES to query menu items]------------------------------------------------------
API "PF_MenuItems" FOR SYSTEM: sessionActiveRoles[SESSION*Role];pf_navItemRoles~;isVisible BOX
[ "id" : I
, "label" : label
, "seqNr" : seqNr
, "ifc" : ifc
, "url" : url
, "parent" : isSubItemOf
]

ENDCONTEXT
18 changes: 18 additions & 0 deletions AmpersandData/SystemContext/Roles.adl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONTEXT PrototypeFramework IN ENGLISH

CONCEPT Role ""
REPRESENT Role TYPE OBJECT
POPULATION Role CONTAINS ["Anonymous"] -- at least one role is needed, because nav items are filtered using 'sessionActiveRoles'. Anonymous is part of SIAMv3

RELATION label[Role*PF_Label] [UNI,TOT]
REPRESENT PF_Label TYPE ALPHANUMERIC
POPULATION label[Role*PF_Label] CONTAINS [ ("Anonymous", "Anonymous") ]

API "PF_AllRoles" FOR SYSTEM : V[ONE*Role] BOX
[ "id" : I
, "label" : label
-- , "maintains" :
-- , "interfaces" :
]

ENDCONTEXT
17 changes: 9 additions & 8 deletions AmpersandData/SystemContext/SystemContext.adl
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
CONTEXT SystemContext IN ENGLISH
CONTEXT PrototypeFramework IN ENGLISH

INCLUDE "Interfaces.adl"
INCLUDE "Interfaces.ifc"

INCLUDE "Navbar.adl"
INCLUDE "Navbar.ifc"

INCLUDE "Roles.adl"

PATTERN SystemSpecific

RELATION sessionAccount[SESSION*Account] [UNI]
RELATION sessionAllowedRoles[SESSION*Role]
RELATION sessionActiveRoles[SESSION*Role]

Expand All @@ -11,9 +16,5 @@ PATTERN SystemSpecific

REPRESENT DateTime TYPE DATETIME
RELATION lastAccess[SESSION*DateTime] [UNI]
RELATION accMostRecentLogin[Account*DateTime] [UNI]
RELATION accLoginTimestamps[Account*DateTime]

ENDPATTERN

ENDCONTEXT
13 changes: 12 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Release notes of Ampersand

## v3.17.0 (10 may 2019)

* [Issue #923](https://github.com/AmpersandTarski/Ampersand/issues/923) Lexer error message had disappeared. Now they show again.
* [Issue #925](https://github.com/AmpersandTarski/Ampersand/issues/925) Add warning when a script contains `BOX <ROWSNH>`, for this is deprecated and could result in an error when a prototype is being generated.
* [Issue #578](https://github.com/AmpersandTarski/Ampersand/issues/578) Implement meta model for navigation menu
* [Issue #932](https://github.com/AmpersandTarski/Ampersand/issues/932) `--daemon` now has an optional parameter to tell what config file is used. defaults to `.ampersand`.
* [Issue #903](https://github.com/AmpersandTarski/Ampersand/issues/903) Add switch to skip installing php dependencies (using Composer package manager).
* [Issue #952](https://github.com/AmpersandTarski/Ampersand/issues/952) Fixed bug causing the ampersand daemon to crash when an .xlsx file had an error.
* Upgrade to [prototype framework v1.2.0](https://github.com/AmpersandTarski/Prototype/releases/tag/v1.2.0). Needed for [Issue #578](https://github.com/AmpersandTarski/Ampersand/issues/578)
* [Issue #578](https://github.com/AmpersandTarski/Ampersand/issues/578) Improvements on the way the navigation bar of a prototype works.

## v3.16.0 (8 april 2019) (few days before scedule)

* New switch: --daemon. This enables automatic checking of your scripts as you type. Very nice in combination with the vscode extention [Ampersand (ADL) language support](https://marketplace.visualstudio.com/items?itemName=AmpersandTarski.language-ampersand).
* New switch: --daemon. This enables automatic checking of your scripts as you type. Very nice in combination with the vscode extension [Ampersand (ADL) language support](https://marketplace.visualstudio.com/items?itemName=AmpersandTarski.language-ampersand).
* [Issue #920](https://github.com/AmpersandTarski/Ampersand/issues/920) Warnings are generated for concepts/relations with names that are equal except for the caseing.

## v3.15.0 (15 march 2019)
Expand Down
Loading

0 comments on commit 65f4d89

Please sign in to comment.