Skip to content
GitLab
Menu
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
82065d47
Commit
82065d47
authored
Nov 27, 2006
by
Rinus Plasmeijer
Browse files
coded name of form to enable any character in a name
parent
736d2a6f
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
libraries/htmlGEC/EncodeDecode.dcl
View file @
82065d47
...
@@ -30,12 +30,13 @@ import htmlFormData
...
@@ -30,12 +30,13 @@ import htmlFormData
|
UpdS
String
// new piece of text
|
UpdS
String
// new piece of text
encodeTriplet
::
!
Triplet
->
String
// encoding of triplets
encodeTriplet
::
!
Triplet
->
String
// encoding of triplets
encodeString
::
!
String
->
String
// encoding of
// Form submission handling
// Form submission handling
callClean
::
!(
Script
->
ElementEvents
)
!
Mode
!
String
->
[
ElementEvents
]
callClean
::
!(
Script
->
ElementEvents
)
!
Mode
!
String
->
[
ElementEvents
]
submitscript
::
BodyTag
submitscript
::
BodyTag
globalstateform
::
!
Value
->
BodyTag
globalstateform
::
!
Value
->
BodyTag
// serializing, de-serializing of iData states to strings stored in the html page
// serializing, de-serializing of iData states to strings stored in the html page
...
@@ -49,9 +50,9 @@ readState :: !String !String !*NWorld -> (!String,!*NWorld)
...
@@ -49,9 +50,9 @@ readState :: !String !String !*NWorld -> (!String,!*NWorld)
// constants that maybe useful
// constants that maybe useful
ThisExe
::
!
ServerKind
->
String
// name of this executable
ThisExe
::
!
ServerKind
->
String
// name of this executable
MyPhP
::
!
ServerKind
->
String
// name of php script interface between server and this executable
MyPhP
::
!
ServerKind
->
String
// name of php script interface between server and this executable
MyDir
::
!
ServerKind
->
String
// name of directory in which persistent form info is stored
MyDir
::
!
ServerKind
->
String
// name of directory in which persistent form info is stored
traceHtmlInput
::
!
ServerKind
!(
Maybe
[(
String
,
String
)])
->
BodyTag
// for debugging showing the information received from browser
traceHtmlInput
::
!
ServerKind
!(
Maybe
[(
String
,
String
)])
->
BodyTag
// for debugging showing the information received from browser
libraries/htmlGEC/EncodeDecode.icl
View file @
82065d47
...
@@ -170,13 +170,13 @@ DecodeArguments Internal (Just args)
...
@@ -170,13 +170,13 @@ DecodeArguments Internal (Just args)
|
nargs
==
1
=
DecodeCleanServerArguments
(
foldl
(+++)
""
[
name
+++
"="
+++
value
+++
";"
\\
(
name
,
value
)
<-
args
])
|
nargs
==
1
=
DecodeCleanServerArguments
(
foldl
(+++)
""
[
name
+++
"="
+++
value
+++
";"
\\
(
name
,
value
)
<-
args
])
#
tripargs
=
reverse
args
// state hidden in last field, rest are triplets
#
tripargs
=
reverse
args
// state hidden in last field, rest are triplets
#
(
state
,
tripargs
)
=
(
urlDecode
(
snd
(
hd
tripargs
)),
tl
tripargs
)
// decode state, get triplets highest positions first
#
(
state
,
tripargs
)
=
(
urlDecode
(
snd
(
hd
tripargs
)),
tl
tripargs
)
// decode state, get triplets highest positions first
#
constriplets
=
filter
(\(
name
,_)
->
name
==
"CS"
)
tripargs
// select constructor triplets
#
constriplets
=
filter
(\(
name
,_)
->
name
==
"CS"
)
tripargs
// select constructor triplets
#
nconstriplets
=
[(
constrip
,
""
)
\\
(_,
codedtrip
)
<-
constriplets
,
(
Just
constrip
)
<-
[
parseString
(
decodeString
(
urlDecode
codedtrip
))]]
// and decode
#
nconstriplets
=
[(
constrip
,
""
)
\\
(_,
codedtrip
)
<-
constriplets
,
(
Just
constrip
)
<-
[
parseString
(
decodeString
(
urlDecode
codedtrip
))]]
// and decode
#
valtriplets
=
filter
(\(
name
,_)
->
name
<>
"CS"
)
tripargs
// select all other triplets
#
valtriplets
=
filter
(\(
name
,_)
->
name
<>
"CS"
)
tripargs
// select all other triplets
#
nvaltriplets
=
[(
mytrip
,
new
)
\\
(
codedtrip
,
new
)
<-
valtriplets
,
(
Just
mytrip
)
<-
[
parseString
(
decodeString
(
urlDecode
codedtrip
))]]
// and decode
#
nvaltriplets
=
[(
mytrip
,
new
)
\\
(
codedtrip
,
new
)
<-
valtriplets
,
(
Just
mytrip
)
<-
[
parseString
(
decodeString
(
urlDecode
codedtrip
))]]
// and decode
=
(
"clean"
,
reverse
nconstriplets
++
nvaltriplets
,
state
)
// order is important, first the structure than the values ...
=
(
"clean"
,
reverse
nconstriplets
++
nvaltriplets
,
state
)
// order is important, first the structure than the values ...
where
where
DecodeCleanServerArguments
::
!
String
->
(!
String
,!
Triplets
,!
String
)
// executable, id + update , new , state
DecodeCleanServerArguments
::
!
String
->
(!
String
,!
Triplets
,!
String
)
// executable, id + update , new , state
DecodeCleanServerArguments
args
DecodeCleanServerArguments
args
#
input
=
[
c
\\
c
<-:
args
|
not
(
isControl
c
)
]
// get rid of communication noise
#
input
=
[
c
\\
c
<-:
args
|
not
(
isControl
c
)
]
// get rid of communication noise
#
(
thisexe
,
input
)
=
mscan
'\"'
input
// get rid of garbage
#
(
thisexe
,
input
)
=
mscan
'\"'
input
// get rid of garbage
...
...
libraries/htmlGEC/Examples/CoffeeMachineDeLuxe/coffeemachine.prj
View file @
82065d47
This diff is collapsed.
Click to expand it.
libraries/htmlGEC/Examples/Simple Workflows/workflowExamples.icl
View file @
82065d47
...
@@ -7,23 +7,25 @@ derive gUpd []
...
@@ -7,23 +7,25 @@ derive gUpd []
//Start world = doHtmlServer (multiUser (Quotation myQuotation)) world
//Start world = doHtmlServer (multiUser (Quotation myQuotation)) world
//Start world = doHtmlServer (multiUser twotasks3) world
//Start world = doHtmlServer (multiUser twotasks3) world
Start
world
=
doHtmlServer
(
multiUser
agenda2
)
world
Start
world
=
doHtmlServer
(
multiUser
twotasks3
)
world
where
where
singleUser
tasks
hst
singleUser
tasks
hst
#
(_,
html
,
hst
)
=
startTask
0
tasks
hst
#
(_,
html
,
hst
)
=
startTask
0
tasks
hst
=
mkHtml
"test"
html
hst
=
mkHtml
"
s
test"
html
hst
multiUser
tasks
hst
multiUser
tasks
hst
#
(
idform
,
hst
)
=
FuncMenu
(
Init
,
nFormId
"pdm_chooseWorker"
#
(
idform
,
hst
)
=
FuncMenu
(
Init
,
nFormId
"pdm_chooseWorker"
(
0
,[(
"User "
+++
toString
i
,\_
->
i
)
\\
i
<-[
0
..
5
]
]))
hst
(
0
,[(
"User "
+++
toString
i
,\_
->
i
)
\\
i
<-[
0
..
5
]
]))
hst
#
currentWorker
=
snd
idform
.
value
#
currentWorker
=
snd
idform
.
value
#
(_,
html
,
hst
)
=
startTask
currentWorker
(
persistent
tasks
)
hst
#
(_,
html
,
hst
)
=
startTask
currentWorker
(
persistent
tasks
)
hst
=
mkHtml
"test"
[
idform
.
form
<=>
html
]
hst
=
mkHtml
"
m
test"
[
idform
.
form
<=>
html
]
hst
where
where
persistent
tasks
tst
persistent
tasks
tst
//
# tst = setTaskAttribute Persistent tst
#
tst
=
setTaskAttribute
Persistent
tst
#
tst
=
setTaskAttribute
StaticDynamic
tst
//
# tst = setTaskAttribute StaticDynamic tst
#
tst
=
setTaskAttribute
Database
tst
//
# tst = setTaskAttribute Database tst
=
tasks
tst
=
tasks
tst
...
...
libraries/htmlGEC/Examples/Work Administration/projectAdmin.prj
View file @
82065d47
This diff is collapsed.
Click to expand it.
libraries/htmlGEC/htmlFormlib.icl
View file @
82065d47
...
@@ -157,7 +157,8 @@ vertlistForm :: !(InIDataId [a]) !*HSt -> (Form [a],!*HSt) | iData a
...
@@ -157,7 +157,8 @@ vertlistForm :: !(InIDataId [a]) !*HSt -> (Form [a],!*HSt) | iData a
vertlistForm
inIDataId
hSt
=
layoutListForm
(\
f1
f2
->
[
f1
<||>
f2
])
mkEditForm
inIDataId
hSt
vertlistForm
inIDataId
hSt
=
layoutListForm
(\
f1
f2
->
[
f1
<||>
f2
])
mkEditForm
inIDataId
hSt
vertlistFormButs
::
!
Int
!
Bool
!(
InIDataId
[
a
])
!*
HSt
->
(
Form
[
a
],!*
HSt
)
|
iData
a
vertlistFormButs
::
!
Int
!
Bool
!(
InIDataId
[
a
])
!*
HSt
->
(
Form
[
a
],!*
HSt
)
|
iData
a
vertlistFormButs
nbuts
showbuts
(
init
,
formid
)
hst
vertlistFormButs
nbuts
showbuts
(
init
,
formid
=:{
mode
})
hst
#
formid
=
formid
<@
Edit
#
indexId
=
subFormId
formid
"idx"
0
<@
Display
#
indexId
=
subFormId
formid
"idx"
0
<@
Display
#
(
index
,
hst
)
=
mkEditForm
(
init
,
indexId
)
hst
#
(
index
,
hst
)
=
mkEditForm
(
init
,
indexId
)
hst
#
(
olist
,
hst
)
=
listForm
(
init
,
formid
)
hst
#
(
olist
,
hst
)
=
listForm
(
init
,
formid
)
hst
...
@@ -197,7 +198,7 @@ vertlistFormButs nbuts showbuts (init,formid) hst
...
@@ -197,7 +198,7 @@ vertlistFormButs nbuts showbuts (init,formid) hst
#
newlist
=
app
.
value
newlist
#
newlist
=
app
.
value
newlist
#
newlist
=
del
.
value
newlist
#
newlist
=
del
.
value
newlist
#
(
list
,
hst
)
=
listForm
(
setID
formid
newlist
)
hst
#
(
list
,
hst
)
=
listForm
(
Set
,
setFormId
formid
newlist
<@
mode
)
hst
#
lengthlist
=
length
newlist
#
lengthlist
=
length
newlist
#
(
index
,
hst
)
=
mkEditForm
(
setID
indexId
obbuts
.
value
)
hst
#
(
index
,
hst
)
=
mkEditForm
(
setID
indexId
obbuts
.
value
)
hst
#
(
bbuts
,
hst
)
=
browseButtons
(
Init
,
bbutsId
)
step
lengthlist
nbuts
hst
#
(
bbuts
,
hst
)
=
browseButtons
(
Init
,
bbutsId
)
step
lengthlist
nbuts
hst
...
@@ -210,7 +211,10 @@ vertlistFormButs nbuts showbuts (init,formid) hst
...
@@ -210,7 +211,10 @@ vertlistFormButs nbuts showbuts (init,formid) hst
=
(
{
form
=
pdbuts
.
form
++
bbuts
.
form
++
=
(
{
form
=
pdbuts
.
form
++
bbuts
.
form
++
[[
toHtml
(
"nr "
<+++
(
i
+1
)
<+++
" / "
<+++
length
list
.
value
)
[[
toHtml
(
"nr "
<+++
(
i
+1
)
<+++
" / "
<+++
length
list
.
value
)
<.||.>
<.||.>
(
onMode
formid
.
mode
(
if
showbuts
(
del
<.=.>
ins
<.=.>
app
<.=.>
copy
<.=.>
paste
)
EmptyBody
)
EmptyBody
EmptyBody
EmptyBody
)
(
onMode
formid
.
mode
(
if
showbuts
(
del
<.=.>
ins
<.=.>
app
<.=.>
copy
<.=.>
paste
)
EmptyBody
)
(
if
showbuts
(
del
<.=.>
ins
<.=.>
app
<.=.>
copy
<.=.>
paste
)
EmptyBody
)
EmptyBody
EmptyBody
)
\\
del
<-
del
.
form
&
ins
<-
ins
.
form
&
app
<-
app
.
form
&
copy
<-
copy
.
form
&
paste
<-
paste
.
form
&
i
<-
[
bbuts
.
value
..]]
\\
del
<-
del
.
form
&
ins
<-
ins
.
form
&
app
<-
app
.
form
&
copy
<-
copy
.
form
&
paste
<-
paste
.
form
&
i
<-
[
bbuts
.
value
..]]
<=|>
<=|>
list
.
form
%
betweenindex
list
.
form
%
betweenindex
...
@@ -288,7 +292,7 @@ listForm inIDataId hSt = layoutListForm (\f1 f2 -> [BodyTag f1:f2]) mkEditForm
...
@@ -288,7 +292,7 @@ listForm inIDataId hSt = layoutListForm (\f1 f2 -> [BodyTag f1:f2]) mkEditForm
layoutListForm
::
!([
BodyTag
]
[
BodyTag
]
->
[
BodyTag
])
layoutListForm
::
!([
BodyTag
]
[
BodyTag
]
->
[
BodyTag
])
!((
InIDataId
a
)
*
HSt
->
(
Form
a
,
*
HSt
))
!((
InIDataId
a
)
*
HSt
->
(
Form
a
,
*
HSt
))
!
(
InIDataId
[
a
])
!*
HSt
->
(
Form
[
a
],!*
HSt
)
|
iData
a
!
(
InIDataId
[
a
])
!*
HSt
->
(
Form
[
a
],!*
HSt
)
|
iData
a
layoutListForm
layoutF
formF
(
init
,
formid
)
hst
layoutListForm
layoutF
formF
(
init
,
formid
=:{
mode
}
)
hst
#
(
store
,
hst
)
=
mkStoreForm
(
init
,
formid
)
id
hst
// enables to store list with different # elements
#
(
store
,
hst
)
=
mkStoreForm
(
init
,
formid
)
id
hst
// enables to store list with different # elements
#
(
layout
,
hst
)
=
layoutListForm`
0
store
.
value
hst
#
(
layout
,
hst
)
=
layoutListForm`
0
store
.
value
hst
#
(
store
,
hst
)
=
mkStoreForm
(
init
,
formid
)
(
const
layout
.
value
)
hst
#
(
store
,
hst
)
=
mkStoreForm
(
init
,
formid
)
(
const
layout
.
value
)
hst
...
...
libraries/htmlGEC/htmlHandler.icl
View file @
82065d47
...
@@ -238,24 +238,25 @@ where
...
@@ -238,24 +238,25 @@ where
mkForm
::
!(
InIDataId
a
)
!*
HSt
->
*(
Form
a
,
!*
HSt
)
|
gForm
{|*|}
a
mkForm
::
!(
InIDataId
a
)
!*
HSt
->
*(
Form
a
,
!*
HSt
)
|
gForm
{|*|}
a
mkForm
(
init
,
formid
=:{
mode
=
Submit
})
hst
=:{
submits
=
False
}
mkForm
(
init
,
formid
=:{
mode
=
Submit
})
hst
=:{
submits
=
False
}
#
(
form
,
hst
)
=
gForm
{|*|}
(
init
,
formid
)
{
hst
&
submits
=
True
}
#
(
form
,
hst
)
=
gForm
{|*|}
(
init
,
formid
)
{
hst
&
submits
=
True
}
#
hst
=
{
hst
&
submits
=
False
}
#
hidden
=
Input
[
Inp_Name
"hidden"
#
hidden
=
Input
[
Inp_Name
"hidden"
,
Inp_Type
Inp_Hidden
,
Inp_Type
Inp_Hidden
,
Inp_Value
(
SV
""
)
,
Inp_Value
(
SV
""
)
]
""
]
""
#
submit
=
Input
[
Inp_Type
Inp_Button
#
submit
=
Input
[
Inp_Type
Inp_Button
,
Inp_Value
(
SV
"Submit"
)
,
Inp_Value
(
SV
"Submit"
)
,
`
Inp_Events
(
callClean
OnClick
Submit
form
id
.
id
)
,
`
Inp_Events
(
callClean
OnClick
Submit
form
name
)
]
""
]
""
#
clear
=
Input
[
Inp_Type
Inp_Reset
,
Inp_Value
(
SV
"Clear"
)]
""
#
clear
=
Input
[
Inp_Type
Inp_Reset
,
Inp_Value
(
SV
"Clear"
)]
""
#
sform
=
[
Form
[
Frm_Method
Post
#
sform
=
[
Form
[
Frm_Method
Post
,
Frm_Name
form
id
.
id
,
Frm_Name
form
name
]
(
form
.
form
++
[
hidden
,
Br
,
submit
,
clear
])
]
(
form
.
form
++
[
hidden
,
Br
,
submit
,
clear
])
]
]
=
({
form
&
form
=
sform
}
,
hst
)
=
({
form
&
form
=
sform
}
,
hst
)
where
formname
=
encodeString
formid
.
id
// to enable the use of any character in a form name
mkForm
inidataid
hst
=
gForm
{|*|}
inidataid
hst
mkForm
inidataid
hst
=
gForm
{|*|}
inidataid
hst
generic
gForm
a
::
!(
InIDataId
a
)
!*
HSt
->
*(
Form
a
,
!*
HSt
)
generic
gForm
a
::
!(
InIDataId
a
)
!*
HSt
->
*(
Form
a
,
!*
HSt
)
gForm
{|
Int
|}
(
init
,
formid
)
hst
gForm
{|
Int
|}
(
init
,
formid
)
hst
...
...
libraries/htmlGEC/htmlSettings.dcl
View file @
82065d47
...
@@ -18,8 +18,8 @@ class iDataSerAndDeSerialize a
...
@@ -18,8 +18,8 @@ class iDataSerAndDeSerialize a
|
gParse
{|*|}
// To de-serialize a string back to a value
|
gParse
{|*|}
// To de-serialize a string back to a value
,
iDataSerialize
a
,
iDataSerialize
a
TraceInput
:==
Tru
e
// show what kind of information is received from Client
TraceInput
:==
Fals
e
// show what kind of information is received from Client
TraceOutput
:==
Tru
e
// show what kind of information is stored
TraceOutput
:==
Fals
e
// show what kind of information is stored
MyDataBase
:==
"iDataDatabase"
// name of database being used by iData applications
MyDataBase
:==
"iDataDatabase"
// name of database being used by iData applications
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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