[Fusionforge-commits] r9334 - in trunk: . gforge/www/include gforge/www/softwaremap gforge/www/tracker

Olivier Berger olberger at libremir.placard.fr.eu.org
Fri Apr 2 18:25:23 CEST 2010


Author: olberger
Date: 2010-04-02 18:25:23 +0200 (Fri, 02 Apr 2010)
New Revision: 9334

Modified:
   trunk/
   trunk/gforge/www/include/project_home.php
   trunk/gforge/www/softwaremap/full_list.php
   trunk/gforge/www/tracker/browse.php
Log:
Embedd RDFa description of the tracker as a sioc:Container
Embedding some RDFa about the project as doap:Project and sioc:Space
Use util_make_link_g for project's page link



Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:8721-8727
/branches/Branch_5_0:8892,8895,8897-8898,8900,8903-8904,8906-8907,8910,8915,8922,8924,8926,8929,8931-8933,8941,8946,8951,8955,8972-8977,8981,8997,8999,9002,9031-9032,9050,9080-9081,9084-9086,9093-9095,9102-9104,9108,9113-9115,9117-9118,9123,9125,9127-9131,9135-9136,9139,9146,9148-9150,9179-9189,9190-9191,9193-9195,9198,9200,9202,9204,9207,9209,9211,9213,9215,9220-9222,9231,9234-9235,9243,9251,9254
/branches/Branch_4_8:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8428,8429-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8662,8674,8751,8754,8756,8760-8761,8812,8850,8945,8995,8998,9004-9006,9124,9137,9141
/branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838

   + /trunk:8721-8727
/branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8428,8429-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8662,8674,8751,8754,8756,8760-8761,8812,8850,8945,8995,8998,9004-9006,9124,9137,9141
/branches/Branch_5_0:8892,8895,8897-8898,8900,8903-8904,8906-8907,8910,8915,8922,8924,8926,8929,8931-8933,8941,8946,8951,8955,8972-8977,8981,8997,8999,9002,9031-9032,9050,9080-9081,9084-9086,9093-9095,9102-9104,9108,9113-9115,9117-9118,9123,9125,9127-9131,9135-9136,9139,9146,9148-9150,9179-9189,9190-9191,9193-9195,9198,9200,9202,9204,9207,9209,9211,9213,9215,9220-9222,9231,9234-9235,9243,9251,9254


Modified: trunk/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge/www/include/project_home.php	2010-04-02 16:19:19 UTC (rev 9333)
+++ trunk/gforge/www/include/project_home.php	2010-04-02 16:25:23 UTC (rev 9334)
@@ -22,12 +22,16 @@
 // ########################################### end top area
 
 // two column deal
+// Embedd some RDFa to describe the project using DOAP and SIOC
 echo '
 <div id="forge-project-home" class="underline-link">
+
+<div about="" typeof="sioc:Space doap:Project" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:doap="http://usefulinc.com/ns/doap#" />
+
 <table id="project-summary-and-devs" class="my-layout-table" summary="">
 	<tr>
 		<td>
-			<h2>'.$project->getPublicName().'</h2>
+			<h2><span property="doap:shortdesc">'.$project->getPublicName().'</span></h2>
 			<h3>'._('Project summary').'</h3>';
 
 
@@ -50,8 +54,16 @@
 $hook_params['group_id'] = $group_id ;
 plugin_hook ("project_before_description",$hook_params) ;
 
-if ($project->getDescription()) {
-	print "<p>" . nl2br($project->getDescription()) . '</p>';
+// insert an empty <span /> which seems to be better if not compacted
+print '<span property="doap:name" content="'. $project->getUnixName() .'"></span>'."\n";
+
+$project_description = $project->getDescription();
+if ($project_description) {
+	// need to use a litteral version for content attribute since nl2br is for HTML
+	print "<p>"
+		.'<span property="doap:description" content="'. preg_quote($project_description,'"') .'">'
+		. nl2br($project_description) 
+		.'</span></p>';
 } else {
 	print "<p>" . _('This project has not yet submitted a description.') . '</p>';
 }
@@ -82,7 +94,11 @@
 }
 
 // registration date
