From 1235b66f3ab7fa5acba5e9b3a1de0b5de765eaa5 Mon Sep 17 00:00:00 2001 From: sosguns2002 Date: Fri, 2 Mar 2018 12:07:03 +0200 Subject: [PATCH] all-working state --- .../.angular-cli.json | 4 +- .../configuration.component.html | 7 +- .../configuration/configuration.component.ts | 16 +- .../app/configuration/resultspreview/match.ts | 1 + .../resultspreview.component.html | 51 +- .../resultspreview.component.ts | 21 +- .../settings/settings.component.html | 34 +- .../settings/settings.component.ts | 3 + .../manageprofiles.component.html | 10 +- .../manageprofiles.component.ts | 2 + .../src/assets/css/dl119_files/custom.css | 11 +- .../src/assets/js/enableStickyBar.js | 1 + .../src/index.html | 6 +- .../madoap/src/madserver.py | 987 -------------- .../madoap/src/madserverv2.py | 1185 ----------------- .../madoap/src/madserverv3.py | 36 +- .../madoap/src/static/exampleProfile.oamp | Bin 5120 -> 5120 bytes 17 files changed, 144 insertions(+), 2231 deletions(-) create mode 100644 interactive-mining-angular-frontend/src/assets/js/enableStickyBar.js delete mode 100755 interactive-mining-backend/madoap/src/madserver.py delete mode 100755 interactive-mining-backend/madoap/src/madserverv2.py diff --git a/interactive-mining-angular-frontend/.angular-cli.json b/interactive-mining-angular-frontend/.angular-cli.json index 9a971db..30ba507 100644 --- a/interactive-mining-angular-frontend/.angular-cli.json +++ b/interactive-mining-angular-frontend/.angular-cli.json @@ -24,7 +24,9 @@ "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/uikit/dist/js/uikit.min.js", - "../node_modules/uikit/dist/js/uikit-icons.min.js" + "../node_modules/uikit/dist/js/uikit-icons.min.js", + "./assets/js/ResizeSensor.js", + "./assets/js/jquery.sticky-sidebar.js" ], "environmentSource": "environments/environment.ts", "environments": { diff --git a/interactive-mining-angular-frontend/src/app/configuration/configuration.component.html b/interactive-mining-angular-frontend/src/app/configuration/configuration.component.html index da50031..7bfb9dd 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/configuration.component.html +++ b/interactive-mining-angular-frontend/src/app/configuration/configuration.component.html @@ -1,11 +1,6 @@ -
+
-
-
-

Working on it, please wait...

-
-
diff --git a/interactive-mining-angular-frontend/src/app/configuration/configuration.component.ts b/interactive-mining-angular-frontend/src/app/configuration/configuration.component.ts index 6962960..34da76c 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/configuration.component.ts +++ b/interactive-mining-angular-frontend/src/app/configuration/configuration.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, AfterViewInit } from '@angular/core'; @Component({ selector: 'app-configuration', templateUrl: './configuration.component.html', styleUrls: ['./configuration.component.css'] }) -export class ConfigurationComponent implements OnInit { +export class ConfigurationComponent implements OnInit, AfterViewInit { constructor() { } @@ -45,8 +45,18 @@ export class ConfigurationComponent implements OnInit { localStorage.setItem('stopwords', '0'); } if (!localStorage.getItem('lettercase') || localStorage.getItem('lettercase') === 'undefined') { - localStorage.setItem('lettercase', 'None'); + localStorage.setItem('lettercase', 'none'); } } + ngAfterViewInit() { + // $('#child1').stickySidebar(); + if(document.getElementById("enableStickyBarScript")) + document.getElementById("enableStickyBarScript").remove(); + var enableStickyBarScript = document.createElement("script"); + enableStickyBarScript.setAttribute("id", "enableStickyBarScript"); + enableStickyBarScript.setAttribute("src", "assets/js/enableStickyBar.js"); + document.body.appendChild(enableStickyBarScript); + } + } diff --git a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/match.ts b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/match.ts index 98b3603..4e08973 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/match.ts +++ b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/match.ts @@ -1,4 +1,5 @@ export class Match { + matchcounter: number; match: string; context: string; extraprev: string; diff --git a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.html b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.html index 2671035..5608adb 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.html +++ b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.html @@ -3,13 +3,13 @@

Matching test area

-

Choose a document sample to test your matchin results!

+

Choose a document sample to test your matchin results!

- - + + + + +
@@ -26,31 +26,36 @@
-
- or -
- - Upload your documents +
+ {{documentsLoaded}} document{{documentsLoaded===1?'':'s'}} loaded + No documents selected +
+ or +
+ + Upload your documents +
-
-

Test results

- -
-
-
- {{matches_number}} - {{prev_matches_number}} +
+
+

Test results

+
+ + {{matches_number}} matche{{matches_number===1?'':'s'}} found + , {{prev_matches_number}} matche{{prev_matches_number===1?'':'s'}} found previously +
+
  • {{result.docTitle}}

    -
    Match 1: {{match.match}}
    +
    Match {{match.matchcounter}}: {{match.match}}

    {{match.extraprev}} {{match.extranext}}

    @@ -60,3 +65,9 @@
+ +
+
+

Working on it, please wait...

+
+
diff --git a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.ts b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.ts index 63d0a3b..48a062f 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.ts +++ b/interactive-mining-angular-frontend/src/app/configuration/resultspreview/resultspreview.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import {ConfigurationService} from '../configuration.service'; +import UIkit from 'uikit'; import {Settings} from '../settings/settings'; import {DocumentResult} from './document-result'; import {Match} from './match'; @@ -15,6 +16,7 @@ export class ResultspreviewComponent implements OnInit { public docSamples: Array = []; public docNameLoaded = ''; public documentsLoaded = 0; + public runingMining = false; public resultsArray: Array = []; public matches_number = ''; public prev_matches_number = ''; @@ -129,10 +131,24 @@ export class ResultspreviewComponent implements OnInit { runMining(): void { if (this.documentsLoaded) { + // display wait message + this.runingMining = true; + // document.getElementById('wait-spinner-modal-center').addClass("uk-open"); this.configurationService.runMining(JSON.stringify(this.getSettingsFromLocalStorage())) .subscribe( res => { - console.log(res.matches); + // hide wait message + this.runingMining = false; + UIkit.modal(document.getElementById('wait-spinner-modal-center')).hide(); + // enable sticky + UIkit.sticky(document.getElementById("cm-run-test-section"), { + top: 25, + showOnUp: true, + animation: "uk-animation-slide-top", + bottom: ".cm-results-section" + }); + console.log(res.matches.length); this.resultsArray.length = 0; + let matchcounter = 0; Object.entries(res.matches).forEach( ([title, matches]) => { let resultClass: DocumentResult = new DocumentResult(); @@ -162,9 +178,12 @@ export class ResultspreviewComponent implements OnInit { } context = this.highlightInElement(context, values.match); match.context = context; + match.matchcounter = ++matchcounter; matchesArray.push(match); } this.resultsArray.push(resultClass); + this.prev_matches_number = this.matches_number; + this.matches_number = matchcounter + ''; }); }); } diff --git a/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.html b/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.html index cd9174c..4432654 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.html +++ b/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.html @@ -58,7 +58,10 @@
  • -
    Positive phrases
    +
    + Positive phrases + {{positivePhrasesArray.length}} phrase{{positivePhrasesArray.length===1?'':'s'}} +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -99,7 +102,10 @@
  • -
    Negative phrases
    +
    + Negative phrases + {{negativePhrasesArray.length}} phrase{{negativePhrasesArray.length===1?'':'s'}} +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -145,7 +151,10 @@
  • -
    Acknowledgement statement proccess
    +
    + Acknowledgement statement proccess + {{settings.wordssplitnum}} +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -159,7 +168,11 @@
  • -
    Matching area size
    +
    + Matching area size + left: {{settings.contextprev}} + right: {{settings.contextnext}} +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -179,7 +192,11 @@
  • -
    Text proccess
    +
    + Text proccess + stopwords + punctuation +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -193,7 +210,10 @@
  • -
    Letter case
    +
    + Letter case + {{settings.lettercase}} +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    @@ -211,7 +231,7 @@

    - Satisfied with the results? +
    diff --git a/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.ts b/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.ts index 7372aa1..19b75a3 100644 --- a/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.ts +++ b/interactive-mining-angular-frontend/src/app/configuration/settings/settings.component.ts @@ -205,6 +205,7 @@ export class SettingsComponent implements OnInit { return; } localStorage.setItem('contextprev', value); + this.getSettingsFromLocalStorage(); } contextnextChange(value): void { @@ -212,6 +213,7 @@ export class SettingsComponent implements OnInit { return; } localStorage.setItem('contextnext', value); + this.getSettingsFromLocalStorage(); } wordssplitnumChange(value): void { @@ -219,6 +221,7 @@ export class SettingsComponent implements OnInit { return; } localStorage.setItem('wordssplitnum', value); + this.getSettingsFromLocalStorage(); } stopwordsCheckBoxChange(value: boolean): void { diff --git a/interactive-mining-angular-frontend/src/app/manageprofiles/manageprofiles.component.html b/interactive-mining-angular-frontend/src/app/manageprofiles/manageprofiles.component.html index 1abdcb4..93098bb 100644 --- a/interactive-mining-angular-frontend/src/app/manageprofiles/manageprofiles.component.html +++ b/interactive-mining-angular-frontend/src/app/manageprofiles/manageprofiles.component.html @@ -8,10 +8,10 @@ - Name + Profile Created Status - Matches found + Matches @@ -36,7 +36,7 @@ {{profile.name}} - {{profile.datecreated}} + {{profile.datecreated}} {{profile.status}} {{profile.matches}} @@ -78,12 +78,12 @@
-
+

Start with a ready example

-