.TH "Eliom_registration.Html_text" 3o 2012-06-11 OCamldoc ""
.SH NAME
Eliom_registration.Html_text \- Eliom service registration and forms creation for untyped HTML page.
.SH Module
Module Eliom_registration.Html_text
.SH Documentation
.sp
Module
.BI "Html_text"
:
.B sig end
.sp
Eliom service registration and forms creation for untyped HTML
page\&. This an instance the
.B Eliom_registration\&.Registration
abstract signature\&. The page content is a
.B string
that must
contains valid HTML and the content type is always
.B text/html
\&.
.sp
.sp
.sp
.sp
.PP
.B ===
.B Service registration
.B ===
.PP
.I val register
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B service:('a, 'b, [< Eliom_service.internal_service_kind ],
.B [< Eliom_service.suff ], 'c, 'd, [ `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> 'b -> string Lwt.t) -> unit
.sp
The function
.B register service handler
will associate the
.B service
to the function
.B handler
\&. The
.B handler
function take
two parameters, the GET and POST parameters of the current HTTP
request, and should returns the corresponding page\&.
.sp
The optional parameter
.B ~scope
is
.B Eliom_common\&.global
by
default, see the Eliom manual for detailled description \&.
.sp
The optional parameter
.B ~options
is specific to each output
module, see the type description for more information\&.
.sp
The optional parameters
.B ?charset
,
.B ?code
,
.B ?content_type
and
.B ?headers
can be used to modify the HTTP answer sent by
Eliom\&. Use this with care\&.
.sp
The optional parameter
.B ~secure_session
has no effect for scope
.B Eliom_common\&.global
\&. With other scopes, the parameter is used
to force the session service table in which the
.B handler
will be
registered\&. By default, the service is registred in the unsecure
session if the current request\&'s protocol is
.B http
, or in the
secure session if the protocol is
.B https
\&. If set to
.B false
(resp\&.
.B true
) the
.B handler
will be stored in the unsecure
(resp\&. secure) session\&. See the Eliom manual for an introduction
to \&.
.sp
The optional parameter
.B ~error_handler
is used to specialize the
error page when actual parameters aren\&'t compatible with the
expected type\&. The default error handler is
.B fun l \-> raise (
.B Eliom_common\&.Eliom_Typing_Error
.B l)
\&.
.sp
.sp
.I val register_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B path:Eliom_lib.Url.path ->
.B get_params:('a, [< Eliom_service.suff ] as 'b, 'c)
.B Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> unit -> string Lwt.t) ->
.B ('a, unit,
.B [> `Attached of
.B ([> `Internal of [> `Service ] ], [> `Get ]) Eliom_service.a_s ],
.B 'b, 'c, unit, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.service
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.I val register_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:(unit, unit,
.B [ `Attached of
.B ([ `Internal of [ `Service ] ], [ `Get ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], unit, unit, [< Eliom_service.registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service ->
.B get_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> unit -> string Lwt.t) ->
.B ('a, unit,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Get ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], 'b, unit, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.coservice
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.I val register_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B get_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> unit -> string Lwt.t) ->
.B ('a, unit, [> `Nonattached of [> `Get ] Eliom_service.na_s ],
.B [ `WithoutSuffix ], 'b, unit, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.coservice\&'
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.I val register_post_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B fallback:('a, unit,
.B [ `Attached of
.B ([ `Internal of [ `Coservice | `Service ] ], [ `Get ])
.B Eliom_service.a_s ],
.B [< Eliom_service.suff ] as 'b, 'c, unit, [< `Registrable ], 'd)
.B Eliom_service.service ->
.B post_params:('e, [ `WithoutSuffix ], 'f) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> 'e -> string Lwt.t) ->
.B ('a, 'e,
.B [> `Attached of
.B ([> `Internal of [ `Coservice | `Service ] ], [> `Post ])
.B Eliom_service.a_s ],
.B 'b, 'c, 'f, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.post_service
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.I val register_post_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:('a, unit,
.B [ `Attached of
.B ([ `Internal of [< `Coservice | `Service ] ], [ `Get ])
.B Eliom_service.a_s ],
.B [< Eliom_service.suff ] as 'b, 'c, unit, [< `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service ->
.B post_params:('d, [ `WithoutSuffix ], 'e) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B ('a -> 'd -> string Lwt.t) ->
.B ('a, 'd,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Post ]) Eliom_service.a_s ],
.B 'b, 'c, 'e, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.post_coservice
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.I val register_post_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?keep_get_na_params:bool ->
.B ?https:bool ->
.B post_params:('a, [ `WithoutSuffix ], 'b) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list -> string Lwt.t) ->
.B (unit -> 'a -> string Lwt.t) ->
.B (unit, 'a, [> `Nonattached of [> `Post ] Eliom_service.na_s ],
.B [ `WithoutSuffix ], unit, 'b, [< Eliom_service.registrable > `Registrable ],
.B Eliom_registration.http_service)
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.post_coservice\&'
followed by
.B Eliom_registration\&.Html_text\&.register
\&.
.sp
.sp
.PP
.B ===
.B Low\-level function
.B ===
.PP
.I val send
:
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B string ->
.B (Eliom_registration.browser_content, Eliom_registration.http_service)
.B Eliom_registration.kind Lwt.t
.sp
The function
.B send page
build the HTTP frame corresponding to
.B page
\&. This may be used for example in an service handler
registered with
.B Eliom_registration\&.Any\&.register
or when building a
custom output module\&.
.sp
.sp