Skip to content

Commit

Permalink
Merge pull request #849 from AmpersandTarski/development
Browse files Browse the repository at this point in the history
Release 3.11.5
  • Loading branch information
hanjoosten authored Nov 23, 2018
2 parents 781febd + 142004a commit bd84710
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 89 deletions.
54 changes: 8 additions & 46 deletions AmpersandData/SystemContext/SystemContext.adl
Original file line number Diff line number Diff line change
@@ -1,57 +1,19 @@
CONTEXT SystemContext IN ENGLISH

PATTERN SystemSpecific
CONCEPT SESSION "een semi-permanente interactieve informatie-uitwisseling, ook bekend als een dialoog, een gesprek of een vergadering, tussen twee of meer communicerende apparaten, of tussen een computer en gebruiker"
PURPOSE CONCEPT SESSION IN DUTCH
{+Sessies zijn nodig om de dialoog aan te kunnen duiden tussen de gebruiker en de computer+}
PURPOSE CONCEPT SESSION IN ENGLISH
{+Sessions are required to allow for associating information with individual visitors+}
CONCEPT Role "een functie of onderdeel die speciaal in een bepaalde bewerking of proces wordt uitgevoerd"
PURPOSE CONCEPT Role IN DUTCH
{+We hebben rollen nodig om een basale vorm van beveiliging te implementeren, gebaseerd op permissies. +}
PURPOSE CONCEPT Role IN ENGLISH
{+We need roles to implement a basic form of security based on permissions. +}
CONCEPT DateTime "een specifiek moment, tijdstip"
PURPOSE CONCEPT DateTime IN DUTCH
{+Om bewerkingen te kunnen plaatsen in de tijd is het nodig om het over specifieke momenten te kunnen hebben.+}
PURPOSE CONCEPT DateTime IN ENGLISH
{+Telling the time enables some ordering of events in time.+}

REPRESENT DateTime TYPE DATETIME

RELATION lastAccess[SESSION*DateTime] [UNI]
MEANING IN DUTCH "het moment waarop de sessie voor het laatst actief was"
MEANING IN ENGLISH "the last timestamp that a session was active"
PURPOSE RELATION lastAccess IN DUTCH
{+Een sessie kan op een bepaald moment actief zijn. Deze relatie bevat de informatie wanneer dat voor de laatste keer was.+}
PURPOSE RELATION lastAccess IN ENGLISH
{+A session can be active at some moment in time. This relation holds the information when that was for the last time.+}
RELATION sessionAccount[SESSION*Account] [UNI]
RELATION sessionAllowedRoles[SESSION*Role]
MEANING IN DUTCH "een rol kan zijn toegestaan gedurende een sessie"
MEANING IN ENGLISH "a role can be allowed during a session"
PURPOSE RELATION sessionAllowedRoles IN DUTCH
{+Aan een gebruiker kunnen specifieke rollen zijn toegekend.+}
PURPOSE RELATION sessionAllowedRoles IN ENGLISH
{+A user can be granted specific roles.+}
RELATION sessionActiveRoles[SESSION*Role]
MEANING IN DUTCH "een rol kan in gebruik zijn gedurende een sessie"
MEANING IN ENGLISH "a role can be active during a session"
PURPOSE RELATION sessionActiveRoles IN DUTCH
{+Gedurende een sessie kan een gebruiker over de permissies van specifieke rollen beschikken.+}
PURPOSE RELATION sessionActiveRoles IN ENGLISH
{+During a session the user can have roles, that grants permission for specific events.+}

PURPOSE CONCEPT "ONE" IN DUTCH
{+De universele singleton+}
PURPOSE CONCEPT "ONE" IN ENGLISH
{+The universal singleton+}

-- The following rule is required for the access control mechanism. It ensures that only allowed roles can be activated
RULE "Active roles MUST be a subset of allowed roles" : sessionActiveRoles |- sessionAllowedRoles
RULE "Active roles MUST be a subset of allowed roles": -- This rule is required for the access control mechanism.
sessionActiveRoles |- sessionAllowedRoles -- It ensures that only allowed roles can be activated.

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

ENDPATTERN

