mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/doc/resources mimefilters.html,1.26,1.27

2003-08-07 14:29:03
Update of /cvsroot/mhonarc/mhonarc/MHonArc/doc/resources
In directory subversions:/tmp/cvs-serv23731/doc/resources

Modified Files:
	mimefilters.html 
Log Message:
Added information about %readmail::Cid hash.


Index: mimefilters.html
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/doc/resources/mimefilters.html,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** mimefilters.html	7 Aug 2003 05:59:39 -0000	1.26
--- mimefilters.html	7 Aug 2003 21:27:04 -0000	1.27
***************
*** 328,331 ****
--- 328,399 ----
  </dl>
  
+ <H4><a name="cidhash">Accessing Other Parts</a></H4>
+ 
+ <p>For some media-types, a filter may need to access other entity
+ parts to properly process a given part.
+ For example,
+ <a href="#m2h_text_html">m2h_text_html::filter</a> must access
+ other entity parts when processing MHTML messages.
+ </p>
+ 
+ <p>When MHonArc parses a multipart message, it fills the
+ <tt><b>%readmail::Cid</b></tt> hash for each entity that defines either
+ a <tt>Content-Id</tt> or <tt>Content-Location</tt>.
+ The <tt>%readmail::Cid</tt> hash is mainly for use by media types,
+ like <tt>multipart/related</tt> where message parts may reference other
+ message parts.
+ </p>
+ 
+ <p>The keys of the <tt>%readmail::Cid</tt> hash will be the
+ <tt>Content-Id</tt>s and <tt>Content-Location</tt>s and each value
+ will be a reference to an entity hash structure.  Code example:
+ </p>
+ <pre class="code">my $entity = $readmail::Cid{$content_id};</pre>
+ <p>The hash structure defines the following fields: </p>
+ 
+ <dl>
+ <dt><strong><code>body</code></strong></td>
+ <dd><pre class="code">
+ my $entity_body_ref = $readmail::Cid{$content_id}-&gt;{'body'}
+ </pre>
+ <p>Scalar reference to the body of the entity.
+ </p>
+ </dd>
+ </tr>
+ <tr valign=top>
+ <td><strong><code>fields</code></strong></td>
+ <dd><pre class="code">
+ my $entity_header_ref = $readmail::Cid{$content_id}-&gt;{'fields'}
+ </pre>
+ <p>Entity header fields hash reference.  The format is the same
+ as described for <code><a href="#fields_hash_ref">$fields_hash_ref</a></code>.
+ </p>
+ </dd>
+ </tr>
+ <tr valign=top>
+ <td><strong><code>filtered</code></strong></td>
+ <dd><pre class="code">
+ my $is_filtered = $readmail::Cid{$content_id}-&gt;{'filtered'}
+ </pre>
+ <p>Boolean if part has already been filtered.  This field should
+ be set to a true value by filters that explicitly filters other entity parts.
+ This tells MHonArc itself to not invoke a filter for the data.
+ </p>
+ </dd>
+ </tr>
+ <tr valign=top>
+ <td><strong><code>uri</code></strong></td>
+ <dd><pre class="code">
+ my $entity_uri = $readmail::Cid{$content_id}-&gt;{'uri'}
+ </pre>
+ <p>The URI to the filtered version of the entity.  This field should
+ be set by filters that explicitly filters other entity parts.
+ </p>
+ </dd>
+ </dl>
+ 
+ <p>For a detailed example on how <tt>%readmail::Cid</tt> can be used, see
+ the MHonArc library <tt>mhtxthtml.pl</tt>.
+ </p>
  
  <H4>Filter Writing Tips</H4>

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV