SystemData.dcl 1.45 KB
Newer Older
1 2 3 4 5
definition module SystemData
/**
* This module provides access to the iTask framework data by means of
* a set of shared data structures.
*/
6
import Maybe, JSON_NG, Shared
7
from SystemTypes		import :: DateTime, :: Date, :: Time, :: User, :: Role, :: TaskList, :: Tree
Bas Lijnse's avatar
Bas Lijnse committed
8
from SystemTypes		import :: TaskListItem, :: Config, :: TaskId, :: TaskNo, :: InstanceNo, :: SharedTaskList
9
from Void				import :: Void
10
from FilePath			import :: FilePath
11

Bas Lijnse's avatar
Bas Lijnse committed
12 13 14 15 16 17 18 19 20 21
//USER-DEFINED SHARES

/*
* Creates a reference to a store identified by a string identifier.
* If no data is store the default value given as second argument is given as result.
*/
sharedStore 			:: !String !a -> Shared a | JSONEncode{|*|}, JSONDecode{|*|}, TC a

//PREDEFINED SHARES 

22
// Date & time
23 24 25
currentDateTime			:: ReadOnlyShared DateTime
currentTime				:: ReadOnlyShared Time
currentDate				:: ReadOnlyShared Date
26

27
// Processes
28
topLevelTasks 			:: SharedTaskList Void
29

30 31
currentProcesses		:: ReadOnlyShared [TaskListItem Void]
processesForCurrentUser	:: ReadOnlyShared [TaskListItem Void]
32

Bas Lijnse's avatar
Bas Lijnse committed
33 34
// Session
currentUser				:: ReadOnlyShared User
35
currentTopTask			:: ReadOnlyShared TaskId
Bas Lijnse's avatar
Bas Lijnse committed
36

Bas Lijnse's avatar
Bas Lijnse committed
37 38 39 40 41
// Application
applicationName			:: ReadOnlyShared String	// Application name
applicationBuild		:: ReadOnlyShared String	// Application build identifier
applicationDirectory	:: ReadOnlyShared FilePath	// Directory in which the applicaton resides
applicationConfig		:: ReadOnlyShared Config	// Server config
42

43
// Random source
44
randomInt				:: ReadOnlyShared Int