Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.AlbumBean


      files[2] = photo1.getImage3();
      files[3] = photo1.getImage4();
      files[4] = photo1.getImage5();
     
      //����ಾ�Ƿ���Ч
      AlbumBean album = AlbumDAO.getAlbumByID(photo1.getAlbum());
      if (album == null) {
        msgs.add(ERROR_KEY, new ActionMessage(
            "error.object_not_found", String.valueOf(photo1
                .getAlbum())));
        break;
View Full Code Here


    try {
      //1. ����Դ�ಾ���������ಾ����Ƭ�����������������Ƭ
      int photo_count = 0;
      List childs = fromCat.getChilds();
      for(int i=0;childs!=null&&i<childs.size();i++){
        AlbumBean abean = (AlbumBean)childs.get(i);
        photo_count += abean.getPhotoCount();
      }
     
      //2. ����Ҫ�ƶ�����Ƭ��
      single_photo_count = fromCat.getPhotoCount()-photo_count;
     
      //3. �޸���Ƭ���ڵķ���
      beginTransaction();
      executeNamedUpdate("MOVE_PHOTO", toCat.getId(), fromCat.getId(), siteid);

      //4. �޸�Ŀ���ಾ����Ƭ��
      executeNamedUpdate("INC_ALBUM_PHOTO_COUNT", single_photo_count, toCat.getId(), siteid);
     
      //5. �޸�Դ�ಾ�ĸ�һ���ಾ����Ƭ��
      AlbumBean src_parent = fromCat.getParent();
      do{
        if(src_parent == null)
          break;
        executeNamedUpdate("INC_ALBUM_PHOTO_COUNT", -single_photo_count, src_parent.getId(), siteid);
        src_parent = src_parent.getParent();
      }while(true);       

      //6. �޸�Ŀ���ಾ�ĸ�һ���ಾ����Ƭ��
      AlbumBean obj_parent = toCat.getParent();
      do{
        if(obj_parent == null)
          break;
        executeNamedUpdate("INC_ALBUM_PHOTO_COUNT", single_photo_count, obj_parent.getId(), siteid);
        obj_parent = obj_parent.getParent();
      }while(true);       

      //7. ���¼���Դ�ಾ����Ƭ��
      executeNamedUpdate("UPDATE_ALBUM_PHOTO_COUNT", photo_count, fromCat.getId(), siteid);
View Full Code Here

  public static void create(int parentId, AlbumBean obj, int pos, int direction)
      throws CapacityExceedException {
    Session ssn = getSession();
    int order_value = 1;
    if (pos > 0) {
      AlbumBean friend = getAlbumByID(pos);
      order_value = friend.getSortOrder();
    }
    // ���ڵ�
    if (parentId > 0){
      AlbumBean parent = (AlbumBean)DAO.getBean(AlbumBean.class, parentId);
      if(parent!=null)
        obj.setParent(parent);
    }

    obj.setSortOrder(order_value - ((direction==1) ? 1 : 0));
View Full Code Here

   * @param linkid
   * @return
   * @throws SQLException
   */
  public static void delete(int siteid, int album_id){
    AlbumBean album = (AlbumBean)getBean(AlbumBean.class, album_id);
    if(album!=null && album.getSite().getId()==siteid)
      delete(album);
  }
View Full Code Here

    else{
      if(album_id < 1)
        return PhotoDAO.listPhotos(site, user, album_id, month_stamp, date, fromIdx, count);
      else{
        //�ж��û���û�з��ʸ��ಾ��Ȩ��
        AlbumBean album = AlbumDAO.getAlbumByID(album_id);
        if(can_access_album(site, user, album, request)){
          return PhotoDAO.listPhotos(album, fromIdx, count);
        }
      }
    }
View Full Code Here

    AlbumForm aform = (AlbumForm) form;
    validateClientId(request, aform);
    if(aform.getFromAlbum()<1||aform.getToAlbum()<1||aform.getFromAlbum()==aform.getToAlbum())
      return makeForward(mapping.findForward("albums"),aform.getSid());
    //����ಾ����Ч��
    AlbumBean fromAlbum = AlbumDAO.getAlbumByID(aform.getFromAlbum());
    if(fromAlbum==null || fromAlbum.getSite().getId()!=aform.getSid()){
      return makeForward(mapping.findForward("albums"),aform.getSid());
    }
    AlbumBean toAlbum = AlbumDAO.getAlbumByID(aform.getToAlbum());
    if(toAlbum==null || toAlbum.getSite().getId()!=aform.getSid()){
      return makeForward(mapping.findForward("albums"),aform.getSid());
    }   
    //�����ಾ����Ч����ʼ�ƶ��ಾ�е���Ƭ
    AlbumDAO.movePhoto(aform.getSid(), fromAlbum, toAlbum);
   
    return makeForward(mapping.findForward("albums"),aform.getSid(),"aid", toAlbum.getId());
  }
View Full Code Here

      int photo_size = DLOG4JUtils.sizeInKbytes(photo.getPhotoInfo().getSize());
      photo.getSite().getCapacity().incPhotoUsed(photo_size);
      photo.getAlbum().incPhotoCount(-1);
      photo.getUser().getCount().incPhotoCount(-1);
      //�ݹ����и��ಾ
      AlbumBean parent = photo.getAlbum().getParent();
      int deep = 0;
      do{
        if(parent == null)
          break;
        deep ++;
        parent.incPhotoCount(-1);
        parent = parent.getParent();
      }while(deep < 10);//������ʮ���ಾ

      //ɾ����ǩ
      TagDAO.deleteTagByRefId(photo.getId(), TagBean.TYPE_PHOTO);
     
View Full Code Here

      final HttpServletResponse response) throws Exception      
  {
    AlbumForm aform = (AlbumForm) form;
    validateClientId(request, aform);
    String ext = "aid="+aform.getId();
    AlbumBean album = AlbumDAO.getAlbumByID(aform.getId());
    ActionForward forward = makeForward(mapping.findForward(PHOTOS), aform.getSid(), ext);
    if(album!=null && album.getSite().getId()==aform.getSid()){
      if(StringUtils.equals(album.getVerifyCode(), aform.getVerifyCode())){
        HttpSession ssn = request.getSession(true);
        ssn.setAttribute(Globals.ALBUM_VERIFY_KEY+aform.getId(),album.getVerifyCode());
        return forward;
      }
    }
    ActionMessages msgs = new ActionMessages();
    msgs.add("verify", new ActionMessage("error.illegal_album_verify_code"));
View Full Code Here

      if(photo.getAlbum().getId() != new_album_id){
        //���ԭ���ಾ�ķ�������
        if (photo.getAlbum().getCover() != null
            && photo.getAlbum().getCover().getId() == photo.getId())
          photo.getAlbum().setCover(null);
        AlbumBean new_album = AlbumDAO.getAlbumByID(new_album_id);
        if(new_album == null)
          throw new ObjectNotFoundException(String.valueOf(new_album));
        if(new_album.getSite().getId()!=photo.getSite().getId())
          throw new IllegalAccessException(new_album.getName());
        //�޸����ಾ����Ƭ�� ����һ��
        AlbumBean parent = new_album;
        int deep = 0;
        do{
          if(parent == null)
            break;
          deep ++;
          parent.incPhotoCount(1);
          parent = parent.getParent();
        }while(deep < 10);//������ʮ���ಾ
       
        //�޸ľ��ಾ����Ƭ������һ��
        parent = photo.getAlbum();
        deep = 0;
        do{
          if(parent == null)
            break;
          deep ++;
          parent.incPhotoCount(-1);
          parent = parent.getParent();
        }while(deep < 10);//������ʮ���ಾ
       
        photo.setAlbum(new_album);
      }
      //�����ಾ����
View Full Code Here

      msgs.add("name", new ActionMessage("error.illegal_glossary"));
    } else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(album.getDesc())){
      msgs.add("desc", new ActionMessage("error.illegal_glossary"));
    } else {
      SiteBean site = super.getSiteBean(request);
      AlbumBean abean = new AlbumBean();
      abean.setName(super.autoFiltrate(site, album.getName()));
      if (StringUtils.isNotEmpty(album.getDesc())){
        String desc = super.autoFiltrate(site, album.getDesc());
        abean.setDesc(super.filterScriptAndStyle(desc));
      }
      abean.setType(album.getType());
      if (StringUtils.isNotEmpty(album.getVerifyCode()))
        abean.setVerifyCode(album.getVerifyCode());
      abean.setSite(site);
      abean.setCreateTime(new Date());
      try {
        //1: ֮ǰ; 2: ֮��; 3: ֮��
        if(album.getDirection()==3)
          album.setParent(album.getId());
        if(album.getCatalog()>0)
          abean.setCatalog(new TypeBean(album.getCatalog()));
        AlbumDAO.create(album.getParent(), abean, album.getId(), album
            .getDirection());
        new_album_id = abean.getId();
      } catch (CapacityExceedException e) {
        msgs.add("album",
            new ActionMessage("error.album_reach_max_size",
                new Integer(e.getCount())));
      } catch (Exception e) {
View Full Code Here

TOP

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

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.