Re: Question to developpers about Squid

From: Axel Trotignon <axel.trotignon@dont-contact.us>
Date: Mon, 28 Feb 2000 09:18:05 +0100

In fact, the full process is :

GSM ---> RAN ---> Gateway ---> Squid Proxy ---> Internet
HDDP/HDML HTTP HTTP/WML

So it's right, it is not a protocol conversion (because there's HTTP on both
sides of Squid), but a conversion in the HTTP content (request).

HDML is a language for the GSM phones. It looks like XML.
So what I want to make, is to convert WML to HDML, so that a GSM could see
(part of) internet pages.
So I have to change :
- http headers,
- http content,
- some constraints explained as follow :

Constraint on the WML input
These constraints are sorted by order of decreasing impact on the original
WML.

High impact constraints
- the timer concept does not exist in HDML. Thus, each time a WML card
contains a timer, it will be omitted and the user will have to click a
softkey to go on his navigation. This implicates :
- the <timer> tag
- the <onevent> tag
- the <template ontimer=""> tag
- the event concept does not exist in HDML. Let's look at the different
possible values of the <event> tag :
- onpick : this event means that the user has picked an item in a selection,
this feature can be translated by the <CE> tag in HDML.
- Onenterforward : this event is raised when you enter the current card with
a <go> task. This cannot be translated into HDML.
- Onenterbackward : this event is raised when you enter the current card
with a <prev> task. This cannot be translated into HDML.
- Ontimer : this cannot be translated into HDML
- The multiple selection does not exist in HDML : a tag <select
multiple="true"> cannot be translated into HDML.
- The <refresh> tag is not translated.

Medium impact constraints
- The HDML transformation of the WML decks can cause a slight variation of
the size of the deck. In order to avoid too large resulting HDML decks, the
size of the incoming WML decks should be limited at a reasonable size.
- The following arguments of the <img> WML tag : align, height, width,
vspace, hspace cannot be translated in HDML.
- The following arguments are not translated into HDML :
- The title argument of <select>.
- The tabindex argument of <select>.
- The name argument of <do>.
- The optional argument of <do>.
- The tabindex argument of <input>.

Low impact constraints
- The options cannot be grouped in WML : the <optgroup> tag cannot be
translated. This tag has a presentation scope, the result is still valid if
this tag is omitted.
- The <fieldset> element cannot be translated. This tag has a presentation
scope, the result is still valid if this tag is omitted.
- Tables do not exist in HDML. You can replace <td> and <tr> by non-breaking
spaces and line breaking.
- Some layout and text formatting tags cannot be translated into HDML : <b>,
<big<, <em>, <i>, <small>, <strong>, <u>.

If the constraints on the above are respected, we can propose an automatic
translation of an incoming WML deck into HDML.

Quick description of the translation algorithm.
- the <wml> tag is translated into <HDML>. The mandatory XML header is
removed.
- The <card> element uses this algorithm :
- If the card contains a <select> element, it is translated into <CHOICE>.
- If the card contains a <input> element, it is translated into <ENTRY>.
- If the card contains a <p> tag, but neither <select> nor <input>, it is
translated into <DISPLAY>.
- If the card contains neither of the above elements, it is translated into
<NODISPLAY>.
- The </card> tag is translated into </CHOICE>, </ENTRY>, </DISPLAY> and
</NODISPLAY> following the same rules.
- In WML, it is possible to perform several selections and fill in several
inputs within the same card. It is not possible in HDML. This can be
translated by using several <CHOICE> AND <ENTRY> cards, linked together by a
row navigation.
- The <templates> tag :
- <template onenterforward="url"> is translated into an <ACTION TYPE="GO"..>
HDML tag placed between the <HDML> tag and the first card tag (into
<CHOICE>, <ENTRY>, <DISPLAY> or <NODISPLAY>).
- <template onenterbackward="url"> is translated into an <ACTION
TYPE="PREV"..> HDML tag placed between the <HDML> tag and the first card
tag.
- The <head> tag :
- The <access> tag is translated into the arguments ACCESSDOMAIN and
ACCESSPATH of the <HDML> tag.
- The <meta> tag is translated only if it concerns cache information. In
this case, it is translated into the TTL argument of <HDML>.
- The <setvar> is translated by the VARS argument of the tags <ACTION>, <A>,
or <GO>, depending on the context of the <setvar> tag.
- <a> and <anchor> are translated into <A>.
- <do..> <go…/></do> is translated into <ACTION TASK="GO"…>
- <do..> <prev…/></do> is translated into <ACTION TASK="PREV"…>
- <do..> <noop/></do> is translated into <ACTION TASK="NOOP"…>

Additional constraints
In a HDML cards, the different tags must be sorted in a certain order. For
example, all the <ACTION> tags must be placed before the first line of text.
A little bit of post processing shall be done in order to make the resulting
HDML code valid.

How to split a SLD into several decks : the principle

The SLD top elements are sorted in two categories :
- the Main elements : MESSAGE, LIST, FORM. These elements represent the Main
sub-SLD.
- the Navigation elements : NAVBAR, MENU. These elements represent the
Navigation sub-SLD.
The split of the SLD into several cards or decks depends on the size of the
sub-SLDs. If both sub-SLDs are small,

The Main elements are placed in the main deck, the Navigation elements are
placed in the Navigation

I hope those explainations will help you to help me in that work ! ;o)

Regards,

--
--------------------------------
Axel TROTIGNON
mailto:axel.trotignon@alcatel.fr
http://www.chez.com/atrotign
http://www.chez.com/sitnema
http://www.chez.com/ouketes
http://www.chez.com/30s
Henrik Nordstrom wrote:
> It sounds like you want to make content transformation and not protocol
> transformation.
>
> WML and HTML is a markup languages, not a protocols.
>
> HTTP, FTP, Gopher is protocols.
>
> HDML I don't know of.
>
> Squid is not exactly suitable for content transformations, except if it
> is done as part of protocol gatewaying from http to some other protocol
> (possibly including http). Hmm.. maybe your transformation can be seen
> as a Transfer-Encoding transformation. In such case the
> Transfer-Encoding patch from Patrick McManus may be of some help. See
> http://squid.sourceforge.net/
>
> Please explain more on what you are trying to do, and we may be able to
> help you further.
>
> The correct address for questions like this is squid-dev@ircache.net.
>
> --
> Henrik Nordstrom
> Squid hacker
>
> Axel Trotignon wrote:
> >
> > Hello !
> >
> > I'd like to develop a feature on the Squid product. In fact, I want to
> > manipulate the HTTP request, by changing some things inside it, to be
> > able to go from one protocol to another (WML to HDML for example).
> >
> > Could you tell be where is the best place to put this code in Squid
> > sources. Which C file, which method ?
> >
> > Thank you very much for answering.
> >
> > Regards,
> > --
> > --------------------------------
> > Axel TROTIGNON
> >
> > mailto:axel.trotignon@alcatel.fr
> > http://www.chez.com/atrotign
> > http://www.chez.com/sitnema
> > http://www.chez.com/ouketes
> > http://www.chez.com/30s
Received on Mon Feb 28 2000 - 01:21:22 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:21 MST