Skip to content

Commit

Permalink
upload of all necessary files for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
sventhiel committed May 17, 2022
1 parent 6ce5c46 commit a01cc0b
Show file tree
Hide file tree
Showing 23 changed files with 2,105 additions and 2,794 deletions.
Binary file modified README.pdf
Binary file not shown.
3,969 changes: 1,432 additions & 2,537 deletions angular/package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"bootstrap": "^4.5.2",
"class-transformer": "^0.4.0",
"es6-shim": "^0.35.6",
"fast-cartesian": "^6.1.0",
"jw-angular-pagination": "^1.2.0",
"keycloak-angular": "^8.2.0",
"keycloak-js": "^11.0.3",
Expand All @@ -41,12 +42,13 @@
"reflect-metadata": "^0.1.13",
"rxjs": "^6.6.7",
"stream": "0.0.2",
"tokenizr": "^1.6.5",
"tslib": "^2.0.0",
"xml-js": "^1.6.11",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.1.1",
"@angular-devkit/build-angular": "^13.1.4",
"@angular/cli": "~13.1.1",
"@angular/compiler-cli": "~13.1.0",
"@types/jasmine": "~3.6.0",
Expand Down
1 change: 1 addition & 0 deletions angular/src/app/basket-dialog/basket-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class BasketDialogComponent implements OnInit {
textTooltipBasketMultimediaAvailable = environment.textTooltipBasketMultimediaAvailable;
textTooltipBasketMultimediaNotAvailable = environment.textTooltipBasketMultimediaNotAvailable;
textTooltipBasketRemove = environment.textTooltipBasketRemove;
textTooltipBasketRemoveSure = environment.textTooltipBasketRemoveSure;
textTooltipBasketEmpty = environment.textTooltipBasketEmpty;
spinner = false;
savedData: Array<Hit> = [];
Expand Down
6 changes: 3 additions & 3 deletions angular/src/app/filters/filters.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class FiltersComponent implements OnChanges {

startSearching(): void {
this.filters.emit(this.chosenFilter);
console.log(this.chosenFilter);
console.log(this.filterValues);
// console.log(this.chosenFilter);
// console.log(this.filterValues);
}

removeFilter(i): void {
Expand All @@ -86,7 +86,7 @@ export class FiltersComponent implements OnChanges {
}

applyDate(dates, datePicker): void {
console.log(dates);
// console.log(dates);
const start = dates[0];
const end = dates[1];
if (start !== undefined || end !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class OtherFiltersComponent implements OnInit {
this.filterValues.forEach((value) => {
this.filter.forEach((item) => {
if (value === item.label) {
console.log(item.label);
// console.log(item.label);
item.checked = true;
}
});
Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/gfbio/gfbio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class GfbioComponent implements OnInit, SearchResult, Filters, SearchInpu
semantic = false;
resetFilters = true;
result: Result;
searchKey = '';
searchKey = [];
from = 0;
filters;
markers;
Expand Down
64 changes: 58 additions & 6 deletions angular/src/app/models/result/hit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ export class Hit {
// it contains the information related to the download of the dataset
private metadatalink: string;
// it contains the information related to the download of the dataset
private identifier: string;
private dcIdentifier: string;
// every dataset can be shown on the map with an specific color
private color: string;
// most of the information of the dataset is in the xml
private xml: string;
// if this dataset has been selected by the user
private checkbox: boolean;

//
private datalink: string;

private parentIdentifier: string;

private dcType: Array<string>;

getTitle(): string {
return this.title;
}
Expand Down Expand Up @@ -67,15 +74,22 @@ export class Hit {
}

setMetadatalink(metadatalink: string): void {
this.metadatalink = metadatalink;
if(metadatalink != "undefined" && metadatalink != null)
{
this.metadatalink = encodeURI(metadatalink);
}else{
this.metadatalink = null;
}

// this.metadatalink = metadatalink;
}

getIdentifier(): string {
return this.identifier;
return this.dcIdentifier;
}

setIdentifier(identifier: string): void {
this.identifier = identifier;
setIdentifier(dcIdentifier: string): void {
this.dcIdentifier = dcIdentifier;
}

getLinkage(): Linkage {
Expand All @@ -99,7 +113,14 @@ export class Hit {
}

setTitleUrl(titleUrl: string): void {
this.titleUrl = titleUrl;
if(titleUrl != "undefined" && titleUrl != null)
{
this.titleUrl = encodeURI(titleUrl);
}else{
this.titleUrl = null;
}

// this.titleUrl = titleUrl;
}

getDescription(): Array<Description> {
Expand Down Expand Up @@ -189,4 +210,35 @@ export class Hit {
setCheckbox(checkbox: boolean): void {
this.checkbox = checkbox;
}

getDatalink(): string {
return this.datalink;
}

setDatalink(datalink: string): void {
if(datalink != "undefined" && datalink != null)
{
this.datalink = encodeURI(datalink);
}else{
this.datalink = null;
}

// this.datalink = datalink;
}

getParentIdentifier(): string {
return this.parentIdentifier;
}

setParentIdentifier(parentIdentifier: string): void {
this.parentIdentifier = parentIdentifier;
}

getType(): Array<string> {
return this.dcType;
}

setType(dcType: Array<string>): void {
this.dcType = dcType;
}
}
9 changes: 8 additions & 1 deletion angular/src/app/models/result/linkage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export class Linkage {
}

setMetadata(metadata: string): void {
this.metadata = metadata;
if(metadata != "undefined" && metadata != null)
{
this.metadata = encodeURI(metadata);
}else{
this.metadata = null;
}

// this.metadata = metadata;
}
getMultimedia(): Array<any> {
return this.multimedia;
Expand Down
42 changes: 27 additions & 15 deletions angular/src/app/search-input/search-input.component.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import {Component, EventEmitter, Output} from '@angular/core';
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {NodeService} from '../services/remote/node.service';
import {CommunicationService} from '../services/local/communication.service';
import {faSearch} from '@fortawesome/free-solid-svg-icons';
import {StartSearchingService} from '../services/local/start-searching.service';
import {environment} from '../../environments/environment';
import * as booleanParser from 'boolean-parser';
import {InputAnalysisService} from '../services/local/input-analysis.service';

@Component({
selector: 'app-search-input',
templateUrl: './search-input.component.html',
styleUrls: ['./search-input.component.css']
})
export class SearchInputComponent {
export class SearchInputComponent implements OnInit {

constructor(private nodeService: NodeService,
private startSearchingService: StartSearchingService,
private communicationService: CommunicationService) {
private communicationService: CommunicationService,
private inputAnalysis: InputAnalysisService) {
}

faSearch = faSearch;
Expand All @@ -23,13 +26,18 @@ export class SearchInputComponent {
result: any;
windowSuggestion = false;
semanticValue: boolean;
formatSimpleSearch = /[!@#$%^&_+\-=\[\]{};':\\|,<>\/?]+/;
formatSemanticSearch = /[!@#$%^&_+\-=\[\]{};':"\\|,<>\/?*]+/;
formatSimpleSearch = /[!@#$%^&_\-=\[\]{};:\\,<>\/?]+/;
formatSemanticSearch = /[!@#$%^&_\-=\[\]{};:\\,<>\/?]+/;
alertSearch = false;
alertSemanticSearch = false;

semSearchImg: string = environment.imagePath + environment.semSearchImg;

ngOnInit(): void {
// const str = 'fff (gg tt gg) hhh (jj vv + cc gg) lll + kkk + rrr bee*';
// console.log(str);
// this.inputAnalysis.getAnalysis(str).then((response) => console.log(response));
}

// by entering a letter on the form, a request will be sent to the node server and then it will be sent to suggestion-window
onWindowSuggestKey(value): void {
if (value !== undefined) {
Expand All @@ -48,12 +56,6 @@ export class SearchInputComponent {
this.alertSearch = this.formatSimpleSearch.test(this.searchKey);
this.alertSemanticSearch = false;
this.startSearching(this.semanticValue);
try {
const parsedQuery = booleanParser.parseBooleanQuery(this.searchKey);
console.log(parsedQuery);
} catch (e){
console.log(e);
}
}

// by clicking on the semantic search button, this method will be called
Expand All @@ -72,12 +74,22 @@ export class SearchInputComponent {
}

startSearching(semantic: boolean): void {
const keyAndSemantic = [this.searchKey, semantic];
this.searchKeyEmmit.emit(keyAndSemantic);
if (this.searchKey.endsWith('*') && this.searchKey.length < 6 && semantic === true) {
alert(environment.textAlertWordLength);
}else {
this.inputAnalysis.getAnalysis2(this.searchKey, semantic).then((response) => {
console.log(response);
const keyAndSemantic = [response, semantic];
// console.log(keyAndSemantic);
this.searchKeyEmmit.emit(keyAndSemantic);
});
// const keyAndSemantic = [this.searchKey, semantic];
// this.searchKeyEmmit.emit(keyAndSemantic);
}
}

onSuggest(): void {
this.nodeService.suggest(this.searchKey).subscribe(data => {
this.nodeService.suggestSimple(this.searchKey).subscribe(data => {
this.communicationService.setSuggest(data.suggest[0].options);
this.windowSuggestion = data.suggest[0].options.length !== 0;
});
Expand Down
17 changes: 15 additions & 2 deletions angular/src/app/services/local/gfbio-preprocess-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class GfbioPreprocessDataService {
private id;
private colors = environment.colors;
private vatTooltip = environment.vatTooltip;
private noCoordinates = environment.noCoordinates;

/*maps the json which comes from the server to the Result class, it is the most important function in this service,
other functions can be deleted according to the json response
Expand Down Expand Up @@ -123,9 +124,9 @@ export class GfbioPreprocessDataService {

getTitleTooltip(hit: Hit): string {
if (hit.getLatitude !== undefined && hit.getLongitude() !== undefined) {
return 'This dataset has coordinates: min latitude: ' + hit.getLatitude() + ', max longitude: ' + hit.getLongitude();
return 'min latitude: ' + hit.getLatitude() + ', max longitude: ' + hit.getLongitude();
} else {
return 'This dataset has no coordinates and can not be located on the map.';
return this.noCoordinates;
}
}

Expand Down Expand Up @@ -164,6 +165,7 @@ export class GfbioPreprocessDataService {
hit.setLatitude(source?.minLatitude);
hit.setTitleTooltip(this.getTitleTooltip(hit));
hit.setMetadatalink(source?.metadatalink);
hit.setDatalink(source?.datalink);
// set array of descriptions
const tr = dom?.querySelectorAll('.desc tr');
const description = [];
Expand Down Expand Up @@ -196,12 +198,19 @@ export class GfbioPreprocessDataService {
// the properties that are going to be extracted are: identifier, linkage and MultimediaObjs
const xml = this.communicationService.xmltoJson(source?.xml)?.elements?.[0]?.elements;
const multimediaObjs: Array<any> = [];
const types: Array<string> = [];
const linkage = new Linkage();
let relation = '';
xml.forEach(element => {
if (element.name === 'dc:identifier') {
hit.setIdentifier(element.elements[0].text);
}
if (element.name === 'dc:type') {
types.push(element.elements[0].text);
}
if (element.name === 'parentIdentifier') {
hit.setParentIdentifier(element.elements[0].text);
}
if (element.name === 'linkage') {
if (element.attributes.type === 'multimedia') {
const text = element.elements[0].text;
Expand Down Expand Up @@ -243,6 +252,7 @@ export class GfbioPreprocessDataService {
descriptionItem.setValue('<ul>' + relation + '</ul>');
description.push(descriptionItem);
}
hit.setType(types);
hit.setLinkage(linkage);
hit.setDescription(description);
hit.setMultimediaObjs(multimediaObjs);
Expand Down Expand Up @@ -311,6 +321,9 @@ export class GfbioPreprocessDataService {
break;
case 'Gatersleben':
dataCenter.setTooltip(GfbioPreprocessDataService.datacenterTooltips.Gatersleben);
break;
case 'ENA':
dataCenter.setTooltip(GfbioPreprocessDataService.datacenterTooltips.ENA);
break;
default:
dataCenter.setTooltip('Publisher');
Expand Down
16 changes: 16 additions & 0 deletions angular/src/app/services/local/input-analysis.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { InputAnalysisService } from './input-analysis.service';

describe('InputAnalysisService', () => {
let service: InputAnalysisService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(InputAnalysisService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
Loading

0 comments on commit a01cc0b

Please sign in to comment.