Package org.osforce.connect.entity.profile

Examples of org.osforce.connect.entity.profile.Profile


  }
 
  @RequestMapping("/detail-view")
  @Permission({"profile-view"})
  public String doDetailView(@RequestAttr Project project, Model model) {
    Profile profile = project.getProfile();
    model.addAttribute(AttributeKeys.PROFILE_KEY_READABLE, profile);
    return "profile/profile-detail";
  }
View Full Code Here


  }
 
  @RequestMapping("/form-view")
  @Permission(value={"profile-add", "profile-edit"}, userRequired=true)
  public String doFormView(@RequestParam Long profileId, Model model) {
    Profile profile = profileService.getProfile(profileId);
    model.addAttribute(AttributeKeys.PROFILE_KEY_READABLE, profile);
    return "profile/logo-form";
  }
View Full Code Here

      @RequestParam Long profileId) throws IOException {
    Attachment attachment = AttachmentUtil.parse(file);
    attachmentService.createAttachment(attachment);
    // write attachment content to local file
    AttachmentUtil.write(attachment);
    Profile profile = profileService.getProfile(profileId);
    Attachment logo = profile.getLogo();
    // delete logo
    if(logo!=null) {
      // delete from disk
      AttachmentUtil.delete(logo);
      // delete from database
      attachmentService.deleteAttachment(logo.getId());
    }
    profile.setLogo(attachment);
    profileService.updateProfile(profile);
    return Collections.singletonMap("id", profile.getId());
  }
View Full Code Here

  }
 
  private Map<Object, Object> createModel(Activity activity) {
    Map<Object, Object> model = CollectionUtil.newHashMap();
    if(StringUtils.equals(Profile.NAME, activity.getEntity())) {
      Profile profile = profileService.getProfile(activity.getLinkedId());
      model.put("profile", profile);
    } else if(StringUtils.equals(Post.NAME, activity.getEntity())) {
      Post blogPost = postService.getPost(activity.getLinkedId());
      model.put("post", blogPost);
    } else if(StringUtils.equals(Forum.NAME, activity.getEntity())){
View Full Code Here

      feature.setRole(role);
      feature.setProject(project);
      featureService.createProjectFeature(feature);
    }
    //
    Profile profile = new Profile();
    profile.setTitle(project.getTitle());
    profile.setProject(project);
    profile.setEnteredBy(project.getEnteredBy());
    profile.setModifiedBy(project.getModifiedBy());
    profile.setProject(project);
    profileService.createProfile(profile);
    return String.format("redirect:/%s/profile", project.getUniqueId());
  }
View Full Code Here

    for(ProjectFeature feature : features) {
      feature.setProject(project);
      projectFeatureDao.save(feature);
    }
    // create project profile
    Profile profile = new Profile();
    profile.setTitle(project.getTitle());
    profile.setProject(project);
    profile.setEnteredBy(user);
    profile.setModifiedBy(user);
    profile.setEntered(now);
    profile.setModified(now);
    profileDao.save(profile);
    // update user project
    user.setProject(project);
    userDao.update(user);
  }
View Full Code Here

  @AfterReturning("execution(* org.osforce.connect.service.profile.ProfileService.createProfile(..))"
      + "execution(* org.osforce.connect.service.profile.ProfileService.updateProfile(..))")
  public void updateProfile(JoinPoint jp) throws Exception {
    Map<Object, Object> context = CollectionUtil.newHashMap();
    Profile profile = (Profile) jp.getArgs()[0];
    context.put("profileId", profile.getId());
    context.put("template", TEMPLATE_PROFILE_UPDATE);
    profileActivityStreamTask.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

TOP

Related Classes of org.osforce.connect.entity.profile.Profile

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.