-
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 started
- Loading branch information
Showing
29 changed files
with
978 additions
and
668 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
71 changes: 71 additions & 0 deletions
71
...int/gui/impl/page/admin/systemconfiguration/component/AdditionalMenuLinkContentPanel.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,71 @@ | ||
/* | ||
* Copyright (c) 2010-2022 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
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; | ||
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 java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
@PanelType(name = "additionalMenuLinkContent") | ||
@PanelInstance( | ||
identifier = "additionalMenuLinkContent", | ||
applicableForType = SystemConfigurationType.class, | ||
display = @PanelDisplay( | ||
label = "AdditionalMenuLinkContentPanel.label", | ||
icon = GuiStyleConstants.CLASS_CIRCLE_FULL, | ||
order = 10 | ||
) | ||
) | ||
@Counter(provider = AdditionalMenuLinkCounter.class) | ||
public class AdditionalMenuLinkContentPanel extends RichHyperlinkListContentPanel { | ||
|
||
public AdditionalMenuLinkContentPanel(String id, AssignmentHolderDetailsModel model, ContainerPanelConfigurationType configurationType) { | ||
super(id, model, configurationType, ItemPath.create( | ||
SystemConfigurationType.F_ADMIN_GUI_CONFIGURATION, | ||
AdminGuiConfigurationType.F_ADDITIONAL_MENU_LINK)); | ||
} | ||
|
||
@Override | ||
protected UserProfileStorage.TableId getTableId() { | ||
return UserProfileStorage.TableId.PAGE_MESSAGE_TEMPLATE_LOCALIZED_CONTENT_PANEL; // todo fix | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2010-2022 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
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.AdminGuiConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class AdditionalMenuLinkCounter extends SimpleCounter<AssignmentHolderDetailsModel<SystemConfigurationType>, SystemConfigurationType> { | ||
|
||
public AdditionalMenuLinkCounter() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public int count(AssignmentHolderDetailsModel<SystemConfigurationType> model, PageBase pageBase) { | ||
SystemConfigurationType object = model.getObjectType(); | ||
AdminGuiConfigurationType agc = object.getAdminGuiConfiguration(); | ||
|
||
return agc != null ? agc.getAdditionalMenuLink().size() : 0; | ||
} | ||
} | ||
|
67 changes: 67 additions & 0 deletions
67
...midpoint/gui/impl/page/admin/systemconfiguration/component/RichHyperlinkDetailsPanel.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,67 @@ | ||
/* | ||
* Copyright (c) 2010-2022 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
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.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 RichHyperlinkDetailsPanel extends MultivalueContainerDetailsPanel<RichHyperlinkType> { | ||
|
||
public RichHyperlinkDetailsPanel(String id, IModel<PrismContainerValueWrapper<RichHyperlinkType>> model, boolean addDefaultPanel) { | ||
super(id, model, addDefaultPanel); | ||
} | ||
|
||
public RichHyperlinkDetailsPanel(String id, IModel<PrismContainerValueWrapper<RichHyperlinkType>> model, boolean addDefaultPanel, ContainerPanelConfigurationType config) { | ||
super(id, model, addDefaultPanel, config); | ||
} | ||
|
||
@Override | ||
protected DisplayNamePanel<RichHyperlinkType> 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("RichHyperlinkType.label"); | ||
} | ||
|
||
@Override | ||
protected IModel<String> getDescriptionLabelModel() { | ||
return () -> getModelObject().getLabel(); | ||
} | ||
|
||
@Override | ||
protected WebMarkupContainer createTypeImagePanel(String idTypeImage) { | ||
WebMarkupContainer c = new WebMarkupContainer(idTypeImage); | ||
c.setVisible(false); | ||
return c; | ||
} | ||
}; | ||
|
||
return d; | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
...oint/gui/impl/page/admin/systemconfiguration/component/RichHyperlinkListContentPanel.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,88 @@ | ||
/* | ||
* Copyright (c) 2010-2022 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
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.component.data.column.CheckBoxHeaderColumn; | ||
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel; | ||
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.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 java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public abstract class RichHyperlinkListContentPanel extends MultivalueContainerListPanelWithDetailsPanel<RichHyperlinkType> { | ||
|
||
private IModel<PrismContainerWrapper<RichHyperlinkType>> model; | ||
|
||
public RichHyperlinkListContentPanel(String id, AssignmentHolderDetailsModel model, ContainerPanelConfigurationType configurationType, ItemPath containerRealPath) { | ||
super(id, RichHyperlinkType.class, configurationType); | ||
|
||
this.model = PrismContainerWrapperModel.fromContainerWrapper(model.getObjectWrapperModel(), containerRealPath); | ||
} | ||
|
||
@Override | ||
protected IColumn<PrismContainerValueWrapper<RichHyperlinkType>, String> createCheckboxColumn() { | ||
return new CheckBoxHeaderColumn<>(); | ||
} | ||
|
||
@Override | ||
protected List<IColumn<PrismContainerValueWrapper<RichHyperlinkType>, String>> createDefaultColumns() { | ||
return Arrays.asList( | ||
new PrismPropertyWrapperColumn<>(getContainerModel(), RichHyperlinkType.F_LABEL, | ||
AbstractItemWrapperColumn.ColumnType.LINK, getPageBase()) { | ||
|
||
@Override | ||
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<RichHyperlinkType>> model) { | ||
RichHyperlinkListContentPanel.this.itemDetailsPerformed(target, model); | ||
} | ||
} | ||
); | ||
} | ||
|
||
@Override | ||
protected boolean isCreateNewObjectVisible() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected IModel<PrismContainerWrapper<RichHyperlinkType>> getContainerModel() { | ||
return model; | ||
} | ||
|
||
@Override | ||
protected MultivalueContainerDetailsPanel<RichHyperlinkType> getMultivalueContainerDetailsPanel( | ||
ListItem<PrismContainerValueWrapper<RichHyperlinkType>> item) { | ||
|
||
return new RichHyperlinkDetailsPanel(MultivalueContainerListPanelWithDetailsPanel.ID_ITEM_DETAILS, item.getModel(), true); | ||
} | ||
} |
Oops, something went wrong.