[Fusionforge-commits] FusionForge branch 5.2-admssw updated. 656c74a863a7189a826cfb911e2d74c930ab34d6

Olivier Berger olberger at fusionforge.org
Tue Aug 27 16:13:37 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 5.2-admssw has been updated
       via  656c74a863a7189a826cfb911e2d74c930ab34d6 (commit)
       via  fdb33a90b1cbbfe44446610dda13cb51a4f88f4e (commit)
       via  fccfe5794e292033f2fb0af3e4af8499cd5d89b4 (commit)
       via  505a4fa9e35f9ee1ae2db210351ab762eda59478 (commit)
       via  cda025beb66461bc34125bcd6a31b789143a34e1 (commit)
       via  e15211ad047833f61699ded107222ed8dde87b77 (commit)
       via  921c99f3c35a975b302f3edf367c1088bab785a2 (commit)
       via  b712540cedcd5a5c385de7b2a5388864c0ee59ff (commit)
       via  4c687075239d46d41266e58e700eb1a1a7bfec2a (commit)
      from  db3bc8eadc836192c6a0af6d43eab17dd16d39dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 656c74a863a7189a826cfb911e2d74c930ab34d6
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 18:11:49 2013 +0200

    Don't rely on www/include/trove.php : global vars problems : paging limit set to 50
    
    Fix the integer division, using ceil for last page if remainder

diff --git a/src/plugins/admssw/common/admssw-init.php b/src/plugins/admssw/common/admssw-init.php
index 70df99e..7ba7e51 100644
--- a/src/plugins/admssw/common/admssw-init.php
+++ b/src/plugins/admssw/common/admssw-init.php
@@ -19,12 +19,9 @@
 
 global $gfplugins;
 require_once $gfplugins.'admssw/include/admsswPlugin.class.php' ;
-require_once $gfwww.'include/trove.php';
 
 $admsswPluginObject = new admsswPlugin ;
 
-admsswPlugin::$PAGING_LIMIT = $TROVE_BROWSELIMIT;
-
 register_plugin ($admsswPluginObject) ;
 
 // Local Variables:
