Skip to content
Snippets Groups Projects
Commit e90c6a66 authored by alvaro's avatar alvaro
Browse files

Merge branch 'master' into adminModule

parents 27db486d e4b4defe
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
<?php
require_once('abstractModule.php');
class RedirectModule extends abstractModule{
//Class module
public function match($uri){
global $conf;
global $localUri;
global $uri;
global $acceptContentType;
global $endpoints;
global $lodspk;
require_once($conf['home'].'classes/MetaDb.php');
$metaDb = new MetaDb($conf['metadata']['db']['location']);
return true;
}
public function execute($pair){
global $conf;
global $localUri;
global $uri;
global $acceptContentType;
global $endpoints;
global $lodspk;
global $results;
global $firstResults;
echo $uri." is The uri";
}
}
?>
<?php
$conf['version'] = '20120910';
$conf['version'] = '20120704';
$conf['output']['select'] = 'json';
$conf['output']['ask'] = 'json';
$conf['output']['describe'] = 'rdf';
......@@ -73,6 +73,7 @@ $conf['modules']['available'] = array('static','uri', 'type', 'service');
//Uncomment next line to enable sessions
//$conf['modules']['available'] = array('session', 'static','uri', 'type', 'service');
$conf['admin']['pass'] = 'admin';
global $lodspk;
include_once('settings.inc.php');
......
......@@ -13,9 +13,17 @@ class Haanga_Extension_Filter_GoogleVizAnnotatedTimeline{
$fieldCounter=0;
$varList = array();
foreach($names as $v){
$variable['name'] = $v;
$variable['value'] = 'value';
if(strpos($v,"=")){
break;
}
if(strpos($v, ".")){
$aux = explode(".", $v);
$variable['name'] = $aux[0];
$variable['value'] = $aux[1];
}
array_push($varList, $variable);
$columnType = 'number';
......@@ -26,18 +34,20 @@ class Haanga_Extension_Filter_GoogleVizAnnotatedTimeline{
$columnType = 'string';
}
array_push($varList, $v);
$data .= " data.addColumn('".$columnType."', '".$v."');\n";
$data .= " data.addColumn('".$columnType."', '".$variable['name']."');\n";
$fieldCounter++;
}
foreach($obj as $k){
$j=0;
foreach($varList as $v){
$value = $k->$v->value;
$name = $v['name'];
$val = $v['value'];
$value = $k->$name->$val."ASDASD";
if($j==0){
$value = "new Date(".date("Y, m, d", strtotime($k->$v->value)).")";
}elseif(($j - 2) %3 == 0 || ($j - 3) %3 == 0){
$value = "'".$k->$v->value."'";
$value = "new Date(".date("Y, m, d", strtotime($k->$name->$val)).")";
}elseif($j-2>=0 && (($j - 2) %3 == 0 || ($j - 3) %3 == 0)){
$value = "'".$k->$name->$val."'";
}
$data .=" data.setCell($i, $j, ".$value.");\n";
$j++;
......
......@@ -59,7 +59,7 @@ class Haanga_Extension_Filter_GoogleVizColumnChart{
$divId = uniqid("columnchart_div");
$pre = "<div id='".$divId."'></div><script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
var options_$divId = ".json_encode($options).";
var options_$divId = ".json_encode($options, JSON_UNESCAPED_UNICODE).";
google.load('visualization', '1', {packages:['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
......
<?php
class Haanga_Extension_Filter_RaphaelTimeline{
public $is_safe = TRUE;
static function main($obj, $varname){
$data = "";
$i = 0;
$j = 0;
$firstColumn = true;
$options = array();
$names = explode(",", $varname);
$fieldCounter=0;
$varList = array();
foreach($names as $v){
if(strpos($v,"=")){
break;
}
$columnType = 'number';
if($firstColumn){
$columnType = 'date';
$firstColumn = false;
}elseif(($fieldCounter - 2) %3 == 0 || ($fieldCounter - 3) %3 == 0){
$columnType = 'string';
}
array_push($varList, $v);
$data .= " data.addColumn('".$columnType."', '".$v."');\n";
$fieldCounter++;
}
foreach($obj as $k){
$j=0;
foreach($varList as $v){
$value = $k->$v->value;
if($j==0){
$value = "new Date(".date("Y, m, d", strtotime($k->$v->value)).")";
}elseif(($j - 2) %3 == 0 || ($j - 3) %3 == 0){
$value = "'".$k->$v->value."'";
}
$data .=" data.setCell($i, $j, ".$value.");\n";
$j++;
}
$i++;
}
//Getting options
$options['height'] = 400;
$options['width'] = 400;
$options['displayAnnotations'] = 'true';
for($z=$fieldCounter; $z < count($names); $z++){
$pair = explode("=", $names[$z]);
$key = trim($pair[0], "\" '");
$value = trim($pair[1], "\" '");
$options[$key] = $value;
}
$divId = uniqid("timeline_div");
$pre = "<div id='".$divId."' style='width: 700px; height: 240px;'></div><script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
var options_$divId = ".json_encode($options).";
google.load('visualization', '1', {packages:['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addRows(".$i.");\n
".$data." var timeline = new google.visualization.AnnotatedTimeLine(document.getElementById('".$divId."'));
timeline.draw(data, options_$divId);
}
</script>";
return $pre;
}
}
......@@ -83,13 +83,9 @@
<td>
{%if row.o.uri == 1%}
<a rel='{{row.p.value}}' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%endif%}
{%if row.o.blank == 1%}
<span property='{{row.p.value}}'>{{row.o.value}}</span>
{%endif%}
{%if row.o.literal == 1%}
<span property='{{row.p.value}}'>{{row.o.value}}</span>
<a rev='[{{row.p.curie}}]' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%else%}
{{row.o.value}}
{%endif%}
</td>
......
......@@ -21,6 +21,10 @@ USAGE=$USAGE"\n===NAMESPACE MANAGEMENT==\n"
USAGE=$USAGE" Add namespace:\t\t\t\t\t\t$0 add namespace prefix http://example.com/sparql\n"
USAGE=$USAGE" Remove namespace:\t\t\t\t\t$0 remove namespace prefix \n"
USAGE=$USAGE" List namespaces:\t\t\t\t\t$0 list namespaces\n"
USAGE=$USAGE"\n===MODULES===\n"
USAGE=$USAGE" Enable module:\t\t\t\t\t\t$0 enable module position\n"
USAGE=$USAGE" Disable module:\t\t\t\t\t$0 disable module\n"
USAGE=$USAGE" List modules:\t\t\t\t\t$0 list modules\n"
USAGE=$USAGE"\n===VERSION==\n"
USAGE=$USAGE" Version:\t\t\t\t\t\t$0 version\n"
USAGEDEBUG="Usage: $0 debug on|off"
......@@ -30,7 +34,7 @@ if [[ $# -eq 0 || "$1" == "--help" ]]; then
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
operations=( create delete debug backup restore default cache version enable disable add remove list )
operations=( create delete debug backup restore default cache version enable disable add remove list details )
currentOperation=
if [[ ${operations[@]} =~ $1 ]]; then
......@@ -264,3 +268,24 @@ if [[ $currentOperation == "list" ]]; then
fi
exit
fi
## Details
if [[ $currentOperation == "details" ]]; then
if [ "$#" != "3" ]; then
echo -e $USAGE
exit 1
fi
detailOperation=( type service uri )
if [[ ${detailOperation[@]} =~ $2 && $2 != "" ]]
then
detailOperation=$2
else
echo -e "Option '$2' not supported. Operation aborted\n" >&2
echo -e $USAGE
exit 1
fi
cd $DIR/..
$DIR/modules/detail-component.sh $detailOperation $3
exit
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
components=( types services uris )
cd $DIR
#Components dir
mainDir=$DIR"/../../components/"$1
componentDir=$mainDir"/"$2
queryDir=$componentDir"/queries"
if [ ! -d "$mainDir" ]
then
echo "ERROR: "$1"' dir doesn't exist. $mainDir" >&2
exit 1
fi
if [ ! -d "$componentDir" ]
then
echo "ERROR: "$2"' dir ($componentDir) doesn't exist." >&2
exit 1
fi
cd $componentDir
views=`ls *.template`
#In certain cases queries may not exist but that's fine
if [ -d "$componentDir" ]
then
cd $queryDir
models=`find . -iname "*.query" |sed -e 's/^\.\///g'`
fi
echo -n "views"
for i in $views
do
NEWLINEVIEW="\n\t$i"
LIST=$LIST$NEWLINEVIEW
done
echo -e $LIST
echo -n "models"
for i in $models
do
NEWLINEMODEL="\n\t$i"
MODELLIST=$MODELLIST$NEWLINEMODEL
done
echo -e $MODELLIST
#!/bin/bash
PIDFILE=/tmp/fusekiPid
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -f $PIDFILE ]
then
exit 1
fi
fusekiDir=$DIR/../../lib/fuseki
cacheDir=$DIR/../../cache
cd $fusekiDir
./fuseki-server --loc data --update /ds &> /dev/null &
echo $! > $PIDFILE
exit
#!/bin/bash
PIDFILE=/tmp/fusekiPid
kill `cat $PIDFILE`
rm $PIDFILE
#!/bin/bash
PIDFILE=/tmp/fusekiPid
PID=`cat $PIDFILE`
kill -0 $PID
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment