forked from Evolveum/midpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started with object collection new page/panels
- Loading branch information
1 parent
4c873aa
commit 3df31e8
Showing
8 changed files
with
169 additions
and
5 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
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
70 changes: 70 additions & 0 deletions
70
...java/com/evolveum/midpoint/gui/impl/page/admin/objectcollection/PageObjectCollection.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,70 @@ | ||
/* | ||
* Copyright (c) 2021 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.objectcollection; | ||
|
||
import com.evolveum.midpoint.gui.api.model.LoadableModel; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.apache.wicket.request.mapper.parameter.PageParameters; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.security.api.AuthorizationConstants; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.web.application.AuthorizationAction; | ||
import com.evolveum.midpoint.web.application.PageDescriptor; | ||
import com.evolveum.midpoint.web.application.Url; | ||
import com.evolveum.midpoint.web.page.admin.configuration.PageAdminConfiguration; | ||
import com.evolveum.midpoint.web.page.admin.objectCollection.ObjectCollectionSummaryPanel; | ||
import com.evolveum.midpoint.web.util.OnePageParameterEncoder; | ||
|
||
@PageDescriptor( | ||
urls = { | ||
@Url(mountUrl = "/admin/newObjectCollection") | ||
}, | ||
encoder = OnePageParameterEncoder.class, | ||
action = { | ||
@AuthorizationAction(actionUri = PageAdminConfiguration.AUTH_CONFIGURATION_ALL, | ||
label = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_LABEL, | ||
description = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_DESCRIPTION), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_OBJECT_COLLECTIONS_ALL_URL, | ||
label = "PageObjectCollection.auth.objectCollectionsAll.label", | ||
description = "PageObjectCollection.auth.objectCollectionsAll.description"), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_OBJECT_COLLECTION_URL, | ||
label = "PageObjectCollection.auth.objectCollection.label", | ||
description = "PageObjectCollection.auth.objectCollection.description") | ||
}) | ||
public class PageObjectCollection extends PageAssignmentHolderDetails<ObjectCollectionType, AssignmentHolderDetailsModel<ObjectCollectionType>> { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(PageObjectCollection.class); | ||
|
||
public PageObjectCollection() { | ||
super(); | ||
} | ||
|
||
public PageObjectCollection(PageParameters parameters) { | ||
super(parameters); | ||
} | ||
|
||
public PageObjectCollection(final PrismObject<ObjectCollectionType> unitToEdit) { | ||
super(unitToEdit); | ||
} | ||
|
||
@Override | ||
protected Class<ObjectCollectionType> getType() { | ||
return ObjectCollectionType.class; | ||
} | ||
|
||
@Override | ||
protected Panel createSummaryPanel(String id, LoadableModel<ObjectCollectionType> summaryModel) { | ||
return new ObjectCollectionSummaryPanel(id, summaryModel, this); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...evolveum/midpoint/gui/impl/page/admin/objectcollection/component/BaseCollectionPanel.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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2021 Evolveum | ||
~ | ||
~ 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="panel" /> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</body> | ||
</html> |
73 changes: 73 additions & 0 deletions
73
...evolveum/midpoint/gui/impl/page/admin/objectcollection/component/BaseCollectionPanel.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,73 @@ | ||
/* | ||
* Copyright (c) 2021 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.objectcollection.component; | ||
|
||
import org.apache.wicket.model.IModel; | ||
|
||
import com.evolveum.midpoint.gui.api.prism.ItemStatus; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper; | ||
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel; | ||
import com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.gui.impl.page.admin.task.component.TaskActivityPanel; | ||
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel; | ||
import com.evolveum.midpoint.prism.Containerable; | ||
import com.evolveum.midpoint.prism.path.ItemName; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
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.prism.ItemVisibility; | ||
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.CollectionRefSpecificationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType; | ||
|
||
@PanelType(name = "baseCollection") | ||
@PanelInstance(identifier = "baseCollection", | ||
applicableFor = ObjectCollectionType.class, | ||
status = ItemStatus.NOT_CHANGED, | ||
display = @PanelDisplay(label = "pageObjectCollection.baseCollection.title", order = 40)) | ||
public class BaseCollectionPanel extends AbstractObjectMainPanel<ObjectCollectionType, ObjectDetailsModels<ObjectCollectionType>> { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(BaseCollectionPanel.class); | ||
private static final String ID_PANEL = "panel"; | ||
|
||
private static final String DOT_CLASS = BaseCollectionPanel.class.getName() + "."; | ||
|
||
public BaseCollectionPanel(String id, AssignmentHolderDetailsModel<ObjectCollectionType> model, ContainerPanelConfigurationType config) { | ||
super(id, model, config); | ||
} | ||
|
||
@Override | ||
protected void initLayout() { | ||
SingleContainerPanel panel = | ||
new SingleContainerPanel<CollectionRefSpecificationType>(ID_PANEL, | ||
createModel(getObjectWrapperModel(), ObjectCollectionType.F_BASE_COLLECTION), | ||
CollectionRefSpecificationType.COMPLEX_TYPE) { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) { | ||
if (ItemPath.create(ObjectCollectionType.F_BASE_COLLECTION, CollectionRefSpecificationType.F_BASE_COLLECTION_REF) | ||
.isSuperPathOrEquivalent(itemWrapper.getPath())) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
return ItemVisibility.AUTO; | ||
} | ||
}; | ||
add(panel); | ||
} | ||
|
||
private <C extends Containerable> PrismContainerWrapperModel<ObjectCollectionType, C> createModel(IModel<PrismObjectWrapper<ObjectCollectionType>> model, ItemName itemName) { | ||
return PrismContainerWrapperModel.fromContainerWrapper(model, itemName); | ||
} | ||
} |
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