Subject: [lemonade] CONVERT's BODYPARTSTRUCTURE doesn't cut it for the client

From: Philip Van Hoof <[email-masked]>
Date: Thu, 29 Nov 2007 19:03:23 +0100

Summary: A client needs to know before launching the CONVERT how the
result will look or what the result can look like. It also needs to know
what it can convert to.

Story:

Consider that the client needs to prepare its part viewers before the
part's contents are fetched. I'll give an example: progressive loading
of JPEGs. 

I'll go into hypothetical-mode. Warn me if I never go out of it (I know
it becomes a dangerous world when going hypothetical, but how else do we
specify things for a future?)

I'm mr. client and I got this bodystructure piece:

("APPLICATION" "OCTET-STREAM" NIL NIL NIL NIL 11111111111161 0)

I can't do a lot with that. I can't instantiate a JPEG viewer because I
don't know yet what I'll receive. I can't tell the server "please
convert this to something more sensible" because I don't know to what I
should convert it to: I don't know what it "is" ... it's a bunch of
bytes for as far as I am, as client developer, concerned.

BODYPARTSTRUCTURE comes to late too. It will only tell me DURING the
conversion phase. At that time I had to make a decision already: it's me
who has to specify this to the CONVERT command, right? But what must I
specify if I don't know what I can do with this part?

So .. a BODYPARTSTRUCTURE-like that I can request BEFORE I convert?

For example:

1 UID FETCH 10 BODYSTRUCTURE

And I receive a 

* 1 FETCH (UID 10 BODYSTRUCTURE (((("TEXT" "PLAIN" NIL NIL NIL "7BIT" 83
4 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "utf-8") NIL NIL "7BIT" 690 13
NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "---") NIL NIL)("APPLICATION"
"WORD-DOCUMENT-whatever" ("NAME" "test.doc") "<id@host>" NIL "BASE64"
113000 NIL ("ATTACHMENT" ("FILENAME" "test.doc")) NIL) "RELATED" ("TYPE"
"multipart/alternative" "BOUNDARY" "---") NIL NIL) "MIXED" ("BOUNDARY"
"---") NIL NIL)) ...

Or perhaps I just receive a ...

... ("APPLICATION" "OCTET-STREAM" NIL NIL NIL NIL 11111111111161 0) ...

What I propose to add to CONVERT is:

2 UID FETCH 10 BODYCONVERTIBLESTRUCTURE[2]
 * BODYCONVERTIBLESTRUCTURE[2] ("IMAGE" "JPG" "CONVERTIBLE-TO" (
	("IMAGE" "JPEG" ("X-WIDTH" "VARIABLE" "Y-WIDTH" "VARIABLE"))
	("IMAGE" "GIF" ("X-WIDTH" "VARIABLE" "Y-WIDTH" "VARIABLE"))
	("APPLICATION" "PDF" NIL)
	("TEXT" "HTML" NIL)
	("TEXT" "PLAIN" NIL)
   ))

And then I can do:

3 UID CONVERT 10 ("APPLICATION/PDF") (BINARY[2] BODYPARTSTRUCTURE[2])

This BODYCONVERTIBLESTRUCTURE must not be a fast one, I would only need
this at the moment when the user wants to view a particular message. I
don't need it to build my summary screen (for which I might want to
fetch BODYSTRUCTURE and ENVELOPE, for example).

The chance for my case will be extremely high that I will do a CONVERT
soon after the BODYCONVERTIBLESTRUCTURE. However, I don't want it
immediately (like with the BODYPARTSTRUCTURE, this doesn't help me).

Based on that response, I will make a decision for my CONVERT command.

Hoping this makes sense :)

-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be

_______________________________________________
lemonade mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/lemonade
Supplemental Web Site:
http://www.standardstrack.com/ietf/lemonade