Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
5da94885
Commit
5da94885
authored
May 01, 2008
by
Rinus Plasmeijer
Browse files
*** empty log message ***
parent
0dff0aa8
Changes
10
Hide whitespace changes
Inline
Side-by-side
libraries/iTasks/InternaliTasksThreadHandling.dcl
View file @
5da94885
...
...
@@ -45,7 +45,6 @@ showThreadTable :: !*TSt -> (!HtmlCode,!*TSt) // watch it: the
administrateNewThread
::
!
UserId
!*
TSt
->
*
TSt
mkTaskThread
::
!
SubPage
!(
Task
a
)
->
Task
a
|
iData
a
mkTaskThread2
::
!
ThreadKind
!(
Task
a
)
->
Task
a
// execute a thread
// Finding threads and evaluation of a thread
...
...
libraries/iTasks/iTasksDB.dcl
View file @
5da94885
...
...
@@ -12,7 +12,6 @@ db_prefix :== "iDBase-"
::
DBid
a
/*
mkDBid :: create a typed database identificator; only Database and TxtFile are currently supported
readDB :: read the database
...
...
libraries/iTasks/iTasksEditors.dcl
View file @
5da94885
...
...
@@ -10,9 +10,12 @@ import iTasksHandler
/*
editTask :: create a task editor to edit a value of given type, and add a button with given name to finish the task
editTask
:: create a task editor (with submit button) to edit a value of given type, finish only if predicate holds
editTask
Pred
:: create a task editor (with submit button) to edit a value of given type, finish only if predicate holds
*/
editTask
::
!
String
!
a
->
Task
a
|
iData
a
editTaskPred
::
!
a
!(
a
->
(
Bool
,
HtmlCode
))
->
Task
a
|
iData
a
editTaskLabel
::
!
String
!
String
!
a
->
(
Task
a
)
|
iData
a
/*
editTaskLabel :: same as editTask, first label used for tracing...
*/
editTaskLabel
::
!
String
!
String
!
a
->
Task
a
|
iData
a
libraries/iTasks/iTasksHandler.dcl
View file @
5da94885
...
...
@@ -61,25 +61,35 @@ instance <<@ Lifespan // default: Session
instance
@>>
SubPage
// default: the *whole* page will be updated when a form has been modified
/
*
Initiate the iTask library with an iData server wrapper such as doHtmlServer in combination with one of the following functions:
/
/
Initiate the iTask library with an iData server wrapper such as doHtmlServer in combination with one of the following functions:
singleUserTask :: iTask start function for defining tasks for one, single user
multiUserTask :: iTask start function for multi-users, with option in window to switch between [0..users - 1]
workFlowTask :: iTask start function for a real workflow
/*
singleUserTask :: iTask start function for defining tasks for one, single user; intended for developing and testing
*/
singleUserTask
::
![
StartUpOptions
]
!(
Task
a
)
!*
HSt
->
(!
Bool
,
Html
,*
HSt
)
|
iData
a
/*
multiUserTask :: iTask start function for multiple -users; intended for developing and testing
*/
multiUserTask
::
![
StartUpOptions
]
!(
Task
a
)
!*
HSt
->
(!
Bool
,
Html
,*
HSt
)
|
iData
a
/*
workFlowTask :: iTask start function to create a real life workflow
- the first arument has to be an itask which is used for login purposes; it should yield
Bool: True, is the user a new one: if so the second argument is spawned as a separate task for that user
UserId: the id of that user
- the second argument is workflow that will spawned as a task
(True if we have new user,user id of the user, has ) :
- the second one is the actual function for that user
a predefined login task is defined in iTaskLogin.dcl
a predefined login task is defined
as an example
in iTaskLogin.dcl
*/
singleUserTask
::
![
StartUpOptions
]
!(
Task
a
)
!*
HSt
->
(!
Bool
,
Html
,*
HSt
)
|
iData
a
multiUserTask
::
![
StartUpOptions
]
!(
Task
a
)
!*
HSt
->
(!
Bool
,
Html
,*
HSt
)
|
iData
a
workFlowTask
::
![
StartUpOptions
]
!(
Task
((
Bool
,
UserId
),
a
))
!(
UserId
a
->
LabeledTask
b
)
!*
HSt
->
(!
Bool
,
Html
,*
HSt
)
|
iData
b
/*
getCurrentAppVersionNr delivers current version number of the iTask aplication
*/
getCurrentAppVersionNr
::
!*
TSt
->
!(!
Int
,!*
TSt
)
libraries/iTasks/iTasksHandler.icl
View file @
5da94885
...
...
@@ -99,7 +99,6 @@ where (<<@) task lifespan = setTaskLifespan
)
(
task
{
tst
&
options
.
tasklife
=
lifespan
})
// assign option on server
instance
<<@
StorageFormat
where
(<<@)
task
storageformat
=
\
tst
->
task
{
tst
&
options
.
taskstorage
=
storageformat
}
instance
<<@
Mode
...
...
@@ -445,13 +444,6 @@ where
#
message
=
if
activated
"iTask application finished"
message
=
(((
True
,
defaultUser
,
eventnr
,
message
,
tasknrs
),
{
tst
&
activated
=
activated
}))
LiftHst
fun
tst
=:{
hst
}
#
(
form
,
hst
)
=
fun
hst
=
(
form
,{
tst
&
hst
=
hst
})
// ******************************************************************************************************
// Html Printing Utilities...
// ******************************************************************************************************
...
...
@@ -490,8 +482,6 @@ getCurrentAppVersionNr tst=:{hst}
#
(
nr
,
hst
)
=
setAppversion
id
hst
=
(
nr
,{
tst
&
hst
=
hst
})
setSVersionNr
::
!
Int
!(
Int
->
Int
)
!*
HSt
->
(!
Int
,!*
HSt
)
setSVersionNr
user
f
hst
#
(
form
,
hst
)
=
mkStoreForm
(
Init
,
nFormId
(
usersessionVersionNr
user
)
0
<@
NoForm
)
f
hst
...
...
@@ -515,4 +505,3 @@ where
|
x
<
y
=
lowest
x
ys
=
lowest
y
ys
libraries/iTasks/iTasksHtmlSupport.dcl
View file @
5da94885
...
...
@@ -14,8 +14,6 @@ Prompting variants:
(!>>) :: prompt when task is activated
(<<?) :: as ?>>, except that prompt is displayed *after* task
(<<!) :: as !>>, except that prompt is displayed *after* task
addHtml :: add html code
*/
(?>>)
infixr
5
::
!
HtmlCode
!(
Task
a
)
->
Task
a
|
iCreate
a
...
...
@@ -23,6 +21,12 @@ addHtml :: add html code
(<<?)
infixl
5
::
!(
Task
a
)
!
HtmlCode
->
Task
a
|
iCreate
a
(<<!)
infixl
5
::
!(
Task
a
)
!
HtmlCode
->
Task
a
|
iCreate
a
addHtml
::
HtmlCode
TSt
->
TSt
mkTaskButtons
::
!
Bool
!
String
!
Int
!
TaskNr
!
Options
![
String
]
*
HSt
->
((
Int
,
HtmlCode
,
String
),*
HSt
)
iTaskButton
::
String
->
Button
/*
addHtml :: to insert html code
iTaskButton :: a standard button as internally used
mkTaskButtons :: vertical anIdentifier userId tasknr options list-of-button-names hst returning (idx of button chosen,the code,the name)
*/
addHtml
::
!
HtmlCode
!*
TSt
->
*
TSt
mkTaskButtons
::
!
Bool
!
String
!
Int
!
TaskNr
!
Options
![
String
]
!*
HSt
->
(!(!
Int
,!
HtmlCode
,!
String
),!*
HSt
)
iTaskButton
::
!
String
->
Button
libraries/iTasks/iTasksHtmlSupport.icl
View file @
5da94885
...
...
@@ -55,16 +55,15 @@ where
=
(
a
,{
tst
&
html
=
ohtml
+|+
nhtml
+|+
BT
prompt
})
addHtml
::
HtmlCode
TSt
->
TSt
addHtml
::
!
HtmlCode
!*
TSt
->
*
TSt
addHtml
bodytag
tst
=:{
activated
,
html
}
|
not
activated
=
tst
// not active, return default value
=
{
tst
&
html
=
html
+|+
BT
bodytag
}
// active, so perform task or get its result
iTaskButton
::
String
->
Button
iTaskButton
::
!
String
->
Button
iTaskButton
label
=
LButton
defpixel
label
mkTaskButtons
::
!
Bool
!
String
!
Int
!
TaskNr
!
Options
![
String
]
*
HSt
->
(
(
Int
,
HtmlCode
,
String
),*
HSt
)
mkTaskButtons
::
!
Bool
!
String
!
Int
!
TaskNr
!
Options
![
String
]
!
*
HSt
->
(
!(!
Int
,
!
HtmlCode
,
!
String
),
!
*
HSt
)
mkTaskButtons
vertical
myid
userId
tasknr
info
btnnames
hst
#
btnsId
=
iTaskId
userId
tasknr
(
myid
<+++
"genBtns"
)
#
myidx
=
length
btnnames
...
...
libraries/iTasks/iTasksLiftingCombinators.dcl
View file @
5da94885
...
...
@@ -11,22 +11,30 @@ import iTasksHandler
/*
(*>>) :: lift functions of type (TSt -> (a,TSt)) to iTask domain
(*#>) :: lift functions of (TSt -> TSt) to iTask domain
*/
(*=>)
infix
4
::
!(!
TSt
->
(!
a
,!
TSt
))
!(
a
->
Task
b
)
->
Task
b
(*#>)
infix
4
::
!(!
TSt
->
TSt
)
!(
Task
a
)
->
Task
a
/*
appIData :: lift iData editors to iTask domain
appIData2 :: lift iData editors to iTask domain, and pass iDataTasknumber in addition for naming convenience
*/
appIData
::
!(
IDataFun
a
)
->
Task
a
|
iData
a
appIData2
::
!(!
String
!*
HSt
->
*(!
Form
a
!,!*
HSt
))
->
Task
a
|
iData
a
/*
appHStOnce :: lift iData *HSt domain to TSt domain, will be executed only once; string used for tracing
appHSt :: lift iData *HSt domain to TSt domain, will be executed on each invocation; string used for tracing
liftHst :: lift iData *HSt domain to the TSt domain
appWorldOnce :: lift *World domain to TSt domain, will be executed only once; string used for tracing
appWorld :: lift *World domain to TSt domain, will be executed on each invocation; string used for tracing
*/
(*=>)
infix
4
::
!(!
TSt
->
(!
a
,!
TSt
))
!(
a
->
Task
b
)
->
Task
b
(*#>)
infix
4
::
!(!
TSt
->
TSt
)
!(
Task
a
)
->
Task
a
appIData
::
!(
IDataFun
a
)
->
Task
a
|
iData
a
appIData2
::
!(!
String
!*
HSt
->
*(!
Form
a
!,!*
HSt
))
->
Task
a
|
iData
a
appHStOnce
::
!
String
!(!*
HSt
->
(!
a
,!*
HSt
))
->
Task
a
|
iData
a
appHSt
::
!
String
!(!*
HSt
->
(!
a
,!*
HSt
))
->
Task
a
|
iData
a
liftHst
::
!(*
HSt
->
*(.
a
,*
HSt
))
!*
TSt
->
*(.
a
,*
TSt
)
/*
appWorldOnce :: lift *World domain to TSt domain, will be executed only once; string used for tracing
appWorld :: lift *World domain to TSt domain, will be executed on each invocation; string used for tracing
*/
appWorldOnce
::
!
String
!(!*
World
->
*(!
a
,!*
World
))
->
Task
a
|
iData
a
appWorld
::
!
String
!(!*
World
->
*(!
a
,!*
World
))
->
Task
a
|
iData
a
...
...
libraries/iTasks/iTasksProcessHandling.dcl
View file @
5da94885
...
...
@@ -53,7 +53,8 @@ suspendMe :: (Task Void)
deleteMe
::
(
Task
Void
)
// Internally used:
// internally used...
showWorkflows
::
!
Bool
!*
TSt
->
(![
BodyTag
],*
TSt
)
scheduleWorkflows
::
!(
Task
a
)
->
(
Task
a
)
|
iData
a
libraries/iTasks/iTasksTimeAndDateHandling.icl
View file @
5da94885
...
...
@@ -10,7 +10,6 @@ import StdFunc
import
iDataFormlib
import
InternaliTasksCommon
,
iTasksBasicCombinators
// Timer Tasks ending when timed out
waitForTimeTask
::
!
HtmlTime
->
(
Task
HtmlTime
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment