Hello,
I just updated to SRF to the most recent version in our repository.
There I noted a problem when using the TagCloud parameter and the query
returns subjects with a count of 1 each. This causes a division by
zero error.
We have some patches (I attached the file) that try to fix some of
these errors. Most of the time these occur only when the query is
incomplete for the selected query printer (e.g. missing an additional
printout when using a chart).
We also use the getParameters function to fetch all possible parameters
for a query printer. For some reason this is missing in the GraphViz
format.
I add our patches within this email. If you consider these that these
patches really fix a bug or add an improvement then could you consider these
changes to be included in the next release?
Thank you very much.
Best regards,
Stephan Robotta
--
Stephan Robotta
Halo Team
ontoprise GmbH - know how to use Know-how
- - -
Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development
- - -
An der RaumFabrik 29; 76227 Karlsruhe; Germany
Tel.: +49 721 509809-10; Fax: +49 721 509809-11
email: robo...@ontoprise.de, www: http://www.ontoprise.com
Registered Office: Karlsruhe, Germany, HRB 109540
Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr
- - -
Index: extensions/SemanticResultFormats/SRF_Messages.php
===================================================================
--- extensions/SemanticResultFormats/SRF_Messages.php (revision 9982)
+++ extensions/SemanticResultFormats/SRF_Messages.php (working copy)
@@ -87,6 +87,16 @@
'srf_paramdesc_minsize' => 'The size of the smallest tags in percent
(default: 77)',
'srf_paramdesc_maxsize' => 'The size of the biggest tags in percent
(default: 177)',
'srf_paramdesc_maxtags' => 'The maximum amount of tags in the cloud',
+
+ // format "graph"
+ 'srf_paramdesc_graphname' => 'Title',
+ 'srf_paramdesc_graphsize' => 'Graph size (in px)',
+ 'srf_paramdesc_graphlegend' => 'Show graph legend or not',
+ 'srf_paramdesc_graphlabel' => 'Graph label',
+ 'srf_paramdesc_rankdir' => 'Rank dir',
+ 'srf_paramdesc_graphlink' => 'Graph link',
+ 'srf_paramdesc_graphcolor' => 'Graph color'
+
);
/** Message documentation (Message documentation)
Index: extensions/SemanticResultFormats/GoogleCharts/SRF_GoogleBar.php
===================================================================
--- extensions/SemanticResultFormats/GoogleCharts/SRF_GoogleBar.php
(revision 9982)
+++ extensions/SemanticResultFormats/GoogleCharts/SRF_GoogleBar.php
(working copy)
@@ -28,6 +28,11 @@
$this->isHTML = true;
$t = "";
+ $n = "";
+
+ // if there is only one column in the results then stop right
away
+ if ($res->getColumnCount() == 1) return "";
+
// print all result rows
$first = true;
$count = 0; // How many bars will they be? Needed to calculate
the height of the image
Index: extensions/SemanticResultFormats/GoogleCharts/SRF_GooglePie.php
===================================================================
--- extensions/SemanticResultFormats/GoogleCharts/SRF_GooglePie.php
(revision 9982)
+++ extensions/SemanticResultFormats/GoogleCharts/SRF_GooglePie.php
(working copy)
@@ -34,6 +34,11 @@
$this->isHTML = true;
$t = "";
+ $n = "";
+
+ // if there is only one column in the results then stop right
away
+ if ($res->getColumnCount() == 1) return "";
+
// print all result rows
$first = true;
$max = 0; // the biggest value. needed for scaling
Index: extensions/SemanticResultFormats/GraphViz/SRF_Graph.php
===================================================================
--- extensions/SemanticResultFormats/GraphViz/SRF_Graph.php (revision 9982)
+++ extensions/SemanticResultFormats/GraphViz/SRF_Graph.php (working copy)
@@ -151,4 +151,16 @@
}
return $result;
}
+
+ function getParameters() {
+ return array(
+ array('name' => 'graphname', 'type' => 'string',
'description' => wfMsg('srf_paramdesc_graphname')),
+ array('name' => 'graphsize', 'type' => 'int',
'description' => wfMsg('srf_paramdesc_graphsize')),
+ array('name' => 'graphlegend', 'type' => 'enumeration',
'description' => wfMsg('srf_paramdesc_graphlegend'), 'values'=>array('yes',
'no')),
+ array('name' => 'graphlabel', 'type' => 'enumeration',
'description' => wfMsg('srf_paramdesc_graphlabel'), 'values'=>array('yes',
'no')),
+ array('name' => 'rankdir', 'type' => 'string',
'description' => wfMsg('srf_paramdesc_rankdir')),
+ array('name' => 'graphlink', 'type' => 'enumeration',
'description' => wfMsg('srf_paramdesc_graphlink'), 'values'=>array('yes',
'no')),
+ array('name' => 'graphcolor', 'type' => 'enumeration',
'description' => wfMsg('srf_paramdesc_graphcolor'), 'values'=>array('yes',
'no'))
+ );
+ }
}
Index: extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php
===================================================================
--- extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php (revision 9982)
+++ extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php (working copy)
@@ -383,4 +383,27 @@
return ( $rtnstr );
}
+
+ function getParameters() {
+ return array(
+ array('name' => 'ploticusmode', 'type' =>
'enumeration', 'values' => array('preftab', 'script')),
+ array('name' => 'ploticusparams', 'type' => 'string'),
+ array('name' => 'imageformat', 'type' => 'enumeration',
'values' => array('png', ' gif', 'jpeg', 'svg', 'svgz', 'swf', 'eps', 'ps',
'drawdump', 'drawdumpa'), 'defaultValue'=>'png'),
+ array('name' => 'titletext', 'type' => 'string'),
+ array('name' => 'showcsv', 'type' => 'boolean'),
+ array('name' => 'ploticusmode', 'type' => 'string'),
+ array('name' => 'debug', 'type' => 'boolean'),
+ array('name' => 'liveupdating', 'type' => 'boolean'),
+ array('name' => 'updatefrequency', 'type' => 'int'),
+ array('name' => 'showtimestamp', 'type' => 'boolean'),
+ array('name' => 'showimagelink', 'type' => 'boolean'),
+ array('name' => 'showrefresh', 'type' => 'boolean'),
+ array('name' => 'drawdumpoutput', 'type' => 'string'),
+ array('name' => 'tblwidth', 'type' => 'int'),
+ array('name' => 'tblheight', 'type' => 'int'),
+ array('name' => 'width', 'type' => 'int'),
+ array('name' => 'height', 'type' => 'int')
+ );
+ }
+
}
Index: extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
===================================================================
--- extensions/SemanticResultFormats/Timeline/SRF_Timeline.php (revision 9982)
+++ extensions/SemanticResultFormats/Timeline/SRF_Timeline.php (working copy)
@@ -148,6 +148,7 @@
$objectlabel =
$object->getLongText( $outputmode, $l );
} else {
$objectlabel =
$object->getShortText( $outputmode, $l );
+ if ($objectlabel == '')
continue;
}
$urlobject = ( $l !== null );
@@ -315,4 +316,11 @@
);
}
+ function getScripts() {
+ global $srfgScriptPath;
+ $scripts [] = '<script type="text/javascript" src="' .
$srfgScriptPath . '/Timeline/SRF_timeline.js"></script>' . "\n";
+ $scripts [] = '<script type="text/javascript" src="' .
$srfgScriptPath . '/Timeline/SimileTimeline/timeline-api.js"></script>' . "\n";
+ return $scripts;
+ }
+
}
Index: extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php
===================================================================
--- extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php (Original)
+++ extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php (Patched
version)
@@ -173,10 +173,12 @@
foreach ( $tags as &$tag ) {
switch ( $this->sizeMode ) {
case 'linear':
- $tag = $this->minTagSize +
$maxSizeIncrease * ( $tag -$min ) / ( $max -$min );
+ $divisor = ($max == $min) ? 1 : $max -
$min;
+ $tag = $this->minTagSize +
$maxSizeIncrease * ( $tag -$min ) / $divisor;
break;
case 'log' : default :
- $tag = $this->minTagSize +
$maxSizeIncrease * ( log( $tag ) -log( $min ) ) / ( log( $max ) -log( $min ) );
+ $divisor = ($max == $min) ? 1 : log(
$max ) - log( $min );
+ $tag = $this->minTagSize +
$maxSizeIncrease * ( log( $tag ) - log( $min ) ) / $divisor ;
break;
}
}
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel