Commit 2f945bf7 authored by Bas Lijnse's avatar Bas Lijnse

Moved 'Framework' modules to hierarchical structure.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@2407 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 06b527d1
......@@ -2,11 +2,11 @@ implementation module CommonCombinators
/**
* This module contains a collection of useful iTasks combinators defined in terms of the basic iTask combinators
*/
import StdBool, StdList,StdOrdList, StdTuple, StdGeneric, StdMisc, StdInt, StdClass, GenRecord, Text, Time, Tuple, List
import Util, Either, GenVisualize, GenUpdate
import StdBool, StdList,StdOrdList, StdTuple, StdGeneric, StdMisc, StdInt, StdClass, Text, Time, Tuple, List, Either
import iTasks.Framework.Util, iTasks.Framework.GenVisualize, iTasks.Framework.GenUpdate, iTasks.Framework.GenRecord
from StdFunc import id, const, o
from SystemTypes import :: User(..), :: Note(..)
from TaskState import :: TaskTree(..), :: DeferredJSON
from iTasks.Framework.TaskState import :: TaskTree(..), :: DeferredJSON
from SystemData import randomInt, topLevelTasks
from Map import qualified put
......
definition module DBTasks
import iTaskClass, Task, Shared
import iTasks.Framework.iTaskClass, iTasks.Framework.Task, iTasks.Framework.Shared
//Convenience wrapper functions for databases with multiple values of type a
class DB a where
......@@ -86,4 +86,4 @@ dbUpdateItem :: a -> Task a | iTask, DB a
*
* @return The removed instance, if it existed
*/
dbDeleteItem :: !(DBRef a) -> Task (Maybe a) | iTask, DB a
\ No newline at end of file
dbDeleteItem :: !(DBRef a) -> Task (Maybe a) | iTask, DB a
implementation module DBTasks
import StdList, StdOrdList, Util, List
import iTaskClass, Task, Shared
import StdList, StdOrdList, List
import iTasks.Framework.iTaskClass, iTasks.Framework.Task, iTasks.Framework.Shared
import iTasks.Framework.Util
from CoreTasks import get, set, return
from CommonCombinators import >>|, >>=
......@@ -51,4 +52,4 @@ dbDeleteItem itemid
derive class iTask DBRef
instance == (DBRef a) where (==) (DBRef x) (DBRef y) = x == y
instance < (DBRef a) where (<) (DBRef x) (DBRef y) = x < y
\ No newline at end of file
instance < (DBRef a) where (<) (DBRef x) (DBRef y) = x < y
......@@ -2,7 +2,8 @@ definition module ExportTasks
/**
* This module provides tasks for exporting data from a workflow to an external source
*/
import FilePath, SystemTypes, Task
import FilePath, SystemTypes
import iTasks.Framework.Task
/**
* Export a document to the server's filesystem.
......
implementation module ExportTasks
import StdBool, FilePath, CSV, File, Map, IWorld, Task, TaskState, TaskStore
import StdBool, FilePath, CSV, File, Map
import iTasks.Framework.IWorld, iTasks.Framework.Task, iTasks.Framework.TaskState, iTasks.Framework.TaskStore
exportDocument :: !FilePath !Document -> Task Document
exportDocument filename document = mkInstantTask eval
......
......@@ -2,7 +2,8 @@ definition module ImportTasks
/**
* This module provides tasks for importing external data into a workflow.
*/
import FilePath, SystemTypes, Task
import FilePath, SystemTypes
import iTasks.Framework.Task
/**
* Import a file on the server's filesystem as a Document
*
......
implementation module ImportTasks
import StdBool, _SystemArray, StdInt, IWorld, Task, TaskState, TaskStore, MIME, Text, Util, CSV, File, Map
import StdBool, _SystemArray, StdInt, MIME, Text, CSV, File, Map
import iTasks.Framework.IWorld, iTasks.Framework.Task, iTasks.Framework.TaskState, iTasks.Framework.TaskStore
import iTasks.Framework.Util
from StdFunc import id
CHUNK_SIZE :== 1024
......
......@@ -5,9 +5,9 @@ definition module CoreCombinators
*/
from Time import :: Timestamp
from LayoutCombinators import :: SetLayout, :: AfterLayout, :: ModifyLayout, :: Layout
import Task, Shared
import iTasks.Framework.Task, iTasks.Framework.Shared
import iTaskClass
import iTasks.Framework.iTaskClass
derive class iTask ParallelTaskType, WorkOnStatus
/**
* Adds a result transformation function to a task.
......
implementation module CoreCombinators
import StdList, StdTuple, StdMisc, StdBool, StdOrdList
import Task, TaskState, TaskStore, TaskEval, Util, HTTP, GenUpdate, GenEq, Store, SystemTypes, Time, Text, Shared, Func, Tuple, List
import iTaskClass, InteractionTasks, LayoutCombinators, UIDefinition
import ClientOverride
from Map import qualified get, put, del, newMap, toList, fromList
from StdFunc import id, const, o, seq
from IWorld import :: IWorld(..)
from iTasks import JSONEncode, JSONDecode, dynamicJSONEncode, dynamicJSONDecode
from TaskEval import localShare, parListShare, topListShare
from CoreTasks import return
from SharedDataSource import write, writeFilterMsg, read, readRegister
import HTTP, GenEq, SystemTypes, Time, Text, Func, Tuple, List
import iTasks.Framework.Task, iTasks.Framework.TaskState, iTasks.Framework.TaskStore, iTasks.Framework.TaskEval
import iTasks.Framework.Util, iTasks.Framework.Shared, iTasks.Framework.Store, iTasks.Framework.GenUpdate
import iTasks.Framework.iTaskClass, iTasks.Framework.UIDefinition
import SystemTypes, InteractionTasks, LayoutCombinators
import iTasks.Framework.ClientSupport.ClientOverride
from Map import qualified get, put, del, newMap, toList, fromList
from StdFunc import id, const, o, seq
from iTasks import JSONEncode, JSONDecode, dynamicJSONEncode, dynamicJSONDecode
from iTasks.Framework.IWorld import :: IWorld(..)
from iTasks.Framework.TaskEval import localShare, parListShare, topListShare
from CoreTasks import return
from SharedDataSource import write, writeFilterMsg, read, readRegister
derive class iTask ParallelTaskType, WorkOnStatus
......
......@@ -3,10 +3,10 @@ definition module CoreTasks
* This module provides the core 'basic tasks' from which more specialized tasks can be derived.
*/
import iTaskClass, Shared
from Error import ::MaybeError(..)
from OSError import ::MaybeOSError, ::OSError, ::OSErrorCode, ::OSErrorMessage
from Task import :: Task
import iTasks.Framework.iTaskClass, iTasks.Framework.Shared
from iTasks.Framework.Task import :: Task
from Error import ::MaybeError(..)
from OSError import ::MaybeOSError, ::OSError, ::OSErrorCode, ::OSErrorMessage
/**
* Lifts a value to the task domain. The task finishes immediately and yields its parameter
......
implementation module CoreTasks
import StdList, StdBool, StdInt, StdTuple,StdMisc, Util, HtmlUtil, Time, Error, OSError, Map, Tuple, List
import StdList, StdBool, StdInt, StdTuple,StdMisc, Time, Error, OSError, Map, Tuple, List
import qualified StdList
import iTaskClass, Task, TaskState, TaskEval, TaskStore, UIDefinition, LayoutCombinators, Shared
from SharedDataSource import qualified read, readRegister, write, writeFilterMsg
from StdFunc import o, id
from IWorld import :: IWorld(..)
from SystemData import topLevelTasks
from Map import qualified get
import iTasks.Framework.Util, iTasks.Framework.HtmlUtil
import iTasks.Framework.iTaskClass, iTasks.Framework.Task, iTasks.Framework.TaskState, iTasks.Framework.TaskEval, iTasks.Framework.TaskStore
import iTasks.Framework.UIDefinition, iTasks.Framework.Shared
import LayoutCombinators
from SharedDataSource import qualified read, readRegister, write, writeFilterMsg
from StdFunc import o, id
from iTasks.Framework.IWorld import :: IWorld(..)
from SystemData import topLevelTasks
from Map import qualified get
return :: !a -> (Task a) | iTask a
return a = mkInstantTask (\taskId iworld-> (Ok a, iworld))
......
......@@ -7,10 +7,10 @@ from Maybe import :: Maybe
from Void import :: Void
from Error import :: MaybeError, :: MaybeErrorString
from Task import :: Task
import iTasks.Framework.iTaskClass
from iTasks.Framework.Task import :: Task
from SystemTypes import :: Note, :: EmailAddress
from InteractionTasks import :: ViewOption
import iTaskClass
:: HTTPMethod = GET | POST
......
......@@ -4,10 +4,10 @@ import StdInt, StdFile, StdTuple, StdList
import Directory, File, FilePath, Error, OSError, UrlEncoding, Text, Tuple, JSON
import SystemTypes, IWorld, Task, TaskState
import LayoutCombinators
import iTasks.Framework.IWorld, iTasks.Framework.Task, iTasks.Framework.TaskState
import iTasks.Framework.Shared
import SystemTypes, LayoutCombinators
import CoreTasks, InteractionTasks, CommonCombinators
import Shared
from ImportTasks import importTextFile
from File import qualified fileExists, readFile
......
definition module LayoutCombinators
import SystemTypes, UIDefinition
import SystemTypes
import iTasks.Framework.UIDefinition
from Task import :: TaskCompositionType
from TaskState import :: TIMeta
from iTasks.Framework.Task import :: TaskCompositionType
from iTasks.Framework.TaskState import :: TIMeta
import Maybe
......
implementation module LayoutCombinators
import StdTuple, StdList, StdBool, StdOrdList
import Maybe, Text, Tuple, Map, Util, HtmlUtil
import SystemTypes, UIDefinition
import Maybe, Text, Tuple, Map
import iTasks.Framework.Util, iTasks.Framework.HtmlUtil
import SystemTypes, iTasks.Framework.UIDefinition
from StdFunc import o
from Task import :: TaskCompositionType, :: TaskCompositionType(..)
from TaskState import :: TIMeta(..)
from iTasks.Framework.Task import :: TaskCompositionType, :: TaskCompositionType(..)
from iTasks.Framework.TaskState import :: TIMeta(..)
derive gEq TaskCompositionType
autoLayout :: Layout
......
......@@ -5,8 +5,8 @@ definition module OptimizedCoreTasks
* if not all expressive power is needed.
*/
import iTaskClass, Shared
from Task import :: Task
import iTasks.Framework.iTaskClass, iTasks.Framework.Shared
from iTasks.Framework.Task import :: Task
interactNullEnter :: !d !v (v->l) -> Task l | descr d & iTask v & iTask l
interactNullUpdate :: !d !(l -> v) (l v -> l) l -> Task l | descr d & iTask l & iTask v
......
implementation module OptimizedCoreTasks
import StdList, StdBool, StdInt, StdTuple,StdMisc, Util, HtmlUtil, Time, Error, OSError, Map, Tuple, List
import StdList, StdBool, StdInt, StdTuple,StdMisc, Time, Error, OSError, Map, Tuple, List
import qualified StdList
import iTaskClass, Task, TaskState, TaskEval, TaskStore, UIDefinition, LayoutCombinators, Shared
import iTasks.Framework.iTaskClass, iTasks.Framework.Task, iTasks.Framework.TaskState, iTasks.Framework.TaskEval
import iTasks.Framework.TaskStore, iTasks.Framework.UIDefinition, iTasks.Framework.Shared
import iTasks.Framework.Util, iTasks.Framework.HtmlUtil
import LayoutCombinators
from SharedDataSource import qualified read, readRegister, write, writeFilterMsg
from StdFunc import o, id
from IWorld import :: IWorld(..)
from iTasks.Framework.IWorld import :: IWorld(..)
from SystemData import topLevelTasks
from Map import qualified get
......
......@@ -3,7 +3,8 @@ definition module SystemData
* This module provides access to the iTask framework data by means of
* a set of shared data structures.
*/
import Maybe, JSON, Shared
import Maybe, JSON
import iTasks.Framework.Shared
from SystemTypes import :: DateTime, :: Date, :: Time, :: User, :: Role, :: TaskList, :: Tree
from SystemTypes import :: TaskListItem, :: Config, :: TaskId, :: TaskNo, :: InstanceNo, :: SharedTaskList
from Void import :: Void
......
implementation module SystemData
import SystemTypes, Store, TaskStore, Time, Shared, Util, Text, Task, Tuple, StdFile, Map
import Random
import StdList, StdBool
from StdFunc import o, seq
from IWorld import :: IWorld(..)
from Util import qualified currentDate, currentTime, currentDateTime, currentTimestamp, dateToTimestamp
import StdList, StdBool, StdFile, Time, Text, Tuple, Map, Random
import iTasks.Framework.Store, iTasks.Framework.TaskStore, iTasks.Framework.Shared, iTasks.Framework.Util
import iTasks.Framework.Task
import SystemTypes
from StdFunc import o, seq
from iTasks.Framework.IWorld import :: IWorld(..)
from iTasks.Framework.Util import qualified currentDate, currentTime, currentDateTime, currentTimestamp, dateToTimestamp
SYSTEM_DATA_NS :== "SystemData"
......@@ -16,24 +17,24 @@ currentDateTime :: ReadOnlyShared DateTime
currentDateTime = createReadOnlySDSPredictable SYSTEM_DATA_NS "currentDateTime" read
where
read iworld
# (dateTime, iworld) = 'Util'.currentDateTime iworld
# (Timestamp ts, iworld) = 'Util'.currentTimestamp iworld
# (dateTime, iworld) = 'iTasks.Framework.Util'.currentDateTime iworld
# (Timestamp ts, iworld) = 'iTasks.Framework.Util'.currentTimestamp iworld
= ((dateTime, Timestamp (ts + 1)), iworld)
currentTime :: ReadOnlyShared Time
currentTime = createReadOnlySDSPredictable SYSTEM_DATA_NS "currentTime" read
where
read iworld
# (time, iworld) = 'Util'.currentTime iworld
# (Timestamp ts, iworld) = 'Util'.currentTimestamp iworld
# (time, iworld) = 'iTasks.Framework.Util'.currentTime iworld
# (Timestamp ts, iworld) = 'iTasks.Framework.Util'.currentTimestamp iworld
= ((time, Timestamp (ts + 1)), iworld)
currentDate :: ReadOnlyShared Date
currentDate = createReadOnlySDSPredictable SYSTEM_DATA_NS "currentDate" read
where
read iworld
# (DateTime date time, iworld) = 'Util'.currentDateTime iworld
# (Timestamp ts, iworld) = 'Util'.currentTimestamp iworld
# (DateTime date time, iworld) = 'iTasks.Framework.Util'.currentDateTime iworld
# (Timestamp ts, iworld) = 'iTasks.Framework.Util'.currentTimestamp iworld
= ((date, Timestamp (ts + secondsUntilChange time)), iworld)
secondsUntilChange {Time|hour,min,sec} = (23-hour)*3600 + (59-min)*60 + (60-sec)
......@@ -108,7 +109,7 @@ externalFile :: !FilePath -> Shared String
externalFile path = createPollingSDS "externalFile" path read write
where
read iworld
# (Timestamp ts, iworld) = 'Util'.currentTimestamp iworld
# (Timestamp ts, iworld) = 'iTasks.Framework.Util'.currentTimestamp iworld
# (res, iworld) = read` iworld
= (fmap (\r -> (r, Timestamp (ts + EXTERNAL_FILE_POLLING_RATE), checkF r)) res, iworld)
......@@ -124,7 +125,7 @@ where
checkF old iworld
# (res,iworld)= read` iworld
| isOk res && (fromOk res) <> old = (Changed, iworld)
# (Timestamp ts, iworld) = 'Util'.currentTimestamp iworld
# (Timestamp ts, iworld) = 'iTasks.Framework.Util'.currentTimestamp iworld
= (CheckAgain (Timestamp (ts + EXTERNAL_FILE_POLLING_RATE)), iworld)
write content iworld=:{world}
......
......@@ -3,17 +3,19 @@ definition module SystemTypes
* This module provides types for all the globally shared concepts
* of the iTasks framework.
*/
import GenEq, Maybe, JSON, Store, Void, Either, FilePath, HTML, Error, File, OS
import GenEq, Maybe, JSON, Void, Either, FilePath, HTML, Error, File, OS
import iTasks.Framework.Store
from Map import :: Map
from Map import qualified get
from HTML import class html
from Time import :: Timestamp
from IWorld import :: IWorld
from UIDefinition import :: UIDef, :: UIControlSequence, :: UIAnnotatedControls, :: UIControl, :: UISize, :: UIDirection, :: UISideSizes, :: UIMinSize, :: UIAttributes
from iTasks.Framework.IWorld import :: IWorld
from iTasks.Framework.UIDefinition import :: UIDef, :: UIControlSequence, :: UIAnnotatedControls, :: UIControl, :: UISize, :: UIDirection, :: UISideSizes, :: UIMinSize, :: UIAttributes
from LayoutCombinators import :: Layout
from Task import :: Task, :: TaskId
from iTaskClass import class iTask, generic gVerify, :: VerifyMask, :: VerifyOptions, generic gDefault, generic gUpdate, generic gVisualizeEditor, generic gVisualizeText, generic gHeaders, generic gGridRows, :: VSt, :: VisualizationResult, :: StaticVisualizationMode(..), visualizeAsText
from Shared import :: ReadWriteShared, :: ReadOnlyShared, :: RWShared
from iTasks.Framework.Task import :: Task, :: TaskId
from iTasks.Framework.iTaskClass import class iTask, generic gVerify, :: VerifyMask, :: VerifyOptions, generic gDefault, generic gUpdate, generic gVisualizeEditor, generic gVisualizeText, generic gHeaders, generic gGridRows, :: VSt, :: VisualizationResult, :: StaticVisualizationMode(..), visualizeAsText
from iTasks.Framework.Shared import :: ReadWriteShared, :: ReadOnlyShared, :: RWShared
//****************************************************************************//
// Common data types that have specialized user interfaces
......
......@@ -2,13 +2,14 @@ implementation module SystemTypes
from StdFunc import until
import StdInt, StdBool, StdClass, StdArray, StdTuple, StdMisc, StdList, StdFunc, StdOrdList
import List, JSON, HTML, Text, Util, Map, Base64, Tuple, dynamic_string
import GenVisualize, GenUpdate
import List, JSON, HTML, Text, Map, Base64, Tuple, dynamic_string
import iTasks.Framework.GenVisualize, iTasks.Framework.GenUpdate
import iTasks.Framework.Util
from Time import :: Timestamp(..)
from Task import :: TaskValue
from iTasks.Framework.Task import :: TaskValue
from UIDefinition import :: UIDef(..), :: UIControlSequence, :: UIActionSet, :: UIControlGroup, :: UIActions, :: UIControls, :: UITitle, :: UIDirection(..), :: UIAnnotatedControls, :: UIAbstractContainer, :: UIViewport, :: UIAction, :: UIControl, stringDisplay
from iTasks.Framework.UIDefinition import :: UIDef(..), :: UIControlSequence, :: UIActionSet, :: UIControlGroup, :: UIActions, :: UIControls, :: UITitle, :: UIDirection(..), :: UIAnnotatedControls, :: UIAbstractContainer, :: UIViewport, :: UIAction, :: UIControl, stringDisplay
from LayoutCombinators import mergeAttributes, setMargins
//* EmailAddress
......
implementation module WorkflowAdmin
import iTasks
import StdMisc, Tuple, Text, Shared
import StdMisc, Tuple, Text
import iTasks.Framework.Shared
from StdFunc import seq
from Util import mb2list, kvGet
from iTasks.Framework.Util import mb2list, kvGet
from Map import qualified newMap
// SPECIALIZATIONS
......
implementation module SQLDatabase
import iTasks, SQL, MySQL, Error, IWorld, Shared
import iTasks, SQL, MySQL, Error
import iTasks.Framework.IWorld, iTasks.Framework.Shared
derive class iTask SQLValue, SQLDate, SQLTime
......
implementation module iTaskClass
import GenVisualize
\ No newline at end of file
......@@ -3,12 +3,12 @@ definition module iTasks
/**
* Main iTask module exporting all end user iTask modules
*/
import Engine // basic iTask system creator
, EngineWrapperStandalone // standalone wrapper
//, EngineWrapperCGI // CGI wrapper
import iTasks.Framework.Engine // basic iTask system creator
, iTasks.Framework.EngineWrapperStandalone // standalone wrapper
//, iTasks.Framework.EngineWrapperCGI // CGI wrapper
, SerializationGraphCopy // use serialization via graph_copy
//, SerializationDynamicLinker // use serialization via dynamic linker
, iTasks.Framework.SerializationGraphCopy // use serialization via graph_copy
//, iTasks.Framework.SerializationDynamicLinker // use serialization via dynamic linker
// System data
, SystemData
......@@ -30,10 +30,12 @@ import Engine // basic iTask system creator
, LayoutCombinators
// Miscellaneous machinery
, JSON // Functions for serializing/deserializing strings
, GenVisualize // Functions for generating GUIs
, GenUpdate // Functions for updating arbitrary values
, GenVerify // Functions for appending errors and hints to form values
, JSON // Functions for serializing/deserializing strings
, iTasks.Framework.Shared // Shared data sources
, iTasks.Framework.GenVisualize // Functions for generating GUIs
, iTasks.Framework.GenUpdate // Functions for updating arbitrary values
, iTasks.Framework.GenVerify // Functions for appending errors and hints to form values
, iTasks.Framework.GenRecord // Functions for manipulating records
// API extensions for user & workflow management
, UserAdmin
......@@ -52,5 +54,5 @@ import Engine // basic iTask system creator
from StdFunc import id, const, o
//Types
import Shared, SystemTypes, GenRecord
from List import instance Functor []
\ No newline at end of file
import SystemTypes
from List import instance Functor []
implementation module iTasks
import GenUpdate, GenVisualize, GenVerify, JSON
import JSON
import iTasks.Framework.GenUpdate
import iTasks.Framework.GenVisualize
import iTasks.Framework.GenVerify
definition module ClientOverride
definition module iTasks.Framework.ClientSupport.ClientOverride
import StdDynamic, SystemTypes
......
implementation module ClientOverride
implementation module iTasks.Framework.ClientSupport.ClientOverride
import SystemTypes
......@@ -11,4 +11,4 @@ cast a = case make_dynamic a of (a::b^) -> a
cast_to_TaskValue :: a -> TaskValue b | TC a & TC b
cast_to_TaskValue a = case make_dynamic a of (a::TaskValue b^) -> a
make_dynamic tva = dynamic tva
\ No newline at end of file
make_dynamic tva = dynamic tva
definition module Engine
definition module iTasks.Framework.Engine
/**
* This module provides the iTasks engine.
* This is the primary function that creates the complete
* environment in which worfklow specifications can be executed.
*/
import Maybe, JSON, FilePath, Task, StdList
from IWorld import :: IWorld
import StdList, Maybe, JSON, FilePath
import iTasks.Framework.Task
from iTasks.Framework.IWorld import :: IWorld
from HTTP import :: HTTPRequest, :: HTTPResponse
//* Configuarion defaults
......
implementation module Engine
implementation module iTasks.Framework.Engine
import StdMisc, StdArray, StdList, StdOrdList, StdTuple, StdChar, StdFile, StdBool, Func
from StdFunc import o, seqList, ::St
import Map, Time, CommandLine, Environment, Error, File, FilePath, Directory, HTTP, OSError, Text, MIME, UrlEncoding
import Util, HtmlUtil
import IWorld
import WebService
import Map, Time, CommandLine, Environment, Error, File, FilePath, Directory, HTTP, OSError, Text, MIME, UrlEncoding
import iTasks.Framework.Util, iTasks.Framework.HtmlUtil
import iTasks.Framework.IWorld, iTasks.Framework.WebService
CLEAN_HOME_VAR :== "CLEAN_HOME"
......
definition module EngineWrapperCGI
definition module iTasks.Framework.EngineWrapperCGI
/**
* This module wraps the iTasks engine in a CGI protocol
* handler and creates an application that can be used together
* with an external webserver which supports CGI
*/
import Engine
import iTasks.Framework.Engine
/**
* Starts the task engine with a list of published task definitions.
......@@ -13,4 +13,4 @@ import Engine
* @param The world
* @return The world
*/
startEngine :: a !*World -> *World | Publishable a
\ No newline at end of file
startEngine :: a !*World ->