Search in sources :

Example 1 with WebPage

use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.

the class PagePreviewChanges method savePerformed.

private void savePerformed(AjaxRequestTarget target) {
    Breadcrumb bc = redirectBack();
    if (bc instanceof BreadcrumbPageInstance) {
        BreadcrumbPageInstance bcpi = (BreadcrumbPageInstance) bc;
        WebPage page = bcpi.getPage();
        if (page instanceof PageAdminObjectDetails) {
            ((PageAdminObjectDetails) page).setSaveOnConfigure(true);
        } else {
            error("Couldn't save changes - unexpected referring page: " + page);
        }
    } else {
        error("Couldn't save changes - no instance for referring page; breadcrumb is " + bc);
    }
}
Also used : WebPage(org.apache.wicket.markup.html.WebPage) Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb) BreadcrumbPageInstance(com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance) PageAdminObjectDetails(com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails)

Example 2 with WebPage

use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.

the class PageBase method createConfigurationItems.

private MainMenuItem createConfigurationItems() {
    MainMenuItem item = new MainMenuItem("fa fa-cog", createStringResource("PageAdmin.menu.top.configuration"), null);
    item.setInsertDefaultBackBreadcrumb(false);
    List<MenuItem> submenu = item.getItems();
    MenuItem menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.bulkActions"), PageBulkAction.class);
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.importObject"), PageImportObject.class, null, null);
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repositoryObjects"), PageDebugList.class);
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repositoryObjectView"), PageDebugView.class, null, createVisibleDisabledBehaviorForEditMenu(PageDebugView.class));
    submenu.add(menu);
    PageParameters params = new PageParameters();
    params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_BASIC);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.basic"), PageSystemConfiguration.class, params, null) {

        @Override
        public boolean isMenuActive(WebPage page) {
            if (!PageSystemConfiguration.class.equals(page.getClass())) {
                return false;
            }
            int index = getSelectedTabForConfiguration(page);
            return PageSystemConfiguration.CONFIGURATION_TAB_BASIC == index ? true : false;
        }
    };
    submenu.add(menu);
    params = new PageParameters();
    params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.notifications"), PageSystemConfiguration.class, params, null) {

        @Override
        public boolean isMenuActive(WebPage page) {
            if (!PageSystemConfiguration.class.equals(page.getClass())) {
                return false;
            }
            int index = getSelectedTabForConfiguration(page);
            return PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION == index ? true : false;
        }
    };
    submenu.add(menu);
    params = new PageParameters();
    params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_LOGGING);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.logging"), PageSystemConfiguration.class, params, null) {

        @Override
        public boolean isMenuActive(WebPage page) {
            if (!PageSystemConfiguration.class.equals(page.getClass())) {
                return false;
            }
            int index = getSelectedTabForConfiguration(page);
            return PageSystemConfiguration.CONFIGURATION_TAB_LOGGING == index ? true : false;
        }
    };
    submenu.add(menu);
    params = new PageParameters();
    params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_PROFILING);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.profiling"), PageSystemConfiguration.class, params, null) {

        @Override
        public boolean isMenuActive(WebPage page) {
            if (!PageSystemConfiguration.class.equals(page.getClass())) {
                return false;
            }
            int index = getSelectedTabForConfiguration(page);
            return PageSystemConfiguration.CONFIGURATION_TAB_PROFILING == index ? true : false;
        }
    };
    submenu.add(menu);
    params = new PageParameters();
    params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.adminGui"), PageSystemConfiguration.class, params, null) {

        @Override
        public boolean isMenuActive(WebPage page) {
            if (!PageSystemConfiguration.class.equals(page.getClass())) {
                return false;
            }
            int index = getSelectedTabForConfiguration(page);
            return PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI == index ? true : false;
        }
    };
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.shadowsDetails"), PageAccounts.class);
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.internals"), PageInternals.class);
    submenu.add(menu);
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repoQuery"), PageRepositoryQuery.class);
    submenu.add(menu);
    if (SystemConfigurationHolder.isExperimentalCodeEnabled()) {
        menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.evaluateMapping"), PageEvaluateMapping.class);
        submenu.add(menu);
    }
    menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.about"), PageAbout.class);
    submenu.add(menu);
    return item;
}
Also used : WebPage(org.apache.wicket.markup.html.WebPage) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 3 with WebPage

use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.

the class PageBase method navigateToNext.

public void navigateToNext(Class<? extends WebPage> pageType, PageParameters params) {
    IPageFactory pFactory = Session.get().getPageFactory();
    WebPage page;
    if (params == null) {
        page = pFactory.newPage(pageType);
    } else {
        page = pFactory.newPage(pageType, params);
    }
    navigateToNext(page);
}
Also used : WebPage(org.apache.wicket.markup.html.WebPage)

Example 4 with WebPage

use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.

the class NewWindowNotifyingBehavior method onNewWindow.

@Override
protected void onNewWindow(AjaxRequestTarget target) {
    LOG.debug("Page version already used in different tab, refreshing page");
    WebPage page = (WebPage) getComponent();
    page.setResponsePage(page.getPageClass(), page.getPageParameters());
}
Also used : WebPage(org.apache.wicket.markup.html.WebPage)

Example 5 with WebPage

use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.

the class MainMenuPanel method createSubmenu.

private void createSubmenu(final ListItem<MenuItem> listItem) {
    final MenuItem menuItem = listItem.getModelObject();
    listItem.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return menuItem.isMenuActive((WebPage) getPage()) ? "active" : null;
        }
    }));
    Link<String> subLink = new Link<String>(ID_SUB_LINK) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            menuItemPerformed(menuItem);
        }
    };
    listItem.add(subLink);
    Label subLabel = new Label(ID_SUB_LABEL, menuItem.getNameModel());
    subLink.add(subLabel);
    listItem.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            MenuItem mi = listItem.getModelObject();
            boolean visible = true;
            if (mi.getVisibleEnable() != null) {
                visible = mi.getVisibleEnable().isVisible();
            }
            return visible && SecurityUtils.isMenuAuthorized(mi);
        }

        @Override
        public boolean isEnabled() {
            MenuItem mi = listItem.getModelObject();
            if (mi.getVisibleEnable() == null) {
                return true;
            }
            return mi.getVisibleEnable().isEnabled();
        }
    });
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) WebPage(org.apache.wicket.markup.html.WebPage) Label(org.apache.wicket.markup.html.basic.Label) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) Link(org.apache.wicket.markup.html.link.Link) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Aggregations

WebPage (org.apache.wicket.markup.html.WebPage)7 Breadcrumb (com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb)3 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 BreadcrumbPageClass (com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageClass)1 BreadcrumbPageInstance (com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 PageAdminObjectDetails (com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails)1 IPageFactory (org.apache.wicket.IPageFactory)1 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)1 Label (org.apache.wicket.markup.html.basic.Label)1 Link (org.apache.wicket.markup.html.link.Link)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)1