diff --git a/src/main/java/ru/ulstu/deadline/model/Deadline.java b/src/main/java/ru/ulstu/deadline/model/Deadline.java index d0564a0..8edab97 100644 --- a/src/main/java/ru/ulstu/deadline/model/Deadline.java +++ b/src/main/java/ru/ulstu/deadline/model/Deadline.java @@ -108,9 +108,7 @@ public class Deadline extends BaseEntity { } return getId().equals(deadline.getId()) && description.equals(deadline.description) && - date.equals(deadline.date) && - executors.equals(deadline.executors) && - done.equals(deadline.done); + date.equals(deadline.date); } @Override diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index bc86bf8..a1febdd 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -100,7 +100,7 @@ public class Paper extends BaseEntity implements UserActivity, EventSource { @Temporal(TemporalType.TIMESTAMP) private Date updateDate = new Date(); - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "paper_id", unique = true) @Fetch(FetchMode.SUBSELECT) @OrderBy("date") @@ -123,10 +123,6 @@ public class Paper extends BaseEntity implements UserActivity, EventSource { @ManyToMany(fetch = FetchType.EAGER) private Set authors = new HashSet<>(); - - @Column(name = "latex_text") - private String latexText; - @ManyToOne() @JoinColumn(name = "conference_id") private Conference conference; @@ -245,14 +241,6 @@ public class Paper extends BaseEntity implements UserActivity, EventSource { this.url = url; } - public String getLatexText() { - return latexText; - } - - public void setLatexText(String latexText) { - this.latexText = latexText; - } - public Conference getConference() { return conference; } @@ -322,13 +310,12 @@ public class Paper extends BaseEntity implements UserActivity, EventSource { Objects.equals(events, paper.events) && Objects.equals(files, paper.files) && Objects.equals(authors, paper.authors) && - Objects.equals(latexText, paper.latexText) && Objects.equals(conference, paper.conference) && Objects.equals(grants, paper.grants); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), title, status, type, createDate, updateDate, deadlines, comment, url, locked, events, files, authors, latexText, conference, grants); + return Objects.hash(super.hashCode(), title, status, type, createDate, updateDate, deadlines, comment, url, locked, events, files, authors, conference, grants); } } diff --git a/src/main/java/ru/ulstu/paper/model/PaperDto.java b/src/main/java/ru/ulstu/paper/model/PaperDto.java index cc44af5..8199d80 100644 --- a/src/main/java/ru/ulstu/paper/model/PaperDto.java +++ b/src/main/java/ru/ulstu/paper/model/PaperDto.java @@ -3,6 +3,7 @@ package ru.ulstu.paper.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.commons.lang3.StringUtils; +import ru.ulstu.core.model.BaseEntity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.file.model.FileDataDto; import ru.ulstu.user.model.UserDto; @@ -89,10 +90,9 @@ public class PaperDto { this.deadlines = paper.getDeadlines(); this.comment = paper.getComment(); this.url = paper.getUrl(); - this.latexText = paper.getLatexText(); this.locked = paper.getLocked(); this.files = convert(paper.getFiles(), FileDataDto::new); - this.authorIds = convert(paper.getAuthors(), user -> user.getId()); + this.authorIds = convert(paper.getAuthors(), BaseEntity::getId); this.authors = convert(paper.getAuthors(), UserDto::new); this.references = convert(paper.getReferences(), ReferenceDto::new); } @@ -212,7 +212,7 @@ public class PaperDto { public String getAuthorsString() { return StringUtils.abbreviate(authors .stream() - .map(author -> author.getLastName()) + .map(UserDto::getLastName) .collect(Collectors.joining(", ")), MAX_AUTHORS_LENGTH); } diff --git a/src/main/java/ru/ulstu/paper/service/PaperService.java b/src/main/java/ru/ulstu/paper/service/PaperService.java index 4f2be86..9e02113 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperService.java @@ -81,9 +81,7 @@ public class PaperService { } public List findAllDto() { - List papers = convert(findAll(), PaperDto::new); - papers.forEach(paperDto -> paperDto.setTitle(StringUtils.abbreviate(paperDto.getTitle(), MAX_DISPLAY_SIZE))); - return papers; + return convert(findAll(), PaperDto::new); } public List findAllActive() { @@ -125,7 +123,6 @@ public class PaperService { private Paper copyFromDto(Paper paper, PaperDto paperDto) throws IOException { paper.setComment(paperDto.getComment()); paper.setUrl(paperDto.getUrl()); - paper.setLatexText(paperDto.getLatexText()); paper.setCreateDate(paper.getCreateDate() == null ? new Date() : paper.getCreateDate()); paper.setLocked(paperDto.getLocked()); paper.setStatus(paperDto.getStatus() == null ? DRAFT : paperDto.getStatus()); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8531d06..830b5ea 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -36,7 +36,7 @@ spring.liquibase.enabled=true # Application Settings ng-tracker.base-url=http://127.0.0.1:8080 ng-tracker.undead-user-login=admin -ng-tracker.dev-mode=false +ng-tracker.dev-mode=true ng-tracker.debug_email= ng-tracker.use-https=false ng-tracker.check-run=false diff --git a/src/main/resources/templates/papers/fragments/paperLineFragment.html b/src/main/resources/templates/papers/fragments/paperLineFragment.html index 8c843d8..2679fce 100644 --- a/src/main/resources/templates/papers/fragments/paperLineFragment.html +++ b/src/main/resources/templates/papers/fragments/paperLineFragment.html @@ -4,23 +4,33 @@ -
-
- - - - +
+ +
+
+
+
- - - - - +
- - \ No newline at end of file diff --git a/src/main/resources/templates/papers/paper.html b/src/main/resources/templates/papers/paper.html index b1f195a..e5b39f7 100644 --- a/src/main/resources/templates/papers/paper.html +++ b/src/main/resources/templates/papers/paper.html @@ -33,8 +33,6 @@