-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MID-7662 new system configuration UI, logging, wip
- Loading branch information
Showing
17 changed files
with
338 additions
and
149 deletions.
There are no files selected for viewing
18 changes: 9 additions & 9 deletions
18
...om/evolveum/midpoint/gui/impl/page/admin/systemconfiguration/PageSystemConfiguration.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2010-2013 Evolveum | ||
~ Copyright (c) 2022 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:extend> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div wicket:id="container" /> | ||
</div> | ||
</div> | ||
<body> | ||
<wicket:extend> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div wicket:id="container"/> | ||
</div> | ||
</div> | ||
</wicket:extend> | ||
</body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 3 additions & 12 deletions
15
...midpoint/gui/impl/page/admin/systemconfiguration/component/AdditionalMenuLinkCounter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...m/midpoint/gui/impl/page/admin/systemconfiguration/component/ClassLoggerDetailsPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import com.evolveum.midpoint.gui.api.component.DisplayNamePanel; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper; | ||
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.RichHyperlinkType; | ||
|
||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class ClassLoggerDetailsPanel extends MultivalueContainerDetailsPanel<ClassLoggerConfigurationType> { | ||
|
||
public ClassLoggerDetailsPanel(String id, IModel<PrismContainerValueWrapper<ClassLoggerConfigurationType>> model, boolean addDefaultPanel) { | ||
super(id, model, addDefaultPanel); | ||
} | ||
|
||
public ClassLoggerDetailsPanel(String id, IModel<PrismContainerValueWrapper<ClassLoggerConfigurationType>> model, boolean addDefaultPanel, ContainerPanelConfigurationType config) { | ||
super(id, model, addDefaultPanel, config); | ||
} | ||
|
||
@Override | ||
protected DisplayNamePanel<ClassLoggerConfigurationType> createDisplayNamePanel(String displayNamePanelId) { | ||
// so far no display name panel needed | ||
DisplayNamePanel d = new DisplayNamePanel<>(displayNamePanelId, Model.of(getModelObject().getRealValue())) { | ||
|
||
@Override | ||
protected IModel<String> createHeaderModel() { | ||
return createStringResource("ClassLoggerConfigurationType.label"); | ||
} | ||
|
||
@Override | ||
protected IModel<String> getDescriptionLabelModel() { | ||
return () -> getModelObject().getPackage(); | ||
} | ||
|
||
@Override | ||
protected WebMarkupContainer createTypeImagePanel(String idTypeImage) { | ||
WebMarkupContainer c = new WebMarkupContainer(idTypeImage); | ||
c.setVisible(false); | ||
return c; | ||
} | ||
}; | ||
|
||
return d; | ||
} | ||
} |
112 changes: 112 additions & 0 deletions
112
.../midpoint/gui/impl/page/admin/systemconfiguration/component/ClassLoggersContentPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; | ||
import org.apache.wicket.markup.html.list.ListItem; | ||
import org.apache.wicket.model.IModel; | ||
|
||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper; | ||
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel; | ||
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanelWithDetailsPanel; | ||
import com.evolveum.midpoint.gui.impl.component.data.column.AbstractItemWrapperColumn; | ||
import com.evolveum.midpoint.gui.impl.component.data.column.PrismPropertyWrapperColumn; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.web.application.Counter; | ||
import com.evolveum.midpoint.web.application.PanelDisplay; | ||
import com.evolveum.midpoint.web.application.PanelInstance; | ||
import com.evolveum.midpoint.web.application.PanelType; | ||
import com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn; | ||
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel; | ||
import com.evolveum.midpoint.web.session.UserProfileStorage; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
@PanelType(name = "classLoggersContent") | ||
@PanelInstance( | ||
identifier = "classLoggersContent", | ||
applicableForType = SystemConfigurationType.class, | ||
display = @PanelDisplay( | ||
label = "ClassLoggersContentPanel.label", | ||
icon = GuiStyleConstants.CLASS_CIRCLE_FULL, | ||
order = 30 | ||
) | ||
) | ||
@Counter(provider = ClassLoggersMenuLinkCounter.class) | ||
public class ClassLoggersContentPanel extends MultivalueContainerListPanelWithDetailsPanel<ClassLoggerConfigurationType> { | ||
|
||
private IModel<PrismContainerWrapper<ClassLoggerConfigurationType>> model; | ||
|
||
public ClassLoggersContentPanel(String id, AssignmentHolderDetailsModel model, ContainerPanelConfigurationType configurationType) { | ||
super(id, ClassLoggerConfigurationType.class, configurationType); | ||
|
||
this.model = PrismContainerWrapperModel.fromContainerWrapper(model.getObjectWrapperModel(), ItemPath.create( | ||
SystemConfigurationType.F_LOGGING, | ||
LoggingConfigurationType.F_CLASS_LOGGER | ||
)); | ||
} | ||
|
||
@Override | ||
protected IColumn<PrismContainerValueWrapper<ClassLoggerConfigurationType>, String> createCheckboxColumn() { | ||
return new CheckBoxHeaderColumn<>(); | ||
} | ||
|
||
@Override | ||
protected List<IColumn<PrismContainerValueWrapper<ClassLoggerConfigurationType>, String>> createDefaultColumns() { | ||
return Arrays.asList( | ||
new PrismPropertyWrapperColumn<>(getContainerModel(), ClassLoggerConfigurationType.F_PACKAGE, | ||
AbstractItemWrapperColumn.ColumnType.LINK, getPageBase()) { | ||
|
||
@Override | ||
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ClassLoggerConfigurationType>> model) { | ||
ClassLoggersContentPanel.this.itemDetailsPerformed(target, model); | ||
} | ||
}, | ||
new PrismPropertyWrapperColumn<>(getContainerModel(), ClassLoggerConfigurationType.F_LEVEL, | ||
AbstractItemWrapperColumn.ColumnType.VALUE, getPageBase()) { | ||
|
||
@Override | ||
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ClassLoggerConfigurationType>> model) { | ||
ClassLoggersContentPanel.this.itemDetailsPerformed(target, model); | ||
} | ||
} | ||
); | ||
} | ||
|
||
@Override | ||
protected boolean isCreateNewObjectVisible() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected IModel<PrismContainerWrapper<ClassLoggerConfigurationType>> getContainerModel() { | ||
return model; | ||
} | ||
|
||
@Override | ||
protected MultivalueContainerDetailsPanel<ClassLoggerConfigurationType> getMultivalueContainerDetailsPanel( | ||
ListItem<PrismContainerValueWrapper<ClassLoggerConfigurationType>> item) { | ||
|
||
return new ClassLoggerDetailsPanel(MultivalueContainerListPanelWithDetailsPanel.ID_ITEM_DETAILS, item.getModel(), true); | ||
} | ||
|
||
@Override | ||
protected UserProfileStorage.TableId getTableId() { | ||
return UserProfileStorage.TableId.PAGE_MESSAGE_TEMPLATE_LOCALIZED_CONTENT_PANEL; // todo fix | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...dpoint/gui/impl/page/admin/systemconfiguration/component/ClassLoggersMenuLinkCounter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import com.evolveum.midpoint.gui.api.page.PageBase; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.web.application.SimpleCounter; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class ClassLoggersMenuLinkCounter extends SimpleCounter<AssignmentHolderDetailsModel<SystemConfigurationType>, SystemConfigurationType> { | ||
|
||
public ClassLoggersMenuLinkCounter() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public int count(AssignmentHolderDetailsModel<SystemConfigurationType> model, PageBase pageBase) { | ||
SystemConfigurationType object = model.getObjectType(); | ||
LoggingConfigurationType lg = object.getLogging(); | ||
|
||
return lg != null ? lg.getClassLogger().size() : 0; | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
...lveum/midpoint/gui/impl/page/admin/systemconfiguration/component/LoggingContentPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- | ||
~ Copyright (c) 2022 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div wicket:id="mainPanel" /> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</body> | ||
</html> |
46 changes: 46 additions & 0 deletions
46
...lveum/midpoint/gui/impl/page/admin/systemconfiguration/component/LoggingContentPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.web.application.PanelDisplay; | ||
import com.evolveum.midpoint.web.application.PanelInstance; | ||
import com.evolveum.midpoint.web.application.PanelType; | ||
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
@PanelType(name = "loggingPanel") | ||
@PanelInstance( | ||
identifier = "loggingPanel", | ||
applicableForType = SystemConfigurationType.class, | ||
display = @PanelDisplay( | ||
label = "LoggingPanelContent.label", | ||
icon = GuiStyleConstants.CLASS_CIRCLE_FULL, | ||
order = 20 | ||
) | ||
) | ||
public class LoggingContentPanel extends AbstractObjectMainPanel<SystemConfigurationType, AssignmentHolderDetailsModel<SystemConfigurationType>> { | ||
|
||
private static final String ID_MAIN_PANEL = "mainPanel"; | ||
|
||
public LoggingContentPanel(String id, AssignmentHolderDetailsModel<SystemConfigurationType> model, ContainerPanelConfigurationType config) { | ||
super(id, model, config); | ||
} | ||
|
||
@Override | ||
protected void initLayout() { | ||
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL, | ||
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_LOGGING)), | ||
LoggingConfigurationType.COMPLEX_TYPE); | ||
add(panel); | ||
} | ||
} |
Oops, something went wrong.