use of com.evolveum.midpoint.xml.ns._public.common.common_3.RichHyperlinkType in project midpoint by Evolveum.
the class AdminGuiConfigPanel method initLayout.
private void initLayout() {
GenericMultiValueLabelEditPanel<RichHyperlinkType> dashboardLinkEditor = new GenericMultiValueLabelEditPanel<RichHyperlinkType>(ID_DASHBOARD_LINK_EDITOR, new PropertyModel<List<RichHyperlinkType>>(getModel(), "userDashboardLink"), createStringResource("AdminGuiConfigPanel.dashboardLinksConfig"), LABEL_SIZE, INPUT_SIZE, true) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createTextModel(final IModel<RichHyperlinkType> model) {
return new PropertyModel<String>(model, "label");
}
@Override
protected void editValuePerformed(AjaxRequestTarget target, IModel<RichHyperlinkType> rowModel) {
RichHyperlinkConfigPanel contentPanel = new RichHyperlinkConfigPanel(getPageBase().getMainPopupBodyId(), rowModel.getObject(), false) {
private static final long serialVersionUID = 1L;
@Override
protected void savePerformed(AjaxRequestTarget target) {
closeModalWindow(target);
target.add(getDashboardLinkEditorContainer());
}
@Override
public StringResourceModel getTitle() {
return createStringResource("AdminGuiConfigPanel.dashboardLinkDialogTitle.title");
}
};
showDialog(contentPanel, target);
}
@Override
protected RichHyperlinkType createNewEmptyItem() {
RichHyperlinkType link = new RichHyperlinkType();
link.getAuthorization().add("");
return link;
}
};
dashboardLinkEditor.setOutputMarkupId(true);
add(dashboardLinkEditor);
GenericMultiValueLabelEditPanel<RichHyperlinkType> additionalMenuItemEditor = new GenericMultiValueLabelEditPanel<RichHyperlinkType>(ID_ADDITIONAL_MENU_ITEM_EDITOR, new PropertyModel<List<RichHyperlinkType>>(getModel(), "additionalMenuLink"), createStringResource("AdminGuiConfigPanel.additionalMenuItemConfig"), LABEL_SIZE, INPUT_SIZE, true) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createTextModel(final IModel<RichHyperlinkType> model) {
return new PropertyModel<String>(model, "label");
}
@Override
protected void editValuePerformed(AjaxRequestTarget target, IModel<RichHyperlinkType> rowModel) {
RichHyperlinkConfigPanel contentPanel = new RichHyperlinkConfigPanel(getPageBase().getMainPopupBodyId(), rowModel.getObject(), true) {
private static final long serialVersionUID = 1L;
@Override
protected void savePerformed(AjaxRequestTarget target) {
closeModalWindow(target);
target.add(getAdditionalMenuItemContainer());
}
@Override
public StringResourceModel getTitle() {
return createStringResource("AdminGuiConfigPanel.additionalMenuItemDialog.title");
}
};
showDialog(contentPanel, target);
}
@Override
protected RichHyperlinkType createNewEmptyItem() {
RichHyperlinkType link = new RichHyperlinkType();
link.getAuthorization().add("");
return link;
}
};
additionalMenuItemEditor.setOutputMarkupId(true);
add(additionalMenuItemEditor);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RichHyperlinkType in project midpoint by Evolveum.
the class TestPreviewChanges method test130GetAdminGuiConfig.
@Test
public void test130GetAdminGuiConfig() throws Exception {
final String TEST_NAME = "test130GetAdminGuiConfig";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestPreviewChanges.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
AdminGuiConfigurationType adminGuiConfiguration = modelInteractionService.getAdminGuiConfiguration(task, result);
// THEN
result.computeStatus();
TestUtil.assertSuccess(result);
assertAdminGuiConfigurations(adminGuiConfiguration, 0, 1, 3, 1, 0);
RichHyperlinkType link = adminGuiConfiguration.getUserDashboardLink().get(0);
assertEquals("Bad link label", "Foo", link.getLabel());
assertEquals("Bad link targetUrl", "/foo", link.getTargetUrl());
assertEquals("Bad timezone targetUrl", "Jamaica", adminGuiConfiguration.getDefaultTimezone());
}
Aggregations