Commit 3c8c102e authored by R2C-SYSTEM Administrator's avatar R2C-SYSTEM Administrator

Merge branch 'dev' into 'master'

Dev to Master for Remasco v1.0 publishing

See merge request OpenSource/remasco!1
parents be6d9f36 7a4d769f
/conf/config.php
This diff is collapsed.
# REMASCO Search
### REMASCO Search is a PHP / JavaScript Application to represent Web Search Results in clustered graphs.
![Screenshot](Images/Screenshot_REMASCO.png)
-----
Copyright (C) 2017 R2C-SYSTEM - [MyDataBall](http://www.mydataball.com)
Based on an idea of Stéphane CHAUVIN <stephane.chauvin@mydataball.com> and created at his request for MyDataBall - R2C-SYSTEM by
* Milad ARDEHALI <milad.ardehali@gmail.com>
* Ambroise ROUGIER <ambroise.rougier@mydataball.com>
* Bertrand FRUCHET <bertrand.fruchet@mydataball.com>
### Pre-requisites
Tested on GNU/Linux Debian 9.3.0-amd64 but may be installable on any Microsoft Windows or Linux Server
* DataBase : MySQL
* Server Language : PHP
* Language Libraries : libapache2-mod-php, php-curl, php-xml, php-mysql
* Client Language : AngularJS / Vis.js / Javascript (Chrome Latest)
* Clustering Server (see below)
* Carrot2 Document Clustering Server, Open-Source version, witch require Java Runtime Environment (JRE) version 1.7.0 or later.
* Any compatible clustering server based on Carrot2 XML / JSON results.
* MyDataball API Clustering Service, witch require an user license token.
For licenses compatibility informations: http://www.gnu.org/licenses/licenses.en.html
### Installation
* Install Java Runtime Environment (tested with OpenJDK 8u151-b12-1)
```
# apt install default-jre-headless
```
* Install Apache Web Server (tested with Apache 2.4.25)
```
# apt install apache2
```
* Install PHP and its dependencies (tested with PHP 7.0)
```
# apt install php libapache2-mod-php php-curl php-xml
```
* Install MariaDB and its dependencies (tested with MariaDB 10.1.26)
```
# apt install mariadb-server mariadb-client php-mysql phpmyadmin
```
* Unzip the remasco archive at the public root directory of the web server
```
# cd /var/www/
# unzip remasco.zip
```
* Create Remasco Database and create DBO User by replacing dbouser and dbopassword below
```
# mysql -u root -p
CREATE DATABASE remasco;
CREATE USER 'dbouser'@'localhost' IDENTIFIED BY 'dbopassword';
GRANT ALL PRIVILEGES ON remasco.* to 'dbouser'@'localhost';
FLUSH PRIVILEGES;
quit
```
* Update Remasco Database with script sql/remasco.sql
```
# mysql -p -u[dbouser] remasco < sql/remasco.sql
```
### Configuration
All the REMASCO Search parameters are store in `conf/config.php`. An example version of this file is provide as `conf/config.php.example` file.
* Make a copy of this file and rename it `conf/config.php`
* Adapt parameters to fit your needs, all parameters are documented
* Finaly, adapt your Apache configuration to point your default webroot directory to /var/www/remasco
### Open-Source Version
**REMASCO Search use the open-source version of Carrot2 clustering engine, developed by the Carrot2 Project**, Copyright (C) 2002-2017, Dawid Weiss, Stanisław Osiński. All rights reserved.
This package contains the open source version of the 3.15.1 version of [Carrot2 DCS Server](http://project.carrot2.org).
You can obtain the lastest binary code at [Carrot2.org](http://project.carrot2.org/download.html) or the source code at [GitHub](https://github.com/carrot2/carrot2).
The version provided here must be launch by hand on server.
If you want to launch Carrot2 DCS Server at startup, adapt to your need the debian init.d script `carrot2-dcs` provided in sub-directory `service`.
### Enhanced Version
REMASCO Search can also use **MyDataBall Search API** as Document Clustering Server.
MyDataBall Search API is based on the **Lingo3G clustering Server with more clusters, more depth and/or more results to be clustered**.
MyDataball - R2C-System DCS Server can only be used with a token provided by purchase of a license.
To enable and use MyDataBall Search API :
* Request an Access Token to MyDataBall Search API by e-mail to <contact@mydataball.com>.
* Modify your conf/config.php file
* In the `clustering_server` parameter, enter `search.mydataball.com`
* In the `dcs_token` parameter, enter token provided by mail by MyDataball - R2C-System
### User Administration
* To change the default admin/password credentials, use MySQL Command Line Interface
```
# mysql -p -u[dbouser] remasco
UPDATE `user` SET `password`=MD5("[newpassword in clear text]") WHERE `userName`="admin";
quit
```
* To add a new user, use MySQL Command Line Interface and replace words in brackets by the new user informations.
```
# mysql -p -u[dbouser] remasco
INSERT INTO `user` (`userName`, `lastName`, `firstName`, `e-mail`, `password`, `teacher`) VALUES ('[New_UserName]', '[New_LastName]', '[New_FirstName]', '[New_Email_Address]', MD5('[NewPassword]','1'));
```
* To delete a user, use MySQL Command Line Interface
```
# mysql -p -u[dbouser] remasco
DELETE FROM `user` WHERE `userName`="[UserName_to_delete]";
```
* If you prefer, install phpmyadmin and use it to mydify or create user accounts.
### Usage
* If you configure REMASCO Search to use local clustering server and if the Carrot2 DCS Server is not launched at startup, launch Carrot2 DCS Server with
```
# cd /var/www/remasco/carrot2-dcs-3.15.1
# ./dcs.sh
```
* Point your web browser to your webserver ip address
```
http://yourwebserver
```
* Enter in Remasco App with default login `'admin'` and default password `'admin'`.
For any questions, send an email to <contact@mydataball.com>
### License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
<style>
.ngdialog.ngdialog-theme-flat .ngdialog-content
{
border-radius: 0px;
-webkit-border-radius: 0px;
box-shadow: 0 0 3px 3px rgba(146, 141, 145, 0.75);
-webkit-box-shadow: 0 0 3px 3px rgba(146, 141, 145, 0.75);
width: 400px;
}
.select2-container .select2-choice .select2-arrow
{
}
</style>
<div style="padding-bottom: 10px;">
<br />
<div style="width: 100%; height: 30px; padding-top: 5px; background-color: #888; text-align: center; color: #fff; font-weight: bolder; font-size: 1.5em">
<span>Classer dans un thème</span>
</div>
<table style="margin: 15px;">
<tr>
<td style="font-weight:bold">Choisissez le thème : </td>
</tr>
<tr>
<td>
<select ui-select2="" data-ng-model="link.selectedTheme" style="width:360px;">
<option data-ng-repeat="theme in themes" value="{{theme.idTheme}}">{{theme.themeName}}</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input style="float: left" class="actionButton" type="button" value="Annuler" data-ng-click="cancelLink()" />
<input style="float: right" class="actionButton" type="button" value="Valider" data-ng-click="saveLink()" />
</td>
</tr>
</table>
</div>
<style>
.ngdialog.ngdialog-theme-flat .ngdialog-content
{
border-radius: 0px;
-webkit-border-radius: 0px;
box-shadow: 0 0 3px 3px rgba(146, 141, 145, 0.75);
-webkit-box-shadow: 0 0 3px 3px rgba(146, 141, 145, 0.75);
width: 300px;
}
</style>
<div style="padding-bottom: 10px;">
<br />
<div style="width: 100%; height: 30px; padding-top: 5px; background-color: #888; text-align: center; color: #fff; font-weight: bolder; font-size: 1.5em">
<span>Ajouter un thème</span>
</div>
<table style="margin: 15px;">
<tr>
<td style="font-weight:bold">Nom du thème :</td>
</tr>
<tr>
<td>
<input type="text" style="width:260px" data-ng-model="newTheme.themeName" />
</td>
</tr>
<tr>
<td colspan="2">
<input style="float: left" class="actionButton" type="button" value="Annuler" data-ng-click="cancelTheme()" />
<input style="float: right" class="actionButton" type="button" value="Valider" data-ng-click="saveTheme()" />
</td>
</tr>
</table>
</div>
This diff is collapsed.
(function () {
var dataBallModule = angular.module('dataBallApp');
// Function to decode string
String.prototype.decode = function(){
return decodeURIComponent(escape(this));
}
// Function to encode string
String.prototype.encode = function() {
return unescape(encodeURIComponent(this));
}
dataBallModule.service('dataBallService', ['dataService', function (dataService) {
this.search = function (query, callBack, errorCallback) {
dataService.post('search.php', { query: escape(query) }).then(function (data) {
var statut = $('#statut').attr('class');
if(statut == 'local') {
callBack(data);
}
if(statut == 'api') {
callBack(JSON.parse(data));
}
}).catch(function (err) {
errorCallback(err);
});
}
this.addHistory = function (history, callBack, errorCallback) {
dataService.post('addHistory.php', history).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.removeHistory = function (id, callBack, errorCallback) {
dataService.post('removeHistory.php', { idHistoric :id}).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.addTheme = function (theme, callBack, errorCallback) {
dataService.post('addTheme.php', theme).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.removeTheme = function (id, callBack, errorCallback) {
dataService.post('removeTheme.php', {idTheme: id}).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.addHistoricToTheme = function (historicId, themeId, callBack, errorCallback) {
dataService.post('addHistoricToTheme.php', {
idHistoric: historicId,
idTheme: themeId
}).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.removeHistoricFromTheme = function (historicId, themeId, callBack, errorCallback) {
dataService.post('removeHistoryFromTheme.php', {
idHistoric: historicId,
idTheme: themeId
}).then(function (data) {
callBack(data);
}).catch(function (err) {
errorCallback(err);
});
}
this.load = function (callBack, errorCallback) {
dataService.get('load.php').then(function (data) {
//callBack({
// themes: [{
// themeId: 1,
// themeName: 'Theme 1',
// historics: [{
// idHistoric: 1,
// query: 'office'
// }, {
// idHistoric: 2,
// query: 'macron'
// }]
// }, {
// themeId: 2,
// themeName: 'Theme 2',
// historics: [{
// idHistoric: 3,
// query: 'test'
// }, {
// idHistoric: 4,
// query: 'test2'
// }]
// }]
//});
callBack(data);
}).catch(function (err) {
//callBack({
// themes: [{
// themeName: 'Theme 1',
// historics: [{
// idHistoric: 1,
// query: 'office'
// }, {
// idHistoric: 2,
// query: 'macron'
// }]
// }, {
// themeName: 'Theme 2',
// historics: [{
// idHistoric: 3,
// query: 'test'
// }, {
// idHistoric: 4,
// query: 'test2'
// }]
// }]
//});
errorCallback(err);
});
}
}]);
})();
(function () {
var dataBallModule = angular.module('dataBallApp', ['ngDialog']);
dataBallModule.service('dataService', ['$q', '$http', function ($q, $http) {
this.get = function (url) {
var deferred = $q.defer();
$http.get(url).success(function (result) {
deferred.resolve(result);
}).error(function (err) {
deferred.reject(err);
});
return deferred.promise;
};
this.post = function (url, data) {
var ext = '?p=' + new Date().getTime();
var deferred = $q.defer();
$http.post(url + ext, data).success(function (result) {
deferred.resolve(result);
}).error(function (err) {
deferred.reject(err);
});
return deferred.promise;
};
}]);
dataBallModule.directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if (event.which === 13) {
scope.$apply(function () {
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
});
};
});
})();
This diff is collapsed.
(function () {
var dataBallModule = angular.module('dataBallApp');
dataBallModule.service('uiService', function () {
this.startLoading = function () {
var exist = $('.appLoading');
if (exist.length == 0) {
var elem = $('[data-ng-app]');
var box = '<div class="appLoading"><table><tr><td><img style="display:inline-block" src="_layouts/15/webparts/Styles/images/loading-24.gif"></td><td><b style="color:#ff9900;padding-left:5px;">لطفاً صبر کنید ...</b></td></tr></table></div>';
elem.append(box);
}
$('.appLoading').animate({
right: '10px'
}, 300);
};
this.endLoading = function () {
$('.appLoading').remove();
};
this.error = function (message) {
alertify.error(message);
};
this.success = function (message) {
alertify.success(message);
}
this.alert = function (message) {
alertify.alert(message);
}
this.confirm = function (message, callBack) {
alertify.confirm(message, function (e) {
if (e) {
callBack();
};
});
}
});
})();
\ No newline at end of file
(function () {
var dataBallModule = angular.module('dataBallApp');
dataBallModule.service('xmlService', function () {
this.getJsonFromXml = function (xml) {
var x2js = new X2JS();
return x2js.xml_str2json(xml);
}
this.getGroupChilds = function (group, orgDocs) {
var self = this;
var documents = group.document || [];
if (!Array.isArray(documents)) {
documents = [documents];
}
var groups = [];
if (group.group && group.group.length > 0) {
group.group.forEach(function (grp) {
groups.push(self.getGroupChilds(grp, orgDocs));
}, this);
}
return {
title: group.title.phrase,
id: group._id,
score: group._score ? parseFloat(group._score) : 0,
documents: documents,
groups: groups
}
}
this.getValidLinks = function (documents, groups) {
var self = this;
var validLinks = [];
documents.forEach(function (document) {
var parents = [];
self.findParents(document._id, groups, parents);
var maxScoreParent = _.maxBy(parents, function (pr) {
return pr.score;
});
if (maxScoreParent) {
validLinks.push({
docId: document._id,
groupId: maxScoreParent.id
});
}
});
return validLinks;
}
this.findParents = function (docId, groups, parents) {
var self = this;
groups.forEach(function (grp) {
if (self.groupIsParentOfDocument(docId, grp)) {
parents.push(grp);
}
if (grp.groups && grp.groups.length > 0) {
self.findParents(docId, grp.groups, parents);
}
});
}
this.groupIsParentOfDocument = function (docId, group) {
return _.find(group.documents, function (doc) {
return doc._refid === docId;
}) !== undefined;
}
this.setNodes = function (group, nodes, validLinks) {
var self = this;
var docCounts = _.filter(validLinks, function (vl) {
return vl.groupId === group.id;
}).length;
var grpCounts = group.groups.length;
var label = grpCounts > 0 ? grpCounts : docCounts;
if (label === 0) {
label = '';
}
var uiGroup = 'group';
if (label === '') {
uiGroup = 'disable';
}
var grpTitle = group.title;
if (grpTitle && grpTitle.length > 15) {
grpTitle = grpTitle.substr(0, 14) + '...';
}
if (label !== '') {
grpTitle += '\n(' + label + ')';
}
nodes.add({ id: "grp_" + group.id, label: grpTitle, group: uiGroup, title: group.title, shape: 'dot', size: 10 });
group.groups.forEach(function (grp) {
self.setNodes(grp, nodes, validLinks);
});
}
this.setEdges = function (group, edges, validLinks) {
var self = this;
group.groups.forEach(function (grp) {
edges.add({ from: 'grp_' + group.id, to: 'grp_' + grp.id });
self.setEdges(grp, edges, validLinks);
});
}
this.findGroupById = function (id, group) {
if (group.id == id) {
return [];
} else if (group.groups) {
var self = this;
for (var i = 0; i < group.groups.length; i++) {
var path = self.findGroupById(id, group.groups[i]);
if (path !== null) {
path.unshift(group.groups[i]);
return path;
}
}
}
return null;
}
});
})();
/*! alertify - v0.3.10 - 2013-07-06 */
!function(a,b){"use strict";var c,d=a.document;c=function(){var c,e,f,g,h,i,j,k,l,m,n,o,p={},q={},r=!1,s={ENTER:13,ESC:27,SPACE:32},t=[];return q={buttons:{holder:'<nav class="alertify-buttons">{{buttons}}</nav>',submit:'<button type="submit" class="alertify-button alertify-button-ok" id="alertify-ok">{{ok}}</button>',ok:'<button class="alertify-button alertify-button-ok" id="alertify-ok">{{ok}}</button>',cancel:'<button class="alertify-button alertify-button-cancel" id="alertify-cancel">{{cancel}}</button>'},input:'<div class="alertify-text-wrapper"><input type="text" class="alertify-text" id="alertify-text"></div>',message:'<p class="alertify-message">{{message}}</p>',log:'<article class="alertify-log{{class}}">{{message}}</article>'},o=function(){var a,c,e=!1,f=d.createElement("fakeelement"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"};for(a in g)if(f.style[a]!==b){c=g[a],e=!0;break}return{type:c,supported:e}},c=function(a){return d.getElementById(a)},p={labels:{ok:"OK",cancel:"Cancel"},delay:5e3,buttonReverse:!1,buttonFocus:"ok",transition:b,addListeners:function(a){var b,c,h,i,j,k="undefined"!=typeof f,l="undefined"!=typeof e,o="undefined"!=typeof n,p="",q=this;b=function(b){return"undefined"!=typeof b.preventDefault&&b.preventDefault(),h(b),"undefined"!=typeof n&&(p=n.value),"function"==typeof a&&("undefined"!=typeof n?a(!0,p):a(!0)),!1},c=function(b){return"undefined"!=typeof b.preventDefault&&b.preventDefault(),h(b),"function"==typeof a&&a(!1),!1},h=function(){q.hide(),q.unbind(d.body,"keyup",i),q.unbind(g,"focus",j),o&&q.unbind(m,"submit",b),k&&q.unbind(f,"click",b),l&&q.unbind(e,"click",c)},i=function(a){var d=a.keyCode;d!==s.SPACE||o||b(a),d===s.ESC&&l&&c(a)},j=function(){o?n.focus():!l||q.buttonReverse?f.focus():e.focus()},this.bind(g,"focus",j),k&&this.bind(f,"click",b),l&&this.bind(e,"click",c),this.bind(d.body,"keyup",i),o&&this.bind(m,"submit",b),this.transition.supported||this.setFocus()},bind:function(a,b,c){"function"==typeof a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},handleErrors:function(){if("undefined"!=typeof a.onerror){var b=this;return a.onerror=function(a,c,d){b.error("["+a+" on line "+d+" of "+c+"]",0)},!0}return!1},appendButtons:function(a,b){return this.buttonReverse?b+a:a+b},build:function(a){var b="",c=a.type,d=a.message,e=a.cssClass||"";switch(b+='<div class="alertify-dialog">',"none"===p.buttonFocus&&(b+='<a href="#" id="alertify-noneFocus" class="alertify-hidden"></a>'),"prompt"===c&&(b+='<form id="alertify-form">'),b+='<article class="alertify-inner">',b+=q.message.replace("{{message}}",d),"prompt"===c&&(b+=q.input),b+=q.buttons.holder,b+="</article>","prompt"===c&&(b+="</form>"),b+='<a id="alertify-resetFocus" class="alertify-resetFocus" href="#">Reset Focus</a>',b+="</div>",c){case"confirm":b=b.replace("{{buttons}}",this.appendButtons(q.buttons.cancel,q.buttons.ok)),b=b.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"prompt":b=b.replace("{{buttons}}",this.appendButtons(q.buttons.cancel,q.buttons.submit)),b=b.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"alert":b=b.replace("{{buttons}}",q.buttons.ok),b=b.replace("{{ok}}",this.labels.ok)}return k.className="alertify alertify-"+c+" "+e,j.className="alertify-cover",b},close:function(a,b){var c,d,e=b&&!isNaN(b)?+b:this.delay,f=this;this.bind(a,"click",function(){c(a)}),d=function(a){a.stopPropagation(),f.unbind(this,f.transition.type,d),l.removeChild(this),l.hasChildNodes()||(l.className+=" alertify-logs-hidden")},c=function(a){"undefined"!=typeof a&&a.parentNode===l&&(f.transition.supported?(f.bind(a,f.transition.type,d),a.className+=" alertify-log-hide"):(l.removeChild(a),l.hasChildNodes()||(l.className+=" alertify-logs-hidden")))},0!==b&&setTimeout(function(){c(a)},e)},dialog:function(a,b,c,e,f){i=d.activeElement;var g=function(){l&&null!==l.scrollTop&&j&&null!==j.scrollTop||g()};if("string"!=typeof a)throw new Error("message must be a string");if("string"!=typeof b)throw new Error("type must be a string");if("undefined"!=typeof c&&"function"!=typeof c)throw new Error("fn must be a function");return"function"==typeof this.init&&(this.init(),g()),t.push({type:b,message:a,callback:c,placeholder:e,cssClass:f}),r||this.setup(),this},extend:function(a){if("string"!=typeof a)throw new Error("extend method must have exactly one paramter");return function(b,c){return this.log(b,a,c),this}},hide:function(){var a,b=this;t.splice(0,1),t.length>0?this.setup(!0):(r=!1,a=function(c){c.stopPropagation(),k.className+=" alertify-isHidden",b.unbind(k,b.transition.type,a)},this.transition.supported?(this.bind(k,this.transition.type,a),k.className="alertify alertify-hide alertify-hidden"):k.className="alertify alertify-hide alertify-hidden alertify-isHidden",j.className="alertify-cover alertify-cover-hidden",i.focus())},init:function(){d.createElement("nav"),d.createElement("article"),d.createElement("section"),j=d.createElement("div"),j.setAttribute("id","alertify-cover"),j.className="alertify-cover alertify-cover-hidden",d.body.appendChild(j),k=d.createElement("section"),k.setAttribute("id","alertify"),k.className="alertify alertify-hidden",d.body.appendChild(k),l=d.createElement("section"),l.setAttribute("id","alertify-logs"),l.className="alertify-logs alertify-logs-hidden",d.body.appendChild(l),d.body.setAttribute("tabindex","0"),this.transition=o(),delete this.init},log:function(a,b,c){var d=function(){l&&null!==l.scrollTop||d()};return"function"==typeof this.init&&(this.init(),d()),l.className="alertify-logs",this.notify(a,b,c),this},notify:function(a,b,c){var e=d.createElement("article");e.className="alertify-log"+("string"==typeof b&&""!==b?" alertify-log-"+b:""),e.innerHTML=a,l.appendChild(e),setTimeout(function(){e.className=e.className+" alertify-log-show"},50),this.close(e,c)},set:function(a){var b;if("object"!=typeof a&&a instanceof Array)throw new Error("args must be an object");for(b in a)a.hasOwnProperty(b)&&(this[b]=a[b])},setFocus:function(){n?(n.focus(),n.select()):h.focus()},setup:function(a){var d,i=t[0],j=this;r=!0,d=function(a){a.stopPropagation(),j.setFocus(),j.unbind(k,j.transition.type,d)},this.transition.supported&&!a&&this.bind(k,this.transition.type,d),k.innerHTML=this.build(i),g=c("alertify-resetFocus"),f=c("alertify-ok")||b,e=c("alertify-cancel")||b,h="cancel"===p.buttonFocus?e:"none"===p.buttonFocus?c("alertify-noneFocus"):f,n=c("alertify-text")||b,m=c("alertify-form")||b,"string"==typeof i.placeholder&&""!==i.placeholder&&(n.value=i.placeholder),a&&this.setFocus(),this.addListeners(i.callback)},unbind:function(a,b,c){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)}},{alert:function(a,b,c){return p.dialog(a,"alert",b,"",c),this},confirm:function(a,b,c){return p.dialog(a,"confirm",b,"",c),this},extend:p.extend,init:p.init,log:function(a,b,c){return p.log(a,b,c),this},prompt:function(a,b,c,d){return p.dialog(a,"prompt",b,c,d),this},success:function(a,b){return p.log(a,"success",b),this},error:function(a,b){return p.log(a,"error",b),this},set:function(a){p.set(a)},labels:p.labels,debug:p.handleErrors}},"function"==typeof define?define([],function(){return new c}):"undefined"==typeof a.alertify&&(a.alertify=new c)}(this);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
/*! ng-dialog - v0.3.11 (https://github.com/likeastore/ngDialog) */
!function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("angular")):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b,c=a.module("ngDialog",[]),d=a.element,e=a.isDefined,f=(document.body||document.documentElement).style,g=e(f.animation)||e(f.WebkitAnimation)||e(f.MozAnimation)||e(f.MsAnimation)||e(f.OAnimation),h="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",i=!1;return c.provider("ngDialog",function(){var c=this.defaults={className:"ngdialog-theme-default",plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0};this.setForceBodyReload=function(a){i=a||!1},this.setDefaults=function(b){a.extend(c,b)};var e,f=0,j=0,k={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller",function(l,m,n,o,p,q,r,s,t){var u=l.find("body");i&&q.$on("$locationChangeSuccess",function(){u=l.find("body")});var v={onDocumentKeydown:function(a){27===a.keyCode&&w.close("$escape")},setBodyPadding:function(a){var b=parseInt(u.css("padding-right")||0,10);u.css("padding-right",b+a+"px"),u.data("ng-dialog-original-padding",b)},resetBodyPadding:function(){var a=u.data("ng-dialog-original-padding");a?u.css("padding-right",a+"px"):u.css("padding-right","")},performCloseDialog:function(a,c){var d=a.attr("id");if("undefined"!=typeof s.Hammer){var f=b.hammerTime;f.off("tap",e),f.destroy&&f.destroy(),delete b.hammerTime}else a.unbind("click");1===j&&u.unbind("keydown"),a.hasClass("ngdialog-closing")||(j-=1),q.$broadcast("ngDialog.closing",a),j=0>j?0:j,g?(b.$destroy(),a.unbind(h).bind(h,function(){a.remove(),0===j&&(u.removeClass("ngdialog-open"),v.resetBodyPadding()),q.$broadcast("ngDialog.closed",a)}).addClass("ngdialog-closing")):(b.$destroy(),a.remove(),0===j&&(u.removeClass("ngdialog-open"),v.resetBodyPadding()),q.$broadcast("ngDialog.closed",a)),k[d]&&(k[d].resolve({id:d,value:c,$dialog:a,remainingDialogs:j}),delete k[d])},closeDialog:function(b,c){var d=b.data("$ngDialogPreCloseCallback");if(d&&a.isFunction(d)){var e=d.call(b,c);a.isObject(e)?e.closePromise?e.closePromise.then(function(){v.performCloseDialog(b,c)}):e.then(function(){v.performCloseDialog(b,c)},function(){}):e&&v.performCloseDialog(b,c)}else v.performCloseDialog(b,c)}},w={open:function(g){function h(a,b){return p.get(a,b||{}).then(function(a){return a.data||""})}function i(b){return b?a.isString(b)&&x.plain?b:"boolean"!=typeof x.cache||x.cache?m.get(b)||h(b,{cache:!0}):h(b,{cache:!1}):"Empty template"}var l=this,x=a.copy(c);g=g||{},a.extend(x,g),f+=1,l.latestID="ngdialog"+f;var y;k[l.latestID]=y=o.defer(),b=a.isObject(x.scope)?x.scope.$new():q.$new();var z,A;return o.when(i(x.template||x.templateUrl)).then(function(c){if(m.put(x.template||x.templateUrl,c),x.showClose&&(c+='<div class="ngdialog-close"></div>'),l.$result=z=d('<div id="ngdialog'+f+'" class="ngdialog"></div>'),z.html(x.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content">'+c+"</div>":'<div class="ngdialog-content">'+c+"</div>"),x.data&&a.isString(x.data)){var g=x.data.replace(/^\s*/,"")[0];b.ngDialogData="{"===g||"["===g?a.fromJson(x.data):x.data}else x.data&&a.isObject(x.data)&&(b.ngDialogData=x.data);if(x.controller&&(a.isString(x.controller)||a.isArray(x.controller)||a.isFunction(x.controller))){var h=t(x.controller,{$scope:b,$element:z});z.data("$ngDialogControllerController",h)}if(x.className&&z.addClass(x.className),A=x.appendTo&&a.isString(x.appendTo)?a.element(document.querySelector(x.appendTo)):u,x.preCloseCallback){var i;a.isFunction(x.preCloseCallback)?i=x.preCloseCallback:a.isString(x.preCloseCallback)&&b&&(a.isFunction(b[x.preCloseCallback])?i=b[x.preCloseCallback]:b.$parent&&a.isFunction(b.$parent[x.preCloseCallback])?i=b.$parent[x.preCloseCallback]:q&&a.isFunction(q[x.preCloseCallback])&&(i=q[x.preCloseCallback])),i&&z.data("$ngDialogPreCloseCallback",i)}if(b.closeThisDialog=function(a){v.closeDialog(z,a)},r(function(){n(z)(b);var a=s.innerWidth-u.prop("clientWidth");u.addClass("ngdialog-open");var c=a-(s.innerWidth-u.prop("clientWidth"));c>0&&v.setBodyPadding(c),A.append(z),x.name?q.$broadcast("ngDialog.opened",{dialog:z,name:x.name}):q.$broadcast("ngDialog.opened",z)}),x.closeByEscape&&u.bind("keydown",v.onDocumentKeydown),x.closeByNavigation&&q.$on("$locationChangeSuccess",function(){v.closeDialog(z)}),e=function(a){var b=x.closeByDocument?d(a.target).hasClass("ngdialog-overlay"):!1,c=d(a.target).hasClass("ngdialog-close");(b||c)&&w.close(z.attr("id"),c?"$closeButton":"$document")},"undefined"!=typeof s.Hammer){var k=b.hammerTime=s.Hammer(z[0]);k.on("tap",e)}else z.bind("click",e);return j+=1,w}),{id:"ngdialog"+f,closePromise:y.promise,close:function(a){v.closeDialog(z,a)}}},openConfirm:function(b){var c=o.defer(),e={closeByEscape:!1,closeByDocument:!1};a.extend(e,b),e.scope=a.isObject(e.scope)?e.scope.$new():q.$new(),e.scope.confirm=function(a){c.resolve(a);var b=d(document.getElementById(f.id));v.performCloseDialog(b,a)};var f=w.open(e);return f.closePromise.then(function(a){return a?c.reject(a.value):c.reject()}),c.promise},close:function(a,b){var c=d(document.getElementById(a));return c.length?v.closeDialog(c,b):w.closeAll(b),w},closeAll:function(b){var c=document.querySelectorAll(".ngdialog");a.forEach(c,function(a){v.closeDialog(d(a),b)})},getDefaults:function(){return c}};return w}]}),c.directive("ngDialog",["ngDialog",function(b){return{restrict:"A",scope:{ngDialogScope:"="},link:function(c,d,e){d.on("click",function(d){d.preventDefault();var f=a.isDefined(c.ngDialogScope)?c.ngDialogScope:"noScope";a.isDefined(e.ngDialogClosePrevious)&&b.close(e.ngDialogClosePrevious);var g=b.getDefaults();b.open({template:e.ngDialog,className:e.ngDialogClass||g.className,controller:e.ngDialogController,scope:f,data:e.ngDialogData,showClose:"false"===e.ngDialogShowClose?!1:"true"===e.ngDialogShowClose?!0:g.showClose,closeByDocument:"false"===e.ngDialogCloseByDocument?!1:"true"===e.ngDialogCloseByDocument?!0:g.closeByDocument,closeByEscape:"false"===e.ngDialogCloseByEscape?!1:"true"===e.ngDialogCloseByEscape?!0:g.closeByEscape,preCloseCallback:e.ngDialogPreCloseCallback||g.preCloseCallback})})}}}]),c});
\ No newline at end of file
This diff is collapsed.
(function(a,b){if(typeof define==="function"&&define.amd){define([],b);}else{if(typeof exports==="object"){module.exports=b();}else{a.X2JS=b();}}}(this,function(){return function(z){var t="1.2.0";z=z||{};i();u();function i(){if(z.escapeMode===undefined){z.escapeMode=true;}z.attributePrefix=z.attributePrefix||"_";z.arrayAccessForm=z.arrayAccessForm||"none";z.emptyNodeForm=z.emptyNodeForm||"text";if(z.enableToStringFunc===undefined){z.enableToStringFunc=true;}z.arrayAccessFormPaths=z.arrayAccessFormPaths||[];if(z.skipEmptyTextNodesForObj===undefined){z.skipEmptyTextNodesForObj=true;}if(z.stripWhitespaces===undefined){z.stripWhitespaces=true;}z.datetimeAccessFormPaths=z.datetimeAccessFormPaths||[];if(z.useDoubleQuotes===undefined){z.useDoubleQuotes=false;}z.xmlElementsFilter=z.xmlElementsFilter||[];z.jsonPropertiesFilter=z.jsonPropertiesFilter||[];if(z.keepCData===undefined){z.keepCData=false;}}var h={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function u(){}function x(B){var C=B.localName;if(C==null){C=B.baseName;}if(C==null||C==""){C=B.nodeName;}return C;}function r(B){return B.prefix;}function s(B){if(typeof(B)=="string"){return B.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");}else{return B;}}function k(B){return B.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&");}function w(C,F,D,E){var B=0;for(;B<C.length;B++){var G=C[B];if(typeof G==="string"){if(G==E){break;}}else{if(G instanceof RegExp){if(G.test(E)){break;}}else{if(typeof G==="function"){if(G(F,D,E)){break;}}}}}return B!=C.length;}function n(D,B,C){switch(z.arrayAccessForm){case"property":if(!(D[B] instanceof Array)){D[B+"_asArray"]=[D[B]];}else{D[B+"_asArray"]=D[B];}break;}if(!(D[B] instanceof Array)&&z.arrayAccessFormPaths.length>0){if(w(z.arrayAccessFormPaths,D,B,C)){D[B]=[D[B]];}}}function a(G){var E=G.split(/[-T:+Z]/g);var F=new Date(E[0],E[1]-1,E[2]);var D=E[5].split(".");F.setHours(E[3],E[4],D[0]);if(D.length>1){F.setMilliseconds(D[1]);}if(E[6]&&E[7]){var C=E[6]*60+Number(E[7]);var B=/\d\d-\d\d:\d\d$/.test(G)?"-":"+";C=0+(B=="-"?-1*C:C);F.setMinutes(F.getMinutes()-C-F.getTimezoneOffset());}else{if(G.indexOf("Z",G.length-1)!==-1){F=new Date(Date.UTC(F.getFullYear(),F.getMonth(),F.getDate(),F.getHours(),F.getMinutes(),F.getSeconds(),F.getMilliseconds()));}}return F;}function q(D,B,C){if(z.datetimeAccessFormPaths.length>0){var E=C.split(".#")[0];if(w(z.datetimeAccessFormPaths,D,B,E)){return a(D);}else{return D;}}else{return D;}}function b(E,C,B,D){if(C==h.ELEMENT_NODE&&z.xmlElementsFilter.length>0){return w(z.xmlElementsFilter,E,B,D);}else{return true;}}function A(D,J){if(D.nodeType==h.DOCUMENT_NODE){var K=new Object;var B=D.childNodes;for(var L=0;L<B.length;L++){var C=B.item(L);if(C.nodeType==h.ELEMENT_NODE){var I=x(C);K[I]=A(C,I);}}return K;}else{if(D.nodeType==h.ELEMENT_NODE){var K=new Object;K.__cnt=0;var B=D.childNodes;for(var L=0;L<B.length;L++){var C=B.item(L);var I=x(C);if(C.nodeType!=h.COMMENT_NODE){var H=J+"."+I;if(b(K,C.nodeType,I,H)){K.__cnt++;if(K[I]==null){K[I]=A(C,H);n(K,I,H);}else{if(K[I]!=null){if(!(K[I] instanceof Array)){K[I]=[K[I]];n(K,I,H);}}(K[I])[K[I].length]=A(C,H);}}}}for(var E=0;E<D.attributes.length;E++){var F=D.attributes.item(E);K.__cnt++;K[z.attributePrefix+F.name]=F.value;}var G=r(D);if(G!=null&&G!=""){K.__cnt++;K.__prefix=G;}if(K["#text"]!=null){K.__text=K["#text"];if(K.__text instanceof Array){K.__text=K.__text.join("\n");}if(z.stripWhitespaces){K.__text=K.__text.trim();}delete K["#text"];if(z.arrayAccessForm=="property"){delete K["#text_asArray"];}K.__text=q(K.__text,I,J+"."+I);}if(K["#cdata-section"]!=null){K.__cdata=K["#cdata-section"];delete K["#cdata-section"];if(z.arrayAccessForm=="property"){delete K["#cdata-section_asArray"];}}if(K.__cnt==0&&z.emptyNodeForm=="text"){K="";}else{if(K.__cnt==1&&K.__text!=null){K=K.__text;}else{if(K.__cnt==1&&K.__cdata!=null&&!z.keepCData){K=K.__cdata;}else{if(K.__cnt>1&&K.__text!=null&&z.skipEmptyTextNodesForObj){if((z.stripWhitespaces&&K.__text=="")||(K.__text.trim()=="")){delete K.__text;}}}}}delete K.__cnt;if(z.enableToStringFunc&&(K.__text!=null||K.__cdata!=null)){K.toString=function(){return(this.__text!=null?this.__text:"")+(this.__cdata!=null?this.__cdata:"");};}return K;}else{if(D.nodeType==h.TEXT_NODE||D.nodeType==h.CDATA_SECTION_NODE){return D.nodeValue;}}}}function o(I,F,H,C){var E="<"+((I!=null&&I.__prefix!=null)?(I.__prefix+":"):"")+F;if(H!=null){for(var G=0;G<H.length;G++){var D=H[G];var B=I[D];if(z.escapeMode){B=s(B);}E+=" "+D.substr(z.attributePrefix.length)+"=";if(z.useDoubleQuotes){E+='"'+B+'"';}else{E+="'"+B+"'";}}}if(!C){E+=">";}else{E+="/>";}return E;}function j(C,B){return"</"+(C.__prefix!=null?(C.__prefix+":"):"")+B+">";}function v(C,B){return C.indexOf(B,C.length-B.length)!==-1;}function y(C,B){if((z.arrayAccessForm=="property"&&v(B.toString(),("_asArray")))||B.toString().indexOf(z.attributePrefix)==0||B.toString().indexOf("__")==0||(C[B] instanceof Function)){return true;}else{return false;}}function m(D){var C=0;if(D instanceof Object){for(var B in D){if(y(D,B)){continue;}C++;}}return C;}function l(D,B,C){return z.jsonPropertiesFilter.length==0||C==""||w(z.jsonPropertiesFilter,D,B,C);}function c(D){var C=[];if(D instanceof Object){for(var B in D){if(B.toString().indexOf("__")==-1&&B.toString().indexOf(z.attributePrefix)==0){C.push(B);}}}return C;}function g(C){var B="";if(C.__cdata!=null){B+="<![CDATA["+C.__cdata+"]]>";}if(C.__text!=null){if(z.escapeMode){B+=s(C.__text);}else{B+=C.__text;}}return B;}function d(C){var B="";if(C instanceof Object){B+=g(C);}else{if(C!=null){if(z.escapeMode){B+=s(C);}else{B+=C;}}}return B;}function p(C,B){if(C===""){return B;}else{return C+"."+B;}}function f(D,G,F,E){var B="";if(D.length==0){B+=o(D,G,F,true);}else{for(var C=0;C<D.length;C++){B+=o(D[C],G,c(D[C]),false);B+=e(D[C],p(E,G));B+=j(D[C],G);}}return B;}function e(I,H){var B="";var F=m(I);if(F>0){for(var E in I){if(y(I,E)||(H!=""&&!l(I,E,p(H,E)))){continue;}var D=I[E];var G=c(D);if(D==null||D==undefined){B+=o(D,E,G,true);}else{if(D instanceof Object){if(D instanceof Array){B+=f(D,E,G,H);}else{if(D instanceof Date){B+=o(D,E,G,false);B+=D.toISOString();B+=j(D,E);}else{var C=m(D);if(C>0||D.__text!=null||D.__cdata!=null){B+=o(D,E,G,false);B+=e(D,p(H,E));B+=j(D,E);}else{B+=o(D,E,G,true);}}}}else{B+=o(D,E,G,false);B+=d(D);B+=j(D,E);}}}}B+=d(I);return B;}this.parseXmlString=function(D){var F=window.ActiveXObject||"ActiveXObject" in window;if(D===undefined){return null;}var E;if(window.DOMParser){var G=new window.DOMParser();var B=null;if(!F){try{B=G.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI;}catch(C){B=null;}}try{E=G.parseFromString(D,"text/xml");if(B!=null&&E.getElementsByTagNameNS(B,"parsererror").length>0){E=null;}}catch(C){E=null;}}else{if(D.indexOf("<?")==0){D=D.substr(D.indexOf("?>")+2);}E=new ActiveXObject("Microsoft.XMLDOM");E.async="false";E.loadXML(D);}return E;};this.asArray=function(B){if(B===undefined||B==null){return[];}else{if(B instanceof Array){return B;}else{return[B];}}};this.toXmlDateTime=function(B){if(B instanceof Date){return B.toISOString();}else{if(typeof(B)==="number"){return new Date(B).toISOString();}else{return null;}}};this.asDateTime=function(B){if(typeof(B)=="string"){return a(B);}else{return B;}};this.xml2json=function(B){return A(B);};this.xml_str2json=function(B){var C=this.parseXmlString(B);if(C!=null){return this.xml2json(C);}else{return null;}};this.json2xml_str=function(B){return e(B,"");};this.json2xml=function(C){var B=this.json2xml_str(C);return this.parseXmlString(B);};this.getVersion=function(){return t;};};}));
\ No newline at end of file
.alertify,
.alertify-show,
.alertify-log {
-webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
-moz-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
-ms-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
-o-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); /* easeOutBack */
}
.alertify-hide {
-webkit-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-moz-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-ms-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-o-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */
}
.alertify-log-hide {
-webkit-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-moz-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-ms-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
-o-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */
}
.alertify-cover {
position: fixed; z-index: 99999;
top: 0; right: 0; bottom: 0; left: 0;
background-color:white;
filter:alpha(opacity=0);
opacity:0;
}
.alertify-cover-hidden {
display: none;
}
.alertify {
position: fixed; z-index: 99999;
top: 50px; left: 50%;
width: 550px;
margin-left: -275px;
opacity: 1;
}
.alertify-hidden {
-webkit-transform: translate(0,-150px);
-moz-transform: translate(0,-150px);
-ms-transform: translate(0,-150px);
-o-transform: translate(0,-150px);
transform: translate(0,-150px);
opacity: 0;
display: none;
}
/* overwrite display: none; for everything except IE6-8 */
:root *> .alertify-hidden {
display: block;
visibility: hidden;
}
.alertify-logs {
position: fixed;
z-index: 50000;
bottom: 10px;
right: 10px;
width: 300px;
}
.alertify-logs-hidden {
display: none;
}
.alertify-log {
display: block;
margin-top: 10px;
position: relative;
right: -300px;
opacity: 0;
}
.alertify-log-show {
right: 0;
opacity: 1;
}
.alertify-log-hide {
-webkit-transform: translate(300px, 0);
-moz-transform: translate(300px, 0);
-ms-transform: translate(300px, 0);
-o-transform: translate(300px, 0);
transform: translate(300px, 0);
opacity: 0;
}
.alertify-dialog {
padding: 25px;
}
.alertify-resetFocus {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.alertify-inner {
text-align: center;
}
.alertify-text {
margin-bottom: 15px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
font-size: 100%;
}
.alertify-buttons {
direction:ltr;
}
.alertify-button,
.alertify-button:hover,
.alertify-button:active,
.alertify-button:visited {
background: none;
text-decoration: none;
border: none;
/* line-height and font-size for input button */
line-height: 1.5;
font-size: 100%;
display: inline-block;
cursor: pointer;
margin-left: 5px;
}
.alertify-isHidden {
display: none;
}
@media only screen and (max-width: 680px) {
.alertify,
.alertify-logs {
width: 90%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.alertify {
left: 5%;
margin: 0;
}
}
/**
* Default Look and Feel
*/
.alertify,
.alertify-log {
font-family: Tahoma;
font-size:12px;
}
.alertify {
background: #FFF;
border: 10px solid #333; /* browsers that don't support rgba */
border: 10px solid rgba(0,0,0,.7);
border-radius: 8px;
box-shadow: 0 3px 3px rgba(0,0,0,.3);
-webkit-background-clip: padding; /* Safari 4? Chrome 6? */
-moz-background-clip: padding; /* Firefox 3.6 */
background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */
}
.alertify-text {
border: 1px solid #CCC;
padding: 10px;
border-radius: 4px;
}
.alertify-button {
border-radius: 4px;
color: #FFF;
font-weight: bold;
padding: 6px 15px;
text-decoration: none;
text-shadow: 1px 1px 0 rgba(0,0,0,.5);
box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5);
background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
}
.alertify-button:hover,
.alertify-button:focus {
outline: none;
background-image: -webkit-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
background-image: -moz-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
background-image: -ms-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
background-image: -o-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
background-image: linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
}
.alertify-button:focus {
box-shadow: 0 0 15px #2B72D5;
}
.alertify-button:active {
position: relative;
box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
}
.alertify-button-cancel,
.alertify-button-cancel:hover,
.alertify-button-cancel:focus {
background-color: #FE1A00;
border: 1px solid #D83526;
}
.alertify-button-ok,
.alertify-button-ok:hover,
.alertify-button-ok:focus {
background-color: #5CB811;
border: 1px solid #3B7808;
}
.alertify-log {
background: #1F1F1F;
background: rgba(0,0,0,.9);
padding: 15px;
border-radius: 4px;
color: #FFF;
text-shadow: -1px -1px 0 rgba(0,0,0,.5);
}
.alertify-log-warning {
background: #E2B616;
background: rgba(226,182,22,.9);
}
.alertify-log-error {
background: #FE1A00;
background: rgba(254,26,0,.9);
}
.alertify-log-success {
background: #5CB811;
background: rgba(92,184,17,.9);
}
html, body
{
height: calc(100% - 12px);
margin: 5px;
font-family: sans-serif;
}
.container
{
position: relative;
width: 100%;
height: 100%;
}
.leftPanel
{
position: absolute;
left: 5px;
width: 248px;
height: calc(100% - 2px);
border: 1px solid #ddd;
background-color: #efefef;
}
.midPanel
{
position: absolute;
left: 255px;
/* width: calc(100% - 420px); */
width: calc(100% - 520px);
height: 100%;
margin: 0 5px;
}
.rightPanel
{
position: absolute;
right: 5px;
/* width: 198px; */
width: 248px;
height: calc(100% - 2px);
border: 1px solid #ddd;
background-color: #efefef;
}
.midContainer
{
position: relative;
width: 100%;
height: 100%;
}
.queryBox
{
position: relative;
top: 0px;
margin: 0 5px 5px 5px;
width: calc(100% - 10px);
height: 45px;
border: 1px solid #ddd;
}
.queryBox input
{
width: calc(100% - 64px);
border: none;
height: 40px;
font-size: 24px;
margin-top: 2px;
padding-left: 10px;
color: #666;
outline: none;
}
.queryBox img
{
position: absolute;
right: 10px;
top: 7px;
width: 32px;
height: 32px;
opacity: 0.5;
cursor: pointer;
}
.queryBox img:hover
{
opacity: 0.8;
}
.detailHeader
{
text-align: center;
padding-top: 9px;
font-size: 23px;
color: #666;
font-weight: bold;
border-bottom: 1px solid #ccc;
height: 36px;
background-color: #666;
color: #fff;
}
.detailContainer
{
padding: 2px;
overflow-y: auto;
height: calc(100% - 52px);
}
.detailContainer table
{
font-size: 0.8em;
}
.detailContainer table tr:nth-child(2n+1)
{
font-weight: bold;
}
.detailContainer table tr:nth-child(2n+2) td
{
padding-bottom: 5px;
}
.detailGroupBox
{
padding: 5px 3px;
font-size: 0.8em;
}
.detailGroupBox:nth-child(2n+1)
{
background-color: #fff;
}
#netContainer
{
position: absolute;
width: calc(100% - 10px);
margin: 0 5px;
border: 1px solid #ddd;
height: calc(100% - 57px);
top: 55px;
}
.actionButton
{
border: 1px solid #777;
background-color: #ddd;
color: #444;
padding: 5px;
cursor: pointer;
min-width: 100px;
margin-top: 15px;
}
.actionButton:hover
{
background-color: #ccc;
}
#loadingContainer
{
display: none;
position: absolute;
width: 50%;
height: 20px;
background-color: #ccc;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#loader
{
position: absolute;
width: 0px;
height: 10px;
background-color: #888;
top: 50%;
transform: translateY(-50%);
left: 1px;
}
.addTheme
{
position: absolute;
top: 5px;
right: 5px;
width: 32px;
height: 32px;
cursor: pointer;
opacity: 0.8;
}
.addTheme:hover
{
opacity: 1;
}
.deleteButton
{
height: 16px;
cursor: pointer;
opacity: 0.8;
}
.deleteButton:hover
{
opacity: 1;
}
.zipButton
{
height: 16px;
cursor: pointer;
opacity: 0.8;
}
.zipButton:hover
{
opacity: 1;
}
.addHistoricButton
{
height: 16px;
cursor: pointer;
opacity: 0.8;
}
.addHistoricButton:hover
{
opacity: 1;
}
h3.userInfo
{
position: absolute;
top: -88px;
background-color: crimson;
padding: 20px;
z-index: 999;
margin: 0 5px !important;
width: calc(100% - 70px);
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
color: #fff;
transition: all 0.5s;
}
h3.userInfo:hover
{
top: 0px;
}
@-webkit-keyframes ngdialog-flipin-horizontal {
0% {
opacity: 0;
-webkit-transform: rotateY(-90deg);
transform: rotateY(-90deg);
}
100% {
opacity: 1;
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
}
@keyframes ngdialog-flipin-horizontal {
0% {
opacity: 0;
-webkit-transform: rotateY(-90deg);
-ms-transform: rotateY(-90deg);
transform: rotateY(-90deg);
}
100% {
opacity: 1;
-webkit-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
transform: rotateY(0deg);
}
}
@-webkit-keyframes ngdialog-flipout-horizontal {
0% {
opacity: 1;
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
100% {
opacity: 0;
-webkit-transform: rotateY(90deg);
transform: rotateY(90deg);
}
}
@keyframes ngdialog-flipout-horizontal {
0% {
opacity: 1;
-webkit-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
transform: rotateY(0deg);
}
100% {
opacity: 0;
-webkit-transform: rotateY(90deg);
-ms-transform: rotateY(90deg);
transform: rotateY(90deg);
}
}
.ngdialog.ngdialog-theme-flat {
/*font-size: 1.5em;*/
font-family:Tahoma;
font-size:12px;
padding-bottom: 100px;
padding-top: 100px;
-webkit-perspective: 1300px;
-ms-perspective: 1300px;
perspective: 1300px;
-webkit-perspective-origin: 50% 150px;
-ms-perspective-origin: 50% 150px;
perspective-origin: 50% 150px;
}
.ngdialog.ngdialog-theme-flat .ngdialog-overlay {
/*background: rgba(232,190,217,.25);*/
background: rgba(238,238,238,.90);
}
.ngdialog.ngdialog-theme-flat.ngdialog-closing .ngdialog-content {
-webkit-animation: ngdialog-flipout-horizontal .5s;
animation: ngdialog-flipout-horizontal .5s;
}
.ngdialog.ngdialog-theme-flat .ngdialog-content {
-webkit-animation: ngdialog-flipin-horizontal .5s;
animation: ngdialog-flipin-horizontal .5s;
background: #fff;
color: #444;
/*font-family: "Helvetica Neue",sans-serif;*/
line-height: 1.5em;
margin: 0 auto;
max-width: 100%;
/*padding: 2em 2em 3em;*/
/*padding:10px;*/
position: relative;
-webkit-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
width: 400px;
box-shadow: 0 0 3px 3px rgba(109,45,95,0.75);
-moz-box-shadow: 0 0 3px 3px rgba(109,45,95,0.75);
-webkit-box-shadow: 0 0 3px 3px rgba(109,45,95,0.75);
-o-box-shadow: 0 0 3px 3px rgba(109,45,95,0.75);
border-radius : 5px;
-moz-border-radius:5px;
-webkit-border-radius: 5px;
-o-border-radius:5px;
}
.ngdialog.ngdialog-theme-flat .ngdialog-close {
cursor: pointer;
position: absolute;
right: 0;
top: 0;
}
.ngdialog.ngdialog-theme-flat .ngdialog-close:before {
background: #27ae60;
color: #fff;
display: block;
font-family: "Helvetica Neue",sans-serif;
font-size: 1em;
font-weight: 100;
height: 1.25em;
line-height: 1px;
overflow: hidden;
padding-top: .5em;
right: 0;
text-align: center;
text-indent: 1px;
top: 0;
width: 1.25em;
}
.ngdialog.ngdialog-theme-flat .ngdialog-message {
margin-bottom: .5em;
}
.ngdialog.ngdialog-theme-flat .ngdialog-input {
margin-bottom: .5em;
}
.ngdialog.ngdialog-theme-flat .ngdialog-input textarea,
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="text"],
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="password"],
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="email"],
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="url"] {
background: #f0f0f0;
border: 0;
border-radius: 3px;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
margin: 0 0 .25em;
min-height: 2.5em;
padding: .25em .67em;
width: 100%;
}
.ngdialog.ngdialog-theme-flat .ngdialog-input textarea:focus,
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="text"]:focus,
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="password"]:focus,
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="email"]:focus,
.ngdialog.ngdialog-theme-flat .ngdialog-input input[type="url"]:focus {
-webkit-box-shadow: inset 0 0 0 2px #666;
box-shadow: inset 0 0 0 2px #666;
outline: none;
}
.ngdialog.ngdialog-theme-flat .ngdialog-buttons {
margin-bottom: -3em;
margin-left: -2em;
margin-right: -2em;
padding-top: 1em;
}
.ngdialog.ngdialog-theme-flat .ngdialog-buttons:after {
clear: both;
content: '';
display: table;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button {
border: 0;
float: right;
font-family: inherit;
font-size: 1em;
letter-spacing: .1em;
line-height: 1em;
margin: 0;
padding: .5em 1em;
text-transform: uppercase;
cursor: pointer;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button:focus {
outline: none;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-primary {
background: #27ae60;
color: #fff;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-primary:focus {
-webkit-box-shadow: inset 0 3px rgba(0,0,0,0.2);
box-shadow: inset 0 3px rgba(0,0,0,0.2);
}
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-secondary {
background: #fff;
color: #ccc;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-secondary:focus {
background: #eee;
-webkit-box-shadow: inset 0 3px #aaa;
box-shadow: inset 0 3px #aaa;
color: #777;
}
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-secondary:hover,
.ngdialog.ngdialog-theme-flat .ngdialog-button.ngdialog-button-secondary:active {
color: #777;
}
\ No newline at end of file
/*! ng-dialog - v0.3.11 (https://github.com/likeastore/ngDialog) */
@-webkit-keyframes ngdialog-fadeout {
0% {
opacity:1
}
100% {
opacity:0
}
}
@keyframes ngdialog-fadeout {
0% {
opacity:1
}
100% {
opacity:0
}
}
@-webkit-keyframes ngdialog-fadein {
0% {
opacity:0
}
100% {
opacity:1
}
}
@keyframes ngdialog-fadein {
0% {
opacity:0
}
100% {
opacity:1
}
}
.ngdialog,.ngdialog *,.ngdialog :after,.ngdialog :before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
.ngdialog {
position:fixed;
overflow:auto;
-webkit-overflow-scrolling:touch;
z-index:10000;
top:0;
right:0;
bottom:0;
left:0
}
.ngdialog-overlay {
position:fixed;
background:rgba(232,190,217,.4);
top:0;
right:0;
bottom:0;
left:0;
-webkit-backface-visibility:hidden;
-webkit-animation:ngdialog-fadein .5s;
animation:ngdialog-fadein .5s
}
.ngdialog.ngdialog-closing .ngdialog-overlay {
-webkit-backface-visibility:hidden;
-webkit-animation:ngdialog-fadeout .5s;
animation:ngdialog-fadeout .5s
}
.ngdialog-content {
background:#fff;
-webkit-backface-visibility:hidden;
-webkit-animation:ngdialog-fadein .5s;
animation:ngdialog-fadein .5s
}
.ngdialog.ngdialog-closing .ngdialog-content {
-webkit-backface-visibility:hidden;
-webkit-animation:ngdialog-fadeout .5s;
animation:ngdialog-fadeout .5s
}
.ngdialog-close:before {
font-family:Helvetica,Arial,sans-serif;
content:'\00D7';
cursor:pointer
}
body.ngdialog-open {
overflow:hidden
}
This diff is collapsed.
.text{
margin-top:20px;
margin-bottom: 20px;
margin-left: 100px;
margin-right: 100px;
text-align: center;
}
.center{
text-align: center;
}
.input{
margin-left: 10%;
margin-top: 10px;
border-color: lightblue;
text-align: center;
}
.title{
text-shadow: 0 0 20px grey;
text-align: center;
}
#boxshadow {
position: relative;
-moz-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
padding: 10px;
background: white;
}
#boxshadow img {
width: 100%;
border: 1px solid #8a4419;
border-style: inset;
}
#boxshadow::after {
content: '';
position: absolute;
z-index: -1;
-webkit-box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
width: 70%;
left: 15%;
height: 100px;
bottom: 0;
}
\ No newline at end of file
This diff is collapsed.
<?php
include_once('constants.php');
$json_data = file_get_contents('php://input');
$update_array = json_decode($json_data,true);
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["status"] = "Erreur.";
if($con->connect_error)
$data["status"] = "Erreur de connexion à la base de données";
else{
// Generate Query and Execute
$sql = "UPDATE Historic SET idTheme = ".$update_array['idTheme']." WHERE idHistoric = ".$update_array['idHistoric'];
if($con->query($sql) == true){
$data["status"] = "Enregistrement validé";
}
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
session_start();
$idUser = $_SESSION["idUser"];
include_once('constants.php');
$json_data = file_get_contents('php://input');
$insert_array = json_decode($json_data,true);
$insert_array["idTheme"] = null;
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["insert_id"] = 0;
$data["status"] = "Erruer";
if($con->connect_error)
$data["status"] = "Erreur de connexion à la base de données.";
else{
// Generate Query and Execute
$sys_date = date("Y-m-d H:i:s");
$sql = "INSERT INTO Historic (query,idTheme,idUser,XMLfile,sysDate) VALUES ('" . $insert_array["query"] . "',NULL,'" . $idUser . "','" . $insert_array["xml"] . "','". $sys_date . "');";
if($con->query($sql) == true){
$data["status"] = "Enregistrement validé...";
$data["idHistoric"] = $con->insert_id;
}
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
session_start();
$idUser = $_SESSION['idUser'];
include_once('constants.php');
$json_data = file_get_contents('php://input');
$insert_array = json_decode($json_data,true);
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["insert_id"] = 0;
$data["status"] = "Erreur";
if($con->connect_error)
$data["status"] = "Erreur de connexion à la base de données.";
else{
// Generate Query and Execute
$sys_date = date("Y-m-d H:i:s");
$sql = "INSERT INTO `Theme` (themeName,idUser,sysDate) VALUES ('" . $insert_array["themeName"] . "','" . $idUser . "','". $sys_date . "');";
if($con->query($sql) == true){
$data["status"] = "Enregistrement validé...";
$data["idTheme"] = $con->insert_id;
}
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
Active project members:
Stanisław Osiński
Dawid Weiss
Past project members and contributors:
Karol Gołembniak
Paweł Kowalik
Urszula Krukar
Irmina Masłowska
Lang Ngo Chi
Steven Schockaert
Michał Wróblewski
Carrot2 Project
Copyright (C) 2002-2017, Dawid Weiss, Stanisław Osiński.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
- Neither the name of the Carrot2 Project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
- We kindly request that you include in the end-user documentation provided with
the redistribution and/or in the software itself an acknowledgement equivalent
to the following: "This product includes software developed by the Carrot2
Project."
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@echo off
rem
rem Suppress Terminate batch job on CTRL+C
rem
if ""%1"" == ""run"" goto delRun
if "%TEMP%" == "" goto mainEntry
if exist "%TEMP%\%~nx0.run" goto mainEntry
echo Y>"%TEMP%\%~nx0.run"
if not exist "%TEMP%\%~nx0.run" goto mainEntry
echo Y>"%TEMP%\%~nx0.Y"
call "%~f0" %* <"%TEMP%\%~nx0.Y"
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
del /Q "%TEMP%\%~nx0.Y" >NUL 2>&1
exit /B %RETVAL%
:delRun
rem consume the dummy argument.
shift
:mainEntry
del /Q "%TEMP%\%~nx0.run" >NUL 2>&1
rem
rem Default JVM options here
rem
if not "%DCS_OPTS%"=="" goto optsSet
set DCS_OPTS=-Xmx768m
:optsSet
rem
rem Launch the DCS
rem
java %DCS_OPTS% -Ddcs.war=war/carrot2-dcs.war -jar invoker.jar -cpdir lib org.carrot2.dcs.DcsApp %*
#!/bin/sh
if [ -z "$DCS_OPTS" ]; then
DCS_OPTS="-Xms64m -Xmx768m"
fi
java $DCS_OPTS -Ddcs.war=war/carrot2-dcs.war -jar invoker.jar -cpdir lib org.carrot2.dcs.DcsApp $@
Copyright (c) 2003, Kohsuke Kawaguchi
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain
the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce
the above copyright notice, this list of
conditions and the following disclaimer in
the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
Copyright (c) 2004-2008 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Carrot2 Document Clustering Server
----------------------------------
Carrot2 Document Clustering Server exposes Carrot2 clustering as a REST
service. It can cluster documents from an external source (e.g., a search
engine) or documents provided directly as an XML stream. Results are returned
in XML or JSON formats.
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
For more information, please refer to Carrot2 Manual:
http://download.carrot2.org/stable/manual
Build information
-----------------
Build version : 3.15.1
Build number : C2-SOFTWARE5-DCS-1
Build time : 2017-03-09 10:29:58
Built by : bamboo
Build revision: 1fa272b872059e64a4ec692d66927820a8a2550c
<?php
//
// Remasco Search example for config.php file
//
// Do not edit this file without changing its name.
// This file is an example of empty config file for Remasco Search than can be used to create "config.php".
//
// Warning: Be sure to not add line feed or spaces after closing php tag.
//#####################
// Database parameters
//#####################
// db_host
// This parameter contains host name or ip address of Dolibarr database server.
// Examples:
// $db_host='localhost';
// $db_host='127.0.0.1';
//
$db_host='localhost' ;
// db_name
// This parameter contains name of Remasco Search database.
// Examples:
// $db_name='remasco';
// $db_name='mydatabase';
//
$db_name='remasco' ;
// db_username
// This parameter contains user name used to read and write into Remasco Search database.
// Examples:
// $db_username='admin';
// $db_username='dboremasco';
// $db_username='remascouser';
//
$db_username='dboremasco';
// db_password
// This parameter contains password used to read and write into Remasco Search database.
// Examples:
// $db_password='myadminpass';
// $db_password='myuserpassword';
//
$db_password='dbopassword' ;
//#################################
// Clustering Server to be used
//#################################
// dcs_type
// This parameter indicates which clustering server must be used by Remasco Search
// local = Use of local clustering server
// api = Use of external clustering server
//
// local clustering server
// Remasco Search include Carrot2 DCS Server in open-source version
// in carrot2-dcs-3.15.1 directory.
// Change this parameter to 'local' to use it.
// You can also use this value to point to your own server:port
// api clustering service
// MyDataBall - R2C-System provides an optimized version of clustering server
// MyDataball - R2C-System DCS Server can only be used with a token provided
// by purchase of a license.
// Change this parameter to 'api' to use it.
//
$dcs_type='local';
// clustering_server
// This parameter contains server Fully Qualified Domain Name
// where Remasco Search must send requests
// Examples:
// $clustering_server='localhost';
// $clustering_server='127.0.0.1';
// $clustering_server='server.mydomain.tld';
// $clustering_server='search.mydataball.com';
//
$clustering_server='localhost';
// dcs_token
// This parameter contains the token or the API key given by your clustering service provider
//
$dcs_token='yourtoken';
// dcs_lang
// This parameter limits results to this language
// Values:
// ALL
// ENGLISH
// FRENCH
// GERMAN
// ITALIAN
// SPANISH
// Exemples:
// $dcs_lang='ALL';
// $dcs_lang='FRENCH';
//
$dcs_lang='FRENCH';
?>
<?php
include_once('conf/config.php');
/* Database Parameters */
define("SERVER",$db_host);
define("USERNAME",$db_username);
define("PASSWORD",$db_password);
define("DATABASE",$db_name);
/* Clustering Server Parameters*/
define("STATUT", $dcs_type);
define("CLUSTERING_SERVER",$clustering_server);
define("TOKEN",$dcs_token);
define("LANG",$dcs_lang);
var app = angular.module('myApp', [ ] );
app.controller('textCtrl', function ($scope) {
$scope.welcome = 'Bienvenue ';
$scope.send = 'se connecter';
});
<?php
session_start();
if(!isset($_SESSION["username"])){
echo "Accès à l'application non autorisé !";
exit;
}
require_once('constants.php');
echo '<h3 class="userInfo">';
echo "Bonjour ".$_SESSION["firstname"].".<br><small>Vous êtes connecté en tant que : ".$_SESSION["username"]."</small>";
echo '<a style="margin-left: 40px; font-size: 14px; text-decoration: none; display: inline-block; padding: 8px; background-color: #666; color: #fff;" href="logout.php">Déconnexion</a>';
echo "</h3>";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>REMASCO by MyDataBall</title>
<!-- --------------- Shared Scripts ------------------------- -->
<script src="Scripts/Shared/jquery-1.9.0.min.js"></script>
<script src="Scripts/Shared/angular.min.js"></script>
<script src="Scripts/Shared/ngDialog.min.js"></script>
<script src="Scripts/Shared/alertify.min.js"></script>
<script src="Scripts/Shared/lodash.js"></script>
<script src="Scripts/Shared/vis.js"></script>
<script src="Scripts/Shared/xml2json.min.js"></script>
<!-- --------------- Services Scripts ----------------------- -->
<script src="Scripts/Services/dataService.js"></script>
<script src="Scripts/Services/select2.js"></script>
<script src="Scripts/Services/uiService.js"></script>
<script src="Scripts/Services/xmlService.js"></script>
<script src="Scripts/Services/dataBall.service.js"></script>
<!-- --------------- App Scripts ---------------------------- -->
<script type="text/javascript" src="Scripts/App/dataBall.controller.js"></script>
<!-- --------------- Styles --------------------------------- -->
<link rel="stylesheet" href="Styles/vis-network.min.css">
<link rel="stylesheet" href="Styles/index.css">
<link rel="stylesheet" href="Styles/alertify.core.css">
<link rel="stylesheet" href="Styles/alertify.default.css">
<link rel="stylesheet" href="Styles/select2.css">
<link rel="stylesheet" href="Styles/ngDialog.min.css">
<link rel="stylesheet" href="Styles/ngDialog-theme-flat.css">
<!-- -------------------------------------------------------- -->
</head>
<body>
<div id ="statut" class="<?php echo STATUT; ?>"></div>
<div class="container" data-ng-app="dataBallApp" data-ng-controller="dataBallController">
<div class="leftPanel">
<div class="detailHeader">Mes thèmes</div>
<div style="height:calc(50% - 48px);position:relative;overflow-y:auto;font-size:0.8em">
<div class="addTheme" data-ng-click="addTheme()">
<img src="Images/add-button.png" class="addTheme" style="top:0;right:0" />
</div>
<br />
<br />
<div data-ng-repeat="theme in themes" style="margin:5px 0 0 5px;">
<div style="position:relative">
<span style="font-weight:bold;">- {{theme.themeName}}</span>
<img src="Images/corbeille.png" class="deleteButton" data-ng-click="removeTheme(theme)" />
<img src="Images/winrar.png" class="zipButton" data-ng-show="theme.historics && theme.historics.length > 1" />
</div>
<div data-ng-repeat="h in theme.historics" style="margin:5px 0 0 10px">
<span style="cursor:pointer" data-ng-click="reloadSearch(h)">- {{h.query}}</span>
<img src="Images/corbeille.png" class="deleteButton" data-ng-click="removeHistoricFromTheme(theme, h)" />
</div>
</div>
</div>
<div class="detailHeader">Historique</div>
<div style="height:calc(50% - 48px);position:relative;overflow-y:auto;font-size:0.8em">
<div data-ng-repeat="h in historics" style="margin:5px 0 0 5px;">
<div style="position:relative">
<span style="font-weight:bold;cursor:pointer" data-ng-click="reloadSearch(h)">- {{h.query}}</span>
<img src="Images/corbeille.png" class="deleteButton" data-ng-click="removeHistoric(h)" />
<img src="Images/file_add.png" class="addHistoricButton" data-ng-click="addHistoricToTheme(h)" />
</div>
</div>
</div>
</div>
<div class="midPanel">
<div class="midContainer">
<div class="queryBox">
<input type="text" data-ng-model="query" data-ng-enter="search()" placeholder="Rechercher ..." />
<img src="Images/search.png" title="Search" data-ng-click="search()" />
</div>
<div id="netContainer">
</div>
<div id="loadingContainer">
<div id="loader"></div>
</div>
</div>
</div>
<div class="rightPanel">
<div class="detailHeader">Résultats</div>
<div class="detailContainer">
<div data-ng-show="details.type=='group'">
<div class="detailGroupBox" data-ng-repeat="grp in details.groups">
{{grp.title}}
</div>
<div class="detailGroupBox" data-ng-repeat="doc in details.documents">
{{doc.title}}
</div>
</div>
<div data-ng-show="details.type=='document'">
<table>
<tr>
<td>Titre :</td>
</tr>
<tr>
<td>{{details.document.title}}</td>
</tr>
<tr data-ng-show="details.document.snippet && details.document.snippet.length > 0">
<td>Résumé :</td>
</tr>
<tr data-ng-show="details.document.snippet && details.document.snippet.length > 0">
<td>{{details.document.snippet}}</td>
</tr>
<tr data-ng-show="details.document.url && details.document.url.length > 0">
<td>Adresse du site :</td>
</tr>
<tr data-ng-show="details.document.url && details.document.url.length > 0">
<!-- <td><a href="{{details.document.url}}" target="_blank">Document Url</a></td> -->
<td><a href="{{details.document.url}}" target="_blank">{{details.document.url}}</a></td>
</tr>
<tr data-ng-show="details.document.sources && details.document.sources.length > 0">
<td>Sources du résultat :</td>
</tr>
<tr data-ng-show="details.document.sources && details.document.sources.length > 0">
<td>
<div class="detailGroupBox" data-ng-repeat="s in details.document.sources">{{s}}</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
// Start the session
session_start();
include_once('constants.php');
// Create connection
$conn = new mysqli(SERVER, USERNAME, PASSWORD, DATABASE);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Check login and password in Database
if (isset($_POST['login']) and isset($_POST['password']) && !empty($_POST['login']) && !empty($_POST['password'])){
$login = addslashes($_POST['login']);
$password = addslashes(md5($_POST['password']));
$sql = "SELECT idUser,userName,firstName FROM user WHERE userName='".$login."' AND password='".$password."'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$info = $result->fetch_assoc();
$_SESSION['idUser'] =$info['idUser'];
$_SESSION['username'] =$info['userName'];
$_SESSION['firstname'] =$info['firstName'];
header('Location: dashboard.php');
exit();
}
else {
echo "<script>alert('Ooops! login ou mot de passe incorrect')</script>";
}
}
$conn->close();
?>
<!DOCTYPE html>
<html>
<head>
<title>Page d'identification</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<link href="Styles/style.css" rel='stylesheet' >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div ng-app='myApp' ng-controller='textCtrl'>
<div id='boxshadow' class="text" ng-show="true">
<form action="index.php" method="POST">
<h2><b>Portail de recherche MyDataBall Remasco</b></h2><br>
<img src="Images/mydataBall.jpg" height="400" width="600" class="img-responsive">
<div class="container" style="width:30%">
<div><h2 class="title" ng-show='login'> {{ welcome + ' ' + login }} </h2></div>
<div class="form-group"><label>Nom d'utilisateur : </label><input type='text' class="form-control" ng-model='login' name='login' required></div>
<div class="form-group"><label>Mot de passe : </label><input type='password' class="form-control" ng-model='password' name='password'></div>
<br>
<input type='submit' class="btn btn-success" ng-model='send' ng-value='send' ng-show='password && login'>
</div>
</form>
</div>
</div>
<script src="controller/controller.js"></script>
</body>
</html>
<?php
session_start();
$idUser = $_SESSION["idUser"];
include_once('constants.php');
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$themes = array();
$theme = array();
$historics = array();
if($con->connect_error)
$data["status"] = "connection error";
else{
$query = "SELECT * FROM Theme WHERE idUser = $idUser";
$result = $con->query($query);
while($row = $result->fetch_assoc())
{
$themes[$row['idTheme']]= array(
"idTheme"=>$row['idTheme'],
"themeName"=>$row['themeName'],
"idUser"=>$row['idUser'],
"sysDate"=>$row['sysDate'],
);
$query1 = "SELECT * FROM Historic WHERE idTheme = '".$row["idTheme"]."'";
$result1 = $con->query($query1);
if($result1->num_rows>0){
while($row1 = $result1->fetch_assoc())
{
$themes[$row['idTheme']]["historics"][] = array(
"idHistoric"=>$row1['idHistoric'],
"query"=>$row1['query'],
"idTheme"=>$row1['idTheme'],
"idUser"=>$row1['idUser'],
"XMLfile"=>$row1['XMLfile'],
"sysDate"=>$row1['sysDate']
);
}
}
$theme[] = $themes[$row['idTheme']];
}
$data["themes"] = $theme;
$sql = "SELECT * FROM Historic WHERE idUser = $idUser";
$result = $con->query($sql);
if($result->num_rows>0)
while($row = $result->fetch_assoc()){
$historics[] = $row;
}
$data["historics"] = $historics;
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
session_start();
session_destroy();
header('Location: index.php');
\ No newline at end of file
<?php
if (!function_exists('curl_init')) {
throw new Exception("Curl is required for this class.");
}
class Carrot2Job
{
private $documents = array();
private $query;
private $source;
private $algorithm;
private $attributes = array();
public function addDocument($title, $content = '', $url = '')
{
$this->documents[] = new Carrot2Document($title, $content, $url);
}
public function getDocuments()
{
return $this->documents;
}
public function setSource($source)
{
$this->source = $source;
}
public function getSource()
{
return $this->source;
}
public function setAlgorithm($algorithm)
{
$this->algorithm = $algorithm;
}
public function getAlgorithm()
{
return $this->algorithm;
}
public function setQuery($query)
{
$this->query = $query;
}
public function getQuery()
{
return $this->query;
}
public function setAttributes(array $attributes)
{
if (is_array($attributes)) {
$this->attributes = $attributes;
}
}
public function setAttribute($key, $value)
{
$this->attributes[$key] = $value;
}
public function getAttributes()
{
return $this->attributes;
}
}
class Carrot2Document
{
private $id;
private $title;
private $content;
private $url;
private $otherFields;
public function __construct($title, $content = '', $url = '', array $otherFields = array(), $id = null)
{
$this->id = $id;
$this->title = $title;
$this->content = $content;
$this->url = $url;
$this->otherFields = $otherFields;
}
public function getId()
{
return $this->id;
}
public function getTitle()
{
return $this->title;
}
public function getContent()
{
return $this->content;
}
public function getUrl()
{
return $this->url;
}
public function getField($fieldName)
{
return isset($this->otherFields[$fieldName]) ? $this->otherFields[$fieldName] : null;
}
public function getOtherFields()
{
return $this->otherFields;
}
}
class Carrot2Cluster
{
private $label;
private $score;
private $documentIds = array();
private $allDocumentIds;
private $subclusters = array();
public function __construct($label, $score, $documentIds, $subclusters)
{
$this->label = $label;
$this->score = $score;
$this->documentIds = $documentIds;
$this->subclusters = $subclusters;
}
public function getLabel()
{
return $this->label;
}
public function size()
{
if (!$this->allDocumentIds) {
$this->allDocumentIds = array();
$this->addDocumentIds($this->allDocumentIds);
}
return count($this->allDocumentIds);
}
public function getSubclusters()
{
return $this->subclusters;
}
public function getDocumentIds()
{
return $this->documentIds;
}
public function getAllDocumentIds()
{
return $this->allDocumentIds;
}
private function addDocumentIds(&$ids)
{
foreach ($this->documentIds as $id) {
$ids[$id] = $id;
}
foreach ($this->subclusters as $subcluster) {
$subcluster->addDocumentIds($ids);
}
return $ids;
}
}
class Carrot2Result
{
private $documents;
private $clusters;
private $attributes;
private $xml;
public function __construct($documents = array(), $clusters = array(), $attributes = array(), $xml = null)
{
$this->documents = $documents;
$this->clusters = $clusters;
$this->attributes = $attributes;
$this->xml = $xml;
}
public function getDocuments()
{
return $this->documents;
}
public function getClusters()
{
return $this->clusters;
}
public function getAttributes()
{
return $this->attributes;
}
public function getXml()
{
return $this->xml;
}
}
class Carrot2Processor
{
private $baseurl;
public function __construct($baseurl = 'http://localhost:8080/dcs/rest')
{
$this->baseurl = $baseurl;
}
public function cluster(Carrot2Job $job)
{
$curl = curl_init($this->baseurl);
// Prepare request parameters
$fields = array_merge($job->getAttributes(), array(
'dcs.output.format' => 'XML'));
$documents = $job->getDocuments();
if (count($documents) > 0) {
$fields['dcs.c2stream'] = $this->generateXml($documents);
}
self::addIfNotNull($fields, 'dcs.source', $job->getSource());
self::addIfNotNull($fields, 'dcs.algorithm', $job->getAlgorithm());
self::addIfNotNull($fields, 'query', $job->getQuery());
curl_setopt_array($curl,
array(
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array('Content-Type: multipart/formdata'),
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $fields
)
);
$response = curl_exec($curl);
$error = curl_errno($curl);
if ($error !== 0) {
throw new Carrot2Exception(curl_error($curl));
}
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpStatus >= 400) {
throw new Carrot2Exception('HTTP error occurred, error code: ' . $httpStatus);
}
return $this->extractResponse($response);
}
private function generateXml($documents)
{
$dom = new DOMDocument('1.0', 'UTF-8');
$resultsElement = $dom->createElement('searchresult');
$dom->appendChild($resultsElement);
foreach ($documents as $document) {
$documentElement = $dom->createElement('document');
$this->appendTextField($dom, $documentElement, 'title', $document->getTitle());
$this->appendTextField($dom, $documentElement, 'snippet', $document->getContent());
$this->appendTextField($dom, $documentElement, 'url', $document->getUrl());
$resultsElement->appendChild($documentElement);
}
return $dom->saveXML();
}
private function appendTextField($dom, $elem, $name, $value)
{
$text = $dom->createElement($name);
$text->appendChild($dom->createTextNode((string)$value));
$elem->appendChild($text);
}
/**
* Extracts Carrot2Results from the XML response.
*/
private function extractResponse($rawXml)
{
$xml = new SimpleXMLElement($rawXml);
return new Carrot2Result($this->extractDocuments($xml),
$this->extractClusters($xml->xpath('/searchresult/group')),
$this->extractAttributes($xml->xpath('/searchresult/attribute')),
$rawXml);
}
private function extractDocuments($xml)
{
$documents = array();
foreach ($xml->xpath('/searchresult/document') as $documentElement) {
$document = new Carrot2Document(
(string)$documentElement->title,
(string)$documentElement->snippet,
(string)$documentElement->url,
$this->extractAttributes($documentElement->xpath('field')),
(string)$documentElement['id']
);
$documents[] = $document;
}
return $documents;
}
private function extractClusters($groupElements)
{
$clusters = array();
foreach ($groupElements as $group) {
$documentIds = array();
foreach ($group->xpath('document') as $document) {
$documentIds []= (string)$document['refid'];
}
$subclusters = $this->extractClusters($group->xpath('group'));
$cluster = new Carrot2Cluster(
(string)$group->title->phrase,
(string)$group['score'],
$documentIds,
$subclusters
);
$clusters[] = $cluster;
}
return $clusters;
}
private function extractAttributes($attributeElements)
{
$attributes = array();
foreach($attributeElements as $attribute) {
$key = $attribute['key'];
$valueElement = $attribute->xpath('value');
if (count($valueElement) > 0) {
$value = $valueElement[0]['value'];
if ($value) {
$attributes[(string)$key] = (string)$value;
}
}
}
return $attributes;
}
private static function addIfNotNull(&$array, $key, $value)
{
if ($value) {
$array[$key] = $value;
}
}
}
class Carrot2Exception extends Exception {
}
<?php
include_once('constants.php');
$json_data = file_get_contents('php://input');
$input_array = json_decode($json_data,true);
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["status"] = "error";
if($con->connect_error)
$data["status"] = "connection error";
else{
$sql = "DELETE FROM `Historic` WHERE idHistoric = " . $input_array["idHistoric"];
if($con->query($sql) == true)
$data["status"] = "Deleted successfully...";
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
include_once('constants.php');
$json_data = file_get_contents('php://input');
$update_array = json_decode($json_data,true);
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["status"] = "error";
if($con->connect_error)
$data["status"] = "connection error";
else{
// Generate Query and Execute
$sql = "UPDATE Historic SET idTheme = NULL WHERE idHistoric = ".$update_array['idHistoric'];
if($con->query($sql) == true){
$data["status"] = "inserted successfully...";
}
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
include_once('constants.php');
$json_data = file_get_contents('php://input');
$input_array = json_decode($json_data,true);
// Connection To DB
$con = new mysqli(SERVER,USERNAME,PASSWORD,DATABASE);
$data["status"] = "error";
if($con->connect_error)
$data["status"] = "connection error";
else{
$sql = "DELETE FROM `Theme` WHERE idTheme = " . $input_array["idTheme"];
if($con->query($sql) == true)
$data["status"] = "Deleted successfully...";
}
$con->close();
header('content-type: application/json');
echo json_encode($data);
\ No newline at end of file
<?php
session_start();
$idUser = $_SESSION['idUser'];
include_once('constants.php');
require_once('model/Carrot2.php');
$json_data = file_get_contents('php://input');
$insert_array = json_decode($json_data,true);
if(STATUT == 'local'){
$query = $insert_array["query"];
$num = "100";
$source = "web";
$algorithm = "lingo";
$format = "xml";
$hierarchy = "max-hierarchy-depth";
$level_hierarchie = "5";
$processor = new Carrot2Processor();
$job = new Carrot2Job();
$job->setSource($source);
$job->setQuery($query);
$job->setAlgorithm($algorithm);
$job->setAttribute("results", $num);
$job->setAttribute($hierarchy, $level_hierarchie);
$job->setAttribute("EToolsDocumentSource.language", LANG);
try {
$result = $processor->cluster($job);
}
catch (Carrot2Exception $e) {
echo 'An error occurred during processing: ' . $e->getMessage();
exit(10);
}
switch ($format) {
case "xml":
displayRawXml($result->getXml());
exit();
break;
case "json":
$xml = simplexml_load_string($result->getXml());
$json = json_encode($xml);
$array = json_decode($json, true);
json_encode($xml, JSON_FORCE_OBJECT);
break;
default:
break;
}
}
else {
$URL = "http://".CLUSTERING_SERVER."/search.php?query=".$insert_array["query"]."&maxResult=100&fts=xml&deep=5&token=".TOKEN."";
$data = file_get_contents($URL);
header('Content-Type: text/html; charset=utf-8');
echo json_encode($data);
}
function displayRawXml($xml) {
header("Content-type: text/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $xml;
}
?>
#!/bin/sh
### BEGIN INIT INFO
# Provides: carrot2-dcs
# Required-Start: $local_fs $remote_fs $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Provide Carrot2 DCS Server
# Description: Provide Carrot2 DCS Server.
### END INIT INFO
# /etc/init.d/carrot2-dcs
# Author : Bertrand FRUCHET <bertrand.fruchet@mydataball.com>
# Date : 4/07/2017
# Copyright : MyDataBall - R2C-SYSTEM
# Carrot2-dcs directory is in /var/www/remasco/carrot2-dcs-3.15.1
SDIR="/var/www/remasco/carrot2-dcs-3.15.1/"
PID=/dev/null
# The following part always gets executed.
echo "Carrot2 DCS Server Service"
# The following part carries out specific functions depending on arguments.
case "$1" in
start)
echo " * Starting Carrot2 DCS Server service"
if [ -f ${SDIR}/RUNNING_PID ]
then
PID=$(cat ${SDIR}/RUNNING_PID)
if ps -p $PID > /dev/null
then
echo " Carrot2 DCS Server service already running ($PID)"
exit 1
else
echo " Previous Execution of Carrot2 DCS Server service crashed ... deleting old RUNNING_PID"
rm -rf ${SDIR}/RUNNING_PID
fi
fi
cd ${SDIR}
echo " starting..."
# nohup ./dcs.sh > /var/log/carrot2-dcs.log 2>&1&
if [ -z "$DCS_OPTS" ]; then
DCS_OPTS="-Xms64m -Xmx768m"
fi
nohup java $DCS_OPTS -Ddcs.war=war/carrot2-dcs.war -jar invoker.jar -cpdir lib org.carrot2.dcs.DcsApp >> /var/log/carrot2-dcs.log 2>&1&
echo $! > ${SDIR}/RUNNING_PID
# > ${DIR}/RUNNING_PID
;;
stop)
echo " * Stopping Carrot2 DCS Server Service"
if [ ! -f ${SDIR}/RUNNING_PID ]
then
echo " nothing to stop"
exit 1;
fi
echo "\n[system] init.d - Application stopped by Carrot2 DCS Server service\n" >> /var/log/carrot2-dcs.log
kill -TERM $(cat ${SDIR}/RUNNING_PID)
;;
status)
if [ -f ${SDIR}/RUNNING_PID ]
then
PID=$(cat ${SDIR}/RUNNING_PID)
PORT=$(lsof -Pan -p $PID -i | awk '/LISTEN/ {print $9}')
if ps -p $PID > /dev/null
then
echo " Carrot2 DCS Server service (PID $PID) is running on port $PORT"
exit 1
fi
else
echo " Carrot2 DCS Server service is NOT running"
exit 1
fi
;;
*)
echo "Usage: /etc/init.d/carrot2-dcs {start|stop|status}"
exit 1
;;
esac
exit 0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 06 déc. 2017 à 16:50
-- Version du serveur : 5.7.19
-- Version de PHP : 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `remasco`
--
-- --------------------------------------------------------
--
-- Structure de la table `Historic`
--
DROP TABLE IF EXISTS `Historic`;
CREATE TABLE IF NOT EXISTS `Historic` (
`idHistoric` int(11) NOT NULL AUTO_INCREMENT,
`query` varchar(50) NOT NULL,
`idTheme` int(11) DEFAULT NULL,
`idUser` int(11) NOT NULL,
`XMLfile` longtext NOT NULL,
`sysDate` datetime NOT NULL,
PRIMARY KEY (`idHistoric`),
KEY `idTheme` (`idTheme`),
KEY `idUser` (`idUser`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=93 ;
--
-- Structure de la table `Theme`
--
DROP TABLE IF EXISTS `Theme`;
CREATE TABLE IF NOT EXISTS `Theme` (
`idTheme` int(11) NOT NULL AUTO_INCREMENT,
`themeName` varchar(20) NOT NULL,
`idUser` int(11) NOT NULL,
`sysDate` datetime NOT NULL,
PRIMARY KEY (`idTheme`),
KEY `idUser` (`idUser`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=47 ;
--
-- Structure de la table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
`idUser` int(11) NOT NULL AUTO_INCREMENT,
`userName` varchar(20) NOT NULL,
`lastName` varchar(20) NOT NULL,
`firstName` varchar(20) NOT NULL,
`e-mail` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`teacher` tinyint(1) NOT NULL,
PRIMARY KEY (`idUser`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`idUser`, `userName`, `lastName`, `firstName`, `e-mail`, `password`, `teacher`) VALUES
(1, 'admin', 'administrateur', 'REMASCO', 'admin@domain.tld', '21232f297a57a5a743894a0e4a801fc3', 1);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
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