Examples of Photo


Examples of com.freewebsys.sns.pojo.Photo

      PhotoAlbum photoAlbum = null;
      if (photoAlbumId == null) {
      }
      for (int i = 0; photoUploadFile != null
          && i < photoUploadFile.length; i++) {
        Photo photo = new Photo();
        // 设置文件名称
        photo.setName(photoUploadFileName[i]);
        photo.setCreateTime(new Date());
        photo.setCommentCount(0);
        photo.setReadCount(0);
        // 设置图片路径
        photo.setImagePath(photoUploadFile[i]);
        int position = photoUploadFile[i].lastIndexOf(".");
        String extension = photoUploadFile[i].substring(position);
        photoUploadFile[i] = photoUploadFile[i].replace(extension, "")
            + "_resize" + extension;
        // 设置缩略图片路径
        photo.setSmallImagePath(photoUploadFile[i]);

        photo.setUserInfo(userInfo);
        baseDao.save(photo);
      }
    } catch (Exception e) {
      throw new PhotoException("Photo保存异常");
    }
View Full Code Here

Examples of com.gracevallorani.jpa.entities.Photo

      try {
        int photoOrder = 0;
       
        for (Storage o: storages) {
          PhotoInternalStorage storage = (PhotoInternalStorage)o;
          Photo photo = new Photo();
          photo.setFullSizeBW(storage.getFullSizeBW());
          photo.setFullSizeColor(storage.getFullSizeColor());
          photo.setThumbnailBW(storage.getThumbnailBW());
          photo.setThumbnailColor(storage.getThumbnailColor());
          photo.setOrder(photoOrder++);
         
          entity.persist(photo);
        }       
      } finally {
        trans.commit();
View Full Code Here

Examples of com.linkedin.restli.example.Photo

  private void runTest(HttpServer server)
      throws IOException, RemoteInvocationException
  {
    server.start();

    Photo photoEntity = REST_CLIENT.sendRequest(PHOTOS_BUILDERS.get().id(1L).build()).getResponseEntity();
    Assert.assertEquals(photoEntity.getTitle(), "Photo 1");

    Album albumEntity = REST_CLIENT.sendRequest(ALBUMS_BUILDERS.get().id(1L).build()).getResponseEntity();
    Assert.assertEquals(albumEntity.getTitle(), "Awesome Album #1");

    server.stop();
View Full Code Here

Examples of com.liusoft.dlog4j.photo.Photo

            msgs.add(ERROR_KEY, new ActionMessage("error.photo_space_full"));
            break;
          }
        }
        //������Ƭ����������ͼ
        Photo img = null;
        try{
          img = getPhotoSaver().save(
              getHttpContext(mapping, form, request, response),
              files[i], photo1.getAutoRotate() == 1);
          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;
View Full Code Here

Examples of com.sissi.protocol.iq.vcard.field.Photo

*/
public class PhotoFieldParser implements FieldParser<Map<String, Object>> {

  @Override
  public Field<?> read(Map<String, Object> element) {
    return new Photo(element.get(Type.NAME).toString(), element.get(Binval.NAME).toString());
  }
View Full Code Here

Examples of com.skyline.wo.model.Photo

    }

  }

  private void addPhotoShare(Long sharerId, String sharerNickname, String sharerPortrait, Long resourceId) {
    Photo photo = albumService.getPhotoDetailById(resourceId, sharerId, true);// (resourceId);
    if (photo != null) {
      Map<String, Object> valueMap = new HashMap<String, Object>();
      valueMap.put("middlefile", photo.getMiddleFile());
      valueMap.put("ext", photo.getExt());
      String digest = FreeMarkerUtils.getShare(ShareType.PHOTO, valueMap);
      shareDao.insertShare(sharerId, sharerNickname, sharerPortrait, ShareType.PHOTO, resourceId, photo.getAlbumName(), digest,
          photo.getOwnerId(), photo.getOwnerNickname(), photo.getOwnerPortrait(), photo.getAlbumId(), photo.getAlbumName());
    }
  }
View Full Code Here

Examples of com.skyline.wo.model.Photo

      viewerId = user.getId();
      // 此处不增加浏览数,统一在通过ajax方式获取图片信息是处理
    }
    int authority = AuthorityUtil.getAuthority(null, viewerId);

    Photo photo = albumService.getPhotoDetailById(photoId, viewerId, addVisitCount);
    // 判断权限
    if (photo != null) {
      int albumAuth = photo.getAuthority();
      if (authority < albumAuth) {
        throw new NoVisitPermissionException("ID为:" + viewerId + "的用户没有访问ID为:"
            + photo.getId() + "图片的权限");
      }
    } else {
      throw new NoResourceException("ID为:" + photoId + "的图片不存在");
    }
    List<Photo> photos = albumService.listPhotoFilesOfAlbum(photo.getAlbumId(), authority);

    ModelAndView mav = new ModelAndView(ViewPaths.ALBUM_VIEWPHOTO);
    mav.addObject("photo", photo);
    mav.addObject("photos", photos);
View Full Code Here

Examples of com.skyline.wo.model.Photo

      throw new NotLoginException("编辑照片信息必须登录");
    }
    long userId = user.getId();

    List<Album> albums = albumService.listAlbumNamesOfUser(userId);
    Photo photo = albumService.getPhotoForChange(userId, photoId);

    ModelAndView mav = new ModelAndView(ViewPaths.ALBUM_EDITPHOTO);
    mav.addObject("photo", photo);
    mav.addObject("albums", albums);

    Long curAlbumId = photo.getAlbumId();
    for (Album album : albums) {
      if (album.getId().equals(curAlbumId)) {
        mav.addObject("cover", album.getCover());
      }
    }
View Full Code Here

Examples of com.skyline.wo.model.Photo

      ModelAndView returnMav = editPhoto(photoId);
      return processValidationErrors("errMsg", errMsg, returnMav);
    }

    long userId = user.getId();
    Photo photo = albumService.getPhotoForChange(userId, photoId);
    Album origAlbum = albumService.getAlbumForChange(photo.getAlbumId(), userId);
    if (setCover == null) {
      if (!photo.getAlbumId().equals(toAlbum)) {
        albumService.changePhotoAlbum(userId, photoId, photo.getAlbumId(), toAlbum);
        if (origAlbum.getCover().equals(photo.getSmallFile())) {// 取消原有封面
          albumService.changeAlbumCover(userId, photo.getAlbumId(), cover, ext);
        }
      }
    } else {
      albumService.changeAlbumCover(userId, photo.getAlbumId(), photo.getSmallFile(),
          photo.getExt());
    }
    String oldDesc = CommonUtils.nullStringToEmpty(photo.getDescription());
    if (!oldDesc.equals(description)) {
      albumService.changePhotoDescription(photo.getAlbumId(), photoId, description);
    }

    String url = buildRecirectPath(URL_PREFIX + "/photo/" + photoId);
    ModelAndView mav = new ModelAndView(new RedirectView(url));
    return mav;
View Full Code Here

Examples of com.skyline.wo.model.Photo

      result.put("errmsg", errorMsgs[0]);
      return result;
    }

    try {
      Photo photo = albumService.getPhotoForChange(user.getId(), photoId);
      String oldDesc = CommonUtils.nullStringToEmpty(photo.getDescription());
      if (!oldDesc.equals(description)) {
        albumService.changePhotoDescription(photo.getAlbumId(), photoId, description);
      }
      result.put("success", Boolean.TRUE);
      result.put("errmsg", "修改照片描述成功");
      return result;
    } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.