<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Knowledge Base / The Appnel Group</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/" />
<link rel="self" type="application/atom+xml" href="http://appnel.com/kb/index.atom" />
<id>tag:appnel.com,2006-06-30:/kb//3</id>
<updated></updated>

<generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>

<entry>
<title>Cache Output for Movable Type Manual</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/cacheoutput" />
<id>tag:appnel.com,2008:/kb//3.605</id>
<published>2008-01-30T16:34:41Z</published>
<updated>2008-01-30T16:41:38Z</updated>
<summary>Cache Output for MT speeds the publishing of pages by caching repetitive blocks of output (content) in memory.
</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>Cache Output for MT - speeds the publishing of pages by caching
repetitive blocks of output (content) in memory.</p>

<h2>SYNOPSIS</h2>

<pre>  # page one
  &lt;mt:cacheoutput name=&quot;example&quot;&gt;
     &lt;!-- The output from this markup will be stored in
     memory once generated. --&gt;
  &lt;/mt:cacheoutput&gt;
  
  # later in the rebuild process... page two.
  &lt;mt:cacheoutput name=&quot;example&quot;&gt;
     &lt;!-- These tags are NOT processed, but replaced with
     the output of the first &quot;example&quot; block regardless
     of this tag&#39;s contents. --&gt;
  &lt;/mt:cacheoutput&gt;
    </pre>

<h2>DESCRIPTION</h2>

<p>This plugin provides a simple block tag that will store the output of
its contents in the request or context object. Subsequent appearances of
the <code>mt:cacheoutput</code> tagset with the same name will simply
replace its contents with the output stored in memory. Depending on the
contents of the tagset, this can significantly improve the speed of MT page
rebuilds by eliminating costly and redundant processing to produce the same
output.</p>

<p>For example, infrequently updated footer or sidebar items are excellent
candidates in which this plugin can be applied.</p>

<h2>TAGS</h2>

<h3>mt:cacheoutput name="" [scope="request|context"]</h3>

<p>A container tag that will process the contained markup and cache it
within the defined scope. Later occurances of the tag with the same name
and scope will insert the cached output rather then process the contained
markup.</p>

<p>The tag takes 2 arguments:</p>

<ul>

<li>name

<p>REQUIRED. The value of this argument is a string that will unique
identify this block of output throughout its scope.</p>

<li>scope

<p>OPTIONAL. A value of either "request" or "context" can be passed in to
define the scope that the output should be kept. The default is "context"
-- the output will only be cache for the current page.</p>

</ul>

<h4>On Scope</h4>

<p>Note that the two cache output blocks with the same name, but different
scopes are treated as if they where named something entirely different with
the same scope.</p>

<p>The following would cache/output two different blocks of output:</p>

<pre>  &lt;mt:cacheoutput name=&quot;example&quot; scope=&quot;request&quot;&gt;
    This output will be cached for the life of the request.
  &lt;/mt:cacheoutput&gt;

  &lt;mt:cacheoutput name=&quot;example&quot; scope=&quot;request&quot;&gt;
    This output will be cached for the life of the page
    context.
  &lt;/mt:cacheoutput&gt;</pre>

<h2>TO DO</h2>

<ul>

<li>Simple longer term options such as file based-caching.

<li>Implement expiry option.

</ul>

<h2>SUPPORT</h2>

<p>Support issues should be directed to the Movable Type Community Forums
at http://community.movabletype.org/.</p>

<h2>AUTHOR</h2>

<p>Timothy Appnel <http://appnel.com/></p>

<h2>COPYRIGHT AND LICENSE</h2>

<p>The software is released under the Artistic License. The terms of the
Artistic License are described at
http://www.perl.com/language/misc/Artistic.html. Except where otherwise
noted, Cache Output for MT is Copyright 2008, Timothy Appnel,
http://appnel.com/. All rights reserved.</p>

<h2>POD ERRORS</h2>

<p>Hey! <strong>The above document had some coding errors, which are
explained below:</strong></p>

<ul>

<li>Around line 63:

<p>You forgot a '=back' before '=head3'</p>

</ul>

]]>

</content>
</entry>

<entry>
<title>Again for Movable Type Manual</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/again" />
<id>tag:appnel.com,2008:/kb//3.604</id>
<published>2008-01-30T16:08:37Z</published>
<updated>2008-01-30T16:31:44Z</updated>
<summary>Again for MT provides a generic means of performing a recursive loop on some template markup.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>Again for MT - enables a generic means of performing a recursive loop on
some template markup</p>

<h2>SYNOPSIS</h2>

<pre>  &lt;mt:again limit=&quot;5&quot;&gt;
  &lt;a href=&quot;&lt;$mt:archivelink$&gt;&quot;&gt;&lt;$mt:archivetitle$&gt;&lt;/a&gt;&lt;br /&gt;
  &lt;mt:archiveprevious&gt;
    &lt;$mt:againhere$&gt;
  &lt;/mt:archiveprevious&gt;
  &lt;/mt:again&gt;
    </pre>

<h2>DESCRIPTION</h2>

<p>Again for MT - enables a generic means of performing a recursive loop on
some template markup.</p>

<p>Wikipedia defines recursion in mathematics and computer science as "a
method of defining functions in which the function being defined is applied
within its own definition." The entry continues "For instance, when the
surfaces of two mirrors are almost parallel with each other the nested
images that occur are a form of recursion."</p>

<p>http://en.wikipedia.org/wiki/Recursion</p>

<p>This MT4 plugin is based on an MT3 plugin originally developed by
LummoxJR.</p>

<p>One such use of recursion in MT templates is calling a functional block
tag like <mt:entryprevious> recursively to show the previous 5 entries to
the one in context. See the SYNOPSIS for a specific example in code.</p>

<h2>TAGS</h2>

<h3>mt:again [limit="5"]</h3>

<p>A container tag that defines the block to repeat when recursing. Take
one optional argument that defines the maximum depth (number of loops) of
the recursion process. The default limit is 50. In order to avoid a
potential server crashing infinite loop from potentially occurring the
maximum limit supported is 50. Setting a limit higher then 50 will be
ignored.</p>

<h3>mt:againhere</h3>

<p>A variable tag representing the point at which the recursion loop takes
place again.</p>

<h3>mt:againstop [any="1"]</h3>

<p>This block tag is an alternative to <mt:againhere> that can be used when
you want to recurse up to a certain point (depth/limit) and then do
something. The contained markup is output when the limit defined in
<mt:again> is reached.</p>

<p>The tag takes an option any argument will make the contents appear at
the deepest point reached by recursion -- regardless if the limit could be
reached. An example would be using <mt:entrynext> and running out of
entries before the limit is reached.</p>

<h2>SUPPORT</h2>

<p>Support issues should be directed to the Movable Type Community Forums
at http://community.movabletype.org/.</p>

<h2>AUTHOR</h2>

<p>Timothy Appnel <http://appnel.com/></p>

<h2>COPYRIGHT AND LICENSE</h2>

<p>This MT4 plugin is based on an MT3 plugin originally developed by
LummoxJR.</p>

<p>The software is released under the Artistic License. The terms of the
Artistic License are described at
http://www.perl.com/language/misc/Artistic.html. Except where otherwise
noted, Again for MT is Copyright 2008, Timothy Appnel, The Appnel Group,
http://appnel.com/. All rights reserved.</p>

]]>

</content>
</entry>

<entry>
<title>Temper for Movable Type Manual</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/devtools/temper" />
<id>tag:appnel.com,2007:/kb//3.583</id>
<published>2007-11-19T18:06:08Z</published>
<updated>2008-01-30T16:28:17Z</updated>
<summary>Temper (TEMPlate profilER) for Movable Type measures and logs system
page building performance information for benchmark and diagnostic
purposes.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<p><strong>Temper (TEMPlate profilER) for Movable Type measures and logs
system page building performance information for benchmark and diagnostic
purposes.</strong></p>

<p>This plugin was designed to aid in pro-actively detecting and identify
performance bottlenecks in a Movable Type system's publishing.</p>

<p>Temper does two things:</p>

<ul>

<li>Enable the output template/page build times to STDERR using DebugMode
16.

<li>Log template/page build times to the system activity log.

</ul>

<h3>System Requirements</h3>

<p>This plugin requires at least version 4.01 of Movable Type and
<code>Time::HiRes</code> from CPAN.</p>

<h3>Getting Started</h3>

<p>You install it like any other plugin by unpacking the contents of the
distribution in the MT application directory.</p>

<p>Once installed, the plugin won't do anything unless you add one of the
following to your mt-config.cgi file:</p>

<pre>    DebugMode 16
    TemplateProfilerLog All</pre>

<p>The first directive will output page build messages for anything it
builds to STDERR. The second directive tells MT to log all page build times
to the activity of regardless of the warning threshold. (Changing "All" to
"Warning" will only log "slow" page builds.)</p>

<p>Remember that DebugMode is the sum of bitwise switches so you may not be
using 16 like in the example above. For instance, displaying general Perl
warnings and tag build times would use a DebugMode of 25 (1+8+16).</p>

<h3>Debug Mode</h3>

<p>Temper will output all page build times to STDERR with a bitwise value
of 16. The output is similar to the template tag build messages DebugMode 8
will output.</p>

<p><strong>NOTE:</strong> that the DebugMode functionality is separate and
independent of the activity logging function.</p>

<h3>Configuration Directives</h3>

<p>You can modify the behavior of this plugin using configuration
directives in your system's mt-config.cgi file.</p>

<ul>

<li>TemplateProfilerLog

<p>Sets the type of activity logging the plugin will perform. Recognized
values are "All", "Warning" or "None". None is the default therefore the
plugin doesn't do anything without this directive or setting the DebugMode
with a bitwise value of 16.</p>

<li>TemplateProfilerEntryThreshold

<p>Defines the maximum amount of time in seconds that an entry page build
can use without generating a warning.</p>

<li>TemplateProfilerPageThreshold

<p>Defines the maximum amount of time in seconds that an page (as in
content record) build can use without generating a warning.</p>

<li>TemplateProfilerArchiveThreshold

<p>Defines the maximum amount of time in seconds that an archive page build
can use without generating a warning.</p>

<li>TemplateProfilerIndexThreshold

<p>Defines the maximum amount of time in seconds that an index page build
can use without generating a warning.</p>

<li>TemplateProfilerSystemThreshold

<p>Defines the maximum amount of time in seconds that a system template
page (such as search results or comment preview page) build can use without
generating a warning.</p>

</ul>

<h3>Known Issues</h3>

<ul>

<li>The activity log meta data I am passing in is being interpreted as a
string and with encoding applied displays the HTML tags rather then passing
them on the browser to interpret. Is this another undocumented change in
MT? How are you suppose to format meta data?

<li>It's been reported that this plugin doesn't work with the PublishQueue.
This needs to be addressed, but I don't have enough information to go off
of yet.

</ul>

]]>

</content>
</entry>

<entry>
<title>mt-closure Manual</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/devtools/mt-closure" />
<id>tag:appnel.com,2007:/v5/kb//3.169</id>
<published>2007-09-26T01:47:41Z</published>
<updated>2007-11-19T21:58:29Z</updated>
<summary>mt-closure is a command-line script for closing comments and pings open for a specified period of time.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>mt-closure - A command-line script for closing comments and pings open
for a specified period of time.</p>

<h2>VERSION</h2>

<p>0.11</p>

<h2>SYNOPSIS</h2>

<pre> ./mt-closure.pl OPTIONS... [BLOG_IDS...]

 Examples:
 ./mt-closure.pl -c --hours=36 2 3 6   
    # closes comments open for 36+ hours in weblogs 2, 3 and 6.
    
 ./mt-closure.pl -cp --days=1 --all 
    # closes comments/pings open for one day+ in all weblogs.
 
 Target:
 -c, --comments      Enable comment closing.
 -p, --pings         Enable ping closing.
 
 At least one target option must be specified.
 
 Selection:
     --all           Will check every weblog in the system.
     --evaluate_on=  Specifies the type of evaluation scheme. Value
              SCHEME must be &#39;created_on&#39; or &#39;modified_on&#39;. 
                     &#39;created_on&#39; is the default.
 
 Timing:
 -h, --hours=INT     Close comments/pings that are older then X hours.
 -d, --days=INT      Close comments/pings that are older then X days. 
 
 At least one time options must be specified.
 
 
 The software is released under the Artistic License. The terms of the 
 Artistic License are described at 
 http://www.perl.com/language/misc/Artistic.html.

 Except where otherwise noted, mt-closure is copyright 2004,
 Appnel Internet Solutions Timothy Appnel, tim@appnel.com.
 All rights reserved.</pre>

<h2>INSTALLATION</h2>

<p>To install mt-closure, place the script on in the main directory where
MovableType has been installed. Read, Write and Execute permissions should
only be assigned to the owner (you) with <code>chmod mt-closure.pl
700</code>.</p>

<h2>PREREQUISITES</h2>

<p>Getopt::Long 2.33+</p>

<h2>BUGS</h2>

