Search in sources :

Example 46 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class OnePageParameterEncoder method decodePageParameters.

@Override
public PageParameters decodePageParameters(Url url) {
    PageParameters parameters = new PageParameters();
    List<String> segments = url.getSegments();
    if (!segments.isEmpty()) {
        String value = segments.get(0);
        parameters.add(PARAMETER, value);
    }
    if (url.getQueryParameters() != null) {
        for (Url.QueryParameter qp : url.getQueryParameters()) {
            parameters.add(qp.getName(), qp.getValue());
        }
    }
    return parameters.isEmpty() ? null : parameters;
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url)

Example 47 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageSystemConfiguration method onBeforeRender.

@Override
protected void onBeforeRender() {
    super.onBeforeRender();
    if (!initialized) {
        PageParameters params = getPageParameters();
        StringValue val = params.get(SELECTED_TAB_INDEX);
        String value = null;
        if (val != null && !val.isNull()) {
            value = val.toString();
        }
        int index = StringUtils.isNumeric(value) ? Integer.parseInt(value) : CONFIGURATION_TAB_BASIC;
        getTabPanel().setSelectedTab(index);
        initialized = true;
    }
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) StringValue(org.apache.wicket.util.string.StringValue)

Example 48 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageSystemConfiguration method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM, true);
    add(mainForm);
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.system.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            systemConfigPanel = new SystemConfigPanel(panelId, model);
            return systemConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.notifications.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            notificationConfigPanel = new NotificationConfigPanel(panelId, new PropertyModel<NotificationConfigurationDto>(model, "notificationConfig"));
            return notificationConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.logging.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            loggingConfigPanel = new LoggingConfigPanel(panelId, new PropertyModel<LoggingDto>(model, "loggingConfig"));
            return loggingConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.profiling.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            profilingConfigPanel = new ProfilingConfigPanel(panelId, new PropertyModel<ProfilingDto>(model, "profilingDto"), PageSystemConfiguration.this);
            return profilingConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.adminGui.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            adminGuiConfigPanel = new AdminGuiConfigPanel(panelId, model);
            return adminGuiConfigPanel;
        }
    });
    TabbedPanel tabPanel = new TabbedPanel(ID_TAB_PANEL, tabs) {

        @Override
        protected void onTabChange(int index) {
            PageParameters params = getPageParameters();
            params.set(SELECTED_TAB_INDEX, index);
        }
    };
    tabPanel.setOutputMarkupId(true);
    mainForm.add(tabPanel);
    initButtons(mainForm);
}
Also used : Form(com.evolveum.midpoint.web.component.form.Form) ArrayList(java.util.ArrayList) TabbedPanel(com.evolveum.midpoint.web.component.TabbedPanel) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Example 49 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageDebugList method objectEditPerformed.

private void objectEditPerformed(AjaxRequestTarget target, String oid, Class<? extends ObjectType> type) {
    PageParameters parameters = new PageParameters();
    parameters.add(PageDebugView.PARAM_OBJECT_ID, oid);
    parameters.add(PageDebugView.PARAM_OBJECT_TYPE, type.getSimpleName());
    navigateToNext(PageDebugView.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 50 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageSystemConfiguration method resetPerformed.

private void resetPerformed(AjaxRequestTarget target) {
    int index = getTabPanel().getSelectedTab();
    PageParameters params = new PageParameters();
    params.add(SELECTED_TAB_INDEX, index);
    PageSystemConfiguration page = new PageSystemConfiguration(params);
    setResponsePage(page);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Aggregations

PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)56 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)7 ArrayList (java.util.ArrayList)6 StringValue (org.apache.wicket.util.string.StringValue)5 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)4 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 StringResourceModel (org.apache.wicket.model.StringResourceModel)4 EditUserPage (org.devgateway.toolkit.forms.wicket.page.user.EditUserPage)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)3 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)3 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)3 Label (org.apache.wicket.markup.html.basic.Label)3 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)3 PropertyModel (org.apache.wicket.model.PropertyModel)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2