Commit 433749f0 authored by Bas Lijnse's avatar Bas Lijnse

Some more basic refactoring. Moving and renaming files and functions

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@364 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 82ce0d0f
definition module iTasksEditors
definition module EditTasks
// *********************************************************************************************************************************
// Basic iTasks Editors
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import iTasksTypes
/*
......
implementation module iTasksEditors
// *********************************************************************************************************************************
// Basic iTasks Editors
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
defpixel :== 100
implementation module EditTasks
import StdList, StdTuple, StdFunc
import iTasksTypes
......@@ -27,7 +19,7 @@ editTask` prompt a tst=:{tasknr,html,hst,userId}
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) id hst // determine if the task has been done previously
| taskdone.Form.value // test if task has completed
# (editor,hst) = (mkEditForm (Init,cFormId tst.options editId a <@ Display) hst) // yes, read out current value, make editor passive
= (editor.Form.value,{tst & activated = True,/* html = html +|+ BT editor.Form.form [],*/ hst = hst}) // return result task
= (editor.Form.value,{tst & activated = True, hst = hst}) // return result task
# (editor,hst) = mkEditForm (Init,cFormId tst.options editId a) hst // no, read out current value from active editor
# (finbut,hst) = mySimpleButton tst.options buttonId prompt (\_ -> True) hst // add button for marking task as done
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) finbut.Form.value hst // remember task status for next time
......
definition module TimeAndDateTasks
/**
* iTasks for Time and Date Handling
*/
import iDataWidgets, iTasksTypes
/*
waitForTimeTask :: Task is done when time has come
waitForDateTask :: Task is done when date has come
*/
waitForTimeTask :: !HtmlTime -> Task HtmlTime
waitForDateTask :: !HtmlDate -> Task HtmlDate
\ No newline at end of file
implementation module iTasksTimeAndDateHandling
implementation module TimeAndDateTasks
// *********************************************************************************************************************************
// iTasks for Time and Date Handling
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import StdFunc
import iDataFormlib
import iTasksTypes
......
definition module iTasksTimeAndDateHandling
// *********************************************************************************************************************************
// iTasks for Time and Date Handling
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import iDataWidgets
import iTasksTypes
/*
waitForTimeTask :: Task is done when time has come
waitForDateTask :: Task is done when date has come
*/
waitForTimeTask :: !HtmlTime -> Task HtmlTime
waitForDateTask :: !HtmlDate -> Task HtmlDate
\ No newline at end of file
definition module iTasksExceptionHandling
definition module ExceptionCombinators
/**
* This module contains iTask combinators for Exception Handling
*/
// *********************************************************************************************************************************
// This module contains iTask combinators for Exception Handling
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import iTasksTypes
/*
<^> :: Evaluate the task; An exception of type e raised by this task, will be catched by the closest handler.
One can use the function create a proper task value or signal the fact that an exception has occured.
Raise :: Raises an exception of type e which will be catched by the closest parent handler for this type
raise :: Raises an exception of type e which will be catched by the closest parent handler for this type
*/
(<^>) infix 1 :: !(e -> a) !(Task a) -> Task a | iData a & TC e // assigns an exception Handler
Raise :: e -> Task a | iCreate a & TC e // rases an exception
raise :: e -> Task a | iCreate a & TC e // rases an exception
implementation module iTasksExceptionHandling
// *********************************************************************************************************************************
// This module contains iTask combinators for Exception Handling
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
implementation module ExceptionCombinators
/**
* This module contains iTask combinators for Exception Handling
*/
import StdList, StdArray, StdTuple, StdFunc
import dynamic_string
import InternaliTasksThreadHandling, BasicCombinators, Startup
import InternaliTasksThreadHandling, BasicCombinators, Engine
serializeExceptionHandler :: !.(Dynamic -> Task .a) -> .String
serializeExceptionHandler task = IF_ClientServer
......@@ -23,8 +19,8 @@ deserializeExceptionHandler thread = IF_ClientServer
fetchException thread = fst (copy_from_string {c \\ c <-: thread})
Raise :: e -> Task a | iCreate a & TC e
Raise e = RaiseDyn (dynamic e)
raise :: e -> Task a | iCreate a & TC e
raise e = raiseDyn (dynamic e)
(<^>) infix 1 :: !(e -> a) !(Task a) -> Task a | iData a & TC e // create an exception Handler
(<^>) exceptionfun task = newTask "exceptionHandler" (Task evalTask)
......@@ -55,10 +51,10 @@ where
with
catch2 tst=:{tasknr}
# tst = deleteSubTasksAndThreads (tl tasknr) tst // delete handler + task
= appTaskTSt (RaiseDyn dynamicValue) tst // look for another handler
= appTaskTSt (raiseDyn dynamicValue) tst // look for another handler
RaiseDyn :: !Dynamic -> Task a | iCreate a
RaiseDyn dynamicValue = Task raise
raiseDyn :: !Dynamic -> Task a | iCreate a
raiseDyn dynamicValue = Task raise
where
raise tst=:{tasknr,staticInfo,activated}
| not activated = (createDefault,tst)
......
definition module Startup
definition module Engine
import iDataSettings, StdBimap
import BasicCombinators
......
implementation module Startup
// *********************************************************************************************************************************
// The iTasks library enables the specification of interactive multi-user workflow tasks (iTasks) for the web.
// This module contains iTask kernel.
// This library is still under construction - MJP
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
implementation module Engine
import StdEnv
import iDataSettings, iDataForms, iDataWidgets, iDataFormlib, iDataTrivial
import UserDB
......
......@@ -4,6 +4,7 @@ import StdEnv
import Http, Session
import JSON
import InternaliTasksCommon
import iTasksProcessHandling
:: NewWorkItem = { icon :: String // An icon name. The actual icon image is defined in the css.
......@@ -20,13 +21,10 @@ where
workflow = http_getValue "workflow" request.arg_get ""
response taskid = "{\"success\" : true, \"taskid\": \"" +++ (toString taskid) /* workflow */ +++ "\"}"
thisUser = session.Session.userId // fetch user id from the session
thisUser = session.Session.userId // fetch user id from the session
startNewProcess labeledTask hst
# tst = mkTst mainuser LSTxtFile LSTxtFile hst // create initial tst
# tst = mkTst mainuser LSTxtFile LSTxtFile hst // create initial tst
# (processId, tst) = latestProcessId tst
# (wid,tst=:{hst}) = appTaskTSt (spawnWorkflow thisUser True labeledTask) {tst & tasknr = [processId]}
= (getProcessId wid, hst)
import iTasksProcessHandling, Combinators, iTasksEditors
\ No newline at end of file
= (getProcessId wid, hst)
\ No newline at end of file
......@@ -10,7 +10,8 @@ import StdList, StdFunc, StdEnv
import dynamic_string, graph_to_string_with_descriptors, graph_to_sapl_string
import iDataTrivial, iDataFormlib
import InternaliTasksCommon, iTasksSettings, BasicCombinators, LiftingCombinators, iTasksProcessHandling
import Startup
import Engine
derive gForm Lifespan, GarbageCollect, StorageFormat, Mode, Options, GlobalInfo, TaskThread, ThreadKind, []
derive gUpd Lifespan, GarbageCollect, StorageFormat, Mode, Options, GlobalInfo, TaskThread, ThreadKind, []
......
definition module StdiTasks
// *********************************************************************************************************************************
// Main iTask pass thru module exporting all End User iTask modules
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
/**
* Main iTask module exporting all end user iTask modules
*/
import
Engine // basic iTask system creator
, iTasksProcessHandling // creation of iTask Workflow Processes
// iTask End User modules:
Startup // basic iTask system creator
, iTasksProcessHandling // creation of iTask Workflow Processes
, iTasksEditors // basic html editors for any type
, UserTasks // tasks for accessing the user database
, BasicCombinators // basic iTask combinators
, Combinators // handy set of additional iTask combinators
, PromptingCombinators // html prompting
, LiftingCombinators // lifting other domains (e.g. iData) to the iTask domain
, EditTasks // basic html editors for any type
, UserTasks // tasks for accessing the user database
, TimeAndDateTasks // iTasks triggered by time and date
, iTasksDB // iTask simple DB access
, BasicCombinators // basic iTask combinators
, iTasksTimeAndDateHandling // iTasks triggered by time and date
, iTasksExceptionHandling // for handling exceptional situations
, Combinators // handy set of additional iTask combinators
, PromptingCombinators // html prompting
, LiftingCombinators // lifting other domains (e.g. iData) to the iTask domain
, iTasksDB // iTask simple DB access
, iTasksSettings // font settings
, ExceptionCombinators // for handling exceptional situations
, iTasksSettings // font settings
\ No newline at end of file
definition module Combinators
/**
* This module contains a collection of handy iTasks combinators defined in terms of the basic iTask combinators
* with Thanks to Erik Zuurbier for suggesting some of the advanced combinators
*/
// *********************************************************************************************************************************
// This module contains a collection of handy iTasks combinators defined in terms of the basic iTask combinators
// with Thanks to Erik Zuurbier for suggesting some of the advanced combinators
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import BasicCombinators, iDataWidgets
:: ChoiceUpdate :== Bool [Bool] -> [Bool] // changed checkbox + current settings -> new settings
......
implementation module Combinators
// *********************************************************************************************************************************
// This module contains a collection of handy iTasks combinators defined in terms of the basic iTask combinators
// with Thanks to Erik Zuurbier for suggesting some of the advanced combinators
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
/**
* This module contains a collection of handy iTasks combinators defined in terms of the basic iTask combinators
* with Thanks to Erik Zuurbier for suggesting some of the advanced combinators
*/
import StdList, StdFunc, StdTuple
import iDataTrivial, iDataFormlib, StdBimap
import BasicCombinators, PromptingCombinators, LiftingCombinators, iTasksTimeAndDateHandling, iTasksSettings, iTasksEditors, UserTasks
import EditTasks, UserTasks, TimeAndDateTasks, BasicCombinators, PromptingCombinators, LiftingCombinators, iTasksSettings
derive gForm []
derive gUpd []
derive read Maybe
derive write Maybe
// ******************************************************************************************************
// monads for combining iTasks
......
implementation module LiftingCombinators
// *********************************************************************************************************************************
// Some iTasks combinators for lifting other domains to the iTask domain:
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import iTasksEditors, BasicCombinators
import EditTasks, BasicCombinators
(*=>) infix 4 :: !(TSt -> (!a,!TSt)) !(a -> Task b) -> (Task b)
(*=>) ftst b = Task doit
......@@ -62,10 +56,3 @@ liftWorld :: !(*World -> *(!a,!*World)) !*TSt -> *(!a,!*TSt)
liftWorld fun tst=: {hst = hst=:{world = world=:{worldC}}}
# (fvalue,theWorld) = fun worldC
= (fvalue,{tst & hst = {hst & world = {world & worldC = theWorld}}})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment