-
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.
simulation result processed object page with correct url mapping
- Loading branch information
Showing
5 changed files
with
161 additions
and
12 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...java/com/evolveum/midpoint/gui/impl/page/admin/simulation/PageSimulationResultObject.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,14 @@ | ||
<!-- | ||
~ 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. | ||
--> | ||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:extend> | ||
simulation result processed object details | ||
</wicket:extend> | ||
</body> | ||
</html> |
90 changes: 90 additions & 0 deletions
90
...java/com/evolveum/midpoint/gui/impl/page/admin/simulation/PageSimulationResultObject.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,90 @@ | ||
/* | ||
* Copyright (c) 2010-2023 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.simulation; | ||
|
||
import com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction; | ||
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor; | ||
import com.evolveum.midpoint.authentication.api.authorization.Url; | ||
import com.evolveum.midpoint.common.Utils; | ||
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; | ||
import com.evolveum.midpoint.security.api.AuthorizationConstants; | ||
import com.evolveum.midpoint.web.page.admin.PageAdmin; | ||
import com.evolveum.midpoint.web.page.error.PageError404; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SimulationResultType; | ||
import org.apache.wicket.RestartResponseException; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.request.mapper.parameter.PageParameters; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
@PageDescriptor( | ||
urls = { | ||
@Url(mountUrl = "/admin/simulations/result/${RESULT_OID}/object/${CONTAINER_ID}"), | ||
@Url(mountUrl = "/admin/simulations/result/${RESULT_OID}/tag/${TAG_OID}/object/${CONTAINER_ID}") | ||
}, | ||
action = { | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_SIMULATIONS_ALL_URL, | ||
label = "PageSimulationResults.auth.simulationsAll.label", | ||
description = "PageSimulationResults.auth.simulationsAll.description"), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_SIMULATION_PROCESSED_OBJECT_URL, | ||
label = "PageSimulationResultObject.auth.simulationProcessedObject.label", | ||
description = "PageSimulationResultObject.auth.simulationProcessedObject.description") | ||
} | ||
) | ||
public class PageSimulationResultObject extends PageAdmin { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String PAGE_PARAMETER_RESULT_OID = "RESULT_OID"; | ||
private static final String PAGE_PARAMETER_TAG_OID = "TAG_OID"; | ||
|
||
private static final String ID_TABLE = "table"; | ||
|
||
public PageSimulationResultObject() { | ||
this(new PageParameters()); | ||
} | ||
|
||
public PageSimulationResultObject(PageParameters parameters) { | ||
super(parameters); | ||
|
||
initLayout(); | ||
} | ||
|
||
private void initLayout() { | ||
|
||
} | ||
|
||
private String getPageParameterResultOid() { | ||
PageParameters params = getPageParameters(); | ||
return params.get(PAGE_PARAMETER_RESULT_OID).toString(); | ||
} | ||
|
||
private String getPageParameterTagOid() { | ||
PageParameters params = getPageParameters(); | ||
return params.get(PAGE_PARAMETER_TAG_OID).toString(); | ||
} | ||
|
||
@Override | ||
protected IModel<String> createPageTitleModel() { | ||
return () -> { | ||
String oid = getPageParameterResultOid(); | ||
|
||
if (!Utils.isPrismObjectOidValid(oid)) { | ||
throw new RestartResponseException(PageError404.class); | ||
} | ||
|
||
String name = WebModelServiceUtils.resolveReferenceName( | ||
new ObjectReferenceType().oid(oid).type(SimulationResultType.COMPLEX_TYPE), this); | ||
|
||
return getString("PageSimulationResultObjects.title", name); | ||
}; | ||
} | ||
} |
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