-print(_('Registered:&nbsp;') . date(_('Y-m-d H:i'), $project->getStartDate()));
+$project_start_date = $project->getStartDate();
+print(_('Registered:&nbsp;') . 
+	'<span property="doap:created" content="'.date('Y-m-d', $project_start_date).'">'.
+	date(_('Y-m-d H:i'), $project_start_date).
+	'</span>');
 
 // Get the activity percentile
 // CB hide stats if desired
@@ -123,6 +139,8 @@
 			}
 	}
 }
+
+
 $hook_params = array () ;
 $hook_params['group_id'] = $group_id ;
 plugin_hook ("project_after_description",$hook_params) ;
@@ -145,7 +163,24 @@
 			$started_developers=true;
 			echo '<span class="develtitle">'. _('Developers').':</span><br />';
 		}
-		echo util_make_link_u ($row_admin['user_name'],$row_admin['user_id'],$row_admin['realname']).'<br />';
+		if (!$started_developers) {
+			echo '<div rel="doap:maintainer">'."\n";
+		} else {
+			echo '<div rel="doap:developer">'."\n";
+		}
+		# a foaf:Person that holds an account on the forge
+		$developer_url = util_make_url_u ($row_admin['user_name'],$row_admin['user_id']);
+		echo '<div typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/" about="'.
+			$developer_url.'#me' .'" >'."\n";
+		echo '<div rel="foaf:holdsAccount">'."\n";
+		echo '<div typeof="sioc:UserAccount" about="'.
+        	$developer_url.
+        	'" xmlns:sioc="http://rdfs.org/sioc/ns#">'."\n";
+		echo util_make_link_u ($row_admin['user_name'],$row_admin['user_id'],$row_admin['realname']) ."<br />\n";
+		echo "</div>\n"; // /sioc:UserAccount
+		echo "</div>\n"; // /foaf:holdsAccount
+		echo "</div>\n"; // /foaf:Person
+		echo "</div>\n"; // /doap:maintainer|developer
 		if ($row_admin['user_id'] == user_getid())
 			$iam_member = true ;
 	}
@@ -300,7 +335,7 @@
 
 // ################# Homepage Link
 
-echo '<div class="public-area-box">';
+echo '<div class="public-area-box" rel="doap:homepage">';
 echo util_make_link ('http://' . $project->getHomePage(), $HTML->getHomePic(_('Home Page')) . '&nbsp;' . _('Project Home Page'), false, true);
 echo '</div>
     ';
@@ -325,12 +360,20 @@
 	if (!$result || $rows < 1) {
 		echo '<br /><em>'._('There are no public trackers available').'</em>';
 	} else {
-		echo '<ul class="tracker">';
+		echo '<ul class="tracker" rel="doap:bug-database">';
 		for ($j = 0; $j < $rows; $j++) {
-			echo '<li>';
-			echo util_make_link ('/tracker/?atid='. db_result($result, $j, 'group_artifact_id')  . '&amp;group_id='.$group_id.'&amp;func=browse',db_result($result, $j, 'name')) . ' ' ;
-			printf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int) db_result($result, $j, 'open_count')), (int) db_result($result, $j, 'open_count'), (int) db_result($result, $j, 'count'));
-			echo '<br />'.db_result($result, $j, 'description').'</li>';
+			// tracker REST paths are something like : /tracker/cm/project/A_PROJECT/atid/NUMBER to plan compatibility
+			// with OSLC-CM server API
+			$group_artifact_id = db_result($result, $j, 'group_artifact_id');
+			$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $project->getUnixName() .'/atid/'. $group_artifact_id);
+			echo '<li about="'. $tracker_stdzd_uri . '" typeof="sioc:Container" xmlns:sioc="http://rdfs.org/sioc/ns#">'."\n";
+            print '<span rel="http://www.w3.org/2002/07/owl#sameAs">'."\n";
+			echo util_make_link ('/tracker/?atid='. $group_artifact_id . '&amp;group_id='.$group_id.'&amp;func=browse',db_result($result, $j, 'name')) . ' ' ;
+			echo "</span>\n"; // /owl:sameAs
+ 			printf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int) db_result($result, $j, 'open_count')), (int) db_result($result, $j, 'open_count'), (int) db_result($result, $j, 'count'));
+			echo '<br />'.db_result($result, $j, 'description');
+			print '<span rel="sioc:has_space" resource="" />'."\n";
+			echo "</li>\n";
 		}
 		echo '</ul>';
 	}
