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: ...@@ -31,7 +31,9 @@ There are two exceptions are:
- optionally, the backends under `twbackends`: - optionally, the backends under `twbackends`:
- they are the only server-side elements of the tina distribution - 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 - 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 @@ ...@@ -54,19 +54,19 @@
<!-- CSS --> <!-- CSS -->
<link rel="stylesheet" href="libs/css2/twjs.css"> <link rel="stylesheet" href="twlibs/css2/twjs.css">
<link rel="stylesheet" href="libs/css2/twjs-mobile.css"> <link rel="stylesheet" href="twlibs/css2/twjs-mobile.css">
<link rel="stylesheet" href="libs/css2/selection-panels.css"> <link rel="stylesheet" href="twlibs/css2/selection-panels.css">
<link rel="stylesheet" href="libs/css2/selection-panels-mobile.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="twlibs/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/bootstrap-3/css/bootstrap.min.css" media="screen">
<!-- NB bs2/3 not used for main grid (graph + bars) but inside the bars --> <!-- 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="twlibs/tweets/tweet.light.ltr.css" rel="stylesheet"/>
<link type="text/css" href="libs/tweets/custom.css" rel="stylesheet"/> <link type="text/css" href="twlibs/tweets/custom.css" rel="stylesheet"/>
<link type="text/css" href="libs/css2/user_form.css" rel="stylesheet"/> <link type="text/css" href="twlibs/css2/user_form.css" rel="stylesheet"/>
<!-- JS --> <!-- JS -->
<!-- <script src="script.js"></script> --> <!-- <script src="script.js"></script> -->
...@@ -116,11 +116,11 @@ ...@@ -116,11 +116,11 @@
<li><a href="http://www.cnrs.fr" target="_blank" <li><a href="http://www.cnrs.fr" target="_blank"
class="navbar-higher" class="navbar-higher"
title="CNRS"> 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" <li><a href="http://iscpif.fr" target="_blank"
class="navbar-higher" class="navbar-higher"
title="ISC-PIF"> 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> </ul>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
<li><a href="https://communityexplorer.org" <li><a href="https://communityexplorer.org"
class="navbar-higher" class="navbar-higher"
title="Community Explorer"> 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;"> style="width:60px; position:absolute; top:-60px; left:-75px; z-index:5; overflow:visible;">
</a></li> </a></li>
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
<li id="setcolorsMenu" class="dropdown"> <li id="setcolorsMenu" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> <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> </a>
<ul id="colorgraph-menu" class="dropdown-menu"> <ul id="colorgraph-menu" class="dropdown-menu">
</ul> </ul>
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
<!-- <!--
<li> <li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomapADEME();"> <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> </a>
</li> </li>
--> -->
...@@ -322,13 +322,13 @@ ...@@ -322,13 +322,13 @@
<li> <li>
<a href="#" id="snapicon" onclick="saveGraphIMG();" class="zoombarbuttons"> <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> </a>
</li> </li>
<li> <li>
<a href="#savemodal" id="saveAs" class="zoombarbuttons" data-toggle="modal" data-target="#savemodal"> <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> </a>
</li> </li>
...@@ -348,21 +348,21 @@ ...@@ -348,21 +348,21 @@
<li> <li>
<a href="#" id="lensButton" class="zoombarbuttons" <a href="#" id="lensButton" class="zoombarbuttons"
title="Center View"> title="Center View">
<img src="libs/img2/target.png"> <img src="twlibs/img2/target.png">
</a> </a>
</li> </li>
<li> <li>
<a href="#" id="layoutButton" class="zoombarbuttons" <a href="#" id="layoutButton" class="zoombarbuttons"
title="Force Atlas Layout"> title="Force Atlas Layout">
<img src="libs/img2/edges.png"> <img src="twlibs/img2/edges.png">
</a> </a>
</li> </li>
<li> <li>
<a href="#" id="noverlapButton" class="zoombarbuttons" <a href="#" id="noverlapButton" class="zoombarbuttons"
title="Disperse Overlapping Nodes"> title="Disperse Overlapping Nodes">
<img src="libs/img2/disperse.png"> <img src="twlibs/img2/disperse.png">
</a> </a>
</li> </li>
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
<a href="#facet-options" id="facets" class="zoombarbuttons" <a href="#facet-options" id="facets" class="zoombarbuttons"
title="Facets coloring options" title="Facets coloring options"
data-toggle="modal" data-target="#facet-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> </a>
</li> </li>
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
<!-- to reopen the panel --> <!-- to reopen the panel -->
<div id="sideunfold"> <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>
</div> </div>
...@@ -518,7 +518,7 @@ ...@@ -518,7 +518,7 @@
style="width:85%; "> style="width:85%; ">
</a> </a>
<a href="https://github.com/moma" target="_blank"> <a href="https://github.com/moma" target="_blank">
<img src="libs/img2/moma.png" <img src="twlibs/img2/moma.png"
alt="Sciencemapping" alt="Sciencemapping"
style="width:85%; "> style="width:85%; ">
</a> </a>
...@@ -529,7 +529,7 @@ ...@@ -529,7 +529,7 @@
<br><br> <br><br>
<div id="sidefold"> <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> </div>
<div id="hidden-elements"> <div id="hidden-elements">
...@@ -597,7 +597,7 @@ ...@@ -597,7 +597,7 @@
<div id="modalloader" class="modal fade"> <div id="modalloader" class="modal fade">
<div id="loader" class="loader"> <div id="loader" class="loader">
<img src="libs/img2/loader.gif"></img> <img src="twlibs/img2/loader.gif"></img>
</div> </div>
<div id="closeloader" data-dismiss="modal"></div> <div id="closeloader" data-dismiss="modal"></div>
</div> </div>
...@@ -731,13 +731,13 @@ ...@@ -731,13 +731,13 @@
</div> </div>
<!-- SCRIPTS --> <!-- SCRIPTS -->
<script src="libs/jquery-3/jquery-3.2.0.min.js" type="text/javascript"></script> <script src="twlibs/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="twlibs/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="twlibs/jquery-3/jquery.easytabs.js" type="text/javascript"></script>
<script src="libs/freshslider.1.0.js" type="text/javascript" ></script> <script src="twlibs/freshslider.1.0.js" type="text/javascript" ></script>
<script src="libs/readmore.js" type="text/javascript"></script> <script src="twlibs/readmore.js" type="text/javascript"></script>
<script src="libs/tweets/widgets.js" type="text/javascript" language="javascript"></script> <script src="twlibs/tweets/widgets.js" type="text/javascript" language="javascript"></script>
<script src="libs/bootstrap-native/bootstrap-native.min.js"></script> <script src="twlibs/bootstrap-native/bootstrap-native.min.js"></script>
<script src="tinawebJS/globalUtils.js" type="text/javascript"></script> <script src="tinawebJS/globalUtils.js" type="text/javascript"></script>
......
...@@ -42,7 +42,7 @@ TW.conf = (function(TW){ ...@@ -42,7 +42,7 @@ TW.conf = (function(TW){
TWConf.relatedDocsAPIS = { TWConf.relatedDocsAPIS = {
// routes by corresponding type // routes by corresponding type
"wosLocalDB": "LOCALDB", "wosLocalDB": "twbackends/phpAPI",
"twitter": "http://127.0.0.1:5000/twitter_search" "twitter": "http://127.0.0.1:5000/twitter_search"
} }
......
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
##### Provides an API for "topPapers" search queries in tinawebJS ##### 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. Main use case is support for one-doc-by-row CSV files.
#### Prerequisites #### Prerequisites
You need any kind of php server support with php > 5.0. You need any kind of php server support with php > 5.0.
...@@ -20,8 +23,9 @@ location ~ \.php$ { ...@@ -20,8 +23,9 @@ location ~ \.php$ {
include snippets/fastcgi-php.conf; include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock; 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 ...@@ -36,11 +40,36 @@ sudo service php7.0-fpm restart
For legacy cortext-style databases, you'll also need sqlite: For legacy cortext-style databases, you'll also need sqlite:
``` ```
sudo apt install sqlite3 sudo apt install sqlite3 php7.0-sqlite3
``` ```
#### Usage #### 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); ...@@ -4,16 +4,13 @@ ini_set('display_errors',1);
ini_set('display_startup_errors',1); ini_set('display_startup_errors',1);
// error_reporting(-1); // error_reporting(-1);
// relative path to dirname "/line"
$project_root = "../";
// exemple call: // 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 // 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'); include('parameters_details.php');
if ($_GET['dbtype'] == "sql") { if ($_GET['dbtype'] == "sql") {
$base = new PDO("sqlite:".$project_root.$graphdb); $base = new PDO("sqlite:".$mainpath.$graphdb);
include('default_div.php'); include('default_div.php');
} }
...@@ -51,7 +48,8 @@ else { ...@@ -51,7 +48,8 @@ else {
// indexing ---------------------------------------------------------------------- // indexing ----------------------------------------------------------------------
// must know about all (sem+soc) cols typed, even if each search doesn't need them // 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, $idxcolsbytype,
$csvsep, $csvquote); $csvsep, $csvquote);
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
......
...@@ -17,7 +17,10 @@ $gexf_db["data/gargistex/model_calibration.gexf"] = "data/gargistex/model_calibr ...@@ -17,7 +17,10 @@ $gexf_db["data/gargistex/model_calibration.gexf"] = "data/gargistex/model_calibr
$gexf= str_replace('"','',$_GET["gexf"]); $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]; $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