diff --git a/src/plugins/admssw/include/admsswPlugin.class.php b/src/plugins/admssw/include/admsswPlugin.class.php
index dbb373d..06ecc73 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -34,7 +34,7 @@ include_once("Graphite.php");
 
 class admsswPlugin extends Plugin {
 	
-	public static $PAGING_LIMIT = 10;
+	public static $PAGING_LIMIT = 50;
 		
 	//var $trovecat_id_index; // cat_id to TroveCat instances
 	var $trovecat_id_to_shortname;	// cat_id to shortname
@@ -545,7 +545,7 @@ class admsswPlugin extends Plugin {
 		
 		// if paging is requested
 		if ($p > 0) {
-			$maxpage = (int) ($projectsnum / $pl);
+			$maxpage = ceil($projectsnum / $pl);
 			if ($p > $maxpage) {
 				header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found",true,404);
 				printf("Page %d requested is beyond the maximum %d !", $p, $maxpage);
@@ -603,7 +603,7 @@ class admsswPlugin extends Plugin {
 				$res->setURI( $pageuri );
 				rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
 		
-				if($p < ( (int) ($projectsnum / $pl) ) ) {
+				if( $p < ceil($projectsnum / $pl) ) {
 					$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
 					rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
 				}
@@ -638,7 +638,7 @@ class admsswPlugin extends Plugin {
 			$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
 			// only display pages stuff if there is more to display
 			if ($projectsnum > $pl) {
-				$html_limit .= trove_html_limit_navigation_box($scripturl, $projectsnum, $pl, $p);
+				$html_limit .= html_trove_limit_navigation_box($scripturl, $projectsnum, $pl, $p);
 			}
 			$html_limit .= '</span>';
 		
diff --git a/src/www/include/html.php b/src/www/include/html.php
index 671f87e..10cae6d 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -1161,6 +1161,36 @@ function html_a_apply($scopy) {
 	return $rv;
 }
 
+/**
+ * html_trove_limit_navigation_box() - displays the navigation links for paging browsing
+ *
+ * @param		string		URL of the very same script
+ * @param		int			total number of results
+ * @param		int			the maximum number displayed on a single page
+ * @param		int			current page number (starting at 1)
+ */
+function html_trove_limit_navigation_box($php_self, $querytotalcount, $trove_browselimit, $page) {
+
+	$html_limit = sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $trove_browselimit).'<br/>';
+
+	// display all the numbers
+	for ($i=1;$i<=ceil($querytotalcount/$trove_browselimit);$i++) {
+		$html_limit .= ' ';
+		if ($page != $i) {
+			$html_limit .= '<a href="'.$php_self;
+			$html_limit .= '?page='.$i;
+			$html_limit .= '">';
+		} else $html_limit .= '<strong>';
+		$html_limit .= '<'.$i.'>';
+		if ($page != $i) {
+			$html_limit .= '</a>';
+		} else $html_limit .= '</strong>';
+		$html_limit .= ' ';
+	}
+	return $html_limit;
+}
+
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
diff --git a/src/www/include/trove.php b/src/www/include/trove.php
index a0364e1..fe7b948 100644
--- a/src/www/include/trove.php
+++ b/src/www/include/trove.php
@@ -432,36 +432,6 @@ function trove_del_cat_id($node) {
         }
 }
 
-/**
- * trove_html_limit_navigation_box() - displays the navigation links for paging browsing
- *
- * @param		string		URL of the very same script
- * @param		int			total number of results
- * @param		int			the maximum number displayed on a single page
- * @param		int			current page number (starting at 1)
- */
-function trove_html_limit_navigation_box($php_self, $querytotalcount, $trove_browselimit, $page) {
-	
-	$html_limit = sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $trove_browselimit).'<br/>';
-	
-	// display all the numbers
-	for ($i=1;$i<=ceil($querytotalcount/$trove_browselimit);$i++) {
-		$html_limit .= ' ';
-		if ($page != $i) {
-			$html_limit .= '<a href="'.$php_self;
-			$html_limit .= '?page='.$i;
-			$html_limit .= '">';
-		} else $html_limit .= '<strong>';
-		$html_limit .= '<'.$i.'>';
-		if ($page != $i) {
-			$html_limit .= '</a>';
-		} else $html_limit .= '</strong>';
-		$html_limit .= ' ';
-	}
-	return $html_limit;
-}
-
-
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
diff --git a/src/www/softwaremap/full_list.php b/src/www/softwaremap/full_list.php
index 035474a..67bc2db 100644
--- a/src/www/softwaremap/full_list.php
+++ b/src/www/softwaremap/full_list.php
@@ -71,7 +71,7 @@ $html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $quer
 
 // only display pages stuff if there is more to display
 if ($querytotalcount > $TROVE_BROWSELIMIT) {
-	$html_limit .= trove_html_limit_navigation_box($_SERVER['PHP_SELF'], $querytotalcount, $TROVE_BROWSELIMIT, $page);
+	$html_limit .= html_trove_limit_navigation_box($_SERVER['PHP_SELF'], $querytotalcount, $TROVE_BROWSELIMIT, $page);
 }
 
 $html_limit .= '</span>';

commit fdb33a90b1cbbfe44446610dda13cb51a4f88f4e
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 17:01:00 2013 +0200

    Finalisation

diff --git a/src/plugins/admssw/include/admsswPlugin.class.php b/src/plugins/admssw/include/admsswPlugin.class.php
index b769eb5..dbb373d 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -514,10 +514,19 @@ class admsswPlugin extends Plugin {
 		return $graph;
 	}
 	
+	/*
+	 * Returns the size of the pages for paged documents (project indexes or full projects dump)
+	 */
 	public function getPagingLimit() {
 		return self::$PAGING_LIMIT;
 	}
 	
+	/*
+	 * Process the paging parameters and eventually redirect, ala LDP
+	 * 
+	 * When there are too many projects to be displayed, it will redirect to the first page : ?page=1
+	 * This can be overriden with the ?allatonce parameter
+	 */
 	public function process_paging_params_or_redirect($projectsnum, $pl) { 
 		
 		$p = getIntFromRequest('page', 0);
@@ -549,16 +558,15 @@ class admsswPlugin extends Plugin {
 	
 	
 	/**
-	 * Provides an HTML preview of the ADMS.SW SoftwareRepository meta-data looking like turtle
+	 * Provides either an HTML preview looking like turtle, or plain RDF of the ADMS.SW SoftwareRepository meta-data
 	 * 
-	 * @param int $group_id
+	 * @param	string	URL of the RDF document
+	 * @param	string	expected content type for the document
+	 * @param	int		page number. If null, means no paging but full document
+	 * @param	int		page length : how many projects per page
+	 * @param	bool	if has to provide full details about projects
+	 * @param	string	URL of the HTML script if different than the RDF document   
 	 */
-// 	public function htmlPreviewProjectsAsTurtle($documenturi) {
-// 		$graph = $this->getProjectListResourcesGraph($documenturi);
-		
-// 		return $graph->dump();
-// 	}
-	
 	public function getProjectsListDisplay($documenturi, $content_type, $p, $pl, $detailed=false, $scripturl=false) {
 		
 		$doc = '';
@@ -609,7 +617,6 @@ class admsswPlugin extends Plugin {
 		
 			// We can support only RDF as RDF+XML or Turtle
 			if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
-				//header('Content-type: '. $content_type);
 				if ($content_type == 'text/turtle') {
 					$doc = $graph->serialize($serializer="Turtle")."\n";
 				}
@@ -624,8 +631,6 @@ class admsswPlugin extends Plugin {
 			}
 		} else {
 			// HTML
-//			$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
-			//$HTML->printSoftwareMapLinks();
 		
 			$doc = '<p>'. _('The following is a preview of (machine-readable) RDF meta-data, in Turtle format (see at the bottom for more details)') .'<br />';
 		
@@ -657,6 +662,8 @@ class admsswPlugin extends Plugin {
 	 * Outputs the public projects list as ADMS.SW for /projects
 	 * 
 	 * @param unknown_type $params
+	 * 
+	 * This has a counterpart in /plugins/admssw/projectsturtle.php which previews the Turtle as HTML
 	 */
 	public function content_negociated_projects_list (&$params) {
 		
@@ -681,17 +688,6 @@ class admsswPlugin extends Plugin {
  			$doc = $this->getProjectsListDisplay($documenturi, $accept, $p, $pl);
  			
  			$params['content'] = $doc . "\n";
- 			
-// 			$graph = $this->getProjectListResourcesGraph(util_make_url ("/projects"));
-						
-// 			if ($accept == 'text/turtle') {
-// 				$doc = $graph->serialize($serializer="Turtle");
-// 			}
-// 			if ($accept == 'application/rdf+xml') {
-// 				$doc = $graph->serialize();
-// 			}
-			
-// 			$params['content'] = $doc . "\n";
 		
  		}
 	}
diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index 97b30e6..37ed53f 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -19,7 +19,17 @@
 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
-	
+
+// Dumps an HTML preview or a full RDF document for public projects, with full details
+
+// The script will paginate the contents (with the same page size than in the softwaremap/trove)
+// redirecting if necessary to ?page=1
+// This can be overriden with ?allatonce
+
+// This script is the counterpart, with full details, of other lists of projects 
+// which contain only an index of projects, like /projects/ (for RDF harvested by machines)
+// or its HTML Turtle preview in /plugins/admssw/projectsturtle.php
+
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
 
@@ -49,92 +59,14 @@ else {
 	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
 	$HTML->printSoftwareMapLinks();
 }
-print $plugin->getProjectsListDisplay($documenturi, $content_type, $p, $pl, true);
+
+// We want full details of the projects
+$detailed = true;
+print $plugin->getProjectsListDisplay($documenturi, $content_type, $p, $pl, $detailed);
 
 if ($content_type == 'text/html') {
 	$HTML->footer(array());
 }
-// $pageuri = '';
-// $chunksize = null;
-// $chunk = null;
-// // if paging is requested
-// if ($p > 0) {
-// 	$chunksize = $pl;
-// 	$chunk = $p;
-// 	$pageuri = $documenturi . '?page='. (string)$p;
-// }
-
-// // process as in content_negociated_projects_list but with full details
-// $graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
-
-// // if not HTML
-// if($content_type != $default_content_type) {
-
-// 	if ($p > 0) {
-// 		$ns = $plugin->admsswNameSpaces();
-// 		$conf = array(
-// 				'ns' => $ns
-// 		);
-		
-// 		$res = ARC2::getResource($conf);
-// 		$res->setURI( $pageuri );
-// 		rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
-		
-// 		if($p < ( (int) ($projectsnum / $pl) ) ) {
-// 			$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
-// 			rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
-// 		}
-// 		else {
-// 			rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
-// 		}
-// 		rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
-		
-// 		$count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
-// 	}
-
-// 	// We can support only RDF as RDF+XML or Turtle
-// 	if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
-// 		header('Content-type: '. $content_type);
-// 		if ($content_type == 'text/turtle') {
-// 			print $graph->serialize($serializer="Turtle")."\n";
-// 		}
-// 		if ($content_type == 'application/rdf+xml') {
-// 			print $graph->serialize()."\n";
-// 		}
-// 	}
-// 	else {
-// 		header('HTTP/1.1 406 Not Acceptable',true,406);
-// 		print $graph->dumpText();
-// 		exit(0);
-// 	}
-// } else {
-// 	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
-// 	$HTML->printSoftwareMapLinks();
-	
-// 	echo '<p>'. sprintf( _('This script is meant to produce machine-readable RDF meta-data, in Turtle or RDF/XML formats, which can be obtained at <tt>%1$s</tt> as Turtle'), $documenturi).'<br />';
-	
-// 	$html_limit = '<span style="text-align:center;font-size:smaller">';
-// 	$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
-// 	// only display pages stuff if there is more to display
-// 	if ($projectsnum > $pl) {
-// 		$html_limit .= trove_html_limit_navigation_box($documenturi, $projectsnum, $pl, $p);
-// 	}
-// 	$html_limit .= '</span>';
-	
-// 	print $html_limit;
-	
-// 	print $graph->dump();
-	
-// 	echo _('To access this RDF document, you may use, for instance :<br />');
-// 	echo '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
-	
-// 	echo _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
-	
-// 	echo _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
-// 	echo '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
-	
-// 	$HTML->footer(array());
-// }
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/admssw/www/projectsturtle.php b/src/plugins/admssw/www/projectsturtle.php
index a4c246e..54bf7c2 100644
--- a/src/plugins/admssw/www/projectsturtle.php
+++ b/src/plugins/admssw/www/projectsturtle.php
@@ -22,16 +22,19 @@
 
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
-require_once $gfwww.'include/trove.php';
-
-/* FIXME
-* Parameters:
-*   $gwords     = target words to search
-*   $gexact     = 1 for search ing all words (AND), 0 - for any word (OR)
-*   $otherfreeknowledge = 1 for search in Free/Libre Knowledge Gforge Initiatives
-*   $order = "project_title" or "title"    -  criteria for ordering results: if empty or not allowed results are ordered by rank
-*
-*/
+
+// Dumps an HTML preview of the Turtle RDF document for an index of public projects
+
+// The script will paginate the contents (with the same page size than in the softwaremap/trove)
+// redirecting if necessary to ?page=1
+// This can be overriden with ?allatonce
+
+// The RDF version is available at /projects/.
+
+// This script is the counterpart, with only un index of projects, of an other lists of projects
+// with full details which can be accessed in /plugins/admssw/full.php
+
+
 
 $pluginname = 'admssw';
 
@@ -44,20 +47,15 @@ $documenturi = util_make_url('/projects/');
 $scripturl = util_make_url('/plugins/'. $plugin->name .'/projectsturtle.php');
 
 // page length
-$pl = $TROVE_BROWSELIMIT;
+$pl = $plugin->getPagingLimit();
 
 $projectsnum = $plugin->getProjectListSize();
 
 $p = $plugin->process_paging_params_or_redirect($projectsnum, $pl);
 
-print $plugin->getProjectsListDisplay($documenturi, 'text/html', $p, $pl, false, $scripturl);
-
-// echo '<p>'. sprintf( _('The following is a preview of the (machine-readable) RDF meta-data which can be obtained at <tt>%1$s</tt> as Turtle'), util_make_url('/projects/')) .'</p>';
-
-// echo $plugin->htmlPreviewProjectsAsTurtle(util_make_url ("/projects"));
-
-// echo _('To access this RDF document, you may use, for instance :<br />');
-// echo '<tt>$ curl -H "Accept: text/turtle" '. util_make_url('/projects/') .'</tt><br />';
+// We don't want full details about the projects, just an index
+$detailed = false;
+print $plugin->getProjectsListDisplay($documenturi, 'text/html', $p, $pl, $detailed, $scripturl);
 
 $HTML->footer(array());
 

commit fccfe5794e292033f2fb0af3e4af8499cd5d89b4
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 17:00:39 2013 +0200

    Add missing docs

diff --git a/src/www/include/trove.php b/src/www/include/trove.php
index 7a592b5..a0364e1 100644
--- a/src/www/include/trove.php
+++ b/src/www/include/trove.php
@@ -432,6 +432,14 @@ function trove_del_cat_id($node) {
         }
 }
 
+/**
+ * trove_html_limit_navigation_box() - displays the navigation links for paging browsing
+ *
+ * @param		string		URL of the very same script
+ * @param		int			total number of results
+ * @param		int			the maximum number displayed on a single page
+ * @param		int			current page number (starting at 1)
+ */
 function trove_html_limit_navigation_box($php_self, $querytotalcount, $trove_browselimit, $page) {
 	
 	$html_limit = sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $trove_browselimit).'<br/>';

commit 505a4fa9e35f9ee1ae2db210351ab762eda59478
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 16:34:01 2013 +0200

    Factorize the code of /projects and full.php

diff --git a/src/plugins/admssw/common/admssw-init.php b/src/plugins/admssw/common/admssw-init.php
index 7ba7e51..70df99e 100644
--- a/src/plugins/admssw/common/admssw-init.php
+++ b/src/plugins/admssw/common/admssw-init.php
@@ -19,9 +19,12 @@
 
 global $gfplugins;
 require_once $gfplugins.'admssw/include/admsswPlugin.class.php' ;
+require_once $gfwww.'include/trove.php';
 
 $admsswPluginObject = new admsswPlugin ;
 
+admsswPlugin::$PAGING_LIMIT = $TROVE_BROWSELIMIT;
+
 register_plugin ($admsswPluginObject) ;
 
 // Local Variables:
diff --git a/src/plugins/admssw/include/admsswPlugin.class.php b/src/plugins/admssw/include/admsswPlugin.class.php
index 8de5745..b769eb5 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -34,6 +34,8 @@ include_once("Graphite.php");
 
 class admsswPlugin extends Plugin {
 	
+	public static $PAGING_LIMIT = 10;
+		
 	//var $trovecat_id_index; // cat_id to TroveCat instances
 	var $trovecat_id_to_shortname;	// cat_id to shortname
 	var $trovecat_id_to_path; // cat_id to path
@@ -512,17 +514,13 @@ class admsswPlugin extends Plugin {
 		return $graph;
 	}
 	
-	public function proces_paging_params_or_redirect($projectsnum, $pl) { 
+	public function getPagingLimit() {
+		return self::$PAGING_LIMIT;
+	}
+	
+	public function process_paging_params_or_redirect($projectsnum, $pl) { 
 		
-		$p = 0;
-		if ( null !== getStringFromRequest('theFirstPage', null)) {
-			$p = 1;
-		}
-		else {
-			$p = getIntFromRequest('page', 0);
-			if ($p > 0) {
-			}
-		}
+		$p = getIntFromRequest('page', 0);
 		
 		if ( null !== getStringFromRequest('allatonce', null)) {
 			$pl = $projectsnum + 1;
@@ -531,7 +529,7 @@ class admsswPlugin extends Plugin {
 		
 		// force paging if too many projects
 		if ( ($projectsnum > $pl) && ! ($p > 0) ) {
-			header("Location: ?theFirstPage");
+			header("Location: ?page=1");
 			header($_SERVER["SERVER_PROTOCOL"]." 303 See Other",true,303);
 			exit;
 		}
@@ -555,10 +553,104 @@ class admsswPlugin extends Plugin {
 	 * 
 	 * @param int $group_id
 	 */
-	public function htmlPreviewProjectsAsTurtle() {
-		$graph = $this->getProjectListResourcesGraph(util_make_url ("/projects"));
+// 	public function htmlPreviewProjectsAsTurtle($documenturi) {
+// 		$graph = $this->getProjectListResourcesGraph($documenturi);
 		
-		return $graph->dump();
+// 		return $graph->dump();
+// 	}
+	
+	public function getProjectsListDisplay($documenturi, $content_type, $p, $pl, $detailed=false, $scripturl=false) {
+		
+		$doc = '';
+		
+		if(! $scripturl) {
+			$scripturl = $documenturi;
+		}
+		
+		$pageuri = '';
+		$chunksize = null;
+		$chunk = null;
+		// if paging is requested
+		if ($p > 0) {
+			$chunksize = $pl;
+			$chunk = $p;
+			$pageuri = $documenturi . '?page='. (string)$p;
+		}
+		
+		$projectsnum = $this->getProjectListSize();
+		
+		// process as in content_negociated_projects_list but with full details
+		$graph = $this->getProjectListResourcesGraph($documenturi, $detailed, $chunk, $chunksize);
+		
+		// if not HTML
+		if($content_type != 'text/html') {
+		
+			if ($p > 0) {
+				$ns = $this->admsswNameSpaces();
+				$conf = array(
+						'ns' => $ns
+				);
+		
+				$res = ARC2::getResource($conf);
+				$res->setURI( $pageuri );
+				rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
+		
+				if($p < ( (int) ($projectsnum / $pl) ) ) {
+					$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
+					rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
+				}
+				else {
+					rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
+				}
+				rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
+		
+				$count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
+			}
+		
+			// We can support only RDF as RDF+XML or Turtle
+			if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
+				//header('Content-type: '. $content_type);
+				if ($content_type == 'text/turtle') {
+					$doc = $graph->serialize($serializer="Turtle")."\n";
+				}
+				if ($content_type == 'application/rdf+xml') {
+					$doc = $graph->serialize()."\n";
+				}
+			}
+			else {
+				header('HTTP/1.1 406 Not Acceptable',true,406);
+				print $graph->dumpText();
+				exit(0);
+			}
+		} else {
+			// HTML
+//			$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
+			//$HTML->printSoftwareMapLinks();
+		
+			$doc = '<p>'. _('The following is a preview of (machine-readable) RDF meta-data, in Turtle format (see at the bottom for more details)') .'<br />';
+		
+			$html_limit = '<span style="text-align:center;font-size:smaller">';
+			$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
+			// only display pages stuff if there is more to display
+			if ($projectsnum > $pl) {
+				$html_limit .= trove_html_limit_navigation_box($scripturl, $projectsnum, $pl, $p);
+			}
+			$html_limit .= '</span>';
+		
+			$doc .= $html_limit;
+		
+			$doc .= $graph->dump();
+		
+			$doc .= _('To access this RDF document, you may use, for instance :<br />');
+			$doc .= '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
+		
+			$doc .= _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
+		
+			$doc .= _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
+			$doc .= '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
+		
+		}
+		return $doc;
 	}
 	
 	/**
@@ -568,27 +660,40 @@ class admsswPlugin extends Plugin {
 	 */
 	public function content_negociated_projects_list (&$params) {
 		
+		
 		$accept = $params['accept'];
 		
 		// we are asked for RDF either as RDF+XML or Turtle
 		if($accept == 'application/rdf+xml' || $accept == 'text/turtle') {
-				
-				
-			// We will return RDF
-			$params['content_type'] = $accept;
-	
-			$graph = $this->getProjectListResourcesGraph(util_make_url ("/projects"));
+								
+ 			// We will return RDF
+ 			$params['content_type'] = $accept;
+
+ 			$documenturi = util_make_url ("/projects");
+ 			
+ 			// page length
+ 			$pl = admsswPlugin::$PAGING_LIMIT;
+ 			
+ 			$projectsnum = $this->getProjectListSize();
+ 			
+ 			$p = $this->process_paging_params_or_redirect($projectsnum, $pl);
+ 			
+ 			$doc = $this->getProjectsListDisplay($documenturi, $accept, $p, $pl);
+ 			
+ 			$params['content'] = $doc . "\n";
+ 			
+// 			$graph = $this->getProjectListResourcesGraph(util_make_url ("/projects"));
 						
-			if ($accept == 'text/turtle') {
-				$doc = $graph->serialize($serializer="Turtle");
-			}
-			if ($accept == 'application/rdf+xml') {
-				$doc = $graph->serialize();
-			}
+// 			if ($accept == 'text/turtle') {
+// 				$doc = $graph->serialize($serializer="Turtle");
+// 			}
+// 			if ($accept == 'application/rdf+xml') {
+// 				$doc = $graph->serialize();
+// 			}
 			
-			$params['content'] = $doc . "\n";
+// 			$params['content'] = $doc . "\n";
 		
-		}
+ 		}
 	}
 	
 	
@@ -871,6 +976,7 @@ class admsswPlugin extends Plugin {
 	}
 }
 
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index a372ea0..97b30e6 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -22,7 +22,6 @@
 	
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
-require_once $gfwww.'include/trove.php';
 
 $pluginname = 'admssw';
 
@@ -34,98 +33,108 @@ $content_type = util_negociate_alternate_content_types($script, $default_content
 
 $plugin = plugin_get_object($pluginname);
 
-// page length
-$pl = $TROVE_BROWSELIMIT;
+$documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
 
-$uricomplement = '';
+// page length
+$pl = $plugin->getPagingLimit();
 
 $projectsnum = $plugin->getProjectListSize();
 
-$p = $plugin->proces_paging_params_or_redirect($projectsnum, $pl);
+$p = $plugin->process_paging_params_or_redirect($projectsnum, $pl);
 
-$documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
-$pageuri = '';
-
-$chunksize = null;
-$chunk = null;
-// if paging is requested
-if ($p > 0) {
-	$chunksize = $pl;
-	$chunk = $p;
-	$pageuri = $documenturi . $uricomplement;
+if ($content_type != 'text/html') {
+	header('Content-type: '. $content_type);
 }
+else {
+	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
+	$HTML->printSoftwareMapLinks();
+}
+print $plugin->getProjectsListDisplay($documenturi, $content_type, $p, $pl, true);
 
-// process as in content_negociated_projects_list but with full details
-$graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
-
-// if not HTML
-if($content_type != $default_content_type) {
-
-	if ($p > 0) {
-		$ns = $plugin->admsswNameSpaces();
-		$conf = array(
-				'ns' => $ns
-		);
+if ($content_type == 'text/html') {
+	$HTML->footer(array());
+}
+// $pageuri = '';
+// $chunksize = null;
+// $chunk = null;
+// // if paging is requested
+// if ($p > 0) {
+// 	$chunksize = $pl;
+// 	$chunk = $p;
+// 	$pageuri = $documenturi . '?page='. (string)$p;
+// }
+
+// // process as in content_negociated_projects_list but with full details
+// $graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
+
+// // if not HTML
+// if($content_type != $default_content_type) {
+
+// 	if ($p > 0) {
+// 		$ns = $plugin->admsswNameSpaces();
+// 		$conf = array(
+// 				'ns' => $ns
+// 		);
 		
-		$res = ARC2::getResource($conf);
-		$res->setURI( $pageuri );
-		rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
+// 		$res = ARC2::getResource($conf);
+// 		$res->setURI( $pageuri );
+// 		rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
 		
-		if($p < ( (int) ($projectsnum / $pl) ) ) {
-			$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
-			rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
-		}
-		else {
-			rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
-		}
-		rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
+// 		if($p < ( (int) ($projectsnum / $pl) ) ) {
+// 			$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
+// 			rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
+// 		}
+// 		else {
+// 			rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
+// 		}
+// 		rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
 		
-		$count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
-	}
-
-	// We can support only RDF as RDF+XML or Turtle
-	if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
-		header('Content-type: '. $content_type);
-		if ($content_type == 'text/turtle') {
-			print $graph->serialize($serializer="Turtle")."\n";
-		}
-		if ($content_type == 'application/rdf+xml') {
-			print $graph->serialize()."\n";
-		}
-	}
-	else {
-		header('HTTP/1.1 406 Not Acceptable',true,406);
-		print $graph->dumpText();
-		exit(0);
-	}
-} else {
-	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
-	$HTML->printSoftwareMapLinks();
+// 		$count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
+// 	}
+
+// 	// We can support only RDF as RDF+XML or Turtle
+// 	if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
+// 		header('Content-type: '. $content_type);
+// 		if ($content_type == 'text/turtle') {
+// 			print $graph->serialize($serializer="Turtle")."\n";
+// 		}
+// 		if ($content_type == 'application/rdf+xml') {
+// 			print $graph->serialize()."\n";
+// 		}
+// 	}
+// 	else {
+// 		header('HTTP/1.1 406 Not Acceptable',true,406);
+// 		print $graph->dumpText();
+// 		exit(0);
+// 	}
+// } else {
+// 	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
+// 	$HTML->printSoftwareMapLinks();
 	
-	echo '<p>'. sprintf( _('This script is meant to produce machine-readable RDF meta-data, in Turtle or RDF/XML formats, which can be obtained at <tt>%1$s</tt> as Turtle'), $documenturi).'<br />';
+// 	echo '<p>'. sprintf( _('This script is meant to produce machine-readable RDF meta-data, in Turtle or RDF/XML formats, which can be obtained at <tt>%1$s</tt> as Turtle'), $documenturi).'<br />';
 	
-	$html_limit = '<span style="text-align:center;font-size:smaller">';
-	$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
-	// only display pages stuff if there is more to display
-	if ($projectsnum > $pl) {
-		$html_limit .= trove_html_limit_navigation_box($documenturi, $projectsnum, $pl, $p);
-	}
-	$html_limit .= '</span>';
+// 	$html_limit = '<span style="text-align:center;font-size:smaller">';
+// 	$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
+// 	// only display pages stuff if there is more to display
+// 	if ($projectsnum > $pl) {
+// 		$html_limit .= trove_html_limit_navigation_box($documenturi, $projectsnum, $pl, $p);
+// 	}
+// 	$html_limit .= '</span>';
 	
-	print $html_limit;
+// 	print $html_limit;
 	
-	print $graph->dump();
+// 	print $graph->dump();
 	
-	echo _('To access this RDF document, you may use, for instance :<br />');
-	echo '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
+// 	echo _('To access this RDF document, you may use, for instance :<br />');
+// 	echo '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
 	
-	echo _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
+// 	echo _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
 	
-	echo _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
-	echo '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
+// 	echo _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
+// 	echo '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
 	
-	$HTML->footer(array());
-}
+// 	$HTML->footer(array());
+// }
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/admssw/www/projectsturtle.php b/src/plugins/admssw/www/projectsturtle.php
index 925131c..a4c246e 100644
--- a/src/plugins/admssw/www/projectsturtle.php
+++ b/src/plugins/admssw/www/projectsturtle.php
@@ -22,6 +22,7 @@
 
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
+require_once $gfwww.'include/trove.php';
 
 /* FIXME
 * Parameters:
@@ -39,12 +40,24 @@ $HTML->printSoftwareMapLinks();
 
 $plugin = plugin_get_object ($pluginname);
 
-echo '<p>'. sprintf( _('The following is a preview of the (machine-readable) RDF meta-data which can be obtained at <tt>%1$s</tt> as Turtle'), util_make_url('/projects/')) .'</p>';
+$documenturi = util_make_url('/projects/');
+$scripturl = util_make_url('/plugins/'. $plugin->name .'/projectsturtle.php');
 
-echo $plugin->htmlPreviewProjectsAsTurtle();
+// page length
+$pl = $TROVE_BROWSELIMIT;
 
-echo _('To access this RDF document, you may use, for instance :<br />');
-echo '<tt>$ curl -H "Accept: text/turtle" '. util_make_url('/projects/') .'</tt><br />';
+$projectsnum = $plugin->getProjectListSize();
+
+$p = $plugin->process_paging_params_or_redirect($projectsnum, $pl);
+
+print $plugin->getProjectsListDisplay($documenturi, 'text/html', $p, $pl, false, $scripturl);
+
+// echo '<p>'. sprintf( _('The following is a preview of the (machine-readable) RDF meta-data which can be obtained at <tt>%1$s</tt> as Turtle'), util_make_url('/projects/')) .'</p>';
+
+// echo $plugin->htmlPreviewProjectsAsTurtle(util_make_url ("/projects"));
+
+// echo _('To access this RDF document, you may use, for instance :<br />');
+// echo '<tt>$ curl -H "Accept: text/turtle" '. util_make_url('/projects/') .'</tt><br />';
 
 $HTML->footer(array());
 

commit cda025beb66461bc34125bcd6a31b789143a34e1
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 15:18:15 2013 +0200

    Move the arguments and redirect to dedicated function

diff --git a/src/plugins/admssw/include/admsswPlugin.class.php b/src/plugins/admssw/include/admsswPlugin.class.php
index f245f34..8de5745 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -512,6 +512,44 @@ class admsswPlugin extends Plugin {
 		return $graph;
 	}
 	
+	public function proces_paging_params_or_redirect($projectsnum, $pl) { 
+		
+		$p = 0;
+		if ( null !== getStringFromRequest('theFirstPage', null)) {
+			$p = 1;
+		}
+		else {
+			$p = getIntFromRequest('page', 0);
+			if ($p > 0) {
+			}
+		}
+		
+		if ( null !== getStringFromRequest('allatonce', null)) {
+			$pl = $projectsnum + 1;
+			$p = 0;
+		}
+		
+		// force paging if too many projects
+		if ( ($projectsnum > $pl) && ! ($p > 0) ) {
+			header("Location: ?theFirstPage");
+			header($_SERVER["SERVER_PROTOCOL"]." 303 See Other",true,303);
+			exit;
+		}
+		
+		// if paging is requested
+		if ($p > 0) {
+			$maxpage = (int) ($projectsnum / $pl);
+			if ($p > $maxpage) {
+				header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found",true,404);
+				printf("Page %d requested is beyond the maximum %d !", $p, $maxpage);
+				exit;
+			}
+		}
+		
+		return $p;
+	}
+	
+	
 	/**
 	 * Provides an HTML preview of the ADMS.SW SoftwareRepository meta-data looking like turtle
 	 * 
diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index 54e0054..a372ea0 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -39,58 +39,28 @@ $pl = $TROVE_BROWSELIMIT;
 
 $uricomplement = '';
 
-$p = 0;
-if ( null !== getStringFromRequest('theFirstPage', null)) {
-	$p = 1;
-	$uricomplement = '?theFirstPage';
-}
-else {
-	$p = getIntFromRequest('page', 0);
-	if ($p > 0) {
-		$uricomplement = '?page=' . $p;
-	}
-}
-
 $projectsnum = $plugin->getProjectListSize();
 
-if ( null !== getStringFromRequest('allatonce', null)) {
-	$pl = $projectsnum + 1;
-	$p = 0;
-}
+$p = $plugin->proces_paging_params_or_redirect($projectsnum, $pl);
 
-// force paging if too many projects
-if ( ($projectsnum > $pl) && ! ($p > 0) ) {
-//	$p = 1;
-	header("Location: ?theFirstPage");
-	header($_SERVER["SERVER_PROTOCOL"]." 303 See Other",true,303);
- 	exit;
+$documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
+$pageuri = '';
+
+$chunksize = null;
+$chunk = null;
+// if paging is requested
+if ($p > 0) {
+	$chunksize = $pl;
+	$chunk = $p;
+	$pageuri = $documenturi . $uricomplement;
 }
 
+// process as in content_negociated_projects_list but with full details
+$graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
+
 // if not HTML
 if($content_type != $default_content_type) {
 
-	$chunksize = null;
-	$chunk = null;
-
-	$documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
-	$pageuri = '';
-	
-	// if paging is requested
-	if ($p > 0) {
-		$maxpage = (int) ($projectsnum / $pl);
-		if ($p > $maxpage) {
-			header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found",true,404);
-			printf("Page %d requested is beyond the maximum %d !", $p, $maxpage);
-			exit;
-		}
-		$chunksize = $pl;
-		$chunk = $p;
-		$pageuri = $documenturi . $uricomplement;
-	}
-	
-	// process as in content_negociated_projects_list but with full details
-	$graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
-
 	if ($p > 0) {
 		$ns = $plugin->admsswNameSpaces();
 		$conf = array(

commit e15211ad047833f61699ded107222ed8dde87b77
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 15:17:49 2013 +0200

    Reuse the same pages index as in softwaremap

diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index e2951fd..54e0054 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -132,14 +132,27 @@ if($content_type != $default_content_type) {
 	$HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
 	$HTML->printSoftwareMapLinks();
 	
-	echo '<p>'. _('This script is meant to produce machine-readable RDF meta-data, in Turtle or RDF/XML formats, which can be obtained with, for instance:').'<br />';
+	echo '<p>'. sprintf( _('This script is meant to produce machine-readable RDF meta-data, in Turtle or RDF/XML formats, which can be obtained at <tt>%1$s</tt> as Turtle'), $documenturi).'<br />';
 	
-	$graph = $plugin->getProjectListResourcesGraph(util_make_url('/plugins/'.$pluginname.'/full.php'), true);
+	$html_limit = '<span style="text-align:center;font-size:smaller">';
+	$html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
+	// only display pages stuff if there is more to display
+	if ($projectsnum > $pl) {
+		$html_limit .= trove_html_limit_navigation_box($documenturi, $projectsnum, $pl, $p);
+	}
+	$html_limit .= '</span>';
+	
+	print $html_limit;
 	
 	print $graph->dump();
 	
 	echo _('To access this RDF document, you may use, for instance :<br />');
-	echo '<tt>$ curl -H "Accept: text/turtle" '. util_make_url('/plugins/'.$pluginname.'/full.php') .'</tt>';
+	echo '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
+	
+	echo _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
+	
+	echo _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
+	echo '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
 	
 	$HTML->footer(array());
 }

commit 921c99f3c35a975b302f3edf367c1088bab785a2
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 15:17:11 2013 +0200

    Create a function to display the list of pages if paging needed

diff --git a/src/www/include/trove.php b/src/www/include/trove.php
index fe7b948..7a592b5 100644
--- a/src/www/include/trove.php
+++ b/src/www/include/trove.php
@@ -432,6 +432,28 @@ function trove_del_cat_id($node) {
         }
 }
 
+function trove_html_limit_navigation_box($php_self, $querytotalcount, $trove_browselimit, $page) {
+	
+	$html_limit = sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $trove_browselimit).'<br/>';
+	
+	// display all the numbers
+	for ($i=1;$i<=ceil($querytotalcount/$trove_browselimit);$i++) {
+		$html_limit .= ' ';
+		if ($page != $i) {
+			$html_limit .= '<a href="'.$php_self;
+			$html_limit .= '?page='.$i;
+			$html_limit .= '">';
+		} else $html_limit .= '<strong>';
+		$html_limit .= '<'.$i.'>';
+		if ($page != $i) {
+			$html_limit .= '</a>';
+		} else $html_limit .= '</strong>';
+		$html_limit .= ' ';
+	}
+	return $html_limit;
+}
+
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
diff --git a/src/www/softwaremap/full_list.php b/src/www/softwaremap/full_list.php
index 0ba3951..035474a 100644
--- a/src/www/softwaremap/full_list.php
+++ b/src/www/softwaremap/full_list.php
@@ -71,22 +71,7 @@ $html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $quer
 
 // only display pages stuff if there is more to display
 if ($querytotalcount > $TROVE_BROWSELIMIT) {
-	$html_limit .= sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $TROVE_BROWSELIMIT).'<br/>';
-
-	// display all the numbers
-	for ($i=1;$i<=ceil($querytotalcount/$TROVE_BROWSELIMIT);$i++) {
-		$html_limit .= ' ';
-		if ($page != $i) {
-			$html_limit .= '<a href="'.$_SERVER['PHP_SELF'];
-			$html_limit .= '?page='.$i;
-			$html_limit .= '">';
-		} else $html_limit .= '<strong>';
-		$html_limit .= '<'.$i.'>';
-		if ($page != $i) {
-			$html_limit .= '</a>';
-		} else $html_limit .= '</strong>';
-		$html_limit .= ' ';
-	}
+	$html_limit .= trove_html_limit_navigation_box($_SERVER['PHP_SELF'], $querytotalcount, $TROVE_BROWSELIMIT, $page);
 }
 
 $html_limit .= '</span>';

commit b712540cedcd5a5c385de7b2a5388864c0ee59ff
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 14:10:50 2013 +0200

    Base paging limit on the softwaremap browsing's one and add allatonce mode

diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index 7a658ad..e2951fd 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -22,6 +22,7 @@
 	
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
+require_once $gfwww.'include/trove.php';
 
 $pluginname = 'admssw';
 
@@ -34,7 +35,7 @@ $content_type = util_negociate_alternate_content_types($script, $default_content
 $plugin = plugin_get_object($pluginname);
 
 // page length
-$pl = 3;
+$pl = $TROVE_BROWSELIMIT;
 
 $uricomplement = '';
 
@@ -44,14 +45,19 @@ if ( null !== getStringFromRequest('theFirstPage', null)) {
 	$uricomplement = '?theFirstPage';
 }
 else {
-	$p = getIntFromRequest('p', 0);
+	$p = getIntFromRequest('page', 0);
 	if ($p > 0) {
-		$uricomplement = '?p=' . $p;
+		$uricomplement = '?page=' . $p;
 	}
 }
 
 $projectsnum = $plugin->getProjectListSize();
 
+if ( null !== getStringFromRequest('allatonce', null)) {
+	$pl = $projectsnum + 1;
+	$p = 0;
+}
+
 // force paging if too many projects
 if ( ($projectsnum > $pl) && ! ($p > 0) ) {
 //	$p = 1;
@@ -96,7 +102,7 @@ if($content_type != $default_content_type) {
 		rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
 		
 		if($p < ( (int) ($projectsnum / $pl) ) ) {
-			$nextpageuri = $documenturi . '?p=' . (string) ($p + 1);
+			$nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
 			rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
 		}
 		else {

commit 4c687075239d46d41266e58e700eb1a1a7bfec2a
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Thu Aug 22 13:59:40 2013 +0200

    Initial support for paging ala LDP

diff --git a/src/plugins/admssw/include/admsswPlugin.class.php b/src/plugins/admssw/include/admsswPlugin.class.php
index bd4bdf7..f245f34 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -58,7 +58,8 @@ class admsswPlugin extends Plugin {
 				'adms' => 'http://www.w3.org/ns/adms#',
 				'foaf' => 'http://xmlns.com/foaf/0.1/',
 				'schema' => 'http://schema.org/',
-				'rad' => 'http://www.w3.org/ns/rad#'
+				'rad' => 'http://www.w3.org/ns/rad#',
+				'ldp' => 'http://www.w3.org/ns/ldp#'
 		);
 		
 		//$this->trovecat_id_index = array();
@@ -157,7 +158,7 @@ class admsswPlugin extends Plugin {
 	 * 
 	 * @return array the namespaces associative array
 	 */
-	private function admsswNameSpaces() {
+	public function admsswNameSpaces() {
 		return $this->ns;
 	}
 	
@@ -423,12 +424,23 @@ class admsswPlugin extends Plugin {
 	//
 	
 	/**
+	 * Returns the number of projects in a project index
+	 */
+	public function getProjectListSize() {
+		// same as for trove's full list
+ 		$projects = get_public_active_projects_asc();
+		return count($projects);
+	}
+		
+	/**
 	 * Provides a Graphite graph for resource(s) representing the ADMS.SW SoftwareRepository
 	 * 
 	 * @param string URI of the document to use
 	 * @param bool are projects to be fully described or just a URI of their resource
+	 * @param $chunk number of the chunk to be returned in case of paging
+	 * @param $chunksize size of chunks in case of paging
 	 */
-    public function getProjectListResourcesGraph($documenturi, $detailed=false) {
+    public function getProjectListResourcesGraph($documenturi, $detailed=false, $chunk=null, $chunksize=null) {
 		
     	// Construct an ARC2_Resource containing the project's RDF (DOAP) description
 		$ns = $this->admsswNameSpaces();
@@ -453,6 +465,17 @@ class admsswPlugin extends Plugin {
 			
 		// same as for trove's full list
 		$projects = get_public_active_projects_asc();
+		
+		
+		if ( isset($chunk) && isset($chunksize) ) {
+			// TODO : do some checks on $chunk $chunksize values
+			// 			if ( ($chunk < 1) && ($chunksize >= 1) ) {
+			// 				// error		
+			// 			}
+			$projects_chunks = array_chunk($projects, $chunksize);
+			$projects = $projects_chunks[$chunk-1];
+		}
+		
 		$proj_uris = array();
 		foreach ($projects as $row_grp) {
 			$proj_uri = util_make_url_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id']).'#project';
diff --git a/src/plugins/admssw/www/full.php b/src/plugins/admssw/www/full.php
index 1a4b47a..7a658ad 100644
--- a/src/plugins/admssw/www/full.php
+++ b/src/plugins/admssw/www/full.php
@@ -33,11 +33,79 @@ $content_type = util_negociate_alternate_content_types($script, $default_content
 
 $plugin = plugin_get_object($pluginname);
 
+// page length
+$pl = 3;
+
+$uricomplement = '';
+
+$p = 0;
+if ( null !== getStringFromRequest('theFirstPage', null)) {
+	$p = 1;
+	$uricomplement = '?theFirstPage';
+}
+else {
+	$p = getIntFromRequest('p', 0);
+	if ($p > 0) {
+		$uricomplement = '?p=' . $p;
+	}
+}
+
+$projectsnum = $plugin->getProjectListSize();
+
+// force paging if too many projects
+if ( ($projectsnum > $pl) && ! ($p > 0) ) {
+//	$p = 1;
+	header("Location: ?theFirstPage");
+	header($_SERVER["SERVER_PROTOCOL"]." 303 See Other",true,303);
+ 	exit;
+}
+
 // if not HTML
 if($content_type != $default_content_type) {
-			
+
+	$chunksize = null;
+	$chunk = null;
+
+	$documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
+	$pageuri = '';
+	
+	// if paging is requested
+	if ($p > 0) {
+		$maxpage = (int) ($projectsnum / $pl);
+		if ($p > $maxpage) {
+			header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found",true,404);
+			printf("Page %d requested is beyond the maximum %d !", $p, $maxpage);
+			exit;
+		}
+		$chunksize = $pl;
+		$chunk = $p;
+		$pageuri = $documenturi . $uricomplement;
+	}
+	
 	// process as in content_negociated_projects_list but with full details
-	$graph = $plugin->getProjectListResourcesGraph(util_make_url('/plugins/'.$pluginname.'/full.php'), true);
+	$graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
+
+	if ($p > 0) {
+		$ns = $plugin->admsswNameSpaces();
+		$conf = array(
+				'ns' => $ns
+		);
+		
+		$res = ARC2::getResource($conf);
+		$res->setURI( $pageuri );
+		rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
+		
+		if($p < ( (int) ($projectsnum / $pl) ) ) {
+			$nextpageuri = $documenturi . '?p=' . (string) ($p + 1);
+			rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
+		}
+		else {
+			rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
+		}
+		rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
+		
+		$count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
+	}
 
 	// We can support only RDF as RDF+XML or Turtle
 	if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/admssw/include/admsswPlugin.class.php |  213 ++++++++++++++++++---
 src/plugins/admssw/www/full.php                   |   64 +++----
 src/plugins/admssw/www/projectsturtle.php         |   35 ++--
 src/www/include/html.php                          |   30 +++
 src/www/softwaremap/full_list.php                 |   17 +-
 5 files changed, 273 insertions(+), 86 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list