3 * admssw plugin script which produces a full list of public projects with all their details
5 * This file is (c) Copyright 2012 by Olivier BERGER, Institut Mines-Telecom
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 require_once('../../env.inc.php');
24 require_once $gfcommon.'include/pre.php';
26 $pluginname = 'admssw';
28 $script = 'admssw_full';
29 $default_content_type = 'text/html';
31 // check for alternate representations (RDF content-types)
32 $content_type = util_negociate_alternate_content_types($script, $default_content_type);
34 $plugin = plugin_get_object($pluginname);
36 $documenturi = util_make_url('/plugins/'.$pluginname.'/full.php');
39 $pl = $plugin->getPagingLimit();
41 $projectsnum = $plugin->getProjectListSize();
43 $p = $plugin->process_paging_params_or_redirect($projectsnum, $pl);
45 if ($content_type != 'text/html') {
46 header('Content-type: '. $content_type);
49 $HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
50 $HTML->printSoftwareMapLinks();
52 print $plugin->getProjectsListDisplay($documenturi, $content_type, $p, $pl, true);
54 if ($content_type == 'text/html') {
55 $HTML->footer(array());
60 // // if paging is requested
64 // $pageuri = $documenturi . '?page='. (string)$p;
67 // // process as in content_negociated_projects_list but with full details
68 // $graph = $plugin->getProjectListResourcesGraph($documenturi, true, $chunk, $chunksize);
71 // if($content_type != $default_content_type) {
74 // $ns = $plugin->admsswNameSpaces();
79 // $res = ARC2::getResource($conf);
80 // $res->setURI( $pageuri );
81 // rdfutils_setPropToUri($res, 'rdf:type', 'ldp:Page');
83 // if($p < ( (int) ($projectsnum / $pl) ) ) {
84 // $nextpageuri = $documenturi . '?page=' . (string) ($p + 1);
85 // rdfutils_setPropToUri($res, 'ldp:nextPage', $nextpageuri);
88 // rdfutils_setPropToUri($res, 'ldp:nextPage', 'rdf:nil');
90 // rdfutils_setPropToUri($res, 'ldp:pageOf', $documenturi);
92 // $count = $graph->addTriples( ARC2::getTriplesFromIndex($res->index) );
95 // // We can support only RDF as RDF+XML or Turtle
96 // if ($content_type == 'text/turtle' || $content_type == 'application/rdf+xml') {
97 // header('Content-type: '. $content_type);
98 // if ($content_type == 'text/turtle') {
99 // print $graph->serialize($serializer="Turtle")."\n";
101 // if ($content_type == 'application/rdf+xml') {
102 // print $graph->serialize()."\n";
106 // header('HTTP/1.1 406 Not Acceptable',true,406);
107 // print $graph->dumpText();
111 // $HTML->header(array('title'=>_('Full ADMS.SW export'),'pagename'=>'admssw_full'));
112 // $HTML->printSoftwareMapLinks();
114 // 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 />';
116 // $html_limit = '<span style="text-align:center;font-size:smaller">';
117 // $html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $projectsnum);
118 // // only display pages stuff if there is more to display
119 // if ($projectsnum > $pl) {
120 // $html_limit .= trove_html_limit_navigation_box($documenturi, $projectsnum, $pl, $p);
122 // $html_limit .= '</span>';
124 // print $html_limit;
126 // print $graph->dump();
128 // echo _('To access this RDF document, you may use, for instance :<br />');
129 // echo '<tt>$ curl -L -H "Accept: text/turtle" '. $documenturi .'</tt><br />';
131 // echo _('This may redirect to several pages documents in case of too big number of results (observing the LDP paging specifications).<br /><br />');
133 // echo _('Alternatively, if you are sure you want the full dump in one single document, use :<br />');
134 // echo '<tt>$ curl -H "Accept: text/turtle" "'. $documenturi .'?allatonce"</tt>';
136 // $HTML->footer(array());
141 // c-file-style: "bsd"