Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Mar 18, 2021
2 parents a7edae7 + 32190dc commit 87387e0
Show file tree
Hide file tree
Showing 50 changed files with 635 additions and 290 deletions.
Expand Up @@ -584,7 +584,7 @@ private String evaluateExpression(C rowValue, Item<?, ?> columnItem, ExpressionT
VariablesMap variablesMap = new VariablesMap();
variablesMap.put(ExpressionConstants.VAR_OBJECT, rowValue, rowValue.getClass());
if (columnItem != null) {
variablesMap.put(ExpressionConstants.VAR_INPUT, columnItem, columnItem.getDefinition().getTypeClass());
variablesMap.put(ExpressionConstants.VAR_INPUT, columnItem, columnItem.getDefinition());
}
Collection<String> evaluatedValues = ExpressionUtil.evaluateStringExpression(variablesMap, getPageBase().getPrismContext(), expression,
MiscSchemaUtil.getExpressionProfile(), getPageBase().getExpressionFactory(), "evaluate column expression",
Expand Down Expand Up @@ -899,9 +899,16 @@ protected boolean isCollectionViewPanelForCompiledView() {
}

protected boolean isCollectionViewPanel() {
return isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget();
return isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget() || defaultCollectionExists();
}

private boolean defaultCollectionExists() {
return getCollectionViewForAllObject() != null;
}

private CompiledObjectCollectionView getCollectionViewForAllObject() {
return getPageBase().getCompiledGuiProfile().findObjectCollectionView(WebComponentUtil.containerClassToQName(getPrismContext(), getType()), null);
}

protected ISelectableDataProvider getDataProvider() {
BoxedTablePanel<PO> table = getTable();
Expand Down
Expand Up @@ -80,7 +80,6 @@ protected void populate(ListItem<VW> item) {
}
switch (columnType) {
case STRING:
LOGGER.info("creating label for {}", item.getModelObject());
Label label = new Label(ID_VALUE, new ReadOnlyModel<>(() -> createLabel(item.getModelObject())));
item.add(label);
break;
Expand Down
Expand Up @@ -17,12 +17,18 @@ class KnownImmutables {
private static final Set<Class<?>> KNOWN_IMMUTABLES = ImmutableSet.<Class<?>>builder()

.add(Void.class, Class.class, String.class, Character.class)
.add(Byte.class, Short.class, Long.class, BigInteger.class)
.add(Byte.class, Short.class, Integer.class, Long.class, BigInteger.class)
.add(Float.class, Double.class, BigDecimal.class)

.add(byte.class, short.class, int.class, long.class)
.add(float.class, double.class)

// FIXME: Add common classes from java.time.*

// Collections.empty* (they are private)
.add(Collections.EMPTY_LIST.getClass(), Collections.EMPTY_SET.getClass(), Collections.EMPTY_MAP.getClass())
.add(Collections.emptyList().getClass())
.add(Collections.emptySet().getClass())
.add(Collections.emptyMap().getClass())

// Collections.singleton* classes (they are private)
.add(Collections.singleton("").getClass())
Expand All @@ -37,7 +43,7 @@ static boolean isImmutable(Object object) {
return true;
}
if (object instanceof MutationBehaviourAware<?>) {
return ((MutationBehaviourAware) object).mutable();
return ((MutationBehaviourAware<?>) object).mutable();
}
if (object instanceof String) {
return true;
Expand Down
Expand Up @@ -38,6 +38,7 @@ class FilterNames {
public static final QName IS_ROOT = queryName("isRoot");
public static final QName NOT = queryName("not");
public static final QName NOT_EQUAL = queryName("notEqual");
public static final QName TYPE = queryName("type");

static final BiMap<String, QName> ALIAS_TO_NAME = ImmutableBiMap.<String, QName>builder()
.put("=", EQUAL)
Expand Down
Expand Up @@ -180,7 +180,18 @@ static void noneFilter(NoneFilterImpl source, QueryWriter target) throws NotSupp
}

static void typeFilter(TypeFilterImpl source, QueryWriter target) throws NotSupportedException {
checkSupported(false, "Filter TypeFilterImpl Not Supported");
target.writeSelf();
target.writeFilterName(TYPE);
target.writeRawValue(source.getType());
var nested = source.getFilter();
if(nested != null) {
target.writeFilterName(AND);
if (nested instanceof OrFilter) {
target.writeNestedFilter(nested);
} else {
target.writeFilter(nested);
}
}
}

static void undefinedFilter(UndefinedFilterImpl source, QueryWriter target)
Expand Down

0 comments on commit 87387e0

Please sign in to comment.