<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> <title> WebMake: Documentation: HTML::WebMake::Content </title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="generator" content="WebMake/2.3" /> <style type="text/css"> body { background-color: #ffffff; color: #000000; line-height: 110%; margin-left: 10px; margin-right: 10px; } p, table, td, th { font-family: verdana,lucida,helvetica,sans-serif; font-size: 11px; line-height: 110%; } pre { margin-left: 3%; white-space: pre; } code, samp, pre, p pre { font-family: "lucida console", "Courier New", courier, "fixed-width", monospace; font-weight: bold; } H1 { font-size: 150%; font-family: Garamond, "Book Antiqua",Times,serif; background: #FFCC66; text-align: center; padding: 0.5em 1em 0.5em 1em; border-width: 1px; border-color: black; border-style: solid; line-height: 120%; } H2 { font-size: 125%; font-family: Garamond, "Book Antiqua",Times,serif; background: #FFDD77; text-align: center; padding: 0.5em 1em 0.5em 1em; border-width: 1px; border-color: black; border-style: solid; line-height: 100%; } H3 { font-size: 100%; font-family: Garamond, "Book Antiqua",Times,serif; background: #FFEE88; text-align: center; padding: 0.5em 1em 0.5em 1em; border-width: 1px; border-color: black; border-style: solid; } H4 { font-size: 75%; font-family: Garamond, "Book Antiqua",Times,serif; } H5 { font-size: 50%; font-family: Garamond, "Book Antiqua",Times,serif; } H6 { font-size: 25%; font-family: Garamond, "Book Antiqua",Times,serif; } A:link { font-weight: bold; color: #004000; text-decoration: underline; } A:visited { font-weight: bold; color: #008000; text-decoration: underline; } A:active { font-weight: bold; color: #800000; text-decoration: underline; } dt { font-size: medium; font-weight: bold; padding-top: 8px; padding-bottom: 8px; } dd { padding-top: 8px; padding-bottom: 8px; } </style> </head> <body bgcolor="#ffffff" text="#000000" link="#3300cc" vlink="#660066"> <!-- font tag for compat with non-CSS browsers --> <font face="lucida,verdana,sans-serif"> <div align="center"> <img src="images/WebMakeTitle.png" alt="WebMake" width="500" height="122" /> </div> <table width="100%"> <tr> <td valign="top"> <strong><a href="http://webmake.taint.org/">WebMake</a> Documentation</strong> (version 2.3) </td> <td valign="top"> <div align="right"> [ <a href="index_08-pod.html">Back</a> | <a href="Main.pm.html">Forward</a> | <a href="index.html">Index</a> | <a href="allinone.html">All In One</a> ] </div> </td> </tr> </table> <!-- yes, it's that Mozilla black-border code again ;) --> <!-- stolen from www.mozilla.org via rc3.org --> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td bgcolor="#aaaaaa"> <table border="0" cellspacing="4" cellpadding="4" width="100%"> <tr> <td bgcolor="#ffffff"> <table border="0" cellspacing="4" cellpadding="4" width="100%"> <tr> <td> <h1>HTML::WebMake::Content</h1><a name="__index__"></a><!-- INDEX BEGIN --> <ul> <li> <a href="#name">NAME</a> </li> <li> <a href="#synopsis">SYNOPSIS</a> </li> <li> <a href="#description">DESCRIPTION</a> </li> <li> <a href="#methods">METHODS</a> </li> </ul> <!-- INDEX END --> <hr /> <h1><a name="name">NAME</a></h1><p> Content - a content item. </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1><pre> <{perl</pre><pre> $cont = get_content_object ("foo.txt"); [... etc.]</pre><pre> }></pre><hr /> <h1><a name="description">DESCRIPTION</a></h1><p> This object allows manipulation of WebMake content items directly. </p> <hr /> <h1><a name="methods">METHODS</a></h1><dl> <dt> <strong><a name="item_get_name">$text = $cont->get_name();</a></strong><br /> </dt> <dd> Return the content item's name. </dd> <dt> <strong><a name="item_as_string">$text = $cont->as_string();</a></strong><br /> </dt> <dd> A textual description of the object for debugging purposes; currently it's name. </dd> <dt> <strong><a name="item_get_filename">$fname = $cont->get_filename();</a></strong><br /> </dt> <dd> Get the filename or datasource location that this content was loaded from. Datasource locations look like this: <code>proto</code>:<code>protocol-specific-location-data</code>, e.g. <code>file:blah/foo.txt</code> or <code>http://webmake.taint.org/index.html</code>. </dd> <dt> <strong><a name="item_get_deps">@filenames = $cont->get_deps();</a></strong><br /> </dt> <dd> Return an array of filenames and locations that this content depends on, i.e. the filenames or locations that it contains variable references to. </dd> <dt> <strong><a name="item_is_generated_content">$flag = $cont->is_generated_content();</a></strong><br /> </dt> <dd> Whether or not a content item was generated from Perl code, or is metadata. Generated content items cannot themselves hold metadata. </dd> <dt> <strong><a name="item_expand">$val = $cont-><code>expand()</code></a></strong><br /> </dt> <dd> Expand a content item, as if in a curly-bracket content reference. If the content item has not been expanded before, the current output file will be noted as the content item's ''main'' URL. </dd> <dt> <strong><a name="item_expand_no_ref">$val = $cont-><code>expand_no_ref()</code></a></strong><br /> </dt> <dd> Expand a content item, as if in a curly-bracket content reference. The current output file will not be used as the content item's ''main'' URL. </dd> <dt> <strong><a name="item_get_metadata">$val = $cont->get_metadata($metaname);</a></strong><br /> </dt> <dd> Get an item of this object's metadata, e.g. <pre> $score = $cont->get_metadata("score");</pre><p> The metadatum is converted to its native type, e.g. <code>score</code> is return as an integer, <code>title</code> as a string, etc. If the metadatum is not provided, the default value for that item, defined in HTML::WebMake::Metadata, is used. </p> <p> Note that this method should only be called from a deferred reference, as metadata often isn't available until all the normal content references in the current page have been expanded. </p> </dd> <dt> <strong><a name="item_get_score">$score = $cont->get_score();</a></strong><br /> </dt> <dd> Return a content item's score. </dd> <dt> <strong><a name="item_get_title">$title = $cont->get_title();</a></strong><br /> </dt> <dd> Return a content item's title. </dd> <dt> <strong><a name="item_get_modtime">$modtime = $cont->get_modtime();</a></strong><br /> </dt> <dd> Return a content item's modification date, in UNIX time_t format, ie. seconds since Jan 1 1970. </dd> <dt> <strong><a name="item_get_edit_href">$url = $cont->get_edit_href();</a></strong><br /> </dt> <dd> Return the URL used to edit a content item, using the WebMake CGI edit script. </dd> <dt> <strong><a name="item_get_declared">$order = $cont->get_declared();</a></strong><br /> </dt> <dd> Returns the content item's declaration order. This is a number representing when the content item was first encountered in the WebMake file; earlier content items have a lower declaration order. Useful for sorting. </dd> <dt> <strong><a name="item_get_kids">@kidobjs = $cont->get_kids ($sortstring);</a></strong><br /> </dt> <dd> Get the child content items for this item. The ''child'' content items are items that use this content as their <code>up</code> metadatum. <p> Returns a list of content objects in unsorted order. </p> </dd> <dt> <strong><a name="item_get_sorted_kids">@kidobjs = $cont->get_sorted_kids ($sortstring);</a></strong><br /> </dt> <dd> Get the child content items for this item. The ''child'' content items are items that use this content as their <code>up</code> metadatum. <p> Returns a list of content objects sorted by the provided sort string. </p> </dd> <dt> <strong><a name="item_get_url">$text = $cont->get_url();</a></strong><br /> </dt> <dd> Get a content item's URL. The URL is defined as the first page listed in the WebMake file's out tags which refers to that item of content. <p> Note that, in some cases, the content item may not have been referred to yet by the time it's <a href="#item_get_url"><code>get_url()</code></a> method is called. In this case, WebMake will insert a symbolic tag, hold the file in memory, and defer writing the file in question until all other output files have been processed and the URL has been found. </p> </dd> </dl> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <table width="100%"> <tr> <td valign="top"> <strong><a href="http://webmake.taint.org/">WebMake</a> Documentation</strong> (version 2.3) </td> <td valign="top"> <div align="right"> [ <a href="index_08-pod.html">Back</a> | <a href="Main.pm.html">Forward</a> | <a href="index.html">Index</a> | <a href="allinone.html">All In One</a> ] </div> </td> </tr> </table> <div align="right"> <a href="http://webmake.taint.org/"> <img src="images/BuiltWithWebMake.png" alt="Built With WebMake" border="0" width="88" height="31" /></a> </div> </font> </body> </html>