<p>No bugs are known, however this script was not rigorously tested and
should be treated as a beta release. Please contact the author with any
bugs.</p>

<h2>TO DO</h2>

<ul>

<li>Implement last(_comment|_ping) schemes to evalute on.</li>

<li>Better/more status messages --quiet and --verbose modes.</li>

</ul>

<h2>LICENSE</h2>

<p>The software is released under the Artistic License. The terms of the
Artistic License are described at
http://www.perl.com/language/misc/Artistic.html.</p>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Except where otherwise noted, mt-closure is copyright 2004, Appnel
Internet Solutions Timothy Appnel, tim@appnel.com. All rights reserved.</p>

]]>

</content>
</entry>

<entry>
<title>Comparing Features: Feeds.App Lite vs. Feeds.App</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/feeds-app/feedsapp-lite-vs-feedsapp" />
<id>tag:appnel.com,2007:/kb//3.571</id>
<published>2007-10-30T19:40:10Z</published>
<updated>2007-10-30T20:53:27Z</updated>
<summary>This document compares the features of Feeds.App Lite that is included in each copy of Movable Type and its commercial counter part that that takes feeds publishing in MT to a whole new level of sophistication.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<p>Feeds.App Lite is a free plugin that ships with Movable Type since
version 3.3 and enables the publishing of links and their titles using
Feeds. Feeds.App is its commercial counterpart that takes feeds publishing
in MT to a whole new level of sophistication enabling you to incorporate
any part of a feed, merge feeds and develop pluggable workflows for
integrating content.</p>

<table>

<p><table> <tr> <th width="45%">&nbsp;</th> <th width="30%">Feeds.App
Lite</th> <th width="25%">Feeds.App</th> </tr> <tr> <td colspan="3"><b>FEED
</b></td> </tr> <tr> <td>Title</td> <td> X </td> <td> X </td> </tr> <tr>
<td>Links</td> <td>primary</td> <td>any</td> </tr> <tr> <td>Subtitle</td>
<td>-</td> <td> X </td> </tr> <tr> <td>Author</td> <td>-</td> <td> X </td>
</tr> <tr> <td>Contributors</td> <td>-</td> <td> X </td> </tr> <tr>
<td>Updated Time</td> <td>-</td> <td> X </td> </tr> <tr> <td>Entries</td>
<td> X </td> <td> X </td> </tr> <tr> <td colspan="3">&nbsp;</td> </tr> <tr>
<td><b>ENTRY </b></td> </tr> <tr> <td>Title</td> <td> X </td> <td> X </td>
</tr> <tr> <td>Links</td> <td>primary</td> <td>any</td> </tr> <tr>
<td>Summary</td> <td>-</td> <td> X </td> </tr> <tr> <td>Content</td>
<td>-</td> <td> X </td> </tr> <tr> <td>Publish Time</td> <td>-</td> <td> X
</td> </tr> <tr> <td>Category/Tags</td> <td>-</td> <td> X </td> </tr> <tr>
<td>Source</td> <td>-</td> <td> X </td> </tr> <tr> <td
colspan="3">&nbsp;</td> </tr> <tr> <td>Layout Tags</td> <td> X </td> <td> X
</td> </tr> <tr> <td>Widget Wizard</td> <td> X </td> <td> X </td> </tr>
<tr> <td>Merging of Feeds</td> <td>-</td> <td> X </td> </tr> <tr> <td>Smart
Text Formatting</td> <td>-</td> <td> X </td> </tr> <tr> <td>Feed Handling
Callbacks</td> <td>-</td> <td> X </td> </tr> <tr> <td>Pluggable Caching
System</td> <td>-</td> <td> X </td> </tr> </table></p>

</table>

]]>

</content>
</entry>

<entry>
<title>Tidy for Movable Type Manual</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/mt-tidy" />
<id>tag:appnel.com,2007:/kb//3.184</id>
<published>2007-10-10T00:58:33Z</published>
<updated>2007-10-10T01:46:27Z</updated>
<summary>Tidy for Movable Type keeps your template markup formatting uniform and more readable.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<p><strong>Tidy for Movable Type keeps your template markup formatting
uniform and more readable.</strong></p>

<p>Movable Type 4 introduces the support of case insensitive tag names that
do away with nagging and generally silent publishing errors because the
wrong case was used in a tag name. Choice is good and avoiding errors is
even better; however, over time, and with multiple developers potentially
working on templates, inconsistently formatted markup is hard to read,
understand and maintain.</p>

<p>Tidy for MT adds a list action labeled "Tidy MT Markup" in the drop down
menu of each template listing page. Simply select one or more templates
from the list, choose "Tidy MT Markup" and then click Go. MT will then tidy
each selected template and save it to the database. Simple.</p>

<h3>Formatting</h3>

<p>Tidy for MT applies the following rules that was considered the best
practice formatting of MT template markup by an informal consensus on MT
developer mailing list.</p>

<ul>

<li>All tag names and arguments will be in lowercase text.

<li>Template tags will use the mt: prefix as opposed to the MT (no colon)
of previous versions. Tidy will maintain alternate namespaces prefixes such
as mtapp.

<li>Variable tags will include a $ inside of each angle bracket. Block
tags, including conditionals, will NOT. (Using $ with block tags has never
been supported.)

</ul>

<h3>Future Considerations and Hacking</h3>

<p>This plugin will eventually support the automatic tidying of a template
when saved; however, a little glitch in implementing this feature was hit
along the way. In the spirit of release early and release often this
feature was rolled back so the plugin could be released.</p>

<p>Those wishing to hack this version of the plugin can open `config.yaml`
in the `mt/plugins/tidy` directory and remove the # symbols from the start
of the callback section.</p>

<pre>    #callbacks:
    #  tmpl_tidy:
    #    callback: MT::Template::pre_save
    #    handler: MT::Plugin::Tidy::pre_save
    #    priority: 10</pre>

<p>This will enable the automatic tidying of every template when saved in
every blog. The current glitch is in providing a enable/disable settings
switch on a per blog basis using a YAML file.</p>

]]>

</content>
</entry>

<entry>
<title>Tags.App 2 Future Directions</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/tags-app/tagsapp-2-future-directions" />
<id>tag:appnel.com,2007:/kb//3.177</id>
<published>2007-10-02T14:54:37Z</published>
<updated>2007-10-02T15:11:48Z</updated>
<summary>A running list of future directions Tags.App may be pursued in the future. </summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<p>The following is a running list of future directions Tags.App that
<em>may</em> be pursued in the future. This information is strictly
informational. There is no guarantee when (if ever) these features will
appear and how they will be implemented.</p>

<ul>

