diff --git a/oth/docs/install.memo b/oth/docs/install.memo index ff16029..2f0ba01 100644 --- a/oth/docs/install.memo +++ b/oth/docs/install.memo @@ -1,3 +1,10 @@ modificare ".build.conf" nella root del progetto per impostare i path modificare l path nello script di crontab in /oth/OSConfig - \ No newline at end of file + +su mongo se non funzionano i text index: +use admin +db.runCommand({ + setParameter: 1, + textSearchEnabled: 1 +}); + diff --git a/oth/docs/memo/notiziaCollection.txt b/oth/docs/memo/notiziaCollection.txt new file mode 100644 index 0000000..1ccebe8 --- /dev/null +++ b/oth/docs/memo/notiziaCollection.txt @@ -0,0 +1,10 @@ +{ + "titolo":"", + "sottotitolo":"", + "testo":"", + "isAnsa":false, + "about":{ + "author":"", + "date":"" + } +} \ No newline at end of file diff --git a/private/common/config.local.php b/private/common/config.local.php index fe6116b..d7e76af 100644 --- a/private/common/config.local.php +++ b/private/common/config.local.php @@ -12,7 +12,7 @@ Creation Date: 07/gen/2016 // $dbconn->password = "root"; $database = new stdClass(); $database->dbName = "fdn2"; -$database->connectionString = null; +$database->connectionString = "mongodb://10.0.0.2:27017"; $currentSystem = new stdClass(); $currentSystem->storageBaseDir = "/home/asdynamics/storage"; // Il path con storage ecc in cui mettere immagini, file temporanei ecc diff --git a/private/lib/dao/GenericDao.php b/private/lib/dao/GenericDao.php index 64c83c7..1ca81e3 100644 --- a/private/lib/dao/GenericDao.php +++ b/private/lib/dao/GenericDao.php @@ -19,9 +19,9 @@ class GenericDao{ $this->mongoObj = new MongoClient(); } else { - if (!preg_match("~^mongo[:][/][/]\w+[:]\w+$~",$connectionString)){ - throw new CoreException("Invalid connectionString parameter passed to 'GenericDao::__construct()' ('".print_r($connectionString,true)."')"); - } +// if (!preg_match("~^mongo[:][/][/]\w+[:].+$~",$connectionString)){ +// throw new CoreException("Invalid connectionString parameter passed to 'GenericDao::__construct()' ('".print_r($connectionString,true)."')"); +// } $this->mongoObj = new MongoClient($connectionString); } diff --git a/public/admin/tablesBackends/notiziaTableBackend.php b/public/admin/tablesBackends/notiziaTableBackend.php index ba3750f..4591b00 100644 --- a/public/admin/tablesBackends/notiziaTableBackend.php +++ b/public/admin/tablesBackends/notiziaTableBackend.php @@ -47,112 +47,6 @@ $exposedFields = array( $ret = DatatablesHelper::getResult($useModel, $permissionFlagRequired, $exposedFields); echo json_encode($ret); -// $ret = new stdClass(); -// $ret->draw = $_POST["draw"]; -// $ret->recordsTotal = 0; -// $ret->recordsFiltered = 0; -// $ret->data = array(); - -// if (AdminLoginManager::isLogged()){ -// $admin = AdminLoginManager::getLogged(); -// if ($admin->hasRole($permissionFlagRequired)){ -// $dao = GlobalVariables::get("dao"); -// $filter = array(); - -// $options = array('limit'=>$_POST["length"], 'skip'=>$_POST["start"]); -// if (sizeof($_POST["order"])>0){ -// foreach ($_POST["order"] as $details){ -// $key = $_POST["columns"][$details["column"]]["data"]; -// $options["sort"][$key] = strcasecmp($details["dir"], "asc")==0?1:-1; -// } -// } - -// $models = $dao->query($useModel, $filter, $options); - -// if (sizeof($models)>0){ -// foreach ($models as $model){ -// $result = new stdClass(); -// foreach ($exposedFields as $key=>$subfield){ -// if (is_array($subfield)){ -// $result->$key = new stdClass(); -// if (sizeof($subfield)>0){ -// foreach ($subfield as $field){ -// $result->$key->$field = $model->$key->$field; -// } -// } -// } -// else { -// $result->$key = $model->$key; -// } -// } -// $result->titolo = $model->titolo; -// $result->sottotitolo = $model->sottotitolo; -// $result->about = $model->about; - -// $ret->data[] = $result; -// } -// } -// $ret->recordsTotal = $dao->count($useModel); -// $ret->recordsFiltered = $dao->count($useModel,$filter); -// } -// } - -// echo json_encode($ret); - - - -die(); - -$table = 'datatables_demo'; - -// Table's primary key -$primaryKey = 'id'; - -// Array of database columns which should be read and sent back to DataTables. -// The `db` parameter represents the column name in the database, while the `dt` -// parameter represents the DataTables column identifier. In this case object -// parameter names -$columns = array( - array( 'db' => 'first_name', 'dt' => 'first_name' ), - array( 'db' => 'last_name', 'dt' => 'last_name' ), - array( 'db' => 'position', 'dt' => 'position' ), - array( 'db' => 'office', 'dt' => 'office' ), - array( - 'db' => 'start_date', - 'dt' => 'start_date', - 'formatter' => function( $d, $row ) { - return date( 'jS M y', strtotime($d)); - } -), -array( - 'db' => 'salary', - 'dt' => 'salary', - 'formatter' => function( $d, $row ) { - return '$'.number_format($d); - } -) -); - -// SQL server connection information -$sql_details = array( - 'user' => '', - 'pass' => '', - 'db' => '', - 'host' => '' -); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * If you just want to use the basic configuration for DataTables with PHP -* server-side, there is no need to edit below this line. -*/ - -require( 'ssp.class.php' ); - -echo json_encode( - SSP::simple( $_POST, $sql_details, $table, $primaryKey, $columns ) -); - ?> \ No newline at end of file