Commit f6ce97c8 authored by Romain Loth's avatar Romain Loth

tina directories refactoring 1/2

parent 2cf9f64e
......@@ -31,7 +31,9 @@ There are two exceptions are:
- optionally, the backends under `twbackends`:
- they are the only server-side elements of the tina distribution
- while part of the distribution, they are **standalone micro-servers**
- they contain their own readme as to how to run them on a server
- once they are configured or run, the communication between them and the main tinaweb client module happens via XHR requests: therefore they can actually reside in any convenient place for your deployment.
......
......@@ -54,19 +54,19 @@
<!-- CSS -->
<link rel="stylesheet" href="libs/css2/twjs.css">
<link rel="stylesheet" href="libs/css2/twjs-mobile.css">
<link rel="stylesheet" href="libs/css2/selection-panels.css">
<link rel="stylesheet" href="libs/css2/selection-panels-mobile.css">
<link rel="stylesheet" href="twlibs/css2/twjs.css">
<link rel="stylesheet" href="twlibs/css2/twjs-mobile.css">
<link rel="stylesheet" href="twlibs/css2/selection-panels.css">
<link rel="stylesheet" href="twlibs/css2/selection-panels-mobile.css">
<link rel="stylesheet" href="libs/jquery-3/jquery-ui-1.12.1/jquery-ui.min.css" media="screen">
<link rel="stylesheet" href="libs/bootstrap-3/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="twlibs/jquery-3/jquery-ui-1.12.1/jquery-ui.min.css" media="screen">
<link rel="stylesheet" href="twlibs/bootstrap-3/css/bootstrap.min.css" media="screen">
<!-- NB bs2/3 not used for main grid (graph + bars) but inside the bars -->
<link rel="stylesheet" href="libs/css2/freshslider.css" media="screen">
<link rel="stylesheet" href="twlibs/css2/freshslider.css" media="screen">
<link type="text/css" href="libs/tweets/tweet.light.ltr.css" rel="stylesheet"/>
<link type="text/css" href="libs/tweets/custom.css" rel="stylesheet"/>
<link type="text/css" href="libs/css2/user_form.css" rel="stylesheet"/>
<link type="text/css" href="twlibs/tweets/tweet.light.ltr.css" rel="stylesheet"/>
<link type="text/css" href="twlibs/tweets/custom.css" rel="stylesheet"/>
<link type="text/css" href="twlibs/css2/user_form.css" rel="stylesheet"/>
<!-- JS -->
<!-- <script src="script.js"></script> -->
......@@ -116,11 +116,11 @@
<li><a href="http://www.cnrs.fr" target="_blank"
class="navbar-higher"
title="CNRS">
<img src="libs/img2/logo_cnrs_transparent.gif" height="23"></a></li>
<img src="twlibs/img2/logo_cnrs_transparent.gif" height="23"></a></li>
<li><a href="http://iscpif.fr" target="_blank"
class="navbar-higher"
title="ISC-PIF">
<img src="libs/img2/logo_ISCPIF_small.svg" height="23"></a></li>
<img src="twlibs/img2/logo_ISCPIF_small.svg" height="23"></a></li>
</ul>
......@@ -160,7 +160,7 @@
<li><a href="https://communityexplorer.org"
class="navbar-higher"
title="Community Explorer">
<img src="libs/img2/logo.png"
<img src="twlibs/img2/logo.png"
style="width:60px; position:absolute; top:-60px; left:-75px; z-index:5; overflow:visible;">
</a></li>
......@@ -194,7 +194,7 @@
<li id="setcolorsMenu" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
Set Colors <img title="Set Colors" src="libs/img2/colors.png" width="20px"><span class="caret"></span>
Set Colors <img title="Set Colors" src="twlibs/img2/colors.png" width="20px"><span class="caret"></span>
</a>
<ul id="colorgraph-menu" class="dropdown-menu">
</ul>
......@@ -314,7 +314,7 @@
<!--
<li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomapADEME();">
<img title="World Map Distribution" width="34px" src="libs/img2/world.png"></img>
<img title="World Map Distribution" width="34px" src="twlibs/img2/world.png"></img>
</a>
</li>
-->
......@@ -322,13 +322,13 @@
<li>
<a href="#" id="snapicon" onclick="saveGraphIMG();" class="zoombarbuttons">
<img title="Take a photo!" style="width:30px" src="libs/img2/camera.png"></img>
<img title="Take a photo!" style="width:30px" src="twlibs/img2/camera.png"></img>
</a>
</li>
<li>
<a href="#savemodal" id="saveAs" class="zoombarbuttons" data-toggle="modal" data-target="#savemodal">
<img style="width:28px" title="Save As..." src="libs/img2/save.png"></img>
<img style="width:28px" title="Save As..." src="twlibs/img2/save.png"></img>
</a>
</li>
......@@ -348,21 +348,21 @@
<li>
<a href="#" id="lensButton" class="zoombarbuttons"
title="Center View">
<img src="libs/img2/target.png">
<img src="twlibs/img2/target.png">
</a>
</li>
<li>
<a href="#" id="layoutButton" class="zoombarbuttons"
title="Force Atlas Layout">
<img src="libs/img2/edges.png">
<img src="twlibs/img2/edges.png">
</a>
</li>
<li>
<a href="#" id="noverlapButton" class="zoombarbuttons"
title="Disperse Overlapping Nodes">
<img src="libs/img2/disperse.png">
<img src="twlibs/img2/disperse.png">
</a>
</li>
......@@ -371,7 +371,7 @@
<a href="#facet-options" id="facets" class="zoombarbuttons"
title="Facets coloring options"
data-toggle="modal" data-target="#facet-options">
<img src="libs/img2/facet_options.png"></img>
<img src="twlibs/img2/facet_options.png"></img>
</a>
</li>
......@@ -420,7 +420,7 @@
<!-- to reopen the panel -->
<div id="sideunfold">
<img title="Open sidepanel" src="libs/img2/unfold2.png"></img>
<img title="Open sidepanel" src="twlibs/img2/unfold2.png"></img>
</div>
</div>
......@@ -518,7 +518,7 @@
style="width:85%; ">
</a>
<a href="https://github.com/moma" target="_blank">
<img src="libs/img2/moma.png"
<img src="twlibs/img2/moma.png"
alt="Sciencemapping"
style="width:85%; ">
</a>
......@@ -529,7 +529,7 @@
<br><br>
<div id="sidefold">
<img title="Close sidepanel" src="libs/img2/fold2.png"></img>
<img title="Close sidepanel" src="twlibs/img2/fold2.png"></img>
</div>
</div>
<div id="hidden-elements">
......@@ -597,7 +597,7 @@
<div id="modalloader" class="modal fade">
<div id="loader" class="loader">
<img src="libs/img2/loader.gif"></img>
<img src="twlibs/img2/loader.gif"></img>
</div>
<div id="closeloader" data-dismiss="modal"></div>
</div>
......@@ -731,13 +731,13 @@
</div>
<!-- SCRIPTS -->
<script src="libs/jquery-3/jquery-3.2.0.min.js" type="text/javascript"></script>
<script src="libs/jquery-3/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<script src="libs/jquery-3/jquery.easytabs.js" type="text/javascript"></script>
<script src="libs/freshslider.1.0.js" type="text/javascript" ></script>
<script src="libs/readmore.js" type="text/javascript"></script>
<script src="libs/tweets/widgets.js" type="text/javascript" language="javascript"></script>
<script src="libs/bootstrap-native/bootstrap-native.min.js"></script>
<script src="twlibs/jquery-3/jquery-3.2.0.min.js" type="text/javascript"></script>
<script src="twlibs/jquery-3/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<script src="twlibs/jquery-3/jquery.easytabs.js" type="text/javascript"></script>
<script src="twlibs/freshslider.1.0.js" type="text/javascript" ></script>
<script src="twlibs/readmore.js" type="text/javascript"></script>
<script src="twlibs/tweets/widgets.js" type="text/javascript" language="javascript"></script>
<script src="twlibs/bootstrap-native/bootstrap-native.min.js"></script>
<script src="tinawebJS/globalUtils.js" type="text/javascript"></script>
......
......@@ -42,7 +42,7 @@ TW.conf = (function(TW){
TWConf.relatedDocsAPIS = {
// routes by corresponding type
"wosLocalDB": "LOCALDB",
"wosLocalDB": "twbackends/phpAPI",
"twitter": "http://127.0.0.1:5000/twitter_search"
}
......
......@@ -3,8 +3,11 @@
##### Provides an API for "topPapers" search queries in tinawebJS
These php files provide access to a CSV or sqlite database as an ajax endpoint for a "related documents" search in tinawebJS client.
Main use case is support for one-doc-by-row CSV files.
#### Prerequisites
You need any kind of php server support with php > 5.0.
......@@ -20,8 +23,9 @@ location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME /your/path/to/LOCALDB/$fastcgi_script_name;
# ---------------------
fastcgi_param SCRIPT_FILENAME
/your/path/to/twbackends/phpAPI/$fastcgi_script_name;
# --------------------------------
}
```
......@@ -36,11 +40,36 @@ sudo service php7.0-fpm restart
For legacy cortext-style databases, you'll also need sqlite:
```
sudo apt install sqlite3
sudo apt install sqlite3 php7.0-sqlite3
```
#### Usage
For a given graph source and database, you will need to **fill in the right settings in `db.json`** in order to associate the graph source file (eg gexf) with this related docs API.
£TODO explain after new specifications implemented
###### Configuration
To use the API for the "topPapers" embedded search in ProjectExplorer, the corresponding settings should be picked either:
- via the interface (side panel menu)
- or directly in settings_explorerjs.js:
```
TWConf.relatedDocsType = "wosLocalDB"
```
Finally, to match the correct DB with the correct graph file:
- both should reside in `data/yoursubdir`
- the appropriate source database information needs to appear in `db.json` in order to associate the graph source file (eg gexf) with this related docs API:
```json
"data/yoursubdir": {
"dbname":"your.sqlite.db",
"title":"yourDocumentTitlesTable",
"date":"yourDocumentPubDatesTable",
"abstract":"yourDocumentContentsTable",
"gexfs": {
"your.graph.gexf": {
"semantic": { "table":"yourTableWithTerms"},
"social": { "table":"yourTableWithSocialNodes"}
}
}
}
```
£TODO update after new specifications implemented
......@@ -4,16 +4,13 @@ ini_set('display_errors',1);
ini_set('display_startup_errors',1);
// error_reporting(-1);
// relative path to dirname "/line"
$project_root = "../";
// exemple call:
// http://blabla/LOCALDB/info_div.php?type=semantic&bi=0&query=[%22Monte%20Carlo%22]&gexf=%22line/AXA/RiskV2PageRank1000.gexf%22&index=ISItermsAxa_2015
include('parameters_details.php');
if ($_GET['dbtype'] == "sql") {
$base = new PDO("sqlite:".$project_root.$graphdb);
$base = new PDO("sqlite:".$mainpath.$graphdb);
include('default_div.php');
}
......@@ -51,7 +48,8 @@ else {
// indexing ----------------------------------------------------------------------
// must know about all (sem+soc) cols typed, even if each search doesn't need them
$csv_search_base = parse_and_index_csv($project_root.$graphdb,
// echodump("filename CSV", $mainpath.$graphdb);
$csv_search_base = parse_and_index_csv($mainpath.$graphdb,
$idxcolsbytype,
$csvsep, $csvquote);
// -------------------------------------------------------------------------------
......
......@@ -17,7 +17,10 @@ $gexf_db["data/gargistex/model_calibration.gexf"] = "data/gargistex/model_calibr
$gexf= str_replace('"','',$_GET["gexf"]);
$mainpath=dirname(getcwd())."/";
// default path to ProjectExplorer root
// (where data directory and db.json file reside)
$mainpath=dirname(getcwd())."/../";
$graphdb = $gexf_db[$gexf];
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment