[Chandler-dev] The type of ContentItem.body [bug 3531]

Brian Kirsch bkirsch at osafoundation.org
Mon Apr 10 17:04:53 PDT 2006


 >>> I propose that we adopt Morgen's proposal (in the bug) that we 
change the type to schema.Text.

Yes, this most definitely should not be a schema.String. Although the 
repository supports the schema.String, Chandler does not.
The reason is the String type can accept an 8bit Python str type in any 
character set encoding.

Having to support strings in different encodings is a nightmare and one 
of the main reasons the Unicode standard was established. Chandler 
textual data is Unicode. As a convenience, the Text type also accept 
ASCII but will raise an error when assigned an 8bit string.

For more info see the I18n Busy Developer Guide:
http://wiki.osafoundation.org/bin/view/Projects/ChandlerInternationalizationBusyDevelopersGuide

If 8bit data needs to be preserved the Lob type should used.

For example, mail coming in to Chandler can be in any character set 
encoding. The message is parsed and converted  to a Chandler MailMessage 
item but we still want to preserve the original 8bit mail text.

It is stored in a Repository lob:
      MailMessage.rfc2822Message = schema.One(schema.Lob, indexed=True)

So to make a short story long :)

the body attribute should be schema.Text not schema.String.

--Brian

Brian Kirsch -  Cosmo Developer / Chandler Internationalization Engineer
Open Source Applications Foundation
543 Howard St. 5th Floor
San Francisco, CA 94105
http://www.osafoundation.org



Ted Leung wrote:

> This is an attempt to resolve 
> <https://bugzilla.osafoundation.org/show_bug.cgi?id=3531>
>
> Currently the type of ContentItem.body is schema.String
>
> I propose that we adopt Morgen's proposal (in the bug) that we change 
> the type to schema.Text, and that any parcel that needs to augment the 
> body of a content item do it via a plugin specific mixin or 
> annotation.   Do people have thoughts on whether it is better to use a 
> mixin or an annotation?   Is there some other mechanism where we could 
> avoid creating parcel/mixin specific body attributes.
>
> ----
> Ted Leung                 Open Source Applications Foundation (OSAF)
>
>
>
>------------------------------------------------------------------------
>
>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
>Open Source Applications Foundation "chandler-dev" mailing list
>http://lists.osafoundation.org/mailman/listinfo/chandler-dev
>  
>


More information about the chandler-dev mailing list