Package org.apache.wicket.model

Examples of org.apache.wicket.model.StringResourceModel


        paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_SYNC_TASKS_PAGINATOR_ROWS);

        columns = new ArrayList<IColumn<TaskTO, String>>();

        columns.add(new PropertyColumn<TaskTO, String>(
                new StringResourceModel("id", this, null), "id", "id"));
        columns.add(new PropertyColumn<TaskTO, String>(
                new StringResourceModel("name", this, null), "name", "name"));
        columns.add(new PropertyColumn<TaskTO, String>(
                new StringResourceModel("description", this, null), "description", "description"));
        columns.add(new PropertyColumn<TaskTO, String>(
                new StringResourceModel("resourceName", this, null), "resource", "resource"));
        columns.add(new DatePropertyColumn<TaskTO>(
                new StringResourceModel("lastExec", this, null), "lastExec", "lastExec"));
        columns.add(new DatePropertyColumn<TaskTO>(
                new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
        columns.add(new PropertyColumn<TaskTO, String>(
                new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
        columns.add(new ActionColumn<TaskTO, String>(new StringResourceModel("actions", this, null, "")) {

            private static final long serialVersionUID = 2054811145491901166L;

            @Override
            public ActionLinksPanel getActions(final String componentId, final IModel<TaskTO> model) {
View Full Code Here


        LOG.error("Exception found", e);

        final Page errorPage;
        PageParameters errorParameters = new PageParameters();
        errorParameters.add("errorTitle", new StringResourceModel("alert", null).getString());

        if (e instanceof UnauthorizedInstantiationException) {
            errorParameters.add("errorMessage", new StringResourceModel("unauthorizedInstantiationException", null)
                    .getString());

            errorPage = new ErrorPage(errorParameters);
        } else if (e instanceof HttpClientErrorException) {
            errorParameters.add("errorMessage", new StringResourceModel("httpClientException", null).getString());

            errorPage = new ErrorPage(errorParameters);
        } else if (e instanceof PageExpiredException || !(SyncopeSession.get()).isAuthenticated()) {

            errorParameters.add("errorMessage", new StringResourceModel("pageExpiredException", null).getString());

            errorPage = new ErrorPage(errorParameters);
        } else if (e.getCause() != null && e.getCause().getCause() != null
                && e.getCause().getCause() instanceof RestClientException) {

            errorParameters.add("errorMessage", new StringResourceModel("restClientException", null).getString());

            errorPage = new ErrorPage(errorParameters);
        } else {
            // redirect to default Wicket error page
            errorPage = new ExceptionErrorPage(e, null);
View Full Code Here

    }

    private void setupResources() {
        List<IColumn<ResourceTO, String>> columns = new ArrayList<IColumn<ResourceTO, String>>();

        columns.add(new PropertyColumn(new StringResourceModel("name", this, null), "name", "name"));

        columns.add(new AbstractColumn<ResourceTO, String>(
                new StringResourceModel("connector", this, null, "connector")) {

            private static final long serialVersionUID = 8263694778917279290L;

            @Override
            public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId,
                    final IModel<ResourceTO> rowModel) {

                final AjaxLink<String> editLink = new ClearIndicatingAjaxLink<String>("link", getPageReference()) {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    protected void onClickInternal(final AjaxRequestTarget target) {

                        editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new ConnectorModalPage(Resources.this.getPageReference(), editConnectorWin,
                                        connectorRestClient.read(rowModel.getObject().getConnectorId()));
                            }
                        });

                        editConnectorWin.show(target);
                    }
                };
                editLink.add(new Label("linkTitle", rowModel.getObject().getConnectorDisplayName()));

                LinkPanel editConnPanel = new LinkPanel(componentId);
                editConnPanel.add(editLink);

                cellItem.add(editConnPanel);

                MetaDataRoleAuthorizationStrategy.authorize(editConnPanel, ENABLE, xmlRolesReader.getAllAllowedRoles(
                        "Connectors", "read"));
            }
        });

        columns.add(new PropertyColumn(new StringResourceModel(
                "propagationPrimary", this, null), "propagationPrimary", "propagationPrimary"));
        columns.add(new PropertyColumn(new StringResourceModel(
                "propagationPriority", this, null), "propagationPriority", "propagationPriority"));

        columns.add(new AbstractColumn<ResourceTO, String>(new StringResourceModel("actions", this, null, "")) {

            private static final long serialVersionUID = 2054811145491901166L;

            @Override
            public String getCssClass() {
View Full Code Here

    private void setupConnectors() {
        List<IColumn<ConnInstanceTO, String>> columns = new ArrayList<IColumn<ConnInstanceTO, String>>();

        columns.add(new PropertyColumn(
                new StringResourceModel("id", this, null), "id", "id"));
        columns.add(new PropertyColumn(
                new StringResourceModel("name", this, null), "connectorName", "connectorName"));
        columns.add(new PropertyColumn(
                new StringResourceModel("displayName", this, null), "displayName", "displayName"));
        columns.add(new PropertyColumn(
                new StringResourceModel("bundleName", this, null), "bundleName", "bundleName"));
        columns.add(new PropertyColumn(
                new StringResourceModel("version", this, null), "version", "version"));
        columns.add(new AbstractColumn<ConnInstanceTO, String>(new StringResourceModel("actions", this, null, "")) {

            private static final long serialVersionUID = 2054811145491901166L;

            @Override
            public String getCssClass() {
View Full Code Here

        log.debug("username {}", username);

        if (username == null || "".equals(username)) {
            log.warn("Username not specified, notifying user that it's a required field.");
            getSession().error(new NotificationMessage(
                    new StringResourceModel("errors.required", this, null, new Object[]{"username"})));
            throw new RestartResponseException(Login.class);
        }

        log.debug("Processing Password Hint for username: {}", username);

        // look up the user's information
        try {
            User user = userManager.getUserByUsername(username);

            StringBuilder msg = new StringBuilder();
            msg.append("Your password hint is: ").append(user.getPasswordHint());
            msg.append("\n\nLogin at: ")
                    .append(RequestCycle.get().getUrlRenderer().renderFullUrl(
                            Url.parse(urlFor(Login.class, null).toString())));

            SimpleMailMessage message = new SimpleMailMessage();
            message.setTo(user.getEmail());

            String subject = '[' + getString("webapp.name") + "] " + getString("user.passwordHint");
            message.setSubject(subject);
            message.setText(msg.toString());
            log.debug("subject: {}", subject);
            log.debug("message: {}", message);
            mailEngine.send(message);

            getSession().info(createDefaultInfoNotificationMessage(new StringResourceModel(
                    "login.passwordHint.sent", this, null, new Object[] {username, "provided email address"})));
        } catch (UsernameNotFoundException e) {
            log.warn(e.getMessage());
            // This exception is expected to not be rethrown
            getSession().error(new NotificationMessage(new StringResourceModel(
                    "login.passwordHint.error", this, null, new Object[] {username})));
        } catch (MailException me) {
            log.error(me.getMessage(), me);
            getSession().error(new NotificationMessage(new ResourceModel("errors.sending.email")));
        }
View Full Code Here

        log.info("onSubmit (address): {}", user.getAddress());

        try {
            getUserManager().saveUser(user);
            getSession().info(createDefaultInfoNotificationMessage(
                    new StringResourceModel("user.added", this, null, new Object[]{user.getFullName()})));
            resolveAndSetResponsePage();
        } catch (UserExistsException e) {
            log.warn("User already exists", e);
            error(new NotificationMessage(new StringResourceModel("errors.existing.user", this, null, new Object[] {
                    user.getUsername(), user.getEmail()})));
        }
    }
View Full Code Here

    protected void onDeleteButtonSubmit() {
        User editedUser = getUser();
        String fullName = editedUser.getFullName();
        log.debug("deleting user: {}, {}", editedUser.getId(), fullName);
        getUserManager().removeUser(editedUser.getId().toString());
        getSession().info(new StringResourceModel(
                "user.deleted", this, null, new Object[] {fullName}).getString());
        resolveAndSetResponsePage();
    }
View Full Code Here

    private Label createSignupLabel() {
        String absoluteSignupLink = RequestCycle.get().getUrlRenderer().renderFullUrl(
                Url.parse(urlFor(Signup.class, null).toString()));
        //TODO: MZA: There should be some better way to use URL inside a label (if not, make it an util method)
        String signupLabelText = new StringResourceModel("login.signup", this, null, new Object[] {
                absoluteSignupLink}).getString();
        Label signupLabel = new Label("signupLabel", signupLabelText);
        signupLabel.setEscapeModelStrings(false);
        return signupLabel;
    }
View Full Code Here

        log.info("(current) onSubmit (address): {}", user.getAddress());

        try {
            getUserManager().saveUser(user);
            getSession().info(createDefaultInfoNotificationMessage(
                    new StringResourceModel("user.added", this, null, new Object[]{user.getFullName()})));
            resolveAndSetResponsePage();
        } catch (UserExistsException e) {
            log.warn("User already exists", e);
            error(new NotificationMessage(new StringResourceModel("errors.existing.user", this, null, new Object[] {
                    user.getUsername(), user.getEmail()})
            ));
        }
    }
View Full Code Here

        } catch (AccessDeniedException ade) {
            // thrown by UserSecurityAdvice configured in aop:advisor
            log.warn(ade.getMessage());
            throw new SecurityException("AccessDenied on saving new user", ade);
        } catch (UserExistsException e) {
            error(new StringResourceModel("errors.existing.user", this, null, new Object[] {
                    user.getUsername(), user.getEmail()}).getString());
            throw new RestartResponseException(getPage());
        }
        return user;
    }
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.