<li>Support for indexing of pages and other taggable objects such as assets
using Registry for extensibility.

<li>Feed view of search results using Atom. (No paging. Fixed maximum
number. Caching? Performance?)

<li>Logging of searches in activity log like MT-Search?

<li>Clean-up default layouts

<li>More layouts -- related tags, tag navigation

<li>Color picker in settings or would wholesale switch to use of opacity
deprecate the need for color entirely?

<li>Convert class name storage in TagsMap to model name.

<li>TagSuggest should recognize unnormalized input in offering suggestions.

</ul>

]]>

</content>
</entry>

<entry>
<title>Gizmos for Movable Type</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/mt-gizmos" />
<id>tag:appnel.com,2007:/v5/kb//3.170</id>
<published>2007-09-26T17:02:33Z</published>
<updated>2007-09-27T00:03:59Z</updated>
<summary>Gizmos for Movable Type is an eclectic grouping of tiny yet helpful template tags, modifiers and text filters. This document pertains to the version 2 edition of the plugin.
</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>Gizmos for Movable Type - An eclectic grouping of tiny yet helpful
template tags, modifiers and text filters.</p>

<h2>VERSION</h2>

<p>2.0</p>

<h2>SYSTEM REQUIREMENTS</h2>

<p>The current release of Gizmos for MT requires Movable Type version 4.01
or better. Gizmos for MT will load and perform as expected using MT 4.0;
however, a bug in that version does impact the operation of the "is active"
template tags.</p>

<h2>TAGS</h2>

<h3>Entry</h3>

<ul>

<li>mt:entryauthornicknamelink**

<p>A tag that inserts and links the nickname of an entry's author rather
then the author's login name as does the c<mt:entryauthorlink> tag.</p>

<p>If the author's profile contains a web URL, the link will be to that
URL. If no URL was provided, but an email address was, the link will be a
mailto: link to that email address. If neither an email address or URL was
provided, then the nickname will not be linked.</p>

<p>Like the built-in c<mt:entryauthorlink>, you can use the c<spam_protect>
attribute to encode the author's email address to provide some protection
against spam.</p>

<li>mt:entrybodymore

<p>A tag that outputs both the entry body and more fields with one tag.
Includes an fragment marker so a permalink can be generated the will scroll
the browser down past the content of the entry's body.</p>

<li>mt:entrycategoryis (id="" or label="")

<p>A conditional tag that will render its contents if the primary category
of the entry in context matches the category defined by either the
<code>id</code> or <code>label</code> argument.</p>

<li>mt:entryifexcerpt**

<p>A conditional tag whose contents will be displayed if an entry has an
excerpt.</p>

<li>mt:entryisnew [days="" or lastn_minutes=""]

<p>A conditional tag that displays its contents if the entry in context has
been published in some recent time period defined by either a
<code>days</code> or <code>lastn_minutes</code> attribute. If neither are
present a default of 7 days is used.</p>

<p>NOTE: Being statically published this conditional will not be evaluated
until the page is built again.</p>

<li>mt:entryprimarycategorylink

<p>Outputs a permalink to the archive page for the primary category of the
entry.</p>

<li>mt:entrysmartbody**

<p>Inserts an entry's excerpt if it has one and the post's body if it
doesn't.</p>

<li>mt:entriesupdated [days="" seconds=""]

<p>A container tag that list entries by their modified_on timestamp. This
is a convience tag that can be used in place of <code>mt:entries
sort_by="modified_on" days=""</code>. This tag does support filtering by
seconds which can be used to display change of this the a day that could be
helpful for very active blogs.</p>

</ul>

<h3>Page</h3>

<ul>

<li>mt:pageauthornicknamelink

<p>Operates the same as <code>mt:entryauthornicknamelink</code> by on a
page.</p>

<li>mt:pagebodymore

<p>A tag that outputs both the page body and more fields with one tag.
Includes an fragment marker so a permalink can be generated the will scroll
the browser down past the content of the page's body.</p>

<li>mt:pageifexcerpt

<p>A conditional tag whose contents will be displayed if an page has an
excerpt.</p>

<li>mt:pageisnew [days="" or lastn_minutes=""]

<p>A conditional tag that works <code>mt:entryisnew</code>, but for
pages.</p>

<p>NOTE: Being statically published this conditional will not be evaluated
until the page is built again.</p>

<li>mt:pagesmartbody

<p>Inserts an page's excerpt if it has one and the page's body if it
doesn't.</p>

<li>mt:pagesupdated [days="" seconds=""]

<p>A container tag that list entries by their modified_on timestamp. This
is a convience tag that can be used in place of <code>mt:pages
sort_by="modified_on"</code>. This tag does support filtering by seconds
which can be used to display change of this the a day that could be helpful
for very active blogs.</p>

</ul>

<h3>Comment</h3>

<ul>

<li>mt:commentatomid

<p>Generates a Atom Syndication Format identifier similar to the built-in
<code>mt:entryatomid</code>. Handy for generating comment feeds in
Atom.</p>

<li>mt:commenterisauthor

<p>A conditional tag that displays its contents based on a comparison of
the commenter and entry/page author's email address.</p>

<li>mt:commenterisblogauthor

<p>A conditional tag that displays its contents based on a comparison of
the commenter and a list of associated author's email addresses. Permisions
are not considered in this list.</p>

<li>mt:commentidentifier

<p>Outputs an identifier made up of the comments system id prefixed with a
'c'. This is most helpful with an HTML id attribute and the
<code>mt:commentpermalink</code> tag.</p>

<li>mt:commentisnew [days="" or lastn_minutes=""]

<p>A conditional tag that works <code>mt:entryisnew</code>, but for
comments. If neither <code>days</code> or <code>lastn_minutes</code> are
present a default of 1 days is used.</p>

<p>NOTE: Being statically published this conditional will not be evaluated
until the page is built again.</p>

<li>mt:commentpermalink

<p>Outputs a permalink for the comment in context based on its parent -- an
entry or page.</p>

<p>For example on an entry with a permalink of
<code>http://example.com/cat/post.html</code> this tag would generate a
comment permalink like <code>http://example.com/cat/post.html#c40</code>
where the comment id in the system is 40.</p>

</ul>

<h3>ID</h3>

<ul>

<li>mt:blog id=""

<p>Creates a context to the identified weblog via a required
<code>id</code> argument.</p>

<li>mt:category id="" or label="" or basename=""

<p>Creates a context to the identified category. Takes an argument of
either <code>id</code> or <code>label</code>. Selecting by <em>label</em>
can only be applied to the current weblog in context. This limitation does
not apply to <em>id</em> because that value is guaranteed to be unique
across the entire system and not just one weblog.</p>

