-
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.
fix showing of reportParam in report tasks
- Loading branch information
Showing
3 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
...in/java/com/evolveum/midpoint/gui/impl/factory/wrapper/ReportParamWrapperFactoryImpl.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,64 @@ | ||
/* | ||
* Copyright (c) 2010-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.factory.wrapper; | ||
|
||
import com.evolveum.midpoint.gui.api.factory.wrapper.WrapperContext; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper; | ||
import com.evolveum.midpoint.gui.impl.prism.wrapper.PrismContainerValueWrapperImpl; | ||
import com.evolveum.midpoint.prism.*; | ||
import com.evolveum.midpoint.util.QNameUtil; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.web.component.prism.ValueStatus; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportParameterType; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class ReportParamWrapperFactoryImpl extends PrismContainerWrapperFactoryImpl<ReportParameterType> { | ||
|
||
@Override | ||
public boolean match(ItemDefinition<?> def) { | ||
return super.match(def) && QNameUtil.match(def.getTypeName(), ReportParameterType.COMPLEX_TYPE); | ||
} | ||
|
||
@Override | ||
public int getOrder() { | ||
return super.getOrder() - 10; | ||
} | ||
|
||
@Override | ||
protected List<? extends ItemDefinition> getItemDefinitions( | ||
PrismContainerWrapper<ReportParameterType> parent, PrismContainerValue<ReportParameterType> value) { | ||
List<ItemDefinition> defs = new ArrayList<>(); | ||
if (parent != null | ||
&& parent.getItem() != null) { | ||
for (Item<?, ?> item : parent.getItem().getValue().getItems()) { | ||
defs.add(item.getDefinition()); | ||
} | ||
} | ||
return defs; | ||
} | ||
|
||
@Override | ||
public PrismContainerWrapper<ReportParameterType> createWrapper(PrismContainerValueWrapper<?> parent, ItemDefinition<?> def, WrapperContext context) throws SchemaException { | ||
PrismContainerWrapper<ReportParameterType> container = super.createWrapper(parent, def, context); | ||
container.setReadOnly(true); | ||
return container; | ||
} | ||
|
||
@Override | ||
protected ItemWrapper<?, ?> createChildWrapper(ItemDefinition<?> def, PrismContainerValueWrapper<?> containerValueWrapper, WrapperContext context) throws SchemaException { | ||
ItemWrapper<?, ?> wrapper = super.createChildWrapper(def, containerValueWrapper, context); | ||
wrapper.setReadOnly(true); | ||
return wrapper; | ||
} | ||
} |
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