Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed May 29, 2020
2 parents 857c05b + facaf14 commit 4d6e29c
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 169 deletions.
Expand Up @@ -11,6 +11,8 @@
import javax.annotation.PostConstruct;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.xml.ns._public.common.common_3.CollectionRefSpecificationType;

import org.springframework.stereotype.Component;

import com.evolveum.midpoint.gui.api.factory.wrapper.WrapperContext;
Expand Down Expand Up @@ -55,6 +57,11 @@ private boolean filterDefinitins(PrismContainerValue<C> value, ItemDefinition<?>
public boolean match(ItemDefinition<?> def) {
QName defName = def.getTypeName();

if (CollectionRefSpecificationType.COMPLEX_TYPE.equals(defName)
&& def.getItemName().equivalent(CollectionRefSpecificationType.F_BASE_COLLECTION_REF)) {
return true;
}

if (TaskPartitionsDefinitionType.COMPLEX_TYPE.equals(defName)) {
return true;
}
Expand Down
Expand Up @@ -17151,9 +17151,9 @@
This collection is merge with filter.
</xsd:documentation>
<xsd:appinfo>
<a:elaborate>true</a:elaborate>
<a:since>4.2</a:since>
<a:displayName>CollectionSpecificationType.collectionRef</a:displayName>
<a:displayName>CollectionSpecificationType.baseCollectionRef</a:displayName>
<a:elaborate>true</a:elaborate>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down
Expand Up @@ -343,23 +343,27 @@ private void compileObjectCollectionView(CompiledObjectCollectionView existingVi
existingView.setFilter(combinedFilter);
}

compileView(existingView, objectCollectionType.getDefaultView());
compileView(existingView, objectCollectionType.getDefaultView(), false);

}

public void compileView(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
compileView(existingView, objectListViewType, true);
}

private void compileView(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
if (objectListViewType != null) {
compileObjectType(existingView, objectListViewType);
compileActions(existingView, objectListViewType);
compileAdditionalPanels(existingView, objectListViewType);
compileAdditionalPanels(existingView, objectListViewType, replaceIfExist);
compileColumns(existingView, objectListViewType);
compileDisplay(existingView, objectListViewType);
compileDistinct(existingView, objectListViewType);
compileSorting(existingView, objectListViewType);
compileCounting(existingView, objectListViewType);
compileDisplayOrder(existingView, objectListViewType);
compileSearchBox(existingView, objectListViewType);
compileRefreshInterval(existingView, objectListViewType);
compileDisplay(existingView, objectListViewType, replaceIfExist);
compileDistinct(existingView, objectListViewType, replaceIfExist);
compileSorting(existingView, objectListViewType, replaceIfExist);
compileCounting(existingView, objectListViewType, replaceIfExist);
compileDisplayOrder(existingView, objectListViewType, replaceIfExist);
compileSearchBox(existingView, objectListViewType, replaceIfExist);
compileRefreshInterval(existingView, objectListViewType, replaceIfExist);
}
}

Expand Down Expand Up @@ -387,13 +391,15 @@ private void compileActions(CompiledObjectCollectionView existingView, GuiObject

}

private void compileAdditionalPanels(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileAdditionalPanels(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
GuiObjectListViewAdditionalPanelsType newAdditionalPanels = objectListViewType.getAdditionalPanels();
if (newAdditionalPanels == null) {
return;
}
// TODO: later: merge additional panel definitions
existingView.setAdditionalPanels(newAdditionalPanels);
if (existingView.getAdditionalPanels() == null || replaceIfExist) {
existingView.setAdditionalPanels(newAdditionalPanels);
}
}

private void compileColumns(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
Expand All @@ -409,60 +415,65 @@ private void compileColumns(CompiledObjectCollectionView existingView, GuiObject
existingColumns.addAll(orderedList);
}

private void compileDisplay(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileDisplay(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
DisplayType newDisplay = objectListViewType.getDisplay();
if (newDisplay == null) {
return;
}
if (existingView.getDisplay() == null) {
existingView.setDisplay(newDisplay);
} else if (replaceIfExist) {
MiscSchemaUtil.mergeDisplay(existingView.getDisplay(), newDisplay);
}
MiscSchemaUtil.mergeDisplay(existingView.getDisplay(), newDisplay);
}

private void compileDistinct(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileDistinct(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
DistinctSearchOptionType newDistinct = objectListViewType.getDistinct();
if (newDistinct == null) {
return;
}
existingView.setDistinct(newDistinct);
if (existingView.getDistinct() == null || replaceIfExist) {
existingView.setDistinct(newDistinct);
}
}

private void compileSorting(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileSorting(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
Boolean newDisableSorting = objectListViewType.isDisableSorting();
if (newDisableSorting != null) {
if (newDisableSorting != null && (existingView.getDisableSorting() == null || replaceIfExist)) {
existingView.setDisableSorting(newDisableSorting);
}
}

private void compileRefreshInterval(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileRefreshInterval(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
Integer refreshInterval = objectListViewType.getRefreshInterval();
if (refreshInterval != null) {
if (refreshInterval != null && (existingView.getRefreshInterval() == null || replaceIfExist)) {
existingView.setRefreshInterval(refreshInterval);
}
}

private void compileCounting(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileCounting(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
Boolean newDisableCounting = objectListViewType.isDisableCounting();
if (newDisableCounting != null) {
if (newDisableCounting != null && (existingView.isDisableCounting() == null || replaceIfExist)) {
existingView.setDisableCounting(newDisableCounting);
}
}

private void compileDisplayOrder(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType){
private void compileDisplayOrder(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist){
Integer newDisplayOrder = objectListViewType.getDisplayOrder();
if (newDisplayOrder != null){
if (newDisplayOrder != null && (existingView.getDisplayOrder() == null || replaceIfExist)){
existingView.setDisplayOrder(newDisplayOrder);
}
}

private void compileSearchBox(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) {
private void compileSearchBox(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, boolean replaceIfExist) {
SearchBoxConfigurationType newSearchBoxConfig = objectListViewType.getSearchBoxConfiguration();
if (newSearchBoxConfig == null) {
return;
}
// TODO: merge
existingView.setSearchBoxConfiguration(newSearchBoxConfig);
if (existingView.getSearchBoxConfiguration() == null || replaceIfExist) {
existingView.setSearchBoxConfiguration(newSearchBoxConfig);
}
}

}
Expand Up @@ -324,8 +324,8 @@ public void compileView(CompiledObjectCollectionView existingView, GuiObjectList
// compileDisplayOrder(existingView, objectListViewType);
// compileSearchBox(existingView, objectListViewType);
// compileRefreshInterval(existingView, objectListViewType);
compileCollection(existingView, objectListViewType, task, result);
collectionProcessor.compileView(existingView, objectListViewType);
compileCollection(existingView, objectListViewType, task, result);
}

private void compileCollection(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType, Task task, OperationResult result)
Expand Down
Expand Up @@ -68,21 +68,21 @@ public void test012CreateObjectCollectionReportWithDoubleView() throws Exception
@Override
public void test013CreateAuditCollectionReportWithDefaultColumn() throws Exception {
expectedColumns = 8;
expectedRow = 47;
expectedRow = 46;
super.test013CreateAuditCollectionReportWithDefaultColumn();
}

@Override
public void test014CreateAuditCollectionReportWithView() throws Exception {
expectedColumns = 2;
expectedRow = 49;
expectedRow = 48;
super.test014CreateAuditCollectionReportWithView();
}

@Override
public void test015CreateAuditCollectionReportWithDoubleView() throws Exception {
expectedColumns = 3;
expectedRow = 51;
expectedRow = 50;
super.test015CreateAuditCollectionReportWithDoubleView();
}

Expand All @@ -102,7 +102,7 @@ public void test017CreateObjectCollectionReportWithFilterAndBasicCollection() th

private void setExpectedValueForDashboardReport() {
expectedColumns = 3;
expectedRow = 8;
expectedRow = 7;
}

@Override
Expand Down
Expand Up @@ -170,38 +170,38 @@
</dataField>
</presentation>
</widget>
<widget>
<identifier>shadow-of-resource</identifier>
<display>
<label>Shadow of resource</label>
<color>#00a65a</color>
<icon>
<cssClass>fa fa-database</cssClass>
</icon>
</display>
<data>
<sourceType>objectCollection</sourceType>
<collection>
<collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb244" relation="default" type="ObjectCollectionType"/>
</collection>
</data>
<presentation>
<dataField>
<fieldType>value</fieldType>
<expression>
<proportional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ProportionalExpressionEvaluatorType">
<style>value-only</style>
</proportional>
</expression>
</dataField>
<dataField>
<fieldType>unit</fieldType>
<expression>
<value>shadows</value>
</expression>
</dataField>
</presentation>
</widget>
<!--<widget>-->
<!-- <identifier>shadow-of-resource</identifier>-->
<!-- <display>-->
<!-- <label>Shadow of resource</label>-->
<!-- <color>#00a65a</color>-->
<!-- <icon>-->
<!-- <cssClass>fa fa-database</cssClass>-->
<!-- </icon>-->
<!-- </display>-->
<!-- <data>-->
<!-- <sourceType>objectCollection</sourceType>-->
<!-- <collection>-->
<!-- <collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb244" relation="default" type="ObjectCollectionType"/>-->
<!-- </collection>-->
<!-- </data>-->
<!-- <presentation>-->
<!-- <dataField>-->
<!-- <fieldType>value</fieldType>-->
<!-- <expression>-->
<!-- <proportional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ProportionalExpressionEvaluatorType">-->
<!-- <style>value-only</style>-->
<!-- </proportional>-->
<!-- </expression>-->
<!-- </dataField>-->
<!-- <dataField>-->
<!-- <fieldType>unit</fieldType>-->
<!-- <expression>-->
<!-- <value>shadows</value>-->
<!-- </expression>-->
<!-- </dataField>-->
<!-- </presentation>-->
<!--</widget>-->
<widget>
<identifier>all audit</identifier>
<display>
Expand Down
Expand Up @@ -215,47 +215,47 @@
</view>
</presentation>
</widget>
<widget>
<identifier>shadow-of-resource</identifier>
<display>
<label>Shadow of resource</label>
<color>#00a65a</color>
<icon>
<cssClass>fa fa-database</cssClass>
</icon>
</display>
<data>
<sourceType>objectCollection</sourceType>
<collection>
<collectionRef oid="11b1f98e-f587-4b9f-b92b-72e251dbb244" relation="default" type="ObjectCollectionType"/>
</collection>
</data>
<presentation>
<dataField>
<fieldType>value</fieldType>
<expression>
<proportional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ProportionalExpressionEvaluatorType">
<style>value-only</style>
</proportional>
</expression>
</dataField>
<dataField>
<fieldType>unit</fieldType>
<expression>
<value>shadows</value>
</expression>
</dataField>
<view>
<column>
<name>nameColumnDashboard</name>
<path>name</path>
<display>
<label>Name (Dashboard)</label>
</display>
</column>
</view>
</presentation>
</widget>
<!--<widget>-->
<!-- <identifier>shadow-of-resource</identifier>-->
<!-- <display>-->
<!-- <label>Shadow of resource</label>-->
<!-- <color>#00a65a</color>-->
<!-- <icon>-->
<!-- <cssClass>fa fa-database</cssClass>-->
<!-- </icon>-->
<!-- </display>-->
<!-- <data>-->
<!-- <sourceType>objectCollection</sourceType>-->
<!-- <collection>-->
<!-- <collectionRef oid="11b1f98e-f587-4b9f-b92b-72e251dbb244" relation="default" type="ObjectCollectionType"/>-->
<!-- </collection>-->
<!-- </data>-->
<!-- <presentation>-->
<!-- <dataField>-->
<!-- <fieldType>value</fieldType>-->
<!-- <expression>-->
<!-- <proportional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ProportionalExpressionEvaluatorType">-->
<!-- <style>value-only</style>-->
<!-- </proportional>-->
<!-- </expression>-->
<!-- </dataField>-->
<!-- <dataField>-->
<!-- <fieldType>unit</fieldType>-->
<!-- <expression>-->
<!-- <value>shadows</value>-->
<!-- </expression>-->
<!-- </dataField>-->
<!-- <view>-->
<!-- <column>-->
<!-- <name>nameColumnDashboard</name>-->
<!-- <path>name</path>-->
<!-- <display>-->
<!-- <label>Name (Dashboard)</label>-->
<!-- </display>-->
<!-- </column>-->
<!-- </view>-->
<!-- </presentation>-->
<!--</widget>-->
<widget>
<identifier>all audit</identifier>
<display>
Expand Down

0 comments on commit 4d6e29c

Please sign in to comment.