Skip to content
Snippets Groups Projects
Commit af6f6dba authored by dre0059's avatar dre0059
Browse files

All files included

parent 6a898f45
Branches master
No related merge requests found
Showing with 584 additions and 1 deletion
File added
This diff is collapsed.
......@@ -166,7 +166,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<failOnError>false</failOnError>
<annotationProcessorPaths>
<path>
......
services:
grobid:
image: grobid/grobid:0.8.1
ports:
- "8070:8070"
db:
image: mysql
restart: always
environment:
MYSQL_USER: admin
MYSQL_ROOT_PASSWORD: admin
MYSQL_DATABASE: article-processor
volumes:
- ~/volumes/tmp/mysql-data:/var/lib/mysql
ports:
- "3306:3306"
package com.dre0059.articleprocessor.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConfigurationProperties(prefix = "grobid")
public class GrobidProperties {
private String host;
public void setHost(String host) {
this.host = host;
}
public String getHost() {
return host;
}
}
package com.dre0059.articleprocessor.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CategoryDto {
private String id;
private String name;
}
package com.dre0059.articleprocessor.dto;
public class DocumentContentDto {
private Long id;
private byte[] content;
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
package com.dre0059.articleprocessor.mapper;
import com.dre0059.articleprocessor.dto.CategoryDto;
import com.dre0059.articleprocessor.model.Category;
import java.util.List;
import org.mapstruct.Mapper;
@Mapper(componentModel = "spring")
public interface CategoryMapper {
CategoryDto toCategoryDto(Category entity);
Category toCategory(CategoryDto categoryDto);
List<CategoryDto> toCategoryDtoList(List<Category> entities);
}
package com.dre0059.articleprocessor.service;
import com.dre0059.articleprocessor.dto.CategoryDto;
import com.dre0059.articleprocessor.mapper.CategoryMapper;
import com.dre0059.articleprocessor.repository.CategoryRepository;
import java.util.List;
import org.springframework.stereotype.Service;
@Service
public class CategoryService {
private final CategoryMapper categoryMapper;
private final CategoryRepository categoryRepository;
public CategoryService(CategoryMapper categoryMapper, CategoryRepository categoryRepository) {
this.categoryMapper = categoryMapper;
this.categoryRepository = categoryRepository;
}
public CategoryDto getCategory(String id) {
return categoryMapper.toCategoryDto(categoryRepository.findById(id).orElse(null));
}
public List<CategoryDto> getAll() {
return categoryMapper.toCategoryDtoList(categoryRepository.findAll());
}
}
grobid.host=http://localhost:8070
\ No newline at end of file
server.port=8080
spring.application.name=articleProcessor
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
# Spring MVC for uploading PDF files
spring.servlet.multipart.max-file-size=5MB
spring.servlet.multipart.max-request-size=5MB
body {
margin: 25px;
background: linear-gradient(black, black, gray);
color: white;
min-height: 100vh;
background-attachment: fixed;
}
a{
text-decoration: none;
color : white;
}
a:visited{
color : white;
}
a:hover {
color: aquamarine;
}
select {
background: rgba(1,1,1,0.8);
color : cadetblue;
border: 1px solid #595959;
margin: 15px;
}
.title{
text-align: center;
}
h2{
color : aquamarine;
}
button {
margin : 5px;
}
form{
margin : 15px;
}
input{
margin : 15px;
}
/* Rodičovský kontajner pre flexbox */
#container {
display: flex;
justify-content: space-between; /* Rozdelenie priestoru medzi textom a PDF */
align-items: flex-start; /* Zarovnanie na vrchnú časť */
gap: 20px; /* Medzera medzi textom a PDF */
}
/* Pre textové informácie a referencie */
#text-container {
flex: 1; /* Text a referencie zabírajú všetok voľný priestor */
padding: 20px; /* Trochu medzery medzi textom a PDF */
}
/* Pre PDF kontajner */
#pdf-container {
width: 960px; /* Šírka PDF kontajnera */
height: 900px; /* Výška PDF kontajnera */
border : none;
}
table{
margin-top : 0 !important;
}
\ No newline at end of file
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