module Eliom:Eliom.ml defines the functions you need to interact with the Eliommod module:sig
..end
exception Eliom_Link_too_old
exception Eliom_Session_expired
exception Eliom_Wrong_parameter
exception Eliom_Typing_Error of (string * exn) list
val get_config : unit -> Simplexmlparser.xml list
Put your options between <eliom ...> and </eliom>
val sync : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd Lwt.t
let sync f sp g p = Lwt.return (f sp g p)
typesuff =
[ `WithSuffix | `WithoutSuffix ]
typeservcoserv =
[ `Coservice | `Service ]
typegetpost =
[ `Get | `Post ]
typeattached_service_kind =
[ `External | `Internal of servcoserv * getpost ]
typeget_attached_service_kind =
[ `External | `Internal of servcoserv * [ `Get ] ]
typepost_attached_service_kind =
[ `External | `Internal of servcoserv * [ `Post ] ]
typeinternal =
[ `Internal of servcoserv * getpost ]
typeregistrable =
[ `Registrable | `Unregistrable ]
type +'a
a_s
type +'a
na_s
typeservice_kind =
[ `Attached of attached_service_kind a_s
| `Nonattached of getpost na_s ]
typeget_service_kind =
[ `Attached of get_attached_service_kind a_s
| `Nonattached of [ `Get ] na_s ]
typepost_service_kind =
[ `Attached of post_attached_service_kind a_s
| `Nonattached of [ `Post ] na_s ]
typeinternal_service_kind =
[ `Attached of internal a_s
| `Nonattached of getpost na_s ]
typeattached =
[ `Attached of attached_service_kind a_s ]
typenonattached =
[ `Nonattached of getpost na_s ]
type ('a, 'b, +'c, +'d, +'e, +'f, +'g)
service
'kind
parameter is a subset of service_kind. 'get
and 'post
are the type of GET and POST parameters.typeurl_path =
string list
val string_of_url_path : url_path -> string
coucou/ciao
is represented by the list ["coucou";"ciao"]
type
server_params
val get_user_agent : server_params -> string
val get_full_url : server_params -> string
val get_ip : server_params -> string
val get_inet_addr : server_params -> Unix.inet_addr
val get_all_get_params : server_params -> (string * string) list
val get_get_params : server_params -> (string * string) list
val get_all_post_params : server_params -> (string * string) list
val get_post_params : server_params -> (string * string) list Lwt.t
val get_current_path_string : server_params -> string
val get_current_path : server_params -> url_path
val get_hostname : server_params -> string option
val get_port : server_params -> int
val get_other_get_params : server_params -> (string * string) list
val get_suffix : server_params -> url_path
val get_exn : server_params -> exn list
val get_config_file_charset : server_params -> string option
val get_cookies : server_params -> (string * string) list
val set_user_timeout : server_params -> float option -> unit
val unset_user_timeout : server_params -> unit
val get_user_timeout : server_params -> float option
val set_user_persistent_timeout : server_params -> float option -> unit
val unset_user_persistent_timeout : server_params -> unit
val get_user_persistent_timeout : server_params -> float option
val set_user_expdate : server_params -> float option -> unit
val get_user_expdate : server_params -> float option
val set_user_persistent_expdate : server_params -> float option -> unit
val get_user_persistent_expdate : server_params -> float option
val set_global_timeout : ?sp:server_params -> float option -> unit
~sp
parameter.val get_global_timeout : ?sp:server_params -> unit -> float option
val get_default_timeout : unit -> float option
val set_global_persistent_timeout : ?sp:server_params -> float option -> unit
val get_global_persistent_timeout : ?sp:server_params -> unit -> float option
val get_default_persistent_timeout : unit -> float option
val set_exn_handler : ?sp:server_params ->
(server_params -> exn -> Eliommod.result_to_send Lwt.t) -> unit
val get_tmp_filename : Extensions.file_info -> string
val get_filesize : Extensions.file_info -> int64
val get_original_filename : Extensions.file_info -> string
unit
for a page without parameter.(int "myvalue")
for a page that takes one parameter, of type int
, called myvalue
. (You must register a function of type int ->
page
).(int "myvalue" ** string "mystring")
for a page that takes two parameters, one of type int
called myvalue
, and one of type string
called mystring
. (The function you will register has a parameter of type (int * string)
).list "l" (int "myvalue" ** string "mystring")
for a page that takes a list of pairs. (The function you will register has a parameter of type (int * string) list
).type ('a, 'b)
binsum =
| |
Inj1 of |
|||
| |
Inj2 of |
(* | Binary sums | *) |
type 'a
param_name
type ('a, 'b, 'c)
params_type
type 'a
listnames = {
|
it : |
val int : string -> (int, [ `WithoutSuffix ], int param_name) params_type
int s
tells that the page takes an integer as parameter, labeled s
val float : string ->
(float, [ `WithoutSuffix ], float param_name) params_type
float s
tells that the page takes a floating point number as parameter, labeled s
val string : string ->
(string, [ `WithoutSuffix ], string param_name) params_type
string s
tells that the page takes a string as parameter, labeled s
val bool : string -> (bool, [ `WithoutSuffix ], bool param_name) params_type
bool s
tells that the page takes a boolean as parameter, labeled s
(to use for example with boolean checkboxes)val file : string ->
(Extensions.file_info, [ `WithoutSuffix ],
Extensions.file_info param_name)
params_type
file s
tells that the page takes a file as parameter, labeled s
val radio_answer : string ->
(string option, [ `WithoutSuffix ], string option param_name)
params_type
radio_answer s
tells that the page takes the result of a click on
a radio button as parameter.val unit : (unit, [ `WithoutSuffix ], unit param_name) params_type
val user_type : (string -> 'a) ->
('a -> string) ->
string -> ('a, [ `WithoutSuffix ], 'a param_name) params_type
user_type s_to_t t_to_s s
tells that the page take a parameter, labeled s
, and that the server will have to use s_to_t
and t_to_s
to make the conversion from and to string.val sum : ('a, [ `WithoutSuffix ], 'b) params_type ->
('a, [ `WithoutSuffix ], 'b) params_type ->
(('a, 'a) binsum, [ `WithoutSuffix ], 'b * 'b) params_type
val prod : ('a, [ `WithoutSuffix ], 'b) params_type ->
('c, [ `Endsuffix | `WithoutSuffix ], 'd) params_type ->
('a * 'c, [ `WithoutSuffix ], 'b * 'd) params_type
**
aboveval opt : ('a, [ `WithoutSuffix ], 'b) params_type ->
('a option, [ `WithoutSuffix ], 'b) params_type
val list : string ->
('a, [ `WithoutSuffix ], 'b) params_type ->
('a list, [ `WithoutSuffix ], 'b listnames) params_type
val (**) : ('a, [ `WithoutSuffix ], 'b) params_type ->
('c, [< `Endsuffix | `WithoutSuffix ], 'd) params_type ->
('a * 'c, [ `WithoutSuffix ], 'b * 'd) params_type
val regexp : Netstring_pcre.regexp ->
string ->
string ->
(string, [ `WithoutSuffix ], string param_name) params_type
regexp r d s
tells that the page takes a string that matches r
as parameter, labeled s
, and that will be rewritten in dval suffix : ('a, [< `Endsuffix | `WithoutSuffix ], 'b) params_type ->
('a, [ `WithSuffix ], 'b) params_type
register_new_service
)val all_suffix : string ->
(string list, [ `Endsuffix ], string list param_name) params_type
val all_suffix_string : string param_name ->
(string, [ `Endsuffix ], string param_name) params_type
val all_suffix_user : (string -> 'a) ->
('a -> string) ->
string -> ('a, [ `Endsuffix ], 'a param_name) params_type
val all_suffix_regexp : Netstring_pcre.regexp ->
string ->
string -> (string, [ `Endsuffix ], string param_name) params_type
val suffix_prod : ('a, [< `Endsuffix | `WithoutSuffix ], 'b) params_type ->
('c, [ `WithoutSuffix ], 'd) params_type ->
('a * 'c, [ `WithSuffix ], 'b * 'd) params_type
register_new_service
). e.g. suffix (int "i" ** string "s")
val static_dir : server_params ->
(string list, unit,
[> `Attached of [> `Internal of [> `Service ] * [> `Get ] ] a_s ],
[ `WithSuffix ], string list param_name, unit param_name,
[> `Unregistrable ])
service
val new_service : ?sp:server_params ->
url:url_path ->
get_params:('a, [< suff ] as 'b, 'c) params_type ->
unit ->
('a, unit,
[> `Attached of [> `Internal of [> `Service ] * [> `Get ] ] a_s ], 'b,
'c, unit param_name, [> `Registrable ])
service
new_service ~url:p ~get_params:pa ()
creates an service
associated to the url_path
p
and that takes the parameters pa
.
If you specify ~suffix:true
, your service will match all requests from client beginning by path
. You can have access to the suffix of the URL using suffix
or suffix_only
. For example new_service ["mysite";"mywiki"] ~suffix:true suffix_only
will match all the URL of the shape http://myserver/mysite/mywiki/thesuffix
If you want to create dynamically a new service during session,
you must add the ~sp
parameter (current server parameters)
val new_external_service : url:url_path ->
get_params:('a, [< suff ] as 'b, 'c) params_type ->
post_params:('d, [ `WithoutSuffix ], 'e) params_type ->
unit ->
('a, 'd, [> `Attached of [> `External ] a_s ], 'b, 'c, 'e,
[> `Unregistrable ])
service
val new_coservice : ?max_use:int ->
?timeout:float ->
fallback:(unit, unit,
[ `Attached of [ `Internal of [ `Service ] * [ `Get ] ] a_s ],
[ `WithoutSuffix ], unit param_name, unit param_name,
[< registrable ])
service ->
get_params:('a, [ `WithoutSuffix ], 'b) params_type ->
unit ->
('a, unit,
[> `Attached of [> `Internal of [> `Coservice ] * [> `Get ] ] a_s ],
[ `WithoutSuffix ], 'b, unit param_name, [> `Registrable ])
service
val new_coservice' : ?max_use:int ->
?timeout:float ->
get_params:('a, [ `WithoutSuffix ], 'b) params_type ->
unit ->
('a, unit, [> `Nonattached of [> `Get ] na_s ], [ `WithoutSuffix ], 'b,
unit param_name, [> `Registrable ])
service
val new_post_service : ?sp:server_params ->
fallback:('a, unit,
[ `Attached of
[ `Internal of [ `Coservice | `Service ] * [ `Get ] ] a_s ],
[< suff ] as 'b, 'c, unit param_name,
[< `Registrable ])
service ->
post_params:('d, [ `WithoutSuffix ], 'e) params_type ->
unit ->
('a, 'd,
[> `Attached of
[> `Internal of [ `Coservice | `Service ] * [> `Post ] ] a_s ],
'b, 'c, 'e, [> `Registrable ])
service
fallback
is the same service without POST parameters.
You can create an service with POST parameters if the same service does not exist
without POST parameters. Thus, the user can't bookmark a page that does not
exist.val new_post_coservice : ?max_use:int ->
?timeout:float ->
fallback:('a, unit,
[ `Attached of
[ `Internal of [< `Coservice | `Service ] * [ `Get ] ]
a_s ],
[< suff ] as 'b, 'c, unit param_name,
[< `Registrable ])
service ->
post_params:('d, [ `WithoutSuffix ], 'e) params_type ->
unit ->
('a, 'd,
[> `Attached of [> `Internal of [> `Coservice ] * [> `Post ] ] a_s ],
'b, 'c, 'e, [> `Registrable ])
service
val new_post_coservice' : ?max_use:int ->
?timeout:float ->
post_params:('a, [ `WithoutSuffix ], 'b) params_type ->
unit ->
(unit, 'a, [> `Nonattached of [> `Post ] na_s ], [ `WithoutSuffix ],
unit param_name, 'b, [> `Registrable ])
service
val preapply : ('a, 'b, [> `Attached of 'd a_s ] as 'c, [< suff ], 'e, 'f, 'g)
service ->
'a ->
(unit, 'b, 'c, [ `WithoutSuffix ], unit param_name, 'f,
[ `Unregistrable ])
service
val make_string_uri : ('a, unit, [< get_service_kind ], [< suff ], 'b,
unit param_name, [< registrable ])
service -> server_params -> 'a -> string
module type REGCREATE =sig
..end
module type FORMCREATE =sig
..end
module type ELIOMFORMSIG =sig
..end
module type ELIOMREGSIG1 =sig
..end
module type ELIOMREGSIG =sig
..end
module type ELIOMSIG =sig
..end
module MakeRegister:
module MakeForms:functor (
Pages
:
FORMCREATE
) ->
ELIOMFORMSIG
with type form_content_elt = Pages.form_content_elt and type form_content_elt_list = Pages.form_content_elt_list and type form_elt = Pages.form_elt and type a_content_elt = Pages.a_content_elt and type a_content_elt_list = Pages.a_content_elt_list and type a_elt = Pages.a_elt and type a_elt_list = Pages.a_elt_list and type div_content_elt = Pages.div_content_elt and type div_content_elt_list = Pages.div_content_elt_list and type uri = Pages.uri and type link_elt = Pages.link_elt and type script_elt = Pages.script_elt and type textarea_elt = Pages.textarea_elt and type select_elt = Pages.select_elt and type input_elt = Pages.input_elt and type pcdata_elt = Pages.pcdata_elt and type a_attrib_t = Pages.a_attrib_t and type form_attrib_t = Pages.form_attrib_t and type input_attrib_t = Pages.input_attrib_t and type textarea_attrib_t = Pages.textarea_attrib_t and type select_attrib_t = Pages.select_attrib_t and type link_attrib_t = Pages.link_attrib_t and type script_attrib_t = Pages.script_attrib_t and type input_type_t = Pages.input_type_t
module type XHTMLFORMSSIG =sig
..end
module Xhtml:sig
..end
module Blocks:sig
..end
module SubXhtml:
module HtmlText:ELIOMSIG
with type page = string and type form_content_elt = string and type form_content_elt_list = string and type form_elt = string and type a_content_elt = string and type a_content_elt_list = string and type a_elt = string and type a_elt_list = string and type div_content_elt = string and type div_content_elt_list = string and type uri = string and type link_elt = string and type script_elt = string and type textarea_elt = string and type select_elt = string and type input_elt = string and type pcdata_elt = string and type a_attrib_t = string and type form_attrib_t = string and type input_attrib_t = string and type textarea_attrib_t = string and type select_attrib_t = string and type link_attrib_t = string and type script_attrib_t = string and type input_type_t = string
module CssText:ELIOMREGSIG
with type page = string
module Text:ELIOMREGSIG
with type page = string * string
module Actions:ELIOMREGSIG
with type page = exn list
module Unit:ELIOMREGSIG
with type page = unit
module Redirections:ELIOMREGSIG
with type page = string
module Files:ELIOMREGSIG
with type page = string
module Any:ELIOMREGSIG
with type page = Eliommod.result_to_send
type 'a
table
val create_table : ?sp:server_params -> unit -> 'a table
~sp
parameterval get_session_data : 'a table -> server_params -> 'a option
val set_session_data : 'a table -> server_params -> 'a -> unit
val remove_session_data : 'a table -> server_params -> unit
type 'a
persistent_table
val create_persistent_table : string -> 'a persistent_table
val get_persistent_data : 'a persistent_table -> server_params -> 'a option Lwt.t
val set_persistent_data : 'a persistent_table -> server_params -> 'a -> unit Lwt.t
val remove_persistent_data : 'a persistent_table -> server_params -> unit Lwt.t
val close_persistent_session : server_params -> unit Lwt.t
val close_volatile_session : server_params -> unit
val close_session : server_params -> unit Lwt.t