Remove PostProvider methods from Core.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ViewPostPage.java
index 8adf46d..409c63a 100644 (file)
@@ -19,14 +19,14 @@ package net.pterodactylus.sone.web;
 
 import java.net.URI;
 
-import com.google.common.base.Optional;
-
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.template.SoneAccessor;
 import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
 
+import com.google.common.base.Optional;
+
 /**
  * This page lets the user view a post and all its replies.
  *
@@ -50,13 +50,10 @@ public class ViewPostPage extends SoneTemplatePage {
        // TEMPLATEPAGE METHODS
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected String getPageTitle(FreenetRequest request) {
                String postId = request.getHttpRequest().getParam("post");
-               Optional<Post> post = webInterface.getCore().getPost(postId);
+               Optional<Post> post = webInterface.getCore().getDatabase().getPost(postId);
                String title = "";
                if (post.isPresent()) {
                        title = post.get().getText().substring(0, Math.min(20, post.get().getText().length())) + "…";
@@ -66,22 +63,16 @@ public class ViewPostPage extends SoneTemplatePage {
                return title;
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
                String postId = request.getHttpRequest().getParam("post");
                boolean raw = request.getHttpRequest().getParam("raw").equals("true");
-               Optional<Post> post = webInterface.getCore().getPost(postId);
+               Optional<Post> post = webInterface.getCore().getDatabase().getPost(postId);
                templateContext.set("post", post.orNull());
                templateContext.set("raw", raw);
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public boolean isLinkExcepted(URI link) {
                return true;