Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Aug 14, 2019
2 parents 719a148 + c15f80a commit 579be31
Show file tree
Hide file tree
Showing 31 changed files with 578 additions and 426 deletions.
15 changes: 0 additions & 15 deletions .tx/config

This file was deleted.

7 changes: 3 additions & 4 deletions build-system/pom.xml
Expand Up @@ -742,7 +742,7 @@
<dependency>
<groupId>com.evolveum.polygon</groupId>
<artifactId>connector-ldap</artifactId>
<version>2.3-M1</version>
<version>2.3</version>
</dependency>
<!-- End connectors -->
<dependency>
Expand Down Expand Up @@ -1400,9 +1400,8 @@
<meminitial>1024m</meminitial>
<maxmem>2048m</maxmem>
<showDeprecation>false</showDeprecation>
<showWarnings>true</showWarnings>
<!-- <verbose>true</verbose> -->
<!--<showWarnings>false</showWarnings -->
<showWarnings>false</showWarnings>
<verbose>false</verbose>
</configuration>
</plugin>
<plugin>
Expand Down
Expand Up @@ -59,8 +59,9 @@ protected void onInitialize() {
add(AttributeModifier.append("class", () -> {
String cssClasses = "";

if (getModelObject() != null && getModelObject().isShowOnTopLevel()
|| !(getParent() instanceof PrismContainerValuePanel)) {
if ((getModelObject() != null && getModelObject().isShowOnTopLevel())
|| (!(getParent() instanceof PrismContainerValuePanel) && getParent()!=null
&& getParent().getParent() instanceof PrismContainerValuePanel)) {
cssClasses = "top-level-prism-container";
}

Expand Down
Expand Up @@ -132,7 +132,7 @@ public void onClick(AjaxRequestTarget target) {
}

protected LoadableDetachableModel<String> getLabelModel() {
return StringResourceModel.of(getModel().getObject()::getDisplayName);
return getPageBase().createStringResource(getModel().getObject().getDisplayName());
}

private void initValues() {
Expand Down
Expand Up @@ -204,7 +204,6 @@ public static AssignmentEditorDto createDtoFromObject(ObjectType object, UserDto

AssignmentType assignment = new AssignmentType();
assignment.setTargetRef(targetRef);
assignment.setTarget(object);

return new AssignmentEditorDto(status, assignment, pageBase);
}
Expand Down Expand Up @@ -552,6 +551,10 @@ public PrismContainerValue<AssignmentType> getNewValue(PrismContext prismContext
if (activation == null || activation.asPrismContainerValue().isEmpty()) {
newAssignment.setActivation(null);
}
//hack for delegation panel. this code should be rewritten
if (newAssignment.getMetadata() != null && newAssignment.getMetadata().asPrismContainerValue().isEmpty()){
newAssignment.setMetadata(null);
}

if (tenantRef != null && AssignmentEditorDtoType.ROLE.equals(this.type)) {
if (tenantRef.getOid() == null) {
Expand Down
Expand Up @@ -463,7 +463,7 @@ public static List<IColumn<PrismContainerValueWrapper<CaseWorkItemType>, String>
@Override
public void populateItem(Item<ICellPopulator<PrismContainerValueWrapper<CaseWorkItemType>>> cellItem,
String componentId, IModel<PrismContainerValueWrapper<CaseWorkItemType>> rowModel) {
cellItem.add(new Label(componentId, ApprovalContextUtil.getStageInfo(unwrapRowModel(rowModel))));
cellItem.add(new Label(componentId, ApprovalContextUtil.getWorkItemStageInfo(unwrapRowModel(rowModel))));
}

@Override
Expand Down
Expand Up @@ -557,15 +557,6 @@ protected ContainerDelta handleAssignmentDeltas(ObjectDelta<F> focusDelta,
assDelta = focusDelta.addModification(assDelta);
}

// todo remove this block [lazyman] after model is updated - it has to
// remove resource from accountConstruction
Collection<PrismContainerValue> values = assDelta.getValues(PrismContainerValue.class);
for (PrismContainerValue value : values) {
AssignmentType ass = new AssignmentType();
ass.setupContainerValue(value);
removeResourceFromAccConstruction(ass);
}

return assDelta;
}

Expand Down
Expand Up @@ -17,6 +17,7 @@

import com.evolveum.midpoint.gui.api.component.DisplayNamePanel;
import com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.prism.PrismContainerWrapper;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel;
Expand Down Expand Up @@ -96,8 +97,15 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
};
getDetailsPanelContainer().add(cancelButton);

CaseWorkItemType workItem = getDetailsPanelItemsList().size() > 0 ? getDetailsPanelItemsList().get(0).getRealValue() : null;
CaseWorkItemActionsPanel actionsPanel = new CaseWorkItemActionsPanel(ID_CASE_WORK_ITEM_ACTIONS_PANEL, Model.of(workItem)){
CaseWorkItemActionsPanel actionsPanel = new CaseWorkItemActionsPanel(ID_CASE_WORK_ITEM_ACTIONS_PANEL,
new LoadableModel<CaseWorkItemType>() {
private static final long serialVersionUID = 1L;

@Override
protected CaseWorkItemType load() {
return getDetailsPanelItemsList().size() > 0 ? getDetailsPanelItemsList().get(0).getRealValue() : null;
}
}){
private static final long serialVersionUID = 1L;

@Override
Expand Down
Expand Up @@ -37,6 +37,7 @@
import com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto;
import com.evolveum.midpoint.web.page.admin.roles.AbstractRoleMemberPanel.QueryScope;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
Expand Down Expand Up @@ -140,7 +141,7 @@ public static <R extends AbstractRoleType> void recomputeMembersPerformed(PageBa

private static <R extends AbstractRoleType> void recomputeOrDeleteMembersPerformed(PageBase pageBase, QueryScope scope,
ObjectQuery query, AjaxRequestTarget target, String operation, String displayNameOfOperation) {
QName defaultType = FocusType.COMPLEX_TYPE;
QName defaultType = AssignmentHolderType.COMPLEX_TYPE;
Task operationalTask = pageBase.createSimpleTask(getTaskName(displayNameOfOperation, scope));

SearchExpressionType script = new SearchExpressionType();
Expand Down
Expand Up @@ -49,6 +49,11 @@ public class TaskInternalPerformanceTabPanel extends AbstractObjectTabPanel<Task
IModel<TaskDto> taskDtoModel, PageBase pageBase) {
super(id, mainForm, taskWrapperModel);
this.taskDtoModel = taskDtoModel;
}

@Override
protected void onInitialize() {
super.onInitialize();
initLayout();
setOutputMarkupId(true);
}
Expand Down
Expand Up @@ -94,7 +94,7 @@ private void fillFromExtension(TaskType taskType) {
objectClass = objectClassItem.getRealValue().getLocalPart();
}

PrismProperty<Boolean> retrySyncItem = task.getExtension().findProperty(SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED);
PrismProperty<Boolean> retrySyncItem = task.getExtension().findProperty(SchemaConstants.MODEL_EXTENSION_RETRY_LIVE_SYNC_ERRORS);
if (retrySyncItem == null || retrySyncItem.getRealValue() == null) {
retryUnhandledErr = true;
} else {
Expand Down Expand Up @@ -219,8 +219,8 @@ public void setResource(TaskAddResourcesDto resource) {
addExtensionDelta(rv, SchemaConstants.MODEL_EXTENSION_DRY_RUN, curr.isDryRun(), prismContext);
}

if (orig.isRetryUnhandledErr() != curr.isRetryUnhandledErr()) {
addExtensionDelta(rv, SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED, curr.isRetryUnhandledErr(), prismContext);
if (orig.isRetryUnhandledErr() != curr.isRetryUnhandledErr()) {
addExtensionDelta(rv, SchemaConstants.MODEL_EXTENSION_RETRY_LIVE_SYNC_ERRORS, curr.isRetryUnhandledErr(), prismContext);
}

if (orig.getKind() != curr.getKind()) {
Expand Down
Expand Up @@ -282,8 +282,8 @@ public abstract class SchemaConstants {
// removing
public static final ItemName MODEL_EXTENSION_DRY_RUN = new ItemName(NS_MODEL_EXTENSION, "dryRun");
public static final ItemName MODEL_EXTENSION_SIMULATE_BEFORE_EXECUTE = new ItemName(NS_MODEL_EXTENSION, "simulateBeforeExecute");
public static final ItemName SYNC_TOKEN_RETRY_UNHANDLED = new ItemName(NS_MODEL_EXTENSION, "retryLiveSyncErrors");
public static final ItemName SYNC_BATCH_SIZE = new ItemName(NS_MODEL_EXTENSION, "liveSyncBatchSize");
public static final ItemName MODEL_EXTENSION_RETRY_LIVE_SYNC_ERRORS = new ItemName(NS_MODEL_EXTENSION, "retryLiveSyncErrors");
public static final ItemName MODEL_EXTENSION_LIVE_SYNC_BATCH_SIZE = new ItemName(NS_MODEL_EXTENSION, "liveSyncBatchSize");
public static final ItemName MODEL_EXTENSION_FINISH_OPERATIONS_ONLY = new ItemName(NS_MODEL_EXTENSION, "finishOperationsOnly");
public static final ItemName MODEL_EXTENSION_KIND = new ItemName(NS_MODEL_EXTENSION, "kind");
public static final ItemName MODEL_EXTENSION_INTENT = new ItemName(NS_MODEL_EXTENSION, "intent");
Expand Down
Expand Up @@ -56,6 +56,16 @@ public static String getStageInfo(CaseType aCase) {
return getStageInfo(aCase.getStageNumber(), getStageCount(aCase.getApprovalContext()), getStageName(aCase), getStageDisplayName(aCase));
}

@Nullable
public static String getWorkItemStageInfo(CaseWorkItemType workItem) {
if (workItem == null) {
return null;
}
CaseType aCase = CaseWorkItemUtil.getCase(workItem);
return getStageInfo(workItem.getStageNumber(), getStageCount(aCase.getApprovalContext()),
getWorkItemStageName(workItem), getWorkItemStageDisplayName(workItem));
}

@Nullable
public static String getStageInfo(CaseWorkItemType workItem) {
if (workItem == null) {
Expand All @@ -64,8 +74,28 @@ public static String getStageInfo(CaseWorkItemType workItem) {
return getStageInfo(CaseWorkItemUtil.getCase(workItem));
}

public static String getStageName(CaseWorkItemType workItem) {
return getStageName(CaseWorkItemUtil.getCaseRequired(workItem));
public static String getWorkItemStageName(CaseWorkItemType workItem) {
if (workItem == null){
return "";
}
CaseType aCase = CaseWorkItemUtil.getCaseRequired(workItem);
if (aCase.getApprovalContext() == null || workItem.getStageNumber() == null){
return "";
}
ApprovalStageDefinitionType def = getStageDefinition(aCase.getApprovalContext(), workItem.getStageNumber());
return def != null ? def.getName() : "";
}

public static String getWorkItemStageDisplayName(CaseWorkItemType workItem) {
if (workItem == null){
return "";
}
CaseType aCase = CaseWorkItemUtil.getCaseRequired(workItem);
if (aCase.getApprovalContext() == null || workItem.getStageNumber() == null){
return "";
}
ApprovalStageDefinitionType def = getStageDefinition(aCase.getApprovalContext(), workItem.getStageNumber());
return def != null ? def.getDisplayName() : "";
}

public static String getStageName(CaseType aCase) {
Expand Down
Expand Up @@ -14007,6 +14007,9 @@
(Target OID, type and relation is matched.)
Note: Filter in the reference is not yet supported.
</xsd:documentation>
<xsd:appinfo>
<a:objectReferenceTargetType>tns:FocusType</a:objectReferenceTargetType>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="allowTransitive" type="xsd:boolean" minOccurs="0" default="false">
Expand Down Expand Up @@ -17823,6 +17826,9 @@
Constraints check is skipped if there was no change in respective properties (name for focus,
identifiers for projection). The default is false.
</xsd:documentation>
<xsd:appinfo>
<a:displayName>ConstraintsCheckingStrategyType.skipWhenNoChange</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="skipWhenNoIteration" type="xsd:boolean" minOccurs="0">
Expand All @@ -17831,6 +17837,9 @@
Constraints check is skipped if there is no iteration defined. So we rely on the repository
(for focus) or the resource (for projection) to report any constraints violations. The default is false.
</xsd:documentation>
<xsd:appinfo>
<a:displayName>ConstraintsCheckingStrategyType.skipWhenNoIteration</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
Expand Down
Expand Up @@ -1355,8 +1355,10 @@ public static void checkValidXmlChars(String stringValue) {
if (stringValue == null) {
return;
}
for (int i = 0; i < stringValue.length(); i++) {
if (!XMLChar.isValid(stringValue.charAt(i))) {
int codepointCount = stringValue.codePointCount(0, stringValue.length());

for (int i = 0; i < codepointCount; i++) {
if (!XMLChar.isValid(stringValue.codePointAt(i))) {
throw new IllegalStateException("Invalid character with regards to XML (code " + ((int) stringValue.charAt(i)) + ") in '" + makeSafelyPrintable(stringValue, 200) + "'");
}
}
Expand Down
Expand Up @@ -290,5 +290,19 @@ public void testGeneratedQNamePrefixes() {
assertEquals("BIG bada boom! wrong element QName in iteration "+i, qNameValue, qNameValueAfter);
}
}
@Test
public void testSupportStringWithSurrogates() {
//unicode block "CJK Unified Ideographs Extension B"
String targetString="\ud864\udd66";
boolean support=true;
assertEquals("length is not 2",2,targetString.length());
assertEquals("codePoint count is not 1",1,targetString.codePointCount(0, targetString.length()));
try {
DOMUtil.checkValidXmlChars(targetString);
}catch(IllegalStateException e) {
support=false;
}
assertTrue("Not support string with surrogates in xml",support);
}

}

0 comments on commit 579be31

Please sign in to comment.