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 Oct 16, 2019
2 parents 11f8f12 + 81f2587 commit 383c097
Show file tree
Hide file tree
Showing 80 changed files with 2,082 additions and 774 deletions.
Expand Up @@ -159,10 +159,18 @@ public boolean isVisible(){

protected void populateAssignmentDetailsPanel(ListItem<AssignmentEditorDto> item){
AssignmentEditorPanel editor = new AssignmentEditorPanel(ID_ROW, item.getModel()){
private static final long serialVersionUID = 1L;

@Override
protected boolean ignoreMandatoryAttributes(){
return AssignmentTablePanel.this.ignoreMandatoryAttributes();
}

@Override
protected boolean isRelationEditable(){
return AssignmentTablePanel.this.isRelationEditable();
}

};
item.add(editor);

Expand Down Expand Up @@ -299,6 +307,10 @@ public void onClick(AjaxRequestTarget target) {
return items;
}

protected boolean isRelationEditable(){
return true;
}

protected void showAllAssignments(AjaxRequestTarget target) {

}
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails;
import com.evolveum.midpoint.web.util.validation.MidpointFormValidator;
import com.evolveum.midpoint.web.util.validation.MidpointFormValidatorImpl;
import com.evolveum.midpoint.web.util.validation.SimpleValidationError;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.prism.xml.ns._public.types_3.ItemPathType;
Expand Down Expand Up @@ -80,7 +81,10 @@ public InducedEntitlementsPanel(String id, IModel<PrismContainerWrapper<Assignme
}

private void createValidator() {
validator = new MidpointFormValidator() {
validator = new MidpointFormValidatorImpl() {

private static final long serialVersionUID = 1L;

@Override
public Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object, Collection<ObjectDelta<? extends ObjectType>> deltas) {
List<SimpleValidationError> errors = new ArrayList<SimpleValidationError>();
Expand Down
Expand Up @@ -117,6 +117,8 @@ public void initLayout() {

AssignmentTablePanel panel = new AssignmentTablePanel<UserType>(ID_ASSIGNMENT_TABLE_PANEL,
assignmentsModel){
private static final long serialVersionUID = 1L;

@Override
protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();
Expand All @@ -138,11 +140,17 @@ public void onClick(AjaxRequestTarget target) {
items.add(item);
return items;
}

@Override
public IModel<String> getLabel() {
return createStringResource("PageAssignmentsList.assignmentsToRequest");
}
public IModel<String> getLabel() {
return createStringResource("PageAssignmentsList.assignmentsToRequest");
}

@Override
protected boolean isRelationEditable() {
return false;
}

};
mainForm.add(panel);

Expand All @@ -153,23 +161,23 @@ public List<UserType> getObject() {
return getSessionStorage().getRoleCatalog().getTargetUserList();
}
},
true, createStringResource("AssignmentCatalogPanel.selectTargetUser")){
true, createStringResource("AssignmentCatalogPanel.selectTargetUser")) {
private static final long serialVersionUID = 1L;

@Override
protected String getUserButtonLabel(){
protected String getUserButtonLabel() {
return getTargetUserSelectionButtonLabel(getModelObject());
}

@Override
protected void onDeleteSelectedUsersPerformed(AjaxRequestTarget target){
protected void onDeleteSelectedUsersPerformed(AjaxRequestTarget target) {
super.onDeleteSelectedUsersPerformed(target);
getSessionStorage().getRoleCatalog().setTargetUserList(new ArrayList<>());
targetUserChangePerformed(target);
}

@Override
protected void multipleUsersSelectionPerformed(AjaxRequestTarget target, List<UserType> usersList){
protected void multipleUsersSelectionPerformed(AjaxRequestTarget target, List<UserType> usersList) {
getSessionStorage().getRoleCatalog().setTargetUserList(usersList);
targetUserChangePerformed(target);
}
Expand Down Expand Up @@ -278,9 +286,7 @@ private void onSingleUserRequestPerformed(AjaxRequestTarget target) {
result.recomputeStatus();
}

findBackgroundTaskOperation(result);
if (backgroundTaskOperationResult != null
&& StringUtils.isNotEmpty(backgroundTaskOperationResult.getAsynchronousOperationReference())){
if (hasBackgroundTaskOperation(result)){
result.setMessage(createStringResource("PageAssignmentsList.requestInProgress").getString());
showResult(result);
clearStorage();
Expand Down Expand Up @@ -340,9 +346,7 @@ private void onMultiUserRequestPerformed(AjaxRequestTarget target) {
"Failed to execute operaton " + result.getOperation(), e);
target.add(getFeedbackPanel());
}
findBackgroundTaskOperation(result);
if (backgroundTaskOperationResult != null
&& StringUtils.isNotEmpty(backgroundTaskOperationResult.getAsynchronousOperationReference())) {
if (hasBackgroundTaskOperation(result)) {
result.setMessage(createStringResource("PageAssignmentsList.requestInProgress").getString());
showResult(result);
clearStorage();
Expand Down Expand Up @@ -411,24 +415,9 @@ private ContainerDelta handleAssignmentDeltas(ObjectDelta<UserType> focusDelta,
}


private void findBackgroundTaskOperation(OperationResult result){
if (backgroundTaskOperationResult != null) {
return;
} else {
List<OperationResult> subresults = result.getSubresults();
if (subresults == null || subresults.size() == 0) {
return;
}
for (OperationResult subresult : subresults) {
if (subresult.getOperation().equals(OPERATION_WF_TASK_CREATED)) {
backgroundTaskOperationResult = subresult;
return;
} else {
findBackgroundTaskOperation(subresult);
}
}
}
return;
private boolean hasBackgroundTaskOperation(OperationResult result){
String caseOid = OperationResult.referenceToCaseOid(result.findAsynchronousOperationReference());
return StringUtils.isNotEmpty(caseOid);
}

private void handleModifyAssignmentDelta(AssignmentEditorDto assDto,
Expand Down
Expand Up @@ -14,6 +14,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import com.evolveum.prism.xml.ns._public.types_3.ItemPathType;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand All @@ -23,7 +24,9 @@
*
* @author shood
* */
public class MidpointFormValidatorImpl implements MidpointFormValidator {
public class MidpointFormValidatorImpl implements MidpointFormValidator, Serializable {

private static final long serialVersionUID = 1L;

@Override
public Collection<SimpleValidationError> validateObject(PrismObject<? extends ObjectType> object, Collection<ObjectDelta<? extends ObjectType>> deltas) {
Expand Down
Expand Up @@ -27,7 +27,7 @@ public class ParameterizedEquivalenceStrategy implements EquivalenceStrategy {

/**
* The (almost) highest level of recognition. Useful e.g. for comparing values for the purpose of XML editing.
* Still, ignores e.g. definitions, parent objects, immutability flag, etc.
* Still, ignores e.g. definitions, parent objects, origin, immutability flag, etc.
*
* Corresponds to pre-4.0 flags ignoreMetadata = false, literal = true.
*/
Expand All @@ -39,7 +39,7 @@ public class ParameterizedEquivalenceStrategy implements EquivalenceStrategy {
*
* Currently this is the default for equals/hashCode.
*
* Corresponds to pre-4.0 flags ignoreMetadata = false, literal = false.
* Roughly corresponds to pre-4.0 flags ignoreMetadata = false, literal = false.
*/
public static final ParameterizedEquivalenceStrategy NOT_LITERAL;

Expand Down Expand Up @@ -101,7 +101,7 @@ public class ParameterizedEquivalenceStrategy implements EquivalenceStrategy {
LITERAL.consideringOperationalData = true;
LITERAL.consideringContainerIds = true;
LITERAL.consideringDifferentContainerIds = true;
LITERAL.consideringValueOrigin = true;
LITERAL.consideringValueOrigin = false;
LITERAL.consideringReferenceFilters = true;
LITERAL.compareElementNames = true;
putIntoNiceNames(LITERAL, "LITERAL");
Expand All @@ -111,7 +111,7 @@ public class ParameterizedEquivalenceStrategy implements EquivalenceStrategy {
NOT_LITERAL.consideringOperationalData = true;
NOT_LITERAL.consideringContainerIds = true;
NOT_LITERAL.consideringDifferentContainerIds = true;
NOT_LITERAL.consideringValueOrigin = true;
NOT_LITERAL.consideringValueOrigin = false;
NOT_LITERAL.consideringReferenceFilters = true;
NOT_LITERAL.compareElementNames = true;
putIntoNiceNames(NOT_LITERAL, "NOT_LITERAL");
Expand Down
Expand Up @@ -29,7 +29,7 @@
"plus",
"minus"
})
public class DeltaSetTripleType implements Serializable, JaxbVisitable {
public class DeltaSetTripleType implements Serializable, JaxbVisitable, Cloneable {

@XmlElement
@Raw
Expand Down
Expand Up @@ -116,7 +116,7 @@ public boolean equals(Object o) {

// TODO consider the strategy
@Override
public int hashCode(ParameterizedEquivalenceStrategy strategy) {
public int hashCode(@NotNull ParameterizedEquivalenceStrategy strategy) {
return Objects.hash(super.hashCode(strategy), oid);
}

Expand Down
Expand Up @@ -153,6 +153,12 @@ public class OperationResult implements Serializable, DebugDumpable, ShortDumpab
private boolean collectingLogEntries; // NOT SERIALIZED
private boolean startedLoggingOverride; // NOT SERIALIZED

/**
* After a trace rooted at this operation result is stored, the dictionary that was extracted is stored here.
* It is necessary to correctly interpret traces in this result and its subresults.
*/
private TraceDictionaryType extractedDictionary; // NOT SERIALIZED

private final List<TraceType> traces = new ArrayList<>();

// Caller can specify the reason of the operation invocation.
Expand Down Expand Up @@ -2414,4 +2420,12 @@ public void setCallerReason(String callerReason) {
public List<LogSegmentType> getLogSegments() {
return logSegments;
}

public TraceDictionaryType getExtractedDictionary() {
return extractedDictionary;
}

public void setExtractedDictionary(TraceDictionaryType extractedDictionary) {
this.extractedDictionary = extractedDictionary;
}
}
Expand Up @@ -571,7 +571,7 @@ public static ObjectType toObjectable(PrismObject object) {
return object != null ? (ObjectType) object.asObjectable() : null;
}

public static <T extends Objectable> PrismObject<T> toPrismObject(T objectable) {
public static <T extends Objectable> PrismObject<T> asPrismObject(T objectable) {
//noinspection unchecked
return objectable != null ? objectable.asPrismObject() : null;
}
Expand Down
Expand Up @@ -813,6 +813,26 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="inputLensContextText" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Lens (model) context at input (text dump).
</xsd:documentation>
<xsd:appinfo>
<a:since>4.0.1</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="outputLensContextText" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Lens (model) context at output (text dump).
</xsd:documentation>
<xsd:appinfo>
<a:since>4.0.1</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down Expand Up @@ -2166,6 +2186,16 @@
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="identifier" type="xsd:int" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Identifier of the dictionary. Used when multiple dictionaries are to be merged.
</xsd:documentation>
<xsd:appinfo>
<a:since>4.0.1</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="entry" type="tns:TraceDictionaryEntryType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Expand All @@ -2190,13 +2220,20 @@
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="identifier" type="xsd:long" minOccurs="0">
<xsd:element name="identifier" type="xsd:int" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Entry identifier.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="originDictionaryId" type="xsd:int" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Identifier of the dictionary in which this entry was originally created.
</xsd:documentation>
<xsd:appinfo>
<a:composite>true</a:composite>
<a:since>4.0.1</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down
Expand Up @@ -2235,7 +2235,7 @@
for activation in these hardcoded states ("undefined" for active and deprecated
states, "archived" for archived state, "disabled" for all other states). To turn off this default behaviour
those hardcoded lifecycle states need to be explicitly defined in the state model
and the forcedActivationStatus property shoule be left undefined.
and the forcedActivationStatus property should be left undefined.
</p>
</xsd:documentation>
<xsd:appinfo>
Expand All @@ -2249,10 +2249,10 @@
<xsd:documentation>
<p>
There are cases when you need to force midpoint thinks that user has assigned some
role. The assignemnt actually doesn't exist but there is a need to preted as it does.
role. The assignment actually doesn't exist but there is a need to pretend as it does.
This can be used e.g. for post-authentication flow. The user has assigned all business,
application, etc. roles but we don't want to consider these roles during his
post-authentication proces. Instead, we want to pretend he has "temporary" role assigned
post-authentication process. Instead, we want to pretend he has "temporary" role assigned
which allows him to perform post-authentication.
</p>
</xsd:documentation>
Expand Down Expand Up @@ -2340,10 +2340,10 @@
<xsd:documentation>
<p>
There are cases when you need to force midpoint thinks that user has assigned some
role. The assignemnt actually doesn't exist but there is a need to preted as it does.
role. The assignment actually doesn't exist but there is a need to pretend as it does.
This can be used e.g. for post-authentication flow. The user has assigned all business,
application, etc. roles but we don't want to consider these roles during his
post-authentication proces. Instead, we want to pretend he has "temporary" role assigned
post-authentication process. Instead, we want to pretend he has "temporary" role assigned
which allows him to perform post-authentication.
</p>
</xsd:documentation>
Expand Down

0 comments on commit 383c097

Please sign in to comment.