Package org.osforce.connect.entity.gallery

Examples of org.osforce.connect.entity.gallery.Photo


      model.put("event", event);
    } else if(StringUtils.equals(Album.NAME, activity.getEntity())) {
      Album album = albumService.getAlbum(activity.getLinkedId());
      model.put("album", album);
    } else if(StringUtils.equals(Photo.NAME, activity.getEntity())) {
      Photo photo = photoService.getPhoto(activity.getLinkedId());
      model.put("photo", photo);
    } else if(StringUtils.equals(Question.NAME, activity.getEntity())) {
      Question question = questionService.getQuestion(activity.getLinkedId());
      model.put("question", question);
    } else if(StringUtils.equals(Answer.NAME, activity.getEntity())) {
View Full Code Here


 
  @RequestMapping("/detail-view")
  @Permission({"photo-view"})
  public String doDetailView(@RequestParam(required=false) Long albumId,
      @RequestParam(required=false) Long photoId, Model model) {
    Photo photo = null;
    if(albumId!=null) {
      List<Photo> photos = photoService.getPhotoList(albumId);
      photo = photos.get(0);
    }
    if(photoId!=null) {
View Full Code Here

  }
 
  @RequestMapping(value="/delete-action", method=RequestMethod.GET)
  @Permission(value={"photo-edit"}, userRequired=true)
  public String doDeleteAction(@RequestParam Long photoId, WebRequest request) {
    Photo photo = photoService.getPhoto(photoId);
    String uniqueId = photo.getAlbum().getProject().getUniqueId();
    Long albumId = photo.getAlbumId();
    // delete from session
    syncSessionPhotoList(photo, request, true);
    // delete from database
    AttachmentUtil.delete(photo.getRealFile());
    attachmentService.deleteAttachment(photo.getRealFileId());
    photoService.deletePhoto(photoId);
    return String.format("redirect:/%s/gallery/photo/form?albumId=%s", uniqueId, albumId);
  }
View Full Code Here

  }

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long photoId = (Long) context.get("photoId");
    Photo photo = photoService.getPhoto(photoId);
    String template = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(photoId);
    activity.setEntity(Photo.NAME);
    activity.setType(Photo.NAME);
    activity.setDescription(template);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(photo.getAlbum().getProjectId());
    activity.setEnteredId(photo.getModifiedId());
    activityService.createActivity(activity);
  }
View Full Code Here

  }

  @AfterReturning("execution(* org.osforce.connect.service.gallery.PhotoService.createPhoto(..)) ||" +
  "execution(* org.osforce.connect.service.gallery.PhotoService.updatePhoto(..))")
  public void updatePhoto(JoinPoint jp) {
    Photo photo = (Photo) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("photoId", photo.getId());
    context.put("template", TEMPLATE_PHOTO_UPDATE);
    photoActivityStreamTask.doAsyncTask(context);
  }
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.gallery.Photo

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.