Package org.apache.wicket.model

Examples of org.apache.wicket.model.StringResourceModel


  @SuppressWarnings("unchecked")
  public Login(PageParameters params) {
    super(params);

    add(new Label("pageTitle", ISIApplication.get().getPageTitleBase() + " :: Login"));
    add(new Label("applicationTitle", new StringResourceModel("applicationTitle", this, null)));
    add(new Label("applicationSubTitle", new StringResourceModel("applicationSubTitle", this, null)));

    add (new BookmarkablePageLink<Void>("forgot", ISIApplication.get().getForgotPasswordPageClass()).setVisible(ISIApplication.get().isEmailOn()));
    add (new BookmarkablePageLink<Void>("register", ISIApplication.get().getRegisterPageClass()).setVisible(ISIApplication.get().isSelfRegisterOn()));
   
    AuthApplication<User> app = null;
View Full Code Here


        eventService.createLoginSession(getRequest());
        eventService.saveLoginEvent();
       
        User user = session.getUser();
        if (!user.isValid()) {
          String notConfirmed = new StringResourceModel("Login.notConfirmed", this, null, "Account not confirmed.").getString();
          error(notConfirmed);
          return;
        }

        // Set default Period
        if (user != null && user.usesPeriods()) {
          session.setCurrentPeriodModel(new HibernateObjectModel<Period>(user.getPeriods().iterator().next()));
          Site currentSite = ISISession.get().getCurrentPeriodModel().getObject().getSite();
          IModel<Site> mCurrentSite = new Model<Site>(currentSite);
          session.setCurrentSiteModel(mCurrentSite);
        }       

        if (!continueToOriginalDestination()) {
          setResponsePage(getApplication().getHomePage());
          setRedirect(true);
        }
       
      } else {
        log.warn("Login failed, user {}, password {}", username.getModelObject(), password.getModelObject());
        String loginFailed = new StringResourceModel("Login.signInFailed", this, null, "Invalid username and/or password.").getString();
        error(loginFailed);
      }
    }
View Full Code Here

  private ICwmService cwmService;

  public ManageClasses(final PageParameters param) {
    super(param);

    setPageTitle(new StringResourceModel("ManageClasses.pageTitle", this, null, "Manage Classes").getString());
   
    // Period Title and Link to edit
    periodTitle = new WebMarkupContainer("period-title");
    add(periodTitle);
    periodTitle.setOutputMarkupPlaceholderTag(true);
View Full Code Here

   
    @Override
    protected void onBeforeRender() {
      if (m == null) {
        m = new ClassMessage();
        m.setMessage((new StringResourceModel("ManageClasses.noClassMessage", this, null, "No Class Message").getString()));
     
      setDefaultModel(new CompoundPropertyModel<ClassMessage>(m));
      classMessageForm.setModel(new CompoundPropertyModel<ClassMessage>(m));
      add(new SimpleAttributeModifier("style", "display:block"));
      super.onBeforeRender();
View Full Code Here

          responseService.deleteClassMessage(ISISession.get().getCurrentPeriodModel());
          m = null;
        }
      };
      add(dialog);
      dialog.setObjectName((new StringResourceModel("ManageClasses.delete.objectName", this, null, "Class Message").getString()));
      dialog.setObjectName("Class Message");
      staticContent.add(new WebMarkupContainer("delete").add(dialog.getDialogBorder().getClickToOpenBehavior()));
    }
View Full Code Here

    private static final long serialVersionUID = 1L;
   
    private Directions (String id) {
      super(id);
      setOutputMarkupPlaceholderTag(true);
      add(new Label("text", new StringResourceModel("isi.${context}.directions", ResponseList.this, Model.of(ResponseList.this), "No responses")));
    }
View Full Code Here

      targetUser = ISISession.get().getStudent();
    } else {
      targetUser = ISISession.get().getUser();
    }

    pageTitleEnd = (new StringResourceModel("Tags.pageTitle", this, null, "Collections").getString());
    setPageTitle(pageTitleEnd);
   
    String tagName = parameters.getString("tag");
    if (tagName != null) {
      selected = TagService.get().findTag(targetUser, tagName);
View Full Code Here

  private IEventService eventService;

  public Register(PageParameters params) {
    super(params);
   
    String pageTitleEnd = (new StringResourceModel("Register.pageTitle", this, null, "Register").getString());
    setPageTitle(pageTitleEnd);
    add(new Label("pageTitle", new PropertyModel<String>(this, "pageTitle")));
    add(new Label("applicationTitle", new StringResourceModel("applicationTitle", this, null)));
    add(new Label("applicationSubTitle", new StringResourceModel("applicationSubTitle", this, null)));
    add(new WebMarkupContainer("preSubmitMessage") {
      private static final long serialVersionUID = 1L;

      @Override
      public boolean isVisible() {
        return (!success);
      }     
    });
   
    // If user comes in with a registration key, confirm their account.
    if (params.containsKey("username") && params.containsKey("key")) {
      User user = UserService.get().getByUsername(params.getString("username")).getObject();
      if (user != null && params.getString("key").equals(user.getSecurityToken())) {
        UserService.get().confirmUser(user);
        ISISession.get().signIn(user, false);
        eventService.createLoginSession(getRequest());
        eventService.saveEvent("user:created", null, null);
        eventService.saveLoginEvent();
        String completed = new StringResourceModel("Registration.completed", this, null,
            "Congratulations, you have successfullly created a new account.").getString();
        info(completed);
        success = true;
      } else {
        // Incorrect credentials or already confirmed: redirect to login page here.
View Full Code Here

  @Override
  protected void onInitialize() {
    super.onInitialize();
   
    setTitle((new StringResourceModel("mediaModal.title", this, null, "Video").getString()));   
    dialogBorder.setEmptyOnClose(true);
    if (getPage() instanceof ISIBasePage) {
      dialogBorder.setPageName(((ISIBasePage) getPage()).getPageName());
      dialogBorder.setEventDetail("video popup");
    } else {
View Full Code Here

      return bpl;

    } else if(wicketId.startsWith("agent_")) {
      String title = elt.getAttribute("title");
      if (Strings.isEmpty(title))
        title = new StringResourceModel("isi.defaultAgentButtonText", this, null, "Help").getObject();
      AgentLink link = new AgentLink(wicketId, title, elt.getAttribute("responseAreaId"));
      link.add(new AttributeRemover("title", "responseAreaId"));
      return link;
     
    } else if (wicketId.startsWith("image_")) {
View Full Code Here

TOP

Related Classes of org.apache.wicket.model.StringResourceModel

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.