Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.MusicBoxBean


  public static void createBox(MusicBoxBean mbox, int pos, boolean up)
       throws CapacityExceedException {
    Session ssn = getSession();
    int order_value = 1;
    if (pos > 0) {
      MusicBoxBean friend = (MusicBoxBean) ssn.get(MusicBoxBean.class,
          new Integer(pos));
      order_value = friend.getSortOrder();
    }
    mbox.setSortOrder(order_value - (up ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(mbox);
View Full Code Here


    int mboxid = -1;
    if (msgs.isEmpty() && StringUtils.isEmpty(mbox.getName()))
      msgs.add("name", new ActionMessage("error.mbox.name_empty"));
    else if (msgs.isEmpty()) {
      SiteBean site = super.getSiteBean(request);
      MusicBoxBean mbean = new MusicBoxBean();
      mbean.setName(super.autoFiltrate(site, mbox.getName()));
      if (StringUtils.isNotEmpty(mbox.getDesc())){
        String desc = super.autoFiltrate(site, mbox.getDesc());
        mbean.setDesc(super.filterScriptAndStyle(desc));
      }
      mbean.setCreateTime(new Date());
      mbean.setSite(site);
      MusicDAO.createBox(mbean, mbox.getId(), mbox.getDirection() == 1);
      mboxid = mbean.getId();
    }
    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
      return mapping.findForward("mbox_add");
    }
View Full Code Here

      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("url", new ActionMessage("error.user_not_available"));
        break;
      }
      // ��֤���ֺе���Ч��
      MusicBoxBean mbox = MusicDAO.getMusicBoxByID(mform.getBox());
      if (mbox == null || mbox.getSite().getId() != mform.getSid()) {
        msgs.add("name", new ActionMessage("error.mbox_not_available",
            new Integer(mform.getBox())));
        break;
      }
      SiteBean site = super.getSiteByID(mform.getSid());
View Full Code Here

      if (StringUtils.isEmpty(mform.getTitle())) {
        msgs.add("name", new ActionMessage("error.music.title_empty"));
        break;
      }
      // ��֤���ֺе���Ч��
      MusicBoxBean mbox = MusicDAO.getMusicBoxByID(mform.getBox());
      if (mbox != null && mbox.getSite().getId() != mform.getSid()) {
        msgs.add("name", new ActionMessage("error.mbox_not_available",
            new Integer(mform.getBox())));
        break;
      }
      SiteBean site = super.getSiteBean(request);
View Full Code Here

      if (mbean.getStatus() == MusicBean.STATUS_NORMAL) {
        // ��֤�µ����ֺе���Ч��(�ƶ����������ֺ�)
        if ((mbean.getMusicBox() == null && mform.getBox() > 0)
            || (mbean.getMusicBox() != null && mform.getBox() != mbean
                .getMusicBox().getId())) {
          MusicBoxBean mbox = MusicDAO
              .getMusicBoxByID(mform.getBox());
          //�ж��Ƿ�Ϊ��վ�����ֺ�
          if(mbox!=null && mbox.getSite().getId()!=site.getId()){
            break;
          }
          //�任���ֺ�
          if (mbox != null
              && (mbean.getMusicBox() == null || mbean.getMusicBox()
                  .getId() != mbox.getId())) {
            //�������ֺ�֮���ƶ����ߴ��޵���
            if (mbean.getMusicBox() != null)
              mbean.getMusicBox().incMusicCount(-1);
            mbean.setMusicBox(mbox);
            mbox.incMusicCount(1);
          } else if (mbox == null && mbean.getMusicBox() != null) {
            //���е���
            mbean.getMusicBox().incMusicCount(-1);
            mbean.setMusicBox(null);
          }
View Full Code Here

      String mboxid) throws Exception {
    MusicBoxForm mform = (MusicBoxForm) form;
    ActionMessages msgs = validateSiteOwner(request, response, mform);
    if (msgs.isEmpty()) {
      SiteBean site = super.getSiteBean(request);
      MusicBoxBean mbox = MusicDAO.getMusicBoxByID(Integer
          .parseInt(mboxid));
      if (mbox.getSite().getId() == site.getId())
        MusicDAO.deleteMusicBox(mbox);
    }
    return makeForward(mapping.findForward("music"), mform.getSid());
  }
View Full Code Here

    super.validateClientId(request, mform);
    if (StringUtils.isNotEmpty(mform.getName())) {
      ActionMessages msgs = validateSiteOwner(request, response, mform);
      if (msgs.isEmpty()) {
        SiteBean site = super.getSiteBean(request);
        MusicBoxBean mbox = MusicDAO.getMusicBoxByID(mform.getId());
        if (mbox.getSite().getId() == site.getId()) {
          mbox.setName(super.autoFiltrate(site,mform.getName()));
          if (StringUtils.isNotEmpty(mform.getDesc())){
            String desc = super.autoFiltrate(site,mform.getDesc());
            mbox.setDesc(desc);
          }
          else
            mbox.setDesc(null);
          MusicDAO.flush();
        }
      }
    }
    return makeForward(mapping.findForward("music"), mform.getSid(), "box",
View Full Code Here

TOP

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

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.