ENDCONTEXT
ENDCONTEXT
58 changes: 58 additions & 0 deletions AmpersandData/SystemContext/SystemContext.docadl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
CONTEXT SystemContext IN ENGLISH
{-This file contains the heritage documentation of SystemContext.adl.
This heritage documentation, however, still has several problems, e.g:
- The default texts are not ENGLISH, even though this is specified in the CONTEXT statement.
- The texts in Dutch say different things that the texts in English.
- The texts may not be appropriate in every situation, whereas the CONTEXT itself, of course, is.

For a better explanation of stuff around sessions, roles, accounts, etc., see SIAMv3.
-}
PATTERN SystemSpecific
CONCEPT SESSION "een semi-permanente interactieve informatie-uitwisseling, ook bekend als een dialoog, een gesprek of een vergadering, tussen twee of meer communicerende apparaten, of tussen een computer en gebruiker"
PURPOSE CONCEPT SESSION IN DUTCH
{+Sessies zijn nodig om de dialoog aan te kunnen duiden tussen de gebruiker en de computer+}
PURPOSE CONCEPT SESSION IN ENGLISH
{+Sessions are required to allow for associating information with individual visitors+}
CONCEPT Role "een functie of onderdeel die speciaal in een bepaalde bewerking of proces wordt uitgevoerd"
PURPOSE CONCEPT Role IN DUTCH
{+We hebben rollen nodig om een basale vorm van beveiliging te implementeren, gebaseerd op permissies. +}
PURPOSE CONCEPT Role IN ENGLISH
{+We need roles to implement a basic form of security based on permissions. +}
CONCEPT DateTime "een specifiek moment, tijdstip"
PURPOSE CONCEPT DateTime IN DUTCH
{+Om bewerkingen te kunnen plaatsen in de tijd is het nodig om het over specifieke momenten te kunnen hebben.+}
PURPOSE CONCEPT DateTime IN ENGLISH
{+Telling the time enables some ordering of events in time.+}

RELATION lastAccess[SESSION*DateTime] [UNI] -- This definition is only needed for `MEANING` to be interpreted correctly.
MEANING IN DUTCH "het moment waarop de sessie voor het laatst actief was"
MEANING IN ENGLISH "the last timestamp that a session was active"
PURPOSE RELATION lastAccess IN DUTCH
{+Een sessie kan op een bepaald moment actief zijn. Deze relatie bevat de informatie wanneer dat voor de laatste keer was.+}
PURPOSE RELATION lastAccess IN ENGLISH
{+A session can be active at some moment in time. This relation holds the information when that was for the last time.+}

RELATION sessionAllowedRoles[SESSION*Role] -- This definition is only needed for `MEANING` to be interpreted correctly.
MEANING IN DUTCH "een rol kan zijn toegestaan gedurende een sessie"
MEANING IN ENGLISH "a role can be allowed during a session"
PURPOSE RELATION sessionAllowedRoles IN DUTCH
{+Aan een gebruiker kunnen specifieke rollen zijn toegekend.+}
PURPOSE RELATION sessionAllowedRoles IN ENGLISH
{+A user can be granted specific roles.+}

RELATION sessionActiveRoles[SESSION*Role] -- This definition is only needed for `MEANING` to be interpreted correctly.
MEANING IN DUTCH "een rol kan in gebruik zijn gedurende een sessie"
MEANING IN ENGLISH "a role can be active during a session"
PURPOSE RELATION sessionActiveRoles IN DUTCH
{+Gedurende een sessie kan een gebruiker over de permissies van specifieke rollen beschikken.+}
PURPOSE RELATION sessionActiveRoles IN ENGLISH
{+During a session the user can have roles, that grants permission for specific events.+}

PURPOSE CONCEPT "ONE" IN DUTCH
{+De universele singleton+}
PURPOSE CONCEPT "ONE" IN ENGLISH
{+The universal singleton+}

ENDPATTERN

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

## Unreleased changes
## v3.11.5 (23 november 2018)

* [Issue #628](https://github.com/AmpersandTarski/Ampersand/issues/628) Fixed a performance issue for specific queries.

## v3.11.4 (27 october 2018)

Expand Down
12 changes: 11 additions & 1 deletion ampersand.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ampersand
version: 3.11.4
version: 3.11.5
author: Stef Joosten
maintainer: [email protected]
synopsis: Toolsuite for automated design of enterprise information systems.
Expand Down Expand Up @@ -132,6 +132,7 @@ library
Ampersand.Input.ADL1.Parser,
Ampersand.Input.ADL1.ParsingLib,
Ampersand.Input.Parsing,
Ampersand.Input.PreProcessor,
Ampersand.Input.Xslx.XLSX,
Ampersand.Misc,
Ampersand.Misc.Options,
Expand Down Expand Up @@ -183,6 +184,15 @@ executable ampersand
default-extensions:NoImplicitPrelude
build-depends: base == 4.11.*,
ampersand

executable ampPreProc
hs-source-dirs: preProcApp
main-is: Main.hs
default-language: Haskell2010
ghc-options: -Wall -threaded
default-extensions:NoImplicitPrelude
build-depends: base == 4.11.*,
ampersand

Test-Suite regression-test
type: exitcode-stdio-1.0
Expand Down
14 changes: 14 additions & 0 deletions preProcApp/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Main where

import Ampersand
import System.Environment
import Ampersand.Input.PreProcessor
import Ampersand.Basics.UTF8 (readUTF8File)

main :: IO ()
main =
do
filename:defs <- getArgs;
input <- readUTF8File filename
inputString <- return $ either id id input
putStr $ either show id (preProcess' filename defs inputString) ++ "\n"
Loading

0 comments on commit bd84710

Please sign in to comment.