Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.BookmarkBean


            tag_count ++;
          }
        }
      }
      if(add_bookmark){
        BookmarkBean bmb = new BookmarkBean();
        bmb.setOwner(journal.getOwner());
        bmb.setSite(journal.getSite());
        bmb.setCreateTime(new Date());
        bmb.setParentId(journal.getId());
        bmb.setParentType(_BeanBase.TYPE_DIARY);
        bmb.setTitle(journal.getTitle());
        journal.getOwner().getCount().incBookmarkCount(1);
        ssn.save(bmb);
      }
      commit();
    }catch(HibernateException e){
View Full Code Here


        }
      }     
     
      ssn.save(topic);
      if (add_bookmark) {
        BookmarkBean bmb = new BookmarkBean();
        bmb.setOwner(topic.getUser());
        bmb.setSite(topic.getSite());
        bmb.setCreateTime(new Date());
        bmb.setParentId(topic.getId());
        bmb.setParentType(_BeanBase.TYPE_BBS);
        bmb.setTitle(topic.getTitle());
        ssn.save(bmb);
      }
      commit();
    } catch (HibernateException e) {
      rollback();
View Full Code Here

  {
    BookmarkForm bookmark = (BookmarkForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    String msg = null;
    if(loginUser!=null){
      BookmarkBean bean = new BookmarkBean();
      bean.setParentId(bookmark.getParentId());
      bean.setParentType(bookmark.getParentType());
      bean.setOwner(loginUser);
      bean.setSite(new SiteBean(bookmark.getSid()));
      bean.setTitle(bookmark.getTitle());
      try{
        if(BookmarkDAO.save(bean))
          msg = getMessage(request,null,"bookmark.created");
        else
          msg = getMessage(request,null,"error.bookmark.exists");
View Full Code Here

  protected static void upgradeBookmarks(Session old_ssn, Session new_ssn){
    Query q = old_ssn.createQuery("FROM BookMarkBean l ORDER BY l.id ASC");
    List bmbs = q.list();   
    for(int i=0;i<bmbs.size();i++){
      BookMarkBean bm = (BookMarkBean)bmbs.get(i)
      BookmarkBean mbean = new BookmarkBean();
      mbean.setCreateTime(bm.getCreateTime());
      mbean.setOwner((UserBean)userids.get(new Integer(bm.getUserId())));
      mbean.setSite(site);
      mbean.setTitle(bm.getLog().getTitle());
      mbean.setParentType(BookmarkBean.TYPE_DIARY);
      mbean.setParentId(((Integer)logids.get(new Integer(bm.getLog().getId()))).intValue());     
      new_ssn.save(mbean);
      System.out.println("BOOKMARK: " + bm.getId() + " -> " + mbean.getId());
    }
  }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.BookmarkBean

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.