@@ -462,6 +505,7 @@
 echo '</td>
     </tr>
     </table>
+    </div><!-- about="" -->
     </div><!-- id="forge-project-home" -->
     ';
 

Modified: trunk/gforge/www/softwaremap/full_list.php
===================================================================
--- trunk/gforge/www/softwaremap/full_list.php	2010-04-02 16:19:19 UTC (rev 9333)
+++ trunk/gforge/www/softwaremap/full_list.php	2010-04-02 16:25:23 UTC (rev 9334)
@@ -131,13 +131,24 @@
 	}	
 
 	if ($row_grp && $viewthisrow) {
+		
+		// Embed RDFa description for /projects/PROJ_NAME 
+		$proj_uri = util_make_url_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id']);
+		print '<div typeof="doap:Project" about="'.$proj_uri.'" xmlns:doap="http://usefulinc.com/ns/doap#">'."\n";
+		
 		print '<table border="0" cellpadding="0" width="100%">';
 		print '<tr valign="top"><td colspan="2">';
-		print "<a href=\"/projects/". strtolower($row_grp['unix_group_name']) ."/\"><strong>"
-			.$row_grp['group_name']."</strong></a> ";
+		print util_make_link_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id'],'<strong>'
+			.'<span property="doap:name">'
+			.$row_grp['group_name']
+			.'</span>'
+			.'</strong>').' ';
 
 		if ($row_grp['short_description']) {
-			print "- " . $row_grp['short_description'];
+			print "- "
+			. '<span property="doap:short_desc">' 
+			. $row_grp['short_description']
+			. '</span>';
 		}
 
 		// extra description
@@ -153,9 +164,10 @@
                               .'<a href="/people/?group_id='.$row_grp['group_id'].'">[This project needs help]</a></td></td>';
                 }
 */
-                print '</table>';
+        print '</table>';
+        print '</div>'; // /doap:Project
 		print '<hr />';
-	} // end if for row and range chacking
+	} // end if for row and range chacking   
 }
 
 // print bottom navigation if there are more projects to display

Modified: trunk/gforge/www/tracker/browse.php
===================================================================
--- trunk/gforge/www/tracker/browse.php	2010-04-02 16:19:19 UTC (rev 9333)
+++ trunk/gforge/www/tracker/browse.php	2010-04-02 16:25:23 UTC (rev 9334)
@@ -232,6 +232,19 @@
 	$status_box = $ath->statusBox('_status',$_status,true,_('Any'));
 }
 echo '<script type="text/javascript" src="/tabber/tabber.js"></script>'."\n";
+
+// start of RDFa
+$proj_name = $group->getUnixName();
+$proj_url = util_make_url_g($group->getUnixName(),$group_id);
+// the tracker's URIs are constructed in order to support addition of an OSLC-CM REST server
+// inside /tracker/cm/. There each tracker has a URL in the form .../project/PROJ_NAME/atid/ATID
+$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $proj_name .'/atid/'. $ath->getID());
+print '<div about="'. $tracker_stdzd_uri
+	.'" typeof="sioc:Container" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:doap="http://usefulinc.com/ns/doap#">'."\n";
+print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource="" />'."\n";
+print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" />'."\n";
+print "</div>\n"; // end of about
+
 echo '
 <div id="tabber" class="tabber">
 	<div class="tabbertab" title="'._('Advanced queries').'">';




More information about the Fusionforge-commits mailing list