Author: ilmari Date: 2007-06-10 16:31:06 +0100 (Sun, 10 Jun 2007) New Revision: 1059
Modified: trunk/Changes trunk/lib/OpenGuides/RDF.pm trunk/t/21_rdf.t trunk/templates/node_rdf.tt Log: Include os:map_link in node RDF (fixes #26)
Modified: trunk/Changes =================================================================== --- trunk/Changes 2007-06-10 15:29:55 UTC (rev 1058) +++ trunk/Changes 2007-06-10 15:31:06 UTC (rev 1059) @@ -16,6 +16,7 @@ Respect redirect=0 (#104). If an unknown action is supplied to wiki.cgi, redirect to action=display (partial fix for #102) + Include os:map_link in node RDF (fixes #26).
0.60 13 May 2007 Removed footer search from edit page (shouldn't have been there).
Modified: trunk/lib/OpenGuides/RDF.pm =================================================================== --- trunk/lib/OpenGuides/RDF.pm 2007-06-10 15:29:55 UTC (rev 1058) +++ trunk/lib/OpenGuides/RDF.pm 2007-06-10 15:31:06 UTC (rev 1059) @@ -81,7 +81,7 @@
foreach my $var ( qw( phone fax website opening_hours_text address postcode city country latitude longitude username - os_x os_y summary ) ) { + os_x os_y summary map_link ) ) { my $val = $metadata{$var}[0] || $defaults{$var} || ""; $tt_vars{$var} = $val; } @@ -103,7 +103,7 @@ # Check for geospatialness and define container object as appropriate. my $is_geospatial; foreach my $var ( qw( os_x os_y latitude longitude address postcode - opening_hours_text ) ) { + opening_hours_text map_link ) ) { $is_geospatial = 1 if $tt_vars{$var}; }
Modified: trunk/t/21_rdf.t =================================================================== --- trunk/t/21_rdf.t 2007-06-10 15:29:55 UTC (rev 1058) +++ trunk/t/21_rdf.t 2007-06-10 15:31:06 UTC (rev 1059) @@ -15,7 +15,7 @@ plan skip_all => "DBD::SQLite could not be used - no database to test with. ($error)"; }
-plan tests => 27; +plan tests => 28;
Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); my $config = OpenGuides::Test->make_basic_config; @@ -56,6 +56,7 @@ opening_hours_text => "test hours", latitude => "51.524193", longitude => "-0.114436", + map_link => "http://pubsite.com/calthorpe/get_there.htm", summary => "a nice pub", } ); @@ -81,6 +82,10 @@ qr|dc:titleWiki::Toolkit Test Site: Calthorpe Arms</dc:title>|, "sets the title correctly" );
+like( $rdfxml, + qr|<os:map_link rdf:resource="http://pubsite.com/calthorpe/get_there.htm" />|, + "includes map link" ); + like( $rdfxml, qr|<foaf:Person rdf:ID="Kake">|, "last username to edit used as contributor" );
Modified: trunk/templates/node_rdf.tt =================================================================== --- trunk/templates/node_rdf.tt 2007-06-10 15:29:55 UTC (rev 1058) +++ trunk/templates/node_rdf.tt 2007-06-10 15:31:06 UTC (rev 1059) @@ -77,6 +77,10 @@ os:y[% os_y %]</os:y> [% END %]
+ [% IF map_link %] + <os:map_link rdf:resource="[% map_link %]" /> + [% END %] + [% END %]
[% IF phone OR fax OR website OR opening_hours_text %]