Package org.vosao.business.mq.message

Examples of org.vosao.business.mq.message.PageMessage


  }

  @Override
  public void remove(List<Long> ids) {
    List<Long> removeIds = new ArrayList<Long>();
    PageMessage message = new PageMessage(Topic.PAGES_DELETED);
    for (Long id : ids) {
      PageEntity page = getDao().getPageDao().getById(id);
      if (page != null) {
        if (canWritePage(page.getFriendlyURL())) {
          if (isLastRootPageVersion(page)) {
            continue;
          }
          removeIds.add(id);
          message.addPage(page.getFriendlyURL(), id);
        }
      }
    }
    TreeItemDecorator<FolderEntity> root = getBusiness().getFolderBusiness()
        .getTree();
View Full Code Here


    if (page != null) {
      if (canWritePage(page.getFriendlyURL())) {
        getDao().getPageDao().removeVersion(id);
        getBusiness().getSystemService().getPageCache().remove(
            page.getFriendlyURL());
        PageMessage message = new PageMessage(Topic.PAGES_DELETED,
            page.getFriendlyURL(), id);
        getBusiness().getMessageQueue().publish(message);
      }
    }
  }
View Full Code Here

*
*/
public class PageCacheClear extends AbstractSubscriber {

  public void onMessage(Message message) {
    PageMessage msg = (PageMessage)message;
    try {
      for (String url : msg.getPages().keySet()) {
        clearDependency(url);     
      }
    }
    catch(Exception e) {
      logger.error(e.getMessage());
View Full Code Here

  }

  private void clearDependency(String url) {
    String dependency = "";
    String[] parts = FolderUtil.getPathChain(url);
    PageMessage message = new PageMessage(Topic.PAGE_CACHE_CLEAR,
        QueueSpeed.LOW);
   
    for (String part : parts) {
      dependency += "/" + part;
      for (PageDependencyEntity entity : getDao().getPageDependencyDao()
          .selectByDependency(dependency)) {

        if (getBusiness().getSystemService().getPageCache()
            .contains(entity.getPage())) {
       
          getBusiness().getSystemService().getPageCache().remove(
              entity.getPage());
         
          message.addPage(entity.getPage(), -1L);
        }
      }
    }
    getBusiness().getMessageQueue().publish(message);
  }
View Full Code Here

*
*/
public class IndexChangedPages extends AbstractSubscriber {

  public void onMessage(Message message) {
    PageMessage msg = (PageMessage)message;
    try {
      VosaoContext.getInstance().setUser(UserHelper.ADMIN);
      for (Set<Long> pages : msg.getPages().values()) {
        for (Long pageId : pages) {
          PageEntity page = getDao().getPageDao().getById(pageId);
          if (page != null) {
            getBusiness().getSearchEngine().updateIndex(
                page.getId());
View Full Code Here

*
*/
public class IndexDeletedPages extends AbstractSubscriber {

  public void onMessage(Message message) {
    PageMessage msg = (PageMessage)message;
    try {
      VosaoContext.getInstance().setUser(UserHelper.ADMIN);
      for (Set<Long> pages : msg.getPages().values()) {
        for (Long pageId : pages) {
          getBusiness().getSearchEngine()
              .removeFromIndex(pageId);
        }
      }
View Full Code Here

        .getCurrentHourPublishedPages()) {
      if (page.getState().equals(PageState.APPROVED)) {
        logger.info("Found published " + page.getFriendlyURL());
        getBusiness().getSystemService().getPageCache().remove(
          page.getFriendlyURL());
        getBusiness().getMessageQueue().publish(new PageMessage(
          Topic.PAGE_CACHE_CLEAR, page.getFriendlyURL(), page.getId()));
      }
    }
    for (PageEntity page : getDao().getPageDao()
        .getCurrentHourUnpublishedPages()) {
      if (page.getState().equals(PageState.APPROVED)) {
        logger.info("Found unpublished " + page.getFriendlyURL());
        getBusiness().getSystemService().getPageCache().remove(
          page.getFriendlyURL());
        getBusiness().getMessageQueue().publish(new PageMessage(
          Topic.PAGE_CACHE_CLEAR, page.getFriendlyURL(), page.getId()));
      }
    }
  }
View Full Code Here

  @Override
  public void saveContent(PageEntity page, String language, String content) {
    ContentEntity contentEntity = getDao().getPageDao().setContent(
        page.getId(), language, content);
    getSystemService().getPageCache().remove(page.getFriendlyURL());
    PageMessage message = new PageMessage(Topic.PAGES_CHANGED,
        page.getFriendlyURL(), page.getId());
    getBusiness().getMessageQueue().publish(message);
  }
View Full Code Here

    getDao().getPageDao().save(page);
    getPageFolder(page.getFriendlyURL());
    getBusiness().getSystemService().getPageCache().remove(
        page.getFriendlyURL());
   
    PageMessage message = new PageMessage(Topic.PAGES_CHANGED,
        page.getFriendlyURL(), page.getId());
   
    getBusiness().getMessageQueue().publish(message);
  }
View Full Code Here

TOP

Related Classes of org.vosao.business.mq.message.PageMessage

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.