Commit 3f76403d authored by Jeroen Henrix's avatar Jeroen Henrix
Browse files

- Moved user-accessible types from Framework/Types to API/SystemTypes (more...

 - Moved user-accessible types from Framework/Types to API/SystemTypes (more consistent with API/SystemData)
 - IWorld moved to separate module IWorld.dcl

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1700 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 52367e02
......@@ -6,7 +6,7 @@ definition module CommonCombinators
import CoreCombinators, TuningCombinators
import Either
from Types import :: User, :: SessionId
from SystemTypes import :: User, :: SessionId
from Map import :: Map
// Additional types for grouping
......
......@@ -5,13 +5,13 @@ implementation module CommonCombinators
*/
import StdBool, StdList,StdOrdList, StdTuple, StdGeneric, StdMisc, StdInt, StdClass, GenRecord, Text, Time
import Util, Either, GenVisualize, GenUpdate
from StdFunc import id, const, o
from Types import :: ProcessId, :: User(..), :: Note(..)
from SessionDB import :: Session
from StdFunc import id, const, o
from SystemTypes import :: ProcessId, :: User(..), :: Note(..)
from SessionDB import :: Session
from TaskContext import :: TaskContext(..), :: TopTaskContext, :: SubTaskContext, :: ParallelMeta
from Shared import mapShared, :: Shared, :: ReadWriteShared
from SystemData import randomInt
from Map import qualified newMap
from Shared import mapShared, :: Shared, :: ReadWriteShared
from SystemData import randomInt
from Map import qualified newMap
import CoreTasks, CoreCombinators, ExceptionCombinators, TuningCombinators, ProcessDBTasks, InteractionTasks
// use string instances of generic function for Tag values
......
......@@ -2,7 +2,7 @@ definition module ExportTasks
/**
* This module provides tasks for exporting data from a workflow to an external source
*/
import FilePath, Types, Task
import FilePath, SystemTypes, Task
/**
* Export a document to the server's filesystem.
......
implementation module ExportTasks
import StdBool, FilePath, CSV, File, Map, DocumentDB, Task, TaskContext, ExceptionCombinators
import StdBool, FilePath, CSV, File, Map, DocumentDB, IWorld, Task, TaskContext, ExceptionCombinators
exportDocument :: !FilePath !Document -> Task Document
exportDocument filename document = mkInstantTask ("Document export", ("Export of document " +++ filename)) eval
......
......@@ -2,7 +2,7 @@ definition module ImportTasks
/**
* This module provides tasks for importing external data into a workflow.
*/
import FilePath, Types, Task
import FilePath, SystemTypes, Task
/**
* Import a file on the server's filesystem as a Document
*
......
implementation module ImportTasks
import StdBool, _SystemArray, StdInt, Task, TaskContext, DocumentDB, MIME, Text, Util, CSV, File, Map, ExceptionCombinators
import StdBool, _SystemArray, StdInt, IWorld, Task, TaskContext, DocumentDB, MIME, Text, Util, CSV, File, Map, ExceptionCombinators
from StdFunc import id
CHUNK_SIZE :== 1024
......
implementation module CoreCombinators
import StdList, StdTuple, StdMisc, StdBool, StdOrdList
import Task, TaskContext, Util, HTTP, GenUpdate, UserDB, Store, Types, Time, Text, Shared
import Task, TaskContext, Util, HTTP, GenUpdate, UserDB, Store, SystemTypes, Time, Text, Shared
import iTaskClass, InteractionTasks
from Map import qualified get, put, del
from StdFunc import id, const, o, seq
from IWorld import :: IWorld(..)
from ProcessDB import :: Process{..}
from ProcessDB import qualified class ProcessDB(..), instance ProcessDB IWorld
from iTasks import JSONEncode, JSONDecode, dynamicJSONEncode, dynamicJSONDecode
......
......@@ -5,6 +5,7 @@ import iTaskClass, Task, TaskContext
from Shared import ::ReadWriteShared(..), :: Shared, :: SharedGetTimestamp, :: SharedWrite, :: SharedRead, :: SharedId
from Shared import qualified readShared, writeShared, isSharedChanged, updateShared
from StdFunc import o, id
from IWorld import :: IWorld(..)
from iTasks import dynamicJSONEncode, dynamicJSONDecode
from ExceptionCombinators import :: SharedException(..), instance toString SharedException, :: OSException(..), instance toString OSException
from WorkflowDB import qualified class WorkflowDB(..), instance WorkflowDB IWorld
......
......@@ -7,8 +7,8 @@ from Maybe import ::Maybe
from Void import ::Void
import iTaskClass
from Task import ::Task
from Types import ::Note, ::EmailAddress
from Task import ::Task
from SystemTypes import ::Note, ::EmailAddress
::HTTPMethod = GET | POST
......
......@@ -4,7 +4,7 @@ import StdInt, StdFile, StdTuple, StdList
import Directory, File, FilePath, OSError, UrlEncoding, Text
import Types, Task, TaskContext, Config
import SystemTypes, IWorld, Task, TaskContext, Config
import ExceptionCombinators
import InteractionTasks
import Shared
......
......@@ -2,7 +2,7 @@ definition module ProcessDBTasks
/**
* This module provides access to the process database
*/
import Maybe, Types
import Maybe, SystemTypes
from Task import :: Task
from ProcessDB import :: Process(..)
from Time import :: Timestamp
......
......@@ -2,17 +2,17 @@ implementation module ProcessDBTasks
import StdOverloaded, StdClass, StdInt, StdMisc, StdArray, StdTuple, StdList, Error, Map, Time
import Task, Store, TaskContext, Shared, Util
from Types import :: ProcessId
from StdFunc import id
from ProcessDB import :: Process{..}
from ProcessDB import qualified class ProcessDB(..), instance ProcessDB IWorld
from SystemTypes import :: ProcessId
from StdFunc import id
from ProcessDB import :: Process{..}
from ProcessDB import qualified class ProcessDB(..), instance ProcessDB IWorld
import GenVisualize
derive gVisualize Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, TaskContainerType, InteractionTaskType, OutputTaskType
derive gUpdate Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, TaskContainerType, InteractionTaskType, OutputTaskType
derive gDefaultMask Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, TaskContainerType, InteractionTaskType, OutputTaskType
derive gVerify Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, TaskContainerType, InteractionTaskType, OutputTaskType
derive gVisualize Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, InteractionTaskType, OutputTaskType
derive gUpdate Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, InteractionTaskType, OutputTaskType
derive gDefaultMask Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, InteractionTaskType, OutputTaskType
derive gVerify Process, ProcessProperties, SystemProperties, TaskProperties, TaskStatus, TaskDescription, InteractionTaskType, OutputTaskType
derive bimap Maybe,(,)
getProcess :: !ProcessId -> Task (Maybe Process)
......
......@@ -4,11 +4,11 @@ definition module SystemData
* a set of shared data structures.
*/
import Maybe
from Shared import :: ReadOnlyShared, :: Shared, :: ReadWriteShared
from Types import :: DateTime, :: Date, :: Time, :: User, :: Role, :: Session, :: UserDetails, :: Workflow
from Void import :: Void
from ProcessDB import :: Process
from WorkflowDB import :: WorkflowDescription
from Shared import :: ReadOnlyShared, :: Shared, :: ReadWriteShared
from SystemTypes import :: DateTime, :: Date, :: Time, :: User, :: Role, :: Session, :: UserDetails, :: Workflow
from Void import :: Void
from ProcessDB import :: Process
from WorkflowDB import :: WorkflowDescription
// Date & time
currentDateTime :: ReadOnlyShared DateTime
......
implementation module SystemData
import Types, Time, Shared, Util
import SystemTypes, Time, Shared, Util
import Random
import StdList
from StdFunc import o
from IWorld import :: IWorld(..)
from Util import qualified currentDate, currentTime, currentDateTime, currentTimestamp
from UserDB import qualified class UserDB(..), instance UserDB IWorld
from ProcessDB import qualified class ProcessDB(..), instance ProcessDB IWorld
......
implementation module TuningCombinators
import Types, StdList, StdMisc, Shared, HTML, Task
import SystemTypes, StdList, StdMisc, Shared, HTML, Task
from Time import :: Timestamp, :: Tm(..), mkTime
class tune b :: !b !(Task a) -> Task a
......
......@@ -6,8 +6,8 @@ definition module UserDBTasks
*/
import Maybe, Void
from Task import :: Task
from Types import :: UserId, :: User, :: UserDetails, :: Role
from Task import :: Task
from SystemTypes import :: UserId, :: User, :: UserDetails, :: Role
/**
* Authenticates a user by username and password
......
......@@ -4,7 +4,7 @@ import StdList, Maybe, HTML, Map, Either, JSON
import Task
from TaskContext import :: TaskContext(..), :: TopTaskContext, :: SubTaskContext, :: ParallelMeta
from StdFunc import id
from Types import :: User, :: UserId, :: UserDetails, :: Role, :: ProcessProperties
from SystemTypes import :: User, :: UserId, :: UserDetails, :: Role, :: ProcessProperties
from UserDB import qualified class UserDB(..)
from UserDB import qualified instance UserDB IWorld
......
definition module DocumentDB
import Maybe, Types
import Maybe, SystemTypes
from GenUpdate import :: DataPath, :: USt
class DocumentDB st
......
implementation module DocumentDB
import StdList, StdArray, StdBool
import Types, Store, Random, Text, Time
import SystemTypes, Store, Random, Text, Time
import GenUpdate
from StdFunc import id
from StdFunc import id
from IWorld import ::IWorld(..)
instance DocumentDB IWorld
where
......
......@@ -3,7 +3,7 @@ definition module ProcessDB
* This module provides an abstract process database
*
*/
import Maybe, Types, Task, TaskContext
import Maybe, SystemTypes, Task, TaskContext
from Time import :: Timestamp
derive JSONEncode Process
......
......@@ -4,8 +4,8 @@ definition module SessionDB
* functions for creating and restoring user sessions.
*/
import Maybe, Error
from Types import :: User, :: Session, :: SessionId, :: IWorld
from Time import :: Timestamp
from SystemTypes import :: User, :: Session, :: SessionId, :: IWorld
from Time import :: Timestamp
class SessionDB st
where
......
......@@ -2,7 +2,8 @@ implementation module SessionDB
import StdEnv, Maybe
import StdGeneric
import Types, Config, Store, Random, Time, Error
import SystemTypes, Config, Store, Random, Time, Error
import IWorld
instance SessionDB IWorld
where
......
......@@ -3,9 +3,9 @@ definition module UserDB
* This module provides the iTasks user database. It provides
* functions for accessing information about system users.
*/
from Maybe import :: Maybe
from Types import :: User, :: UserDetails, :: UserId, :: IWorld
from Time import :: Timestamp
from Maybe import :: Maybe
from SystemTypes import :: User, :: UserDetails, :: UserId, :: IWorld
from Time import :: Timestamp
class UserDB st
where
......
......@@ -3,8 +3,9 @@ implementation module UserDB
import StdEnv, Maybe
import StdGeneric
import Time, File, Error, Config, Util
import IWorld
from Types import :: Password(..)
from SystemTypes import :: Password(..)
derive bimap (,), Maybe
......
definition module WorkflowDB
from Maybe import :: Maybe
from Types import :: Workflow, :: WorkflowDescription, :: WorkflowId, :: User, :: UserDetails, :: IWorld
from Time import :: Timestamp
from Maybe import :: Maybe
from SystemTypes import :: Workflow, :: WorkflowDescription, :: WorkflowId, :: User, :: UserDetails, :: IWorld
from Time import :: Timestamp
class WorkflowDB st
where
......
......@@ -5,9 +5,10 @@ definition module Engine
* environment in which worfklow specifications can be executed.
*/
import Maybe, JSON, Task
from Types import :: IWorld, :: Workflow
from HTTP import :: HTTPRequest, :: HTTPResponse
from Config import :: Config
from SystemTypes import :: Workflow
from IWorld import :: IWorld
from HTTP import :: HTTPRequest, :: HTTPResponse
from Config import :: Config
:: HandlerFormat :== String
......
......@@ -7,6 +7,7 @@ import Util, HtmlUtil
import TuningCombinators
import Setup
import Config
import IWorld
from WorkflowDB import qualified class WorkflowDB(..), instance WorkflowDB IWorld
from UserAdmin import manageUsers
......
......@@ -5,7 +5,7 @@ definition module GenRecord
* All fields with the same name & type can be copied automatically, only different fields have to be mapped manually.
*/
import Types, GenUpdate
import SystemTypes, GenUpdate
/**
* Copies all fields with same name & type from one record to another.
......
definition module GenUpdate
import StdGeneric, Maybe, Void, Either, Store, Types
import StdGeneric, Maybe, Void, Either, Store, SystemTypes
from Map import :: Map
//Datapath is used to point to substructures of data structures
......
implementation module GenUpdate
import StdString, StdBool, StdChar, StdList, StdArray, StdTuple, StdMisc, Maybe, StdGeneric, StdEnum
import Types, Text, Util, DocumentDB
import SystemTypes, Text, Util, DocumentDB
from StdFunc import id, const, o
from TUIDefinition import :: TUISize(..), :: TUIFixedSize, :: TUIWeight
......
implementation module GenVisualize
import StdBool, StdChar, StdList, StdArray, StdTuple, StdMisc, StdGeneric, StdEnum, StdFunc
import GenUpdate, GenVerify, Util, Maybe, Functor, Text, HTML, JSON, TUIDefinition, Types, HtmlUtil
import GenUpdate, GenVerify, Util, Maybe, Functor, Text, HTML, JSON, TUIDefinition, SystemTypes, HtmlUtil
mkVSt :: *VSt
mkVSt = {VSt| origVizType = VTextDisplay, vizType = VTextDisplay, currentPath = startDataPath,
......
......@@ -4,6 +4,6 @@ definition module ApplicationService
* It serves basic meta data about the application such as name and build.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
applicationService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
implementation module ApplicationService
import HTTP
import Types, HtmlUtil
import HtmlUtil
import SystemTypes
from IWorld import :: IWorld(..)
applicationService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
applicationService url format path req iworld=:{application}
......
......@@ -5,6 +5,6 @@ definition module DocumentService
* processed by workflows.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
documentService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
......@@ -2,7 +2,7 @@ implementation module DocumentService
import StdInt, StdList
import HTTP, Map, Error
import Types, HtmlUtil, DocumentDB, SessionDB
import SystemTypes, HtmlUtil, DocumentDB, SessionDB
documentService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
documentService url format path req iworld
......
......@@ -4,6 +4,6 @@ definition module SessionService
* creates temporary access codes with which the other services can be accessed.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
sessionService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
......@@ -2,7 +2,8 @@ implementation module SessionService
import StdBool, StdList
import HTTP, Text, JSON
import Types, SessionDB, HtmlUtil
import SystemTypes, SessionDB, HtmlUtil
import IWorld
from UserDB import qualified class UserDB(..), instance UserDB IWorld
sessionService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
......
......@@ -4,6 +4,6 @@ definition module StencilService
* for placement in graphical workflow diagrams.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
stencilService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
implementation module StencilService
import StdArray, StdString, StdInt, StdList, StdBool, StdClass
import Types, SessionDB, HtmlUtil
import SystemTypes, IWorld, SessionDB, HtmlUtil
import HTTP, Text, Error
import GenEq
......
......@@ -5,6 +5,6 @@ definition module TaskService
* and the active tasks belonging to them.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
taskService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
......@@ -2,7 +2,8 @@ implementation module TaskService
import StdList, StdBool
import Time, JSON
import Types, Task, TaskInstance, TaskContext, TUIDiff, TUIEncode, Util, HtmlUtil
import SystemTypes, Task, TaskInstance, TaskContext, TUIDiff, TUIEncode, Util, HtmlUtil
import IWorld
from ProcessDB import qualified class ProcessDB(..), instance ProcessDB IWorld
from SessionDB import qualified class SessionDB(..), instance SessionDB IWorld
......
......@@ -4,6 +4,6 @@ definition module UserService
* information about users of the application.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
userService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
......@@ -2,7 +2,7 @@ implementation module UserService
import StdOrdList
import HTTP, Error, HtmlUtil
import Types, UserDB
import SystemTypes, UserDB
from SessionDB import qualified class SessionDB(..), instance SessionDB IWorld
userService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
......
......@@ -5,6 +5,6 @@ definition module WorkflowService
* The workflows are organized in a folder hierarchy.
*/
from HTTP import :: HTTPRequest, :: HTTPResponse
from Types import :: IWorld
from IWorld import :: IWorld
workflowService :: !String !String ![String] !HTTPRequest !*IWorld -> (!HTTPResponse, !*IWorld)
\ No newline at end of file
......@@ -2,7 +2,7 @@ implementation module WorkflowService
import StdArray, StdString, StdInt, StdList, StdBool, StdClass
import HTTP, Error, Text
import Types, HtmlUtil, UserDB
import SystemTypes, IWorld, HtmlUtil, UserDB
import GenEq
from WorkflowDB import qualified class WorkflowDB(..), instance WorkflowDB IWorld
from WorkflowDB import :: WorkflowDescription{..}, :: WorkflowId
......
definition module IWorld
from Config import :: Config
from FilePath import :: FilePath
from Map import :: Map
from Maybe import :: Maybe
from SystemTypes import :: DateTime, :: User
from Time import :: Timestamp
:: *IWorld = { application :: !String // The name of the application
, storeDirectory :: !FilePath // The generic data store
, tmpDirectory :: !FilePath // The path for temporary files, the garbage collector also works on files in this dir
, config :: !Config // The server configuration
, timestamp :: !Timestamp // The timestamp of the current request
, latestEvent :: !Maybe Timestamp // The timestamp of the last event of the (detached) process
, localDateTime :: !DateTime // The local date & time of the current request
, currentUser :: !User // The currently logged in user
, parallelVars :: !Map String Dynamic // The set of shared state variables used during parallel task execution
, readShares :: !Maybe [String] // The IDs of shares from which was read
, world :: !*World // The outside world
}
implementation module IWorld
from Config import :: Config
from FilePath import :: FilePath
from Map import :: Map
from Maybe import :: Maybe
from SystemTypes import :: DateTime, :: User
from Time import :: Timestamp
......@@ -8,7 +8,7 @@ definition module Shared
import Void, Maybe, Error, GenEq
from StdFunc import id, const
from Types import :: IWorld
from IWorld import :: IWorld
from Time import :: Timestamp
from GenUpdate import :: USt, :: UpdateMode, generic gUpdate
......