Skip to content

Commit 6ae28d2

Browse files
committed
feat: add searchShadowByResourceDisabled option for export command
1 parent fc256e0 commit 6ae28d2

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tools/ninja/src/main/java/com/evolveum/midpoint/ninja/action/AbstractRepositorySearchAction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ private List<SearchProducerWorker> createProducersForShadows(
159159
QueryFactory queryFactory = context.getPrismContext().queryFactory();
160160
List<SearchProducerWorker> shadowProducers = new ArrayList<>();
161161

162+
if (options.isSearchShadowByResourceDisabled()) {
163+
shadowProducers.add(createShadowProducer(queue, operation, producers, filter));
164+
return shadowProducers;
165+
}
166+
162167
try {
163168
RepositoryService repository = context.getRepository();
164169

tools/ninja/src/main/java/com/evolveum/midpoint/ninja/action/ExportOptions.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class ExportOptions extends BaseImportExportOptions implements BasicExpor
2626
public static final String P_NO_IDS = "-ni";
2727
public static final String P_NO_IDS_LONG = "--no-container-ids";
2828

29+
public static final String P_SEARCH_SHADOW_BY_RESOURCE_DISABLED_LONG = "--searchShadowByResourceDisabled";
30+
2931
@Parameter(names = { P_OUTPUT, P_OUTPUT_LONG }, descriptionKey = "export.output")
3032
private File output;
3133

@@ -38,6 +40,9 @@ public class ExportOptions extends BaseImportExportOptions implements BasicExpor
3840
@Parameter(names = { P_REPLACE_OID_MAPPING_FILE_LONG}, descriptionKey = "export.replaceOid")
3941
private File replaceOid;
4042

43+
@Parameter(names = { P_SEARCH_SHADOW_BY_RESOURCE_DISABLED_LONG }, descriptionKey = "export.searchShadowByResourceDisabled")
44+
private boolean searchShadowByResourceDisabled;
45+
4146
@Override
4247
public File getOutput() {
4348
return output;
@@ -74,4 +79,12 @@ public void setReplaceOid(File replaceOid) {
7479
public File getReplaceOid() {
7580
return replaceOid;
7681
}
82+
83+
public void setSearchShadowByResourceDisabled(boolean searchShadowByResourceDisabled) {
84+
this.searchShadowByResourceDisabled = searchShadowByResourceDisabled;
85+
}
86+
87+
public boolean isSearchShadowByResourceDisabled() {
88+
return searchShadowByResourceDisabled;
89+
}
7790
}

tools/ninja/src/main/resources/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export.output=Output file for export
3838
export.overwrite=Overwrite output file
3939
export.skipids=Skips container ids
4040
export.replaceOid=Replace oid mapping file
41+
export.searchShadowByResourceDisabled=Disable search shadow by resource
4142
base.filterRole=Value of role object filter used to search objects. If you start the filter with the \
4243
letter @, the rest should be a filename. Start the filter with % to use Axiom query language.
4344
base.filterUser=Value of user object filter used to search objects. If you start the filter with the \

0 commit comments

Comments
 (0)