Skip to content

Commit

Permalink
Update role mining data export.
Browse files Browse the repository at this point in the history
  • Loading branch information
tchrapovic committed May 15, 2023
1 parent 11aa9f0 commit 6e2e416
Show file tree
Hide file tree
Showing 8 changed files with 634 additions and 242 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void assignRoles(List<PrismObject<UserType>> userList, List<PrismObject<R
for (int i = 0; i < groupSize; i++) {
RoleType roleType = rolesList.get(startIndex + i).asObjectable();
UserType userType = userTypePrismObject.asObjectable();
LOGGER.info("Assign object iterator: {},",i);

try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@
<button type="button" class="btn btn-primary btn-sm" wicket:id="keyGenerateButton"></button>
</div>

<div class="d-flex flex-wrap gap-2 w-100">
<span class="col-3 d-flex justify-content-end align-items-center" wicket:id="securityModeLabel">
</span>
<select class="btn btn-default btn-sm dropdown-toggle" style="width:150px" wicket:id="choiceSecurity"></select>
</div>

<div class="d-flex flex-wrap gap-2 w-100">
<span class="col-3 d-flex justify-content-end align-items-center" wicket:id="nameModeLabel">
</span>
<select class="btn btn-default btn-sm dropdown-toggle" wicket:id="choiceNameMode"></select>
<select class="btn btn-default btn-sm dropdown-toggle" style="width:150px" wicket:id="choiceNameMode"></select>
</div>

<div class="d-flex flex-wrap gap-2 w-100">
Expand Down Expand Up @@ -93,17 +99,25 @@
</div>

<div class="d-flex flex-wrap gap-2 w-100 row">
<span class="col-4 d-flex justify-content-end">
<span class="col-4 d-flex justify-content-end align-items-center">
<wicket:message key="roleMiningExportPanel.role.suffix.label"/>
</span>
<input class="form-control form-control-sm col-5" placeholder="(none)" wicket:id="applicationSuffix" type="text"/>
</div>

<div class="d-flex flex-wrap gap-2 w-100 row">
<span class="col-4 d-flex justify-content-end align-items-center">
<wicket:message key="roleMiningExportPanel.export.dropdown.archetype.title"/>
</span>
<input class="form-control form-control-sm col-5 " wicket:id="archetypeApplicationDropdown">
</div>

<div class="d-flex flex-wrap gap-2 w-100">
<span class="col-3 d-flex justify-content-end align-items-center" wicket:id="businessLabel">
</span>
</div>


<div class="d-flex flex-wrap gap-2 w-100 row">
<span class="col-4 d-flex justify-content-end">
<wicket:message key="roleMiningExportPanel.role.prefix.label"/>
Expand All @@ -118,6 +132,14 @@
<input class="form-control form-control-sm col-5" placeholder="(none)" wicket:id="businessSuffix" type="text"/>
</div>

<div class="d-flex flex-wrap gap-2 w-100 row">
<span class="col-4 d-flex justify-content-end align-items-center">
<wicket:message key="roleMiningExportPanel.export.dropdown.archetype.title"/>
</span>
<input class="form-control form-control-sm col-5" wicket:id="archetypeBusinessDropdown">
</div>


<div class="d-flex flex-wrap gap-2 w-100">
<div class="col-3 d-flex justify-content-end">
<input class="btn btn-default btn-sm" wicket:id="submitExportOptions" type="submit" value="Edit options"/>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
*/
package com.evolveum.midpoint.web.page.admin.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.util.exception.CommonException;
import com.evolveum.midpoint.web.component.dialog.*;

import org.apache.commons.collections4.IteratorUtils;
Expand Down Expand Up @@ -388,7 +387,7 @@ public IModel<Boolean> getVisible() {

});

headerMenuItems.add(new InlineMenuItem(createStringResource("roleMiningExport.operation.button.title")) {
headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportAll"), true) {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -397,25 +396,14 @@ public InlineMenuItemAction initAction() {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
var list = get(ID_MAIN_FORM)
.getBehaviors(PageDebugDownloadBehaviour.class);
var downloadBehaviour = list.get(0);
ExportMiningPanel dialog = new ExportMiningPanel(((PageBase) getPage()).getMainPopupBodyId(),
createStringResource("roleMiningExportPanel.panel.message"), downloadBehaviour);
((PageBase) getPage()).showMainPopup(dialog, target);
public void onSubmit(AjaxRequestTarget target) {
exportAll(target);
}
};
}

@Override
public IModel<Boolean> getVisible() {
return Model.of(true);
}

});

headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.exportAll"), true) {
headerMenuItems.add(new InlineMenuItem(createStringResource("roleMiningExport.operation.button.title")) {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -424,11 +412,50 @@ public InlineMenuItemAction initAction() {
private static final long serialVersionUID = 1L;

@Override
public void onSubmit(AjaxRequestTarget target) {
exportAll(target);
public void onClick(AjaxRequestTarget target) {
var list = get(ID_MAIN_FORM)
.getBehaviors(PageDebugDownloadBehaviour.class);
var downloadBehaviour = list.get(0);
ExportMiningPanel dialog = new ExportMiningPanel(((PageBase) getPage()).getMainPopupBodyId(),
createStringResource("roleMiningExportPanel.panel.message"), downloadBehaviour) {
@Override
public HashMap<String, String> getArchetypeObjectsList() {
String string = DOT_CLASS + "filterArchetypeObjects";
OperationResult result = new OperationResult(string);

List<PrismObject<ArchetypeType>> archetypeObjectList = null;
try {
archetypeObjectList = getMidpointApplication().getRepositoryService()
.searchObjects(ArchetypeType.class, null, null, result);
} catch (CommonException e) {
e.printStackTrace();
}

if (archetypeObjectList != null) {
archetypeObjectList.sort(Comparator.comparing(p -> p.getName().toString()));
}

HashMap<String, String> hashMap = new HashMap<>();

List<ArchetypeType> archetypeTypes = new ArrayList<>();
assert archetypeObjectList != null;
for (PrismObject<ArchetypeType> archetypeTypePrismObject : archetypeObjectList) {
archetypeTypes.add(archetypeTypePrismObject.asObjectable());
hashMap.put(String.valueOf(archetypeTypePrismObject.getName()), archetypeTypePrismObject.getOid());
}
return hashMap;
}
};
((PageBase) getPage()).showMainPopup(dialog, target);
}
};
}

@Override
public IModel<Boolean> getVisible() {
return Model.of(true);
}

});

headerMenuItems.add(new InlineMenuItem(createStringResource("pageDebugList.menu.deleteSelected"), true) {
Expand Down

0 comments on commit 6e2e416

Please sign in to comment.