commit 2b790e0080b3a75612faa278a3eee11a19f27f1c
Author: Ondřej Váně <onry.vane@gmail.com>
Date:   Sat Apr 4 00:11:02 2020 +0200

    Re #7726: Implementace architektury FE
    
    - implementace metody pro získání všech dokumentů z BE
    - implementováno basic view pro stránku Browse

diff --git a/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/IndexController.java b/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/IndexController.java
index e068b48..505d6a5 100644
--- a/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/IndexController.java
+++ b/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/IndexController.java
@@ -1,5 +1,6 @@
 package cz.zcu.kiv.aswi.fulltextsearch;
 
+import cz.zcu.kiv.aswi.fulltextsearch.model.DocumentResponse;
 import cz.zcu.kiv.aswi.fulltextsearch.model.Query;
 import cz.zcu.kiv.aswi.fulltextsearch.model.QueryResponse;
 import cz.zcu.kiv.aswi.fulltextsearch.model.ResponseMessage;
@@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.xml.bind.JAXBException;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 @CrossOrigin(origins = "*", allowedHeaders = "*")
@@ -51,6 +53,24 @@ public class IndexController {
         }
     }
 
+    @GetMapping("/documents")
+    public List<DocumentResponse> uploadFile() {
+
+        // TODO : získat všechny uložené dokumenty v systému
+
+        return new ArrayList<>() {
+            {
+                add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-06-16-n24_0855", 1));
+                add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-09-15-n37_1365", 2));
+                add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-08-25-n34_1255", 3));
+                add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-07-07-n27_0980", 4));
+            }
+        };
+
+    }
+
+
+
     @GetMapping("/add")
     public String add() {
         String response;
diff --git a/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/model/DocumentResponse.java b/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/model/DocumentResponse.java
new file mode 100644
index 0000000..a4efbff
--- /dev/null
+++ b/be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/model/DocumentResponse.java
@@ -0,0 +1,28 @@
+package cz.zcu.kiv.aswi.fulltextsearch.model;
+
+public class DocumentResponse {
+
+    private String documentName;
+    private int id;
+
+    public DocumentResponse(String documentName, int id) {
+        this.documentName = documentName;
+        this.id = id;
+    }
+
+    public String getDocumentName() {
+        return documentName;
+    }
+
+    public void setDocumentName(String documentName, int id) {
+        this.documentName = documentName;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+}
diff --git a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.css b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.css
index e69de29..e535a99 100644
--- a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.css
+++ b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.css
@@ -0,0 +1,9 @@
+h1 {
+  font-size: xx-large;
+}
+
+.text-box {
+  margin: auto;
+  width: 80%;
+  padding: 10px;
+}
diff --git a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.html b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.html
index c3640d7..b089fae 100644
--- a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.html
+++ b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.html
@@ -1 +1,13 @@
-<p>browse works!</p>
+<div class="text-box">
+  <div class="card">
+    <h1 class="card-header">All documents</h1>
+    <div class="card-body">
+      <ul class="list-group">
+        <li class="list-group-item" *ngFor="let documentResponse of documents">
+          <b>Id: </b>{{documentResponse.id}}
+          <b>Document name: </b>{{documentResponse.documentName}}
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
diff --git a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.ts b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.ts
index 1e91611..14a2a7e 100644
--- a/fe/fulltextsearch/src/app/components/pages/browse/browse.component.ts
+++ b/fe/fulltextsearch/src/app/components/pages/browse/browse.component.ts
@@ -1,4 +1,6 @@
 import { Component, OnInit } from '@angular/core';
+import {DocumentResponse} from '../../../model/DocumentResponse';
+import {QueryService} from '../../../services/query.service';
 
 @Component({
   selector: 'app-browse',
@@ -6,10 +8,14 @@ import { Component, OnInit } from '@angular/core';
   styleUrls: ['./browse.component.css']
 })
 export class BrowseComponent implements OnInit {
+  documents: DocumentResponse[] = null;
 
-  constructor() { }
+  constructor( private queryService: QueryService ) { }
 
   ngOnInit(): void {
+    this.queryService.getDocuments().subscribe( documents => {
+      this.documents = documents;
+    });
   }
 
 }
diff --git a/fe/fulltextsearch/src/app/services/query.service.ts b/fe/fulltextsearch/src/app/services/query.service.ts
index 7a99b23..ac0cd6f 100644
--- a/fe/fulltextsearch/src/app/services/query.service.ts
+++ b/fe/fulltextsearch/src/app/services/query.service.ts
@@ -3,6 +3,7 @@ import {HttpClient, HttpEventType, HttpHeaders} from '@angular/common/http';
 import {Observable} from 'rxjs';
 import {QueryResponse} from '../model/QueryResponse';
 import {Query} from '../model/Query';
+import {DocumentResponse} from '../model/DocumentResponse';
 
 const httpOptions = {
   headers: new HttpHeaders( {
@@ -17,6 +18,7 @@ export class QueryService {
 
   backendUrl = 'http://localhost:8080/';
   uploadFileUrl = 'upload';
+  documentsUrl = 'documents';
 
   constructor(private httpClient: HttpClient) {}
 
@@ -35,4 +37,10 @@ export class QueryService {
       observe: 'events'
     });
   }
+
+  getDocuments(): Observable<DocumentResponse[]> {
+    return this.httpClient.get<DocumentResponse[]>(this.backendUrl + this.documentsUrl, httpOptions);
+  }
+
+
 }
