Examples of Post


Examples of org.superbiz.rest.model.Post

        User user = dao.find(User.class, userId);
        if (user == null) {
            throw new IllegalArgumentException("user id " + id + " not found");
        }

        Post post = dao.find(Post.class, id);
        if (post == null) {
            throw new IllegalArgumentException("post id " + id + " not found");
        }

        post.setTitle(title);
        post.setContent(content);
        post.setUser(user);
        return dao.update(post);
    }
View Full Code Here

Examples of org.superbiz.rest.model.Post

@Stateless
public class CommentDAO extends DAO {
    @EJB private DAO dao;

    public List<Comment> list(long postId) {
        Post post = dao.find(Post.class, postId);
        if (post == null) {
            throw new IllegalArgumentException("post with id " + postId + " not found");
        }
        return Collections.unmodifiableList(post.getComments());
    }
View Full Code Here

Examples of org.superbiz.rest.model.Post

        }
        return Collections.unmodifiableList(post.getComments());
    }

    public Comment create(String author, String content, long postId) {
        Post post = dao.find(Post.class, postId);
        if (post == null) {
            throw new IllegalArgumentException("post with id " + postId + " not found");
        }

        Comment comment = new Comment();
View Full Code Here

Examples of org.superbiz.rest.model.Post

public class PostDAO {
    @EJB private DAO dao;

    public Post create(String title, String content, long userId) {
        User user = dao.find(User.class, userId);
        Post post = new Post();
        post.setTitle(title);
        post.setContent(content);
        post.setUser(user);
        return dao.create(post);
    }
View Full Code Here

Examples of org.superbiz.rest.model.Post

        User user = dao.find(User.class, userId);
        if (user == null) {
            throw  new IllegalArgumentException("user id " + id + " not found");
        }

        Post post = dao.find(Post.class, id);
        if (post == null) {
            throw  new IllegalArgumentException("post id " + id + " not found");
        }

        post.setTitle(title);
        post.setContent(content);
        post.setUser(user);
        return dao.update(post);
    }
View Full Code Here

Examples of sagan.blog.Post

    }

    // Query methods

    public Post getPost(Long postId) {
        Post post = postRepository.findOne(postId);
        if (post == null) {
            throw new PostNotFoundException(postId);
        }
        return post;
    }
View Full Code Here

Examples of se.caboo.beast.model.Post

    NSArray<Post> topicPosts = singleTopic.posts();
    for (Post post : topicPosts) {
      System.out.println("Application.Application:   " + post.createdAt());
    }
   
    Post randomPost = topicPosts.lastObject();
    System.out.println("Application.Application: Fetching the topic for a post (this will break if topic is not already fetched)");
    System.out.println("Application.Application:   " + randomPost.topic().title());
   
    System.out.println("Application.Application: Fetch author of post");
    User postedByUser = randomPost.user();
    System.out.println("Application.Application:   " + postedByUser.displayName());
   
    System.out.println("Application.Application: Fetching posts by author");
    NSArray<Post> userPosts = postedByUser.posts();
    for (Post post : userPosts) {
View Full Code Here

Examples of sino.entities.Post

    public void deletePost(long id) throws PostServiceException {
        ParamUtility.checkNotNegative(null, id, "id");
        ParamUtility.checkState(null, this.postDao, "postDao");

        try {
            Post post = this.postDao.retrieve(id);
            if (post != null) {
                this.postDao.delete(post);
            }
        } catch (DaoException e) {
            throw new PostServiceException("Cannot delete post. Dao exception: " + e.getMessage(), e);
View Full Code Here

Examples of slash.navigation.rest.Post

    public String checkForUpdate(String routeConverterVersion, String routeConverterBits, long startCount,
                                 String javaVersion, String javaBits,
                                 String osName, String osVersion, String osArch,
                                 String webstartVersion, long startTime) throws IOException {
        log.fine("Checking for update for version " + routeConverterVersion);
        Post request = new Post(rootUrl + UPDATE_CHECK_URI, credentials);
        request.addString("id", valueOf(startTime));
        request.addString("javaBits", javaBits);
        request.addString("javaVersion", javaVersion);
        request.addString("locale", getDefault().getLanguage());
        request.addString("osArch", osArch);
        request.addString("osName", osName);
        request.addString("osVersion", osVersion);
        request.addString("rcStartCount", Long.toString(startCount));
        request.addString("rcVersion", routeConverterVersion);
        request.addString("rcBits", routeConverterBits);
        if (webstartVersion != null)
            request.addString("webstartVersion", webstartVersion);
        return request.executeAsString().replace("\"", "");
    }
View Full Code Here

Examples of tifauv.jplop.core.board.Post

    // Load the roles
    Element board = p_history.getDocumentElement();
    if (board != null) {
      // <post> elements
      NodeList posts = board.getElementsByTagName(Post.POST_TAGNAME);
      Post post = null;
      for (int i=posts.getLength()-1; i>=0; --i) {
        post = new Post((Element)posts.item(i));
        getObject().addPost(post);
      }
     
      // We have the past post, update the id counter
      if (post != null)
        getObject().setNextId(post.getId() + 1);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.