Package org.timedex.beans

Examples of org.timedex.beans.PageMeta


import org.timedex.dao.interfaces.PageMetaDAO;

public class PageMetaDAOImpl extends AbstractDAOImpl<PageMeta> implements PageMetaDAO {

  public PageMeta findByPage(Page page) {
    PageMeta result = (PageMeta)getCurrentSession()
      .createCriteria(PageMeta.class)
      .add(Restrictions.eq("pageId", page.getId()))
      .uniqueResult();
    return result;
  }
View Full Code Here


        try {
          sessionStrategy.beginTransaction();

          double rank = pre;

          PageMeta meta = pageMetaDAO.findByPage(p);
          List<Page> linksIn = pageLinkDAO.findLinksInByPage(p);

          if (linksIn == null || linksIn.size() == 0)
            continue;

          for (Page linkIn : linksIn) {
            PageMeta linkInMeta = pageMetaDAO
                .findByPage(linkIn);
            List<Page> linksOut = pageLinkDAO
                .findLinksOutByPage(linkIn);

            if (linksOut != null && linksOut.size() != 0)
              rank += (linkInMeta.getRank())
                  / linksOut.size();
          }

          if (meta == null) {
            meta = new PageMeta(p, new Date(0), 0, rank);
            pageMetaDAO.create(meta);
          } else
            pageMetaDAO.updatePageRank(meta, rank);

          sessionStrategy.commitTransaction();
View Full Code Here

          try {
            sessionStrategy.beginTransaction();

            double rank = pre;

            PageMeta meta = pageMetaDAO.findByPage(p);
            List<Page> linksIn = pageLinkDAO.findLinksInByPage(p);

            if (linksIn == null || linksIn.size() == 0)
              continue;

            for (Page linkIn : linksIn) {
              PageMeta linkInMeta = pageMetaDAO
                  .findByPage(linkIn);
              List<Page> linksOut = pageLinkDAO
                  .findLinksOutByPage(linkIn);

              if (linksOut != null && linksOut.size() != 0)
                rank += (linkInMeta.getRank())
                    / linksOut.size();
            }

            if (meta == null) {
              meta = new PageMeta(p, new Date(0), 0, rank);
              pageMetaDAO.create(meta);
            } else
              pageMetaDAO.updatePageRank(meta, rank);

            sessionStrategy.commitTransaction();
View Full Code Here

TOP

Related Classes of org.timedex.beans.PageMeta

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.