<li>mt:comment id=""

<p>Creates a context to the identified comment via a required <em>id</em>
argument.</p>

<li>mt:entry id="" or basename="" or title=""

<p>Creates a context to the identified entry. Takes an argument of either
<code>id</code>, <code>basename</code> or <code>title</code>. Selecting by
<code>basename</code> or <code>title</code> can only be applied to the
current weblog in context. This limitation does not apply to
<code>id</code> because that value is guaranteed to be unique across the
entire system and not just one weblog.</p>

<li>mt:ping id=""

<p>Creates a context to the identified ping via a required <em>id</em>
argument.</p>

</ul>

<h3>Counts</h3>

<ul>

<li>mt:countheading class_type=""

<p>Outputs the object count as a grammatically correct string by combining
the count and count label like <code>mt:countlabel</code> as one tag.</p>

<li>mt:countisone class_type=""

<p>A conditional tag that displays its contents if the count of the
class_type is zero. This tag is context sensitive and will adapt according
to its placement.</p>

<p>This tag follows the same context evaluation progression as</p>

<li>mt:countiszero class_type=""

<p>A conditional tag that displays its contents if the count of the
class_type is zero. This tag is context sensitive and will adapt according
to its placement.</p>

<p>The <code>class_type</code> is based on the identifier all MT::Objects
must define. This value is the same one used to look up a package name
using the <code>model</code> method found in the MT class.</p>

<p>In determining its context the tag will perform the following
evaluations:</p>

<ul>

<li>If the <code>class_type</code> is NOT a value of 'entry' or 'page' the
tag will return a count related to the entry.

<li>The tag will next check if it is in the context of an entries or pages
list and count the defined class_type based on that collection.

<li>As a final option, the tag will base its count on the blog in context.

</ul>

<li>mt:countlabel class_type=""

<p>Outputs an object's defined singular or pural form based on the count
that is in context.</p>

<li>mt:imagecount

<p>This variable tag will output the image count of the body and extended
body of the entry or page in context.</p>

<li>mt:wordcount

<p>This variable tag will output the word count of the body and extended
body of the entry or page in context.</p>

</ul>

<h3>Is Active</h3>

<ul>

<li>mt:archivetypeisactive type=""

<p>A conditional tag that will render its contents if the template is of an
archive type that matches the <em>type</em> argument name.</p>

<li>mt:categoryisactive

<p>A conditional tag that will render its contents if the category in
context matches either the archive category or the category of the entry in
context.</p>

<li>mt:entryisactive

<p>A conditional tag that will render its contents if the entry in context
matches the archive entry.</p>

<li>mt:folderisactive

<p>A conditional tag that will render its contents if the folder in context
matches either the archive folder or the folder of the page in context.</p>

<li>mt:indexisactive template=""

<p>A conditional tag that will render its contents if the page is an Index
template and its name matches the <em>template</em> argument.</p>

<li>mt:pageisactive

<p>A conditional tag that will render its contents if the page in context
matches the archive page.</p>

</ul>

<h3>Other</h3>

<ul>

<li>mt:alternator [key="" odd="" even=""]

<p>Alternates between odd and even values each time it appears. All
additional arguments are optional.</p>

<ul>

<li>key

<p>This optional argument allows the system to track multiple alternators
if necessary. In order to increment a specific alternator simply use the
same key. If a key is not defined the plugin uses the default
identifier.</p>

<li>odd

<p>This optional argument sets the value to return when the alternator is
on. If undefined the default is odd.</p>

<li>even

<p>This optional argument sets the value to return when the alternator is
off. If undefined the default is even.</p>

</ul>

<li>mt:archivedateheader

<p>This container tag only works within an <code>mt:archivelist</code>
tagset. If you try and use it elsewhere, you’ll receive an error.</p>

<p>If you use monthly archives, the contents of this container will only be
printed when a new year starts.</p>

<p>If you use weekly archives, the contents of this container will only be
printed when a new month starts.</p>

<p>If you use another sort of archive, the contents of this tag will always
be ignored.</p>

<li>mt:asjsinclude

<p>A container tag that encodes and wraps its contents in a JavaScript
document.write statement. This is allows you to dynamically include content
without the use of server side includes (SSI).</p>

<li>mt:autotitle [reverse="1" glue=""]

<p>Inserts a title constructed from the current context. This tag takes two
optional arguments.</p>

<ul>

<li>reverse

<p>By default the <code>mt:autotitle</code> tag orders its element from
most specific to least specific. Specifying <code>reverse</code> with a
true value (1) will reverse the order of the elements used in generating
the title from least specific to most specific. The default is false
(0).</p>

<li>glue

<p>This optional argument specifes the string to use when joining the
elements together to form the title. By default the tag uses < the less
then character.</p>

</ul>

<li>mt:block

<p>This container tag does nothing itself; however, it can be used to apply
modifiers to any arbitrary block of markup or text.</p>

<li>mt:htmlencodeblock

<p>A container tag that allows the encode_html modifier to be used on any
block of markup or text.</p>

<li>mt:link [blog_id=""]

<p>Overloads the built-in <code>mt:link</code> tag to enable linking to
templates, entries and pages in other blogs in a less verbose fashion.</p>

<p>These two examples are essentially the same:</p>

<pre>  &lt;$mt:link template=&quot;Main Index&quot; blog_id=&quot;40&quot;$&gt;

  &lt;mt:blog id=&quot;40&quot;&gt;&lt;$mt:link template=&quot;Main Index$&gt;&lt;/mt:blog&gt;</pre>

<li>mt:xmlencodeblock

<p>A container tag that allows the encode_xml modifier to be used on any
block of markup or text.</p>

</ul>

<h3>Deprecated</h3>

<ul>

<li>mt:entrycommentcountisone

<p>DEPRECATED. Use <code>mt:countisone class_type="comment"</code>
instead.</p>

<li>mt:entrycommentcountiszero

<p>DEPRECATED. Use <code>mt:countiszero class_type="comment"</code>
instead.</p>

<li>mt:entrycommentcountlabel

<p>DEPRECATED. Use <code>mt:countlabel class_type="comment"</code>
instead.</p>

<li>mt:templatecomment

<p>DEPRECATED. Use <code>mt:ignore</code> instead.</p>

</ul>

<h2>MODIFIERS</h2>

<ul>

<li>camel_case

<p>Converts text into a camel-cased word such as camelCasedWord.</p>

<li>cpaned

<p>Converts text into a CPAN style file name. Spaces and double colons are
converted to dashes. All other non-word characters are stripped.</p>

<li>encode_csv

