From bf6dd8390c1419b8fec56f6dcf09822c2cf59b72 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 5 Sep 2018 11:39:20 +0300 Subject: ActivityStreams: Article -> Note --- .../com/juick/server/api/activity/Profile.java | 12 ++++++------ .../juick/server/api/activity/model/Article.java | 22 ---------------------- .../juick/server/api/activity/model/Create.java | 6 +++--- .../com/juick/server/api/activity/model/Note.java | 22 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 juick-server/src/main/java/com/juick/server/api/activity/model/Article.java create mode 100644 juick-server/src/main/java/com/juick/server/api/activity/model/Note.java (limited to 'juick-server/src/main/java/com/juick/server/api/activity') diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index 0b8db1fc..d19b1c9c 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -80,16 +80,16 @@ public class Profile { if (!user.isAnonymous()) { ServletUriComponentsBuilder uriComponentsBuilder = ServletUriComponentsBuilder.fromCurrentRequestUri(); List mids = messagesService.getUserBlog(user.getUid(), 0, before); - List
articles = messagesService.getMessages(visitor, mids).stream().map(m -> { - Article article = new Article(); - article.setPublished(m.getTimestamp()); - article.setContent(m.getText()); - return article; + List notes = messagesService.getMessages(visitor, mids).stream().map(m -> { + Note note = new Note(); + note.setPublished(m.getTimestamp()); + note.setContent(m.getText()); + return note; }).collect(Collectors.toList()); Person person = new Person(); person.setName(user.getName()); OrderedCollectionPage page = new OrderedCollectionPage(); - page.setOrderedItems(articles.stream().map(a -> { + page.setOrderedItems(notes.stream().map(a -> { Create create = new Create(); create.setActor(person); create.setObject(a); diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java deleted file mode 100644 index e117475d..00000000 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.juick.server.api.activity.model; - -public class Article extends ActivityObject { - private String content; - private String attributedTo; - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getAttributedTo() { - return attributedTo; - } - - public void setAttributedTo(String attributedTo) { - this.attributedTo = attributedTo; - } -} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java index 7b4e7b16..8d81b26b 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java @@ -3,7 +3,7 @@ package com.juick.server.api.activity.model; public class Create extends ActivityObject { private Person actor; - private Article object; + private Note object; public Person getActor() { return actor; @@ -13,11 +13,11 @@ public class Create extends ActivityObject { this.actor = actor; } - public Article getObject() { + public Note getObject() { return object; } - public void setObject(Article object) { + public void setObject(Note object) { this.object = object; } } diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java new file mode 100644 index 00000000..0716779a --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java @@ -0,0 +1,22 @@ +package com.juick.server.api.activity.model; + +public class Note extends ActivityObject { + private String content; + private String attributedTo; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getAttributedTo() { + return attributedTo; + } + + public void setAttributedTo(String attributedTo) { + this.attributedTo = attributedTo; + } +} -- cgit v1.2.3