Package org.cast.cwm.data

Examples of org.cast.cwm.data.User


  protected void addCommonComponents() {
    add(new Label("applicationTitle", new StringResourceModel("applicationTitle", this, null)));
    add(new Label("applicationSubTitle", new StringResourceModel("applicationSubTitle", this, null)));
   
    User user = (User) AuthDataSession.get().getUser();
    add(new Label("userName", (user == null ? new StringResourceModel("unknownUserName", this, null).getString() : user.getFullName())));     

    add(new ISIApplication.LogoutLink("logoutLink"));
  }
View Full Code Here


    ISIResponse isiResponse = getISIResponse();
    setVisible((isiResponse != null) && belongsToUser(isiResponse));
  }
 
  private boolean belongsToUser(ISIResponse isiResponse) {
    User user = mUser.getObject();
    return (user != null) && Role.STUDENT.equals(user.getRole()) && user.equals(isiResponse.getUser());
  }
View Full Code Here

      return null;
    return mUser.getObject();
  }

  private boolean isTeacher() {
    User user = getUser();
    return (user != null) && user.getRole().subsumes(Role.TEACHER);
  }
View Full Code Here

    if (role.subsumes(Role.TEACHER))
      return getTeacherTOCPageClass();
    return getStudentTOCPageClass();
  }
  public Class<? extends ISIStandardPage> getReadingPageClass() {
    User user = CwmSession.get().getUser();
    if (user!=null && Role.TEACHER.equals(user.getRole()))
      return getTeacherReadingPageClass();
    else
      return getStudentReadingPageClass();
  }
View Full Code Here

    }

    @Override
    protected void onSubmit() {
      IModel<User> userModel = UserService.get().getByEmail(email.getModelObject());
      User user = userModel.getObject();
      if (user != null) {
        Databinder.getHibernateSession().beginTransaction();
        user.generateSecurityToken();
        Databinder.getHibernateSession().getTransaction().commit();
        String url = "/password?username=" + user.getUsername() + "&key=" + user.getSecurityToken();
        ((ISIEmailService) EmailService.get()).sendXmlEmail(userModel, ISIEmailService.EMAIL_FORGOT, url);
        String passwordSent = new StringResourceModel("ForgotPassword.passwordSent", this, null,
            "Thank you! In a few minutes you should get an email.  You will need to click on the link in that email to reset your password.").getString();
        info(passwordSent);
        success = true;
View Full Code Here

  public boolean isVisible() {
    List<Response> responses = getResponses();
    if (responses.isEmpty())
      return false;
    ISIPrompt prompt = (ISIPrompt) responses.get(0).getPrompt();
    User user = targetUserModel.getObject();
    return !(prompt.isDelayFeedback() && needsReview(prompt, user));
  }
View Full Code Here

      return new StudentScorePanel(panelId, makeResponseModelList(), userModel);
    }
  }

  private User makeUser() {
    User user = new User();
    user.setFirstName("Mickey");
    user.setLastName("Mouse");
    return user;
  }
View Full Code Here

  @SuppressWarnings({ "rawtypes", "unchecked" })
  @Before
  public void setUp() {
    response = new ISIResponse();
    user = new User();
    user.setFirstName("Mickey");
    user.setLastName("Mouse");
    user.setRole(Role.STUDENT);
    response.setUser(user);
    userModel = new Model(user);
View Full Code Here

  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Before
  public void setUp() {
    student = new User();
    student.setFirstName("Mickey");
    student.setLastName("Mouse");
    studentModel = new Model(student);

    pageContentLoc = mock(ContentLoc.class);
View Full Code Here

TOP

Related Classes of org.cast.cwm.data.User

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.