-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
373 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/de/holarse/backend/db/repositories/AttachmentRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package de.holarse.backend.db.repositories; | ||
|
||
import de.holarse.backend.db.Attachment; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface AttachmentRepository extends JpaRepository<Attachment, Integer> { | ||
|
||
@Query("from Attachment a " + | ||
"join a.attachmentType at " + | ||
"join at.attachmentGroup ag " + | ||
"where a.nodeId = :nodeId and ag.code = :code " + | ||
"order by a.weight") | ||
List<Attachment> findByGroup(@Param("nodeId") Integer nodeId, @Param("code") String code); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package de.holarse.backend.view; | ||
|
||
import de.holarse.backend.db.NodeStatus; | ||
|
||
public class SettingsView { | ||
|
||
private boolean archived; | ||
private boolean commentable; | ||
private boolean published; | ||
private boolean deleted; | ||
|
||
public static SettingsView of(final NodeStatus nodeStatus) { | ||
final SettingsView view = new SettingsView(); | ||
view.setArchived(nodeStatus.isArchived()); | ||
view.setCommentable(nodeStatus.isCommentable()); | ||
view.setPublished(nodeStatus.isPublished()); | ||
view.setDeleted(nodeStatus.isDeleted()); | ||
return view; | ||
} | ||
|
||
public boolean isPublished() { | ||
return published; | ||
} | ||
|
||
public void setPublished(boolean published) { | ||
this.published = published; | ||
} | ||
|
||
public boolean isArchived() { | ||
return archived; | ||
} | ||
|
||
public void setArchived(boolean archived) { | ||
this.archived = archived; | ||
} | ||
|
||
public boolean isCommentable() { | ||
return commentable; | ||
} | ||
|
||
public void setCommentable(boolean commentable) { | ||
this.commentable = commentable; | ||
} | ||
|
||
public boolean isDeleted() { | ||
return deleted; | ||
} | ||
|
||
public void setDeleted(boolean deleted) { | ||
this.deleted = deleted; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/de/holarse/backend/view/WebsiteLinkView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package de.holarse.backend.view; | ||
|
||
import de.holarse.backend.db.Attachment; | ||
|
||
public class WebsiteLinkView { | ||
|
||
private Attachment link1; | ||
private Attachment link2; | ||
private Attachment link3; | ||
|
||
public Attachment getLink1() { | ||
return link1; | ||
} | ||
|
||
public void setLink1(Attachment link1) { | ||
this.link1 = link1; | ||
} | ||
|
||
public Attachment getLink2() { | ||
return link2; | ||
} | ||
|
||
public void setLink2(Attachment link2) { | ||
this.link2 = link2; | ||
} | ||
|
||
public Attachment getLink3() { | ||
return link3; | ||
} | ||
|
||
public void setLink3(Attachment link3) { | ||
this.link3 = link3; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "WebsiteLinkView{" + "link1=" + link1 + ", link2=" + link2 + ", link3=" + link3 + '}'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.