Examples of PageTagEntity


Examples of org.vosao.entity.PageTagEntity

    return result;
  }

  @Override
  public List<TagEntity> getTags(String pageURL) {
    PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
    if (pageTag != null) {
      return getDao().getTagDao().getById(pageTag.getTags());
    }
    return Collections.EMPTY_LIST;
  }
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

    return "/" + result;
  }

  @Override
  public void addTag(String pageURL, TagEntity tag) {
    PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
    if (pageTag == null) {
      pageTag = new PageTagEntity(pageURL);
    }
    if (!pageTag.getTags().contains(tag.getId())) {
      pageTag.getTags().add(tag.getId());
    }
    getDao().getPageTagDao().save(pageTag);
    if (!tag.getPages().contains(pageURL)) {
      tag.getPages().add(pageURL);
      getDao().getTagDao().save(tag);
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

    }
  }

  @Override
  public void removeTag(String pageURL, TagEntity tag) {
    PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
    if (pageTag != null) {
      if (pageTag.getTags().contains(tag.getId())) {
        pageTag.getTags().remove(tag.getId());
        getDao().getPageTagDao().save(pageTag);
      }
    }
    if (tag.getPages().contains(pageURL)) {
      tag.getPages().remove(pageURL);
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

      return null;
    }
  }

  public List<TagEntity> getPageTags(String pageURL) {
    PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
    if (pageTag != null) {
      return getDao().getTagDao().getById(pageTag.getTags());
    }
    return Collections.EMPTY_LIST;
  }
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

import org.vosao.entity.PageTagEntity;

public class PageTagDaoTest extends AbstractDaoTest {

  private PageTagEntity addPageTag(String url) {
    return getDao().getPageTagDao().save(new PageTagEntity(url));
  }
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

 
  public void testGetByURL() {
    addPageTag("/test1");
    addPageTag("/test2");
    addPageTag("/test3");
    PageTagEntity tag = getDao().getPageTagDao().getByURL("/test1");
    assertNotNull(tag);
    assertEquals("/test1", tag.getPageURL());
 
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

  }

  public String createPageTagXML(String pageURL) {
    Document doc = DocumentHelper.createDocument();
    Element e = doc.addElement("tags");
    PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
    if (pageTag != null) {
      List<TagEntity> tags = getDao().getTagDao().getById(
          pageTag.getTags());
      for (TagEntity tag : tags) {
        Element tagElement = e.addElement("tag");
        tagElement.addElement("name").setText(
            getBusiness().getTagBusiness().getPath(tag));
      }
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

      Element element = i.next();
      if (element.getName().equals("tag")) {
        String path = element.elementText("name");
        TagEntity tag = getBusiness().getTagBusiness().getByPath(path);
        if(tag != null) {
          PageTagEntity pageTag = getDao().getPageTagDao().getByURL(pageURL);
          if (pageTag == null) {
            pageTag = new PageTagEntity(pageURL);
          }
          if (!pageTag.getTags().contains(tag.getId())) {
            pageTag.getTags().add(tag.getId());
          }
          getDaoTaskAdapter().pageTagSave(pageTag);
          if (!tag.getPages().contains(pageURL)) {
            tag.getPages().add(pageURL);
            getDaoTaskAdapter().tagSave(tag);
View Full Code Here

Examples of org.vosao.entity.PageTagEntity

  @Override
  public void pageTagSave(PageTagEntity entity) throws DaoTaskException {
    if (isSkip()) {
      if (entity.getId() == null) {
        PageTagEntity found = getDao().getPageTagDao().getByURL(
            entity.getPageURL());
        if (found == null) {
          throw new DaoTaskException("Page Tag not found while "
              + "skipping save operation. " + entity.getPageURL());
        }
        entity.setId(found.getId());
      }
    }
    else {
      getDao().getPageTagDao().saveNoAudit(entity);
    }
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.