Package org.osforce.connect.entity.stream

Examples of org.osforce.connect.entity.stream.Activity


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


  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long activityId = (Long) context.get("activityId");
    String[] targets = (String[]) context.get("targets");
    if(targets!=null) {
      Activity activity = activityService.getActivity(activityId);
      for(String target : targets) {
        Token accessToken = getAccessToken(target, activity.getEnteredBy());
        ApiService apiService = getApiService(target);
        Map<String, Object> params = CollectionUtil.newHashMap();
        params.put("format", "json");
        params.put("accessToken", accessToken);
        params.put("status", activity.getDescription());
        apiService.updateStatus(params);
      }
    }
  }
View Full Code Here

    this.activitySynchronizeTask = activitySynchronizeTask;
  }

  @AfterReturning("execution(* org.osforce.connect.service.stream.ActivityService.createActivity(..))")
  public void createActivity(JoinPoint jp) {
    Activity activity = (Activity) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("activityId", activity.getId());
    context.put("targets", activity.getTargets());
    activitySynchronizeTask.doAsyncTask(context);
  }
View Full Code Here

  protected void doTask(Map<Object, Object> context) throws IOException, TemplateException {
    Long profileId = (Long) context.get("profileId");
    String templateName = (String) context.get("template");
    Profile profile = profileService.getProfile(profileId);
    Activity activity = new Activity();
    activity.setLinkedId(profile.getId());
    activity.setEntity(Profile.NAME);
    activity.setType(Profile.NAME);
    activity.setDescription(templateName);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setEnteredId(profile.getModifiedId());
    activity.setProjectId(profile.getProjectId());
    activityService.createActivity(activity);
  }
View Full Code Here

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long memberId = (Long) context.get("memberId");
    TeamMember member = memberService.getMember(memberId);
    String template = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(memberId);
    activity.setEntity(TeamMember.NAME);
    activity.setType(TeamMember.NAME);
    activity.setDescription(template);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(member.getProjectId());
    activity.setEnteredId(member.getUserId());
    activityService.createActivity(activity);
  }
View Full Code Here

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long folderId = (Long) context.get("folderId");
    Folder folder = folderService.getFolder(folderId);
    String template = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(folderId);
    activity.setEntity(Folder.NAME);
    activity.setType(Folder.NAME);
    activity.setDescription(template);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(folder.getProjectId());
    activity.setEnteredId(folder.getModifiedId());
    activityService.createActivity(activity);
  }
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.stream.Activity

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.