<p>Converts text into comma seperated value (CSV) safe text.</p>

<li>dashify

<p>Like the buit-in <code>dirify</code> modifiers, but with dashes.</p>

<li>double_spaces**

<p>Converts multiple spaces to non-breaking spaces so they'll display
properly in HTML.</p>

<li>plain_xml

<p>Strips HTML then XML encodes the resulting text.</p>

<li>real_spaces

<p>Converts the underscore character to an actualy space.</p>

<li>strip_whitespaces

<p>Removes any leading or trailing whitespace.</p>

<li>trim_to_proper

<p>Trims a string to the number of characters passed in and automatically
appends "..." if the string is longer then the value provided.</p>

<li>wiki_case

<p>Converts text into a wiki-cased word such as WikiCasedWord.</p>

</ul>

<h2>TEXT FORMATTING</h2>

<ul>

<li>Preformatted Text

<p>A simple text formatting engine which wraps the entry text in HTML
&lt;pre&gt; tags and encodes any special charcters with MT's built-in
encode_html filter.</p>

</ul>

<h2>INSTALLATION</h2>

<p>To install the plugin, simply place the files in the <span
class="filename">plugins</span> directory into your <span
class="filename"><em>MovableTypeHome</em>/plugins/</span> directory. If the
<span class="filename">plugins</span> directory does not exist, you need to
create it.</p>

<h2>LICENSE</h2>

<p>The software is released under the Artistic License. The terms of the
Artistic License are described at
http://www.perl.com/language/misc/Artistic.html.</p>

<h2>AUTHOR & COPYRIGHT</h2>

<p>** - Tags and modifiers originally developed and copyright 2002 by Adam
Kalsey, The Kalsey Group.</p>

<p>Except where otherwise noted, Gizmos for MT is copyright 2002-2007, The
Appnel Group.</p>

]]>

</content>
</entry>

<entry>
<title>mt-rebuild</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/devtools/mt-rebuild" />
<id>tag:appnel.com,2007:/v5/kb//3.168</id>
<published>2007-09-26T01:40:30Z</published>
<updated>2007-09-26T22:37:31Z</updated>
<summary>Documentation for mt-rebuild, a utility script for rebuilding a Movable Type weblogs from the command-line or cron.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>mt-rebuild - A utility script for rebuilding a Movable Type weblogs from
the command-line or <span class="filename">cron</span>.</p>

<h2>VERSION</h2>

<p>0.2</p>

<h2>SYNOPSIS</h2>

<pre>        # To rebuild all weblogs in the system.
        mt-rebuild -all

        # To rebuild an entire weblog:
        mt-rebuild -mode=&quot;all&quot; -blog_id=0

        # To rebuild all archives, but not index templates:
        mt-rebuild -mode=&quot;all&quot; -blog_id=0 -no_indexes

        # To rebuild a weblog archive type:
        mt-rebuild -mode=&quot;archive&quot; -blog_id=0 -archive_type=&quot;(Individual|Daily|Weekly|Monthly|Category)&quot;

        # To rebuild a specific weblog entry:
        mt-rebuild -mode=&quot;entry&quot; -blog_id=&quot;0&quot; -entry_id=0

        # To rebuild a specific weblog index template:
        mt-rebuild -mode=&quot;index&quot; -blog_id=&quot;0&quot; -template=&quot;your template name&quot;</pre>

<h2>DESCRIPTION</h2>

<p>mt-rebuild.pl is a utility script for rebuilding a MovableType template
from the command-line as opposed to the standard MT browser interface. This
is particularly helpful when combined with <span
class="filename">cron</span> to automatically update a part of your site on
a regular basis. An example would be the updating of syndicated content
feeds using the mt-rssfeed plugin.</p>

<p>This script depreciates its more limited predecessor
mt-rebuild-index.</p>

<h2>INSTALLATION</h2>

<p>To install mt-rebuild, place the script on in the main directory where
MovableType has been installed. Read, Write and Execute permissions should
only be assigned to the owner (you) with <code>chmod mt-rebuild-index.pl
700</code>.</p>

<h2>LICENSE</h2>

<p>The software is released under the Artistic License. The terms of the
Artistic License are described at
http://www.perl.com/language/misc/Artistic.html.</p>

]]>

</content>
</entry>

<entry>
<title>MT::Log::Base</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/devtools/mt-log-base" />
<id>tag:appnel.com,2007:/kb//3.140</id>
<published>2007-01-10T05:31:41Z</published>
<updated>2007-01-10T05:37:21Z</updated>
<summary>A base class for creating application and task-specific activity log classes easier.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::Log::Base - a base class for creating application and task-specific
activity log classes easier.</p>

<h2>VERSION</h2>

<p>0.14</p>

<h2>SYNOPSIS</h2>

<pre>  # creating a subclass....

  package MT::Log::Example;
  use base &#39;MT::Log::Base&#39;;
  MT::Log::Example-&gt;install;
  sub class_label { &#39;Example&#39; }
  1;

  # to use it to log message an application...

  use MT::Log::Example;
  MT::Log::Example-&gt;warning(&#39;warning! will rogers, danger!&#39;);
  MT::Log::Example-&gt;log_error(&#39;ACK!&#39;,&#39;this is metadata&#39;);</pre>

<h2>DESCRIPTION</h2>

<p>MT::Log::Base is a base class for creating application and task-specific
activity logging classes easier. The class itself is a subclass of MT::Log
that provides additional functionality and common operations missing from
MT::Log that most logging classes will need to perform.</p>

<h2>METHODS</h2>

<p>NOTE: This section only details methods that are provided or altered by
MT::Log::Base as a subclass of MT::Log. See the MT::Log documentation for
more details.</p>

<ul>

<li>MT::Log::Base->install

<p>Calls MT::Log->add_class on itself to register itself with the system.
All subclasses should call this method when initially loaded.</p>

<li>MT::Log::Base->new([%params||\%params])

<p>A more functional constructor that handles a lot of common
initialization automatically.</p>

<ul>

<li>Dereferences parameters represented as a HASH reference to be passed
through to the MT::Log constructor

<li>Automatically sets the <code>blog_id</code>, <code>ip</code> and
<code>author_id</code> columns if possible

<li>Defaults to the log level to info if one has not been set

</ul>

<li>$log->class_label

<p>Forces any subclasses of MT::Log::Base to overload this method.</p>

<li>$log->key

<p>Returns a lowercase representation of the value returned by
<code>class_label</code>.</p>

<li>$log->metadata([$data])

<p>Gets/sets the metadata column. Automatically truncates the metadata
string if it exceeds 255 characters.</p>

<li>$log->description

<p>Returns the value of metadata as an HTML encoded string and wrapped in
<code>pre</code> tags.</p>

</ul>

<h3>Logging Methods</h3>

<p>MT::Log::Base provides a group of class methods that make the process of
creating a activity log object, setting all the necessary column values and
saving it possible in one statement.</p>

<p>Each level has its own method and take a required message string and an
optional metadata string.</p>

<p>Available methods are as follows:</p>

<ul>

<li>MT::Log::Base->log($message,[$metadata])

<p>Posts a (info) message in the activity log</p>

<li>MT::Log::Base->diag($message,[$metadata])

<p>Posts a diagnostic message in the activity log</p>

<li>MT::Log::Base->warnings($message,[$metadata])

<p>Posts a warning message in the activity log</p>

<li>MT::Log::Base->security($message,[$metadata])

<p>Posts a security message in the activity log</p>

<li>MT::Log::Base->error_log($message,[$metadata])

<p>Posts a error message in the activity log</p>

</ul>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

<entry>
<title>MT::Log::Telegraph</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/telegraph/mt-log-telegraph" />
<id>tag:appnel.com,2007:/kb//3.139</id>
<published>2007-01-09T21:06:52Z</published>
<updated>2007-01-09T21:09:01Z</updated>
<summary>An activity log class for recording Telegraph information.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::Log::Telegraph - an activity log class for recording Telegraph
information.</p>

<h2>SYNOPSIS</h2>

<pre>  use MT::Log::Telegraph;
  
  MT::Log::Telegraph-&gt;warn(&#39;warning! will rogers, danger!&#39;);
  MT::Log::Telegraph-&gt;log_error(&#39;ack!&#39;);</pre>

<h2>DESCRIPTION</h2>

<p>MT::Log::Telegraph is an activity log class for recording Telegraph
information. It is a subclass of MT::Log via MT::Log::Base.</p>

<p>The class can be used with the Movable Type Activity Log directly, but
can also be subclassed for other Telegraph related logging needs.</p>

<h2>METHODS</h2>

<p>MT::Log::Telegraph is a subclass of MT::Log via MT::Log::Base. The
following methods overload the methods found in their parent class.</p>

<ul>

<li>class_label

<p>A read-only accessor which returns 'Telegraph'.</p>

<li>metadata_object

<li>metadata_class

<p>These methods are not implemented and return null if called.</p>

<li>metadata([$res])

<p>Gets/sets the log entry metadata. To set the metadata a HTTP::Response
or URI::Fetch::Response object can be passed in. The URI and the status
code and message are recorded along with the HTTP Content-Type,
Last-Modified and ETag if available.</p>

</ul>

<h2>SEE ALSO</h2>

<p>MT::Log</p>

<p>MT::Log::Base</p>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

<entry>
<title>MT::Telegraph::CacheMgr::Object</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/telegraph/mt-telegraph-cachemgr-object" />
<id>tag:appnel.com,2007:/kb//3.138</id>
<published>2007-01-09T20:33:20Z</published>
<updated>2007-01-09T20:34:37Z</updated>
<summary>A cache manager driver used for the local storage of remote content using the Movable Type object storage system.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::Telegraph::CacheMgr::Object - a cache manager driver used for the
local storage of remote content using the Movable Type object storage
system.</p>

<h2>VERSION</h2>

<p>Telegraph 0.62</p>

<h2>SYNOPSIS</h2>

<pre>  use MT::Telegraph::CacheMgr;

  my $p = {cache_name  =&gt; &#39;example cache&#39;};

  my $cache =
    MT::Telegraph::CacheMgr-&gt;new(&#39;Object&#39;, $p)
      or die MT::Telegraph::CacheMgr-&gt;errstr;</pre>

<h2>DESCRIPTION</h2>

<p>This class is a driver used for the local storage of remote content
using the Movable Type object storage system.</p>

<h2>METHODS</h2>

<ul>

<li>MT::CacheMgr->new('Object',{cache_name => ''})

<p>This driver requires a <code>cache_name</code> parameter be passed when
a cache manager based on this driver is instantiated. The value of
<code>cache_name</code> will be used to set the <code>cache</code> column
in MT::CacheData.</p>

<p>When selecting a cache name, use a reasonably unique string to avoid
naming collisions.</p>

</ul>

<h2>SEE ALSO</h2>

<p>MT::CacheData</p>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

<entry>
<title>MT::Telegraph::CacheMgr::File</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/telegraph/mt-telegraph-cachemgr-file" />
<id>tag:appnel.com,2007:/kb//3.137</id>
<published>2007-01-09T20:10:27Z</published>
<updated>2007-01-09T20:32:44Z</updated>
<summary>A cache manager driver used for the local storage of remote content using the local file system for storage.
</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::Telegraph::CacheMgr::File - a cache manager driver used for the
local storage of remote content using the local file system for
storage.</p>

<h2>VERSION</h2>

<p>Telegraph 0.62</p>

<h2>SYNOPSIS</h2>

<pre>  use MT::Telegraph::CacheMgr;

  my $p = {cache_root =&gt; &#39;/path/to/cache/directory&#39;};

  my $cache =
    MT::Telegraph::CacheMgr-&gt;new(&#39;File&#39;, $p)
      or die MT::Telegraph::CacheMgr-&gt;errstr;</pre>

<h2>DESCRIPTION</h2>

<p>This class is a driver used for the local storage of remote content
using the local file system.</p>

<h2>METHODS</h2>

<ul>

<li>MT::CacheMgr->new('File',{ cache_root => '/path/to/cache/directory'})

<p>This driver requires a <code>cache_root</code> parameter be passed when
a cache manager based on this driver is instantiated. File-based caches are
identified by their absolute path name. The cache root must be an absolute
path on the local file system.</p>

</ul>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

<entry>
<title>MT::Telegraph::CacheMgr</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/telegraph/mt-telegraph-cachemgr" />
<id>tag:appnel.com,2007:/kb//3.136</id>
<published>2007-01-09T19:57:13Z</published>
<updated>2007-01-09T20:21:18Z</updated>
<summary>Telegraph framework manager for handling the local storage of data retrieved by agents.</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::Telegraph::CacheMgr - Telegraph framework manager for handling the
local storage of data retrieved by agents.</p>

<h2>VERSION</h2>

<p>Telegraph 0.62</p>

<h2>SYNOPSIS</h2>

<pre>  use MT::Telegraph::CacheMgr;

  my $p = {cache_root =&gt; &#39;/path/to/cache/directory&#39;};

  my $cache =
    MT::Telegraph::CacheMgr-&gt;new(&#39;File&#39;, $p)
      or die MT::Telegraph::CacheMgr-&gt;errstr;</pre>

<h2>DESCRIPTION</h2>

<p>MT::Telegraph::CacheMgr is the telegraph framework manager for handling
the local storage of data retrieved by agents. Caching is used in Telegraph
to reduce bandwidth usage and speed processing of remote content.</p>

<p>The Telegraph Cache Manager uses derived classes that store cached data
in different manners such as files on a filesystem, or in the Movable Type
object store.</p>

<h2>USAGE</h2>

<p>The MT::CacheMgr interface is implemented by subclasses that store
cached data in different manners (such as as files on a filesystem, or in
memory).</p>

<p>MT::CacheMgr is used to instantiate a cache interface and as a base
class for all cache manager drivers. This is a similar pattern to the one
used by MT::FileMgr, Movable Type's built-in file management system.</p>

<p>The cache management functions and interface is a simplified version of
the the Cache package found in CPAN.</p>

<h2>METHODS</h2>

<ul>

<li>MT::CacheMgr->new($type,[\%param])

<p>Constructor for all cache manager types.</p>

<p>Takes a required driver type and parameters HASH reference and return a
cache manager object. The driver class that will be loaded, instantiated
and returned is the type parameter with 'MT::Telegraph::CacheMgr::'
prepended. For instance, calling <code>new</code> with a type of 'File'
will instantiate a MT::Telegraph::CacheMgr::File object.</p>

<p>While the cache manager base class does not require parameters per se, a
cache driver may chose to do so. See the specific cache driver
documentation for more details.</p>

<p>NOTE: Subclasses should not overload this method, but use the
<code>init</code> method instead.</p>

<li>$cache->init([\%param])

<p>This method contains any logic necessary to initialize a cache manager
driver. The method in MT::CacheMgr does nothing, but return the cache
object. Subclasses will typically overload this method to the logic
specific to its purpose.</p>

<p>The <code>new</code> method calls this method after loading the driver
class and instantiates an object. The parameters HASH reference given to
<code>new</code> is passed through. The <code>init</code> method is
expected to return the cache object if successful or <code>undef</code> in
coordination with the <code>error</code> method instead.</p>

<li>$cache->default_expires

<p>The current default expiration time in seconds since the epoch and the
expiry defined by <code>set_default_expires</code>.</p>

<li>$cache->set_default_expires($expiry)

<p>Set the expiry time for all data in the cache based on the required
expiry string parameter. The expiry string can be expressed in seconds
since the epoch, or alternatively using a string like '10 minutes'. Valid
units are s, second, seconds, sec, m, minute, minutes, min, h, hour, hours,
w, week, weeks, M, month, months, y, year and years. You can also specify
an absolute time, such as '16 Nov 94 22:28:20' or any other time that
Date::Parse can understand. Finally, the strings 'now' and 'never' may also
be used.</p>

<li>$cache->purge

<p>Remove all expired data from the cache.</p>

<li>$cache->clear

<p>Remove all entries from the cache regardless of their expiry time.</p>

<li>$cache->exists($key)

<p>Returns a boolean value to indicate whether there is any data present in
the cache with the given key. Takes a required key parameter that
identifies the specific data to check.</p>

<li>$cache->set($key,$data)

<p>Stores data into the cache with a specific key identifier. Takes a
required key identifier and a required SCALAR (or SCALAR reference)
containing the data to be cache. Serialization will be handled
transparently by the specific cache driver in use.</p>

<p>NOTE: If a key is already in use, the existing data will simply be
overwritten. To avoid this always check a key with the <code>exists</code>
method.</p>

<li>$cache->get($key)

<p>Returns the data from the cache, or <code>undef</code> if nothing
exists. Takes a required key parameter that identifies the specific data to
retrieve.</p>

<li>$cache->remove($key)

<p>Clear the data for this key from the cache.</p>

<p>Takes a required key parameter that identifies the specific data to
retrieve.</p>

<li>error

<p>Inherited from <code>MT::ErrorHandler</code>, sets an error message and
return <code>undef</code>.</p>

<li>errstr

<p>Inherited from <code>MT::ErrorHandler</code>, returns the last error
message for the class/object.</p>

</ul>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

<entry>
<title>MT::CacheData</title>
<link rel="alternate" type="text/html" href="http://appnel.com/kb/telegraph/mt-cachedata" />
<id>tag:appnel.com,2007:/kb//3.135</id>
<published>2007-01-09T16:46:42Z</published>
<updated>2007-01-09T20:20:28Z</updated>
<summary>A MT::Object subclass used by MT::Telegraph::CacheMgr::Object to cache HTTP responses.
</summary>
<author>
<name>Timothy Appnel</name>
<uri>http://appnel.com/</uri>
</author>

<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />
<category term="" label="" scheme="http://www.sixapart.com/ns/types#tag" />

<content type="html" xml:lang="en" xml:base="http://appnel.com/kb/">
<![CDATA[<h2>NAME</h2>

<p>MT::CacheData - A MT::Object subclass used by
MT::Telegraph::CacheMgr::Object to cache HTTP responses.</p>

<h2>VERSION</h2>

<p>Telegraph 0.62</p>

<h2>DESCRIPTION</h2>

<p>A MT::Object subclass used by MT::Telegraph::CacheMgr::Object to cache
HTTP responses.</p>

<p>MT::CacheData is a part of the Telegraph framework.</p>

<h2>USAGE</h2>

<p><em>MT::CacheData</em> is a subclass of <em>MT::Object</em> that
inherits all of the data-management and storage methods. See the
<em>MT::Object</em> documentation for details working with objects in
Movable Type.</p>

<h2>METHODS</h2>

<ul>

<li>id

<p>An system assigned integer and identifier of the record in the
database.</p>

<li>blog_id

<p>An optional identifier associating the cached data with a specific
weblog in the system.</p>

<li>cache

<p>A required name of the cache the data is associated with. This is
typically set and managed by MT::CacheMgr.</p>

<li>key

<p>A required unique string identifier such as a URI for the cached data.
The key value scheme and assignment is determined by the cache and its
implementation.</p>

<li>http_tag

<p>The HTTP ETag of the cache data if any.</p>

<li>http_last_modified

<p>The HTTP Last-Modified time stamp (if any) represented as a string in
RFC822 format.</p>

<li>data

<p>The cached data. This method takes a reference to a Perl data structure
and transparently handles serialization and deserialization.</p>

</ul>

<h2>AUTHOR & COPYRIGHT</h2>

<p>Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All
Rights Reserved. This code cannot be redistributed without permission of
the author.</p>

]]>

</content>
</entry>

</feed>
