Package com.ponxu.blog4j.model

Examples of com.ponxu.blog4j.model.Tag


  // 把标签关联到文章
  private void updateTags(Post post, int[] tagIds) {
    // 1 删除多余标签
    Iterator<Tag> tit = post.getTags().iterator();
    while (tit.hasNext()) {
      Tag tag = tit.next();
      if (BeanUtils.isNot(tag.getId(), tagIds)) {
        removeTag(post.getId(), tag.getId());
        tit.remove();
      }
    }

    // 2 关联新增标签
View Full Code Here


    renderTemplate(FTL.admin.TAG_LIST);
  }

  public void post() {
    int id = getIntParam("id");
    Tag tag = prepareTag(id);
    tag.setName(getParam("name"));
    tag.setSort(getIntParam("sort", tag.getSort()));

    if (id == 0) {
      id = tagService.add(tag);
    } else {
      tagService.modify(tag);
View Full Code Here

    renderString(String.valueOf(id));
  }

  private Tag prepareTag(int id) {
    Tag tag = null;
    tag = new Tag();
    tag.setId(id);
    return tag;
  }
View Full Code Here

TOP

Related Classes of com.ponxu.blog4j.model.Tag

Copyright © 2018 www.massapicom. 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.