Author: nick Date: 2008-10-18 15:51:09 +0100 (Sat, 18 Oct 2008) New Revision: 1228
Added: trunk/templates/metadata.tt Modified: trunk/Changes trunk/lib/OpenGuides.pm trunk/templates/node.tt Log: Finish off the metadata discovery things
Modified: trunk/Changes =================================================================== --- trunk/Changes 2008-10-18 14:37:04 UTC (rev 1227) +++ trunk/Changes 2008-10-18 14:51:09 UTC (rev 1228) @@ -6,6 +6,8 @@ 0.64 Correctly specify all build_requires (#245) Fix some broken POD (#246) + Metadata discovery features (action=metadata) + JSON support for node details and metatdata discovery
0.63 16 August 2008 Major overhaul of RDF output.
Modified: trunk/lib/OpenGuides.pm =================================================================== --- trunk/lib/OpenGuides.pm 2008-10-18 14:37:04 UTC (rev 1227) +++ trunk/lib/OpenGuides.pm 2008-10-18 14:51:09 UTC (rev 1228) @@ -1023,15 +1023,18 @@
my @values; my $type; - if($args{"type"}) { + my $may_descend = 0; + if($args{"type"} && $args{"type"} ne "metadata_type") { $type = $args{"type"}; @values = $wiki->store->list_metadata_by_type($args{"type"}); } else { + $may_descend = 1; $type = "metadata_type"; @values = $wiki->store->list_metadata_names; }
my %tt_vars = ( type => $type, + may_descend => $may_descend, metadata => @values, num_results => scalar @values, not_deletable => 1,
Added: trunk/templates/metadata.tt =================================================================== --- trunk/templates/metadata.tt (rev 0) +++ trunk/templates/metadata.tt 2008-10-18 14:51:09 UTC (rev 1228) @@ -0,0 +1,24 @@ +[% INCLUDE header.tt + page_title = "Metadata of type $type - $site_name" + feed_base = "$cgi_url?action=metadata;type=$type" +%] +[% INCLUDE banner.tt %] +<div id="content"> +[% INCLUDE navbar.tt %] +<div id="maincontent"> +<h2>Metadata Listing - Things of type [% type %]</h2> +<ol> + [% FOREACH md = metadata %] + <li> + [% IF may_descend %]<a href="[% cgi_url %]?action=metadata;type=[% md %]">[% END %][% md %][% IF may_descend %]</a>[% END %] + </li> + [% END %] +</ol> +</div> + +<p> + This list is available as + <a href="[% cgi_url %]?action=metadata;type=[% type %];format=json">json</a>. +</p> + +[% INCLUDE footer.tt %]
Modified: trunk/templates/node.tt =================================================================== --- trunk/templates/node.tt 2008-10-18 14:37:04 UTC (rev 1227) +++ trunk/templates/node.tt 2008-10-18 14:51:09 UTC (rev 1228) @@ -123,6 +123,8 @@ <div id="rdf_link"> <a href="[% cgi_url %]?id=[% node_param %];format=rdf">RDF/XML for this node</a> + <a href="[% cgi_url %]?id=[% node_param %];format=json">JSON for this + node</a> [% IF rss_locale_url %] / <a href="[% rss_locale_url %]">RSS feed for this locale</a> [% END %]
openguides-commits@lists.openguides.org