Package org.osforce.connect.entity.document

Examples of org.osforce.connect.entity.document.File


      model.put("question", question);
    } else if(StringUtils.equals(Answer.NAME, activity.getEntity())) {
      Answer answer = answerService.getAnswer(activity.getLinkedId());
      model.put("answer", answer);
    } else if(StringUtils.equals(File.NAME, activity.getEntity())) {
      File file = fileService.getFile(activity.getLinkedId());
      model.put("file", file);
    } else if(StringUtils.equals(Folder.NAME, activity.getEntity())) {
      Folder folder = folderService.getFolder(activity.getLinkedId());
      model.put("folder", folder);
    }
View Full Code Here


  }
 
  @RequestMapping(value="/delete-action", method=RequestMethod.GET)
  @Permission(value={"file-edit"}, userRequired=true)
  public String doDeleteAction(@RequestParam Long fileId, WebRequest request) {
    File file = fileService.getFile(fileId);
    String uniqueId = file.getFolder().getProject().getUniqueId();
    Long folderId = file.getFolderId();
    //
    syncSessionFileList(file, request, Boolean.TRUE);
    //
    AttachmentUtil.delete(file.getRealFile());
    attachmentService.deleteAttachment(file.getRealFileId());
    fileService.deleteFile(fileId);
    return String.format("redirect:/%s/document/file/list?folderId=%s", uniqueId, folderId);
  }
View Full Code Here

  }

  @AfterReturning("execution(* org.osforce.connect.service.document.FileService.createFile(..)) ||"
      + "execution(* org.osforce.connect.service.document.FileService.updateFile(..))")
  public void updateFile(JoinPoint jp) {
    File file = (File) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("fileId", file.getId());
    context.put("template", TEMPLATE_FILE_UPDATE);
    fileActivityStreamTask.doAsyncTask(context);
  }
View Full Code Here

  }

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long fileItemId = (Long) context.get("filed");
    File file = fileService.getFile(fileItemId);
    String template = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(fileItemId);
    activity.setEntity(File.NAME);
    activity.setType(File.NAME);
    activity.setDescription(template);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(file.getFolder().getProjectId());
    activity.setEnteredId(file.getModifiedId());
    activityService.createActivity(activity);
  }
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.document.File

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.