Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/skip-mapping
Browse files Browse the repository at this point in the history
# Conflicts:
#	repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/report/QReportMapping.java
  • Loading branch information
katkav committed May 31, 2021
2 parents 5d3b19e + 978cd21 commit a6c5b50
Show file tree
Hide file tree
Showing 113 changed files with 5,200 additions and 517 deletions.
@@ -0,0 +1,174 @@
package com.evolveum.midpoint.common.refinery.deleg;

import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

import javax.xml.namespace.QName;

import com.evolveum.midpoint.common.refinery.PropertyLimitations;
import com.evolveum.midpoint.common.refinery.RefinedAttributeDefinition;
import com.evolveum.midpoint.prism.ComplexTypeDefinition;
import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.ItemProcessing;
import com.evolveum.midpoint.schema.processor.ResourceAttributeDefinition;
import com.evolveum.midpoint.schema.processor.deleg.AttributeDefinitionDelegator;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AttributeFetchStrategyType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AttributeStorageStrategyType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LayerType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType;

public interface RefinedAttributeDefinitionDelegator<T> extends AttributeDefinitionDelegator<T>, RefinedAttributeDefinition<T> {

@Override
RefinedAttributeDefinition<T> delegate();

@Override
default boolean isTolerant() {
return delegate().isTolerant();
}

@Override
default Boolean isSecondaryIdentifierOverride() {
return delegate().isSecondaryIdentifierOverride();
}

@Override
default boolean canAdd(LayerType layer) {
return delegate().canAdd(layer);
}

@Override
default boolean canRead(LayerType layer) {
return delegate().canRead(layer);
}

@Override
default boolean canModify(LayerType layer) {
return delegate().canModify(layer);
}

@Override
default boolean isIgnored(LayerType layer) {
return delegate().isIgnored(layer);
}

@Override
default ItemProcessing getProcessing(LayerType layer) {
return delegate().getProcessing(layer);
}

@Override
default String getDescription() {
return delegate().getDescription();
}

@Override
default ResourceAttributeDefinition<T> getAttributeDefinition() {
return delegate().getAttributeDefinition();
}

@Override
default MappingType getOutboundMappingType() {
return delegate().getOutboundMappingType();
}

@Override
default boolean hasOutboundMapping() {
return delegate().hasOutboundMapping();
}

@Override
default List<MappingType> getInboundMappingTypes() {
return delegate().getInboundMappingTypes();
}

@Override
default int getMaxOccurs(LayerType layer) {
return delegate().getMaxOccurs(layer);
}

@Override
default int getMinOccurs(LayerType layer) {
return delegate().getMinOccurs(layer);
}

@Override
default boolean isOptional(LayerType layer) {
return delegate().isOptional(layer);
}

@Override
default boolean isMandatory(LayerType layer) {
return delegate().isMandatory(layer);
}

@Override
default boolean isMultiValue(LayerType layer) {
return delegate().isMultiValue(layer);
}

@Override
default boolean isSingleValue(LayerType layer) {
return delegate().isSingleValue(layer);
}

@Override
default boolean isExclusiveStrong() {
return delegate().isExclusiveStrong();
}

@Override
default PropertyLimitations getLimitations(LayerType layer) {
return delegate().getLimitations(layer);
}

@Override
default AttributeFetchStrategyType getFetchStrategy() {
return delegate().getFetchStrategy();
}

@Override
default AttributeStorageStrategyType getStorageStrategy() {
return delegate().getStorageStrategy();
}

@Override
default List<String> getTolerantValuePattern() {
return delegate().getTolerantValuePattern();
}

@Override
default List<String> getIntolerantValuePattern() {
return delegate().getIntolerantValuePattern();
}

@Override
default boolean isVolatilityTrigger() {
return delegate().isVolatilityTrigger();
}

@Override
default String debugDump(int indent, LayerType layer) {
return delegate().debugDump(indent, layer);
}

@Override
default Integer getModificationPriority() {
return delegate().getModificationPriority();
}

@Override
default Boolean getReadReplaceMode() {
return delegate().getReadReplaceMode();
}

@Override
default boolean isDisplayNameAttribute() {
return delegate().isDisplayNameAttribute();
}

@Override
RefinedAttributeDefinition<T> deepClone(Map<QName, ComplexTypeDefinition> ctdMap,
Map<QName, ComplexTypeDefinition> onThisPath, Consumer<ItemDefinition> postCloneAction);
}
Expand Up @@ -23,7 +23,7 @@
/**
* @author mederly
*/
public interface ItemDefinition<I extends Item> extends Definition {
public interface ItemDefinition<I extends Item> extends Definition, PrismItemAccessDefinition {

@NotNull
ItemName getItemName();
Expand Down Expand Up @@ -71,45 +71,6 @@ default boolean isMultiValue() {
*/
boolean isDynamic();

/**
* Returns true if this item can be read (displayed).
* In case of containers this flag is, strictly speaking, not applicable. Container is an
* empty shell. What matters is access to individual sub-item. However, for containers this
* value has a "hint" meaning. It means that the container itself contains something that is
* readable. Which can be used as a hint by the presentation to display container label or block.
* This usually happens if the container contains at least one readable item.
* This does NOT mean that also all the container items can be displayed. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
* <p>
* Note: It was considered to use a different meaning for this flag - a meaning that would allow
* canRead()=false containers to have readable items. However, this was found not to be very useful.
* Therefore the "something readable inside" meaning was confirmed instead.
*/
boolean canRead();

/**
* Returns true if this item can be modified (updated).
* In case of containers this means that the container itself should be displayed in modification forms
* E.g. that the container label or block should be displayed. This usually happens if the container
* contains at least one modifiable item.
* This does NOT mean that also all the container items can be modified. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
*/
boolean canModify();

/**
* Returns true if this item can be added: it can be part of an object that is created.
* In case of containers this means that the container itself should be displayed in creation forms
* E.g. that the container label or block should be displayed. This usually happens if the container
* contains at least one createable item.
* This does NOT mean that also all the container items can be created. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
*/
boolean canAdd();

/**
* Returns the name of an element this one can be substituted for (e.g. c:user -&gt; c:object,
* s:pipeline -&gt; s:expression, etc). EXPERIMENTAL
Expand Down
@@ -0,0 +1,22 @@
package com.evolveum.midpoint.prism;


public interface ItemDefinitionTransformer {

<I extends ItemDefinition<?>> I transformItem(ComplexTypeDefinition parentDef, I currentDef);

<T extends TypeDefinition> T applyValue(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, T valueDef);


public interface TransformableItem {

void transformDefinition(ComplexTypeDefinition parentDef, ItemDefinitionTransformer transformer);

}

public interface TransformableValue {

void transformDefinition(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, ItemDefinitionTransformer transformation);
}

}
Expand Up @@ -224,6 +224,7 @@ <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOr
@Override
PrismContainer<C> cloneComplex(CloneStrategy strategy);

@Deprecated
PrismContainerDefinition<C> deepCloneDefinition(boolean ultraDeep, Consumer<ItemDefinition> postCloneAction);

@Override
Expand Down
@@ -0,0 +1,59 @@
/*
* Copyright (c) 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.prism;

public interface PrismItemAccessDefinition {

/**
* Returns true if this item can be read (displayed).
* In case of containers this flag is, strictly speaking, not applicable. Container is an
* empty shell. What matters is access to individual sub-item. However, for containers this
* value has a "hint" meaning. It means that the container itself contains something that is
* readable. Which can be used as a hint by the presentation to display container label or block.
* This usually happens if the container contains at least one readable item.
* This does NOT mean that also all the container items can be displayed. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
* <p>
* Note: It was considered to use a different meaning for this flag - a meaning that would allow
* canRead()=false containers to have readable items. However, this was found not to be very useful.
* Therefore the "something readable inside" meaning was confirmed instead.
*/
boolean canRead();

/**
* Returns true if this item can be modified (updated).
* In case of containers this means that the container itself should be displayed in modification forms
* E.g. that the container label or block should be displayed. This usually happens if the container
* contains at least one modifiable item.
* This does NOT mean that also all the container items can be modified. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
*/
boolean canModify();

/**
* Returns true if this item can be added: it can be part of an object that is created.
* In case of containers this means that the container itself should be displayed in creation forms
* E.g. that the container label or block should be displayed. This usually happens if the container
* contains at least one createable item.
* This does NOT mean that also all the container items can be created. The sub-item permissions
* are controlled by similar properties on the items. This property only applies to the container
* itself: the "shell" of the container.
*/
boolean canAdd();

interface Mutable extends PrismItemAccessDefinition {

void setCanRead(boolean val);

void setCanModify(boolean val);

void setCanAdd(boolean val);

}
}

0 comments on commit a6c5b50

Please sign in to comment.