Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.PhotoBean


      final HttpServletResponse response, String s_photo_id) throws Exception      
  {
    PhotoForm photo = (PhotoForm)form;
    //ɾ����Ƭ�ļ�
    int photo_id = Integer.parseInt(s_photo_id);
    PhotoBean pbean = PhotoDAO.getPhotoByID(photo_id);
    String ext = null;
    if(pbean != null){
      HttpContext context = getHttpContext(mapping, form, request, response);
      getPhotoSaver().delete(context, pbean.getImageURL());
      if(!pbean.getPreviewURL().equals(pbean.getImageURL()))
        getPhotoSaver().delete(context, pbean.getPreviewURL());
      //ɾ�����ݿ���Ϣ
      PhotoDAO.delete(pbean);
      SearchProxy.remove(pbean);
      ext = "aid="+pbean.getAlbum().getId();
    }
    return makeForward(mapping.findForward("photo_album"), photo.getSid(), ext);
  }
View Full Code Here


          if(img == null){
            msgs.add(ERROR_KEY, new ActionMessage("error.upload_failed"));
            break;       
          }
          //д�뵽���ݿ�
          PhotoBean pbean = new PhotoBean();
          pbean.setSite(site);
          pbean.setUser(loginUser);
          if(StringUtils.isNotEmpty(photo1.getName())){
            pbean.setName(super.autoFiltrate(site, photo1.getName()));
          }
          else
            pbean.setName(img.getName());
          pbean.setDesc(photo_desc);
          if(StringUtils.isNotEmpty(photo1.getKeyword())){
            if(site.isFlagSet(SiteBean.Flag.ILLEGAL_GLOSSARY_IGNORE))
              pbean.setKeyword(photo1.getKeyword());
            else
              pbean.setKeyword(DLOGSecurityManager.IllegalGlossary
                  .deleteIllegalWord(photo1.getKeyword()));
          }
          pbean.setPreviewURL(img.getPreviewURL());
          pbean.setImageURL(img.getImageURL());
         
          pbean.setPhotoInfo(img);
          pbean.setFileName(super.autoFiltrate(site,img.getFileName()));
          pbean.setStatus(photo1.getStatus());//������������
          PhotoDAO.create(album, pbean, (photo1.getCover()==1));
        }catch(IllegalAccessException e){
          msgs.add(ERROR_KEY, new ActionMessage("error.access_deny", e.getMessage()));
          break;
        }catch(Exception e){
View Full Code Here

    ActionMessages msgs = new ActionMessages();
   
    if(StringUtils.isEmpty(photo.getName()))
      msgs.add("name", new ActionMessage("error.photo.name_empty"));
    else{
      PhotoBean pbean = PhotoDAO.getPhotoByID(photo.getId());
      if(pbean != null){
        if(!StringUtils.equals(pbean.getName(), photo.getName())){
          pbean.setName(super.autoFiltrate(pbean.getSite(), photo.getName()));
        }
       
        if(!StringUtils.equals(pbean.getDesc(),photo.getDesc())){
          String desc = StringUtils.abbreviate(super.autoFiltrate(
              pbean.getSite(), photo.getDesc()),
              MAX_PHOTO_DESC_LENGTH);
          pbean.setDesc(super.filterScriptAndStyle(desc));
        }
        else
          pbean.setDesc(" ");
        pbean.setStatus(photo.getStatus());
        int new_album = photo.getAlbum();
        String new_Keyword = photo.getKeyword();
        if(!pbean.getSite().isFlagSet(SiteBean.Flag.ILLEGAL_GLOSSARY_IGNORE))
          new_Keyword = DLOGSecurityManager.IllegalGlossary.deleteIllegalWord(new_Keyword);
        PhotoDAO.update(new_album, pbean, new_Keyword, (photo.getCover()==1));
      }
    }
   
View Full Code Here

   * @return
   */
  public PhotoBean photo(SiteBean site, SessionUserObject user, int photo_id){
    if(site==null || photo_id < 1)
      return null;
    PhotoBean photo = PhotoDAO.getPhotoByID(photo_id);
    if(canViewThisPhoto(site,user,photo,request))
      return photo;
    return null;
  }
View Full Code Here

TOP

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

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.