Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.MusicBean


      SiteBean toSite = super.getSiteByID(loginUser.getOwnSiteId());
      if(toSite==null){
        msg = super.getMessage(request, null, "error.site_not_available");
        break;
      }
      MusicBean mbean = MusicDAO.getMusicByID(mid);
      if(mbean!=null && mbean.getSite().getId()==mform.getSid())
      {
        MusicBean music = new MusicBean();
        music.setCreateTime(new Date());
        music.setMusicBox(null);
        music.setAlbum(mbean.getAlbum());
        music.setSinger(mbean.getSinger());
        music.setSite(new SiteBean(loginUser.getOwnSiteId()));
        music.setTitle(mbean.getTitle());
        music.setUrl(mbean.getUrl());
        music.setWord(mbean.getWord());
        MusicDAO.addMusic(music);
        msg = getMessage(request, null, "music.collected", music.getTitle());
      }
      break;
    }while(true);
    return msgbox(mapping, form, request, response, msg, mform.getFromPage());
  }
View Full Code Here


    q.setMaxResults(20);
    List res = q.list();
    List songs = new ArrayList();
    for(int i=0;res!=null&&i<res.size();i++){
      Object[] objs = (Object[])res.get(i);
      MusicBean mbean = new MusicBean();
      mbean.setTitle((String)objs[0]);
      mbean.setUrl((String)objs[1]);
      songs.add(mbean);
    }
    return songs;
  }
View Full Code Here

        }
        q2.setInteger(i+1, ids[0]);
        q2.executeUpdate();
        //ɾ������
        for(i=0;i<musics.size();i++){
          MusicBean mbean = (MusicBean)musics.get(i);
          if(mbean.getMusicBox()!=null)
            mbean.getMusicBox().incMusicCount(-1);
          ssn.delete(mbean);
        }
        commit();
      }
    }catch(HibernateException e){
View Full Code Here

      //��������
      if(isUserInBlackList(site, loginUser)){
        msgs.add("music", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      MusicBean mbean = new MusicBean();
      mbean.setSite(site);
      mbean.setIntroducer(loginUser);
      mbean.setMusicBox(mbox);
      mbean.setTitle(super.autoFiltrate(site, mform.getTitle()));
      if (StringUtils.isNotEmpty(mform.getAlbum()))
        mbean.setAlbum(mform.getAlbum());
      if (StringUtils.isNotEmpty(mform.getSinger()))
        mbean.setSinger(mform.getSinger());
      if (StringUtils.isNotEmpty(mform.getUrl()))
        mbean.setUrl(mform.getUrl());
      if (StringUtils.isNotEmpty(mform.getWord())){
        String word = super.autoFiltrate(site, mform.getWord());
        mbean.setWord(super.filterScriptAndStyle(word));
      }
      else
        mbean.setWord("&nbsp;");
      mbean.setCreateTime(new Date());
      mbean.setStatus(MusicBean.STATUS_RECOMMEND);
      MusicDAO.addMusic(mbean);
      break;
    }while(true);

    if (!msgs.isEmpty()) {
View Full Code Here

        msgs.add("name", new ActionMessage("error.mbox_not_available",
            new Integer(mform.getBox())));
        break;
      }
      SiteBean site = super.getSiteBean(request);
      MusicBean mbean = new MusicBean();
      mbean.setSite(site);
      mbean.setMusicBox(mbox);
      mbean.setTitle(super.autoFiltrate(site, mform.getTitle()));
      if (StringUtils.isNotEmpty(mform.getAlbum()))
        mbean.setAlbum(mform.getAlbum());
      if (StringUtils.isNotEmpty(mform.getSinger()))
        mbean.setSinger(mform.getSinger());
      if (StringUtils.isNotEmpty(mform.getUrl()))
        mbean.setUrl(mform.getUrl());
      if (StringUtils.isNotEmpty(mform.getWord())){
        String word = StringUtils.abbreviate(super.autoFiltrate(site,
            mform.getWord()), MAX_MUSIC_LENGTH);
        mbean.setWord(super.filterScriptAndStyle(word));
      }
      else
        mbean.setWord("  ");
      mbean.setCreateTime(new Date());
      MusicDAO.addMusic(mbean);
      break;
    }

    if (!msgs.isEmpty()) {
View Full Code Here

      throws Exception {
    MusicForm mform = (MusicForm) form;
    ActionMessages msgs = validateSiteOwner(request, response, mform);
    if (msgs.isEmpty()) {
      int music_id = Integer.parseInt(mid);
      MusicBean mbean = MusicDAO.getMusicByID(music_id);
      SiteBean site = super.getSiteBean(request);
      if (mbean != null && mbean.getSite().getId() == site.getId()) {
        MusicDAO.deleteMusic(mbean);
        SearchProxy.remove(mbean);
      }
    }
    return makeForward(mapping.findForward("music"), mform.getSid(), "box",
View Full Code Here

      if(!msgs.isEmpty()){
        saveMessages(request, msgs);
        break;
      }
      SiteBean site = super.getSiteBean(request);
      MusicBean mbean = MusicDAO.getMusicByID(mform.getId());
      //�ж��Ƿ�Ϊ��վ����
      if(mbean==null ||mbean.getSite().getId()!=site.getId()){
        break;
      }
      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);
          }
        }
      }

      //����ֵ
      if(!StringUtils.equals(mbean.getTitle(), mform.getTitle()))
        mbean.setTitle(super.autoFiltrate(site,mform.getTitle()));
      if (StringUtils.isNotEmpty(mform.getAlbum()))
        mbean.setAlbum(super.autoFiltrate(site,mform.getAlbum()));
      if (StringUtils.isNotEmpty(mform.getSinger()))
        mbean.setSinger(super.autoFiltrate(site,mform.getSinger()));
      if (StringUtils.isNotEmpty(mform.getUrl()))
        mbean.setUrl(mform.getUrl());
      if (StringUtils.isNotEmpty(mform.getWord())){
        String word = StringUtils.abbreviate(super.autoFiltrate(site,
          mform.getWord()), MAX_MUSIC_LENGTH);
        mbean.setWord(super.filterScriptAndStyle(word));
      }
      else
        mbean.setWord("  ");
      if (mbean.getStatus() != MusicBean.STATUS_NORMAL) {
        // �����Ƽ����������
        mbean.getMusicBox().incMusicCount(1);
        mbean.setStatus(MusicBean.STATUS_NORMAL);
      }
      MusicDAO.flush();
      break;
    }while(true);
   
View Full Code Here

          diary.setReplyNotify(diaryForm.getNotify());
          diary.setWeather(diaryForm.getWeather());
          diary.setModifyTime(new Date());
          if (diaryForm.getBgSound() != -1) {
            // ��鱳�������Ƿ���Ч
            MusicBean song = MusicDAO.getMusicByID(diaryForm.getBgSound());
            if (song != null
                && song.getSite().getId() == diary.getSite().getId()) {
              diary.setBgSound(song);
            }
          }
          try {
            // �����ϴ�����Ϣ
View Full Code Here

      journal.setWriteTime(DateUtils.mergeDateTime(log.getWriteDate(), log.getWriteTime()).getTime());
      Date curTime = new Date();
      if(journal.getWriteTime().after(curTime))
        journal.setWriteTime(curTime);
      // ��鱳�������Ƿ���Ч
      MusicBean song = MusicDAO.getMusicByID(log.getBgSound());
      if (song != null && song.getSite().getId() == site.getId()) {
        journal.setBgSound(song);
      }
      DiaryDAO.create(journal, log.getBookmark() == 1);
      // �����ϴ�����Ϣ
      pickupUploadFileItems(request, response, loginUser.getId(), site, journal
View Full Code Here

          || journal.getStatus() != DiaryBean.STATUS_DRAFT) {
        msgs.add("draft", new ActionMessage("error.draft_not_exists"));
        break;
      }
      // ��鱳�������Ƿ���Ч
      MusicBean song = MusicDAO.getMusicByID(log.getBgSound());
      if (song != null && song.getSite().getId() == site.getId()) {
        journal.setBgSound(song);
      }
      if (StringUtils.isEmpty(log.getWeather()))
        journal.setWeather(DEFAULT_WEATHER);
      else
View Full Code Here

TOP

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

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.