Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint into audit
Browse files Browse the repository at this point in the history
# Conflicts:
#	repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/audit/RAuditEventRecord.java
#	repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/audit/RObjectDeltaOperation.java
#	repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/util/RUtil.java
  • Loading branch information
SavvasMisaghMoayyed committed Feb 7, 2018
2 parents bef067f + d8972d8 commit 0038571
Show file tree
Hide file tree
Showing 163 changed files with 4,316 additions and 798 deletions.
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.evolveum.midpoint.gui.api.util;

import com.evolveum.midpoint.web.security.MidPointApplication;

/**
* Created by Viliam Repan (lazyman).
*/
public interface MidPointApplicationConfiguration {

void init(MidPointApplication application);
}
Expand Up @@ -18,12 +18,7 @@

import java.io.Serializable;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.*;

import javax.xml.namespace.QName;

Expand Down Expand Up @@ -285,7 +280,11 @@ public void setSelected(boolean selected) {
}

public void sort() {
Collator collator = Collator.getInstance(WebModelServiceUtils.getLocale());
Locale locale = WebModelServiceUtils.getLocale();
if (locale == null) {
locale = Locale.getDefault();
}
Collator collator = Collator.getInstance(locale);
if (isSorted()) {
collator.setStrength(Collator.SECONDARY); // e.g. "a" should be different from "á"
collator.setDecomposition(Collator.FULL_DECOMPOSITION); // slower but more precise
Expand Down
Expand Up @@ -3883,3 +3883,4 @@ CertCampaignStateFilter.IN_REVIEW_STAGE=In review stage
CertCampaignStateFilter.REVIEW_STAGE_DONE=Review stage done
CertCampaignStateFilter.IN_REMEDIATION=In remediation
CertCampaignStateFilter.CLOSED=Closed
pageAdminFocus.dataProtection=Data protection
2 changes: 1 addition & 1 deletion gui/admin-gui/testng-integration.xml
Expand Up @@ -19,7 +19,7 @@
<test name="Web Integration" preserve-order="true" parallel="false" verbose="10">
<classes>
<class name="com.evolveum.midpoint.web.TestCleanStartup"/>
<class name="com.evolveum.midpoint.web.TestIntegrationObjectWrapperFactory"/>
<!--<class name="com.evolveum.midpoint.web.TestIntegrationObjectWrapperFactory"/>-->
<class name="com.evolveum.midpoint.web.TestIntegrationSecurity"/>
</classes>
</test>
Expand Down
2 changes: 1 addition & 1 deletion gui/admin-gui/testng-unit.xml
Expand Up @@ -18,7 +18,7 @@
<suite name="unit" parallel="false">
<test name="Web Unit" preserve-order="true" parallel="false" verbose="10">
<classes>
<class name="com.evolveum.midpoint.web.TestUnitObjectWrapperFactory"/>
<!--<class name="com.evolveum.midpoint.web.TestUnitObjectWrapperFactory"/>-->
<class name="com.evolveum.midpoint.web.TestDescriptorLoader"/>
</classes>
</test>
Expand Down
13 changes: 8 additions & 5 deletions infra/prism/src/main/java/com/evolveum/midpoint/prism/Item.java
Expand Up @@ -550,11 +550,14 @@ protected void diffInternal(Item<V,D> other, Collection<? extends ItemDelta> del
delta.addValueToDelete(valueClone);
}
} else {
if (delta.getDefinition() == null && other.getDefinition() != null) {
delta.setDefinition(other.getDefinition().clone());
}
// the other exists, this means that we need to compare the values one by one
Collection<PrismValue> outstandingOtheValues = new ArrayList<PrismValue>(other.getValues().size());
outstandingOtheValues.addAll(other.getValues());
Collection<PrismValue> outstandingOtherValues = new ArrayList<PrismValue>(other.getValues().size());
outstandingOtherValues.addAll(other.getValues());
for (PrismValue thisValue : getValues()) {
Iterator<PrismValue> iterator = outstandingOtheValues.iterator();
Iterator<PrismValue> iterator = outstandingOtherValues.iterator();
boolean found = false;
while (iterator.hasNext()) {
PrismValue otherValue = iterator.next();
Expand All @@ -581,9 +584,9 @@ protected void diffInternal(Item<V,D> other, Collection<? extends ItemDelta> del
delta.addValueToDelete(thisValue.clone());
}
}
// outstandingOtheValues are those values that the other has and we could not
// outstandingOtherValues are those values that the other has and we could not
// match them to any of our values. These must be new values to add
for (PrismValue outstandingOtherValue : outstandingOtheValues) {
for (PrismValue outstandingOtherValue : outstandingOtherValues) {
delta.addValueToAdd(outstandingOtherValue.clone());
}
// Some deltas may need to be polished a bit. E.g. transforming
Expand Down
Expand Up @@ -1351,24 +1351,21 @@ public void applyToMatchingPath(Item item) throws SchemaException {
}
if (valuesToReplace != null) {
item.replaceAll(PrismValue.cloneCollection(valuesToReplace));
// Application of delta might have removed values therefore leaving empty items.
// Those needs to be cleaned-up (removed) as empty item is not a legal state.
cleanupAllTheWayUp(item);
return;
}
if (valuesToAdd != null) {
if (item.getDefinition() != null && item.getDefinition().isSingleValue()) {
item.replaceAll(PrismValue.cloneCollection(valuesToAdd));
} else {
for (V valueToAdd : valuesToAdd) {
if (!item.containsEquivalentValue(valueToAdd)) {
item.add(valueToAdd.clone());
}
}
} else {
if (valuesToDelete != null) {
item.removeAll(valuesToDelete);
}
if (valuesToAdd != null) {
if (item.getDefinition() != null && item.getDefinition().isSingleValue()) {
item.replaceAll(PrismValue.cloneCollection(valuesToAdd));
} else {
for (V valueToAdd : valuesToAdd) {
if (!item.containsEquivalentValue(valueToAdd)) {
item.add(valueToAdd.clone());
}
}
}
}
}
if (valuesToDelete != null) {
item.removeAll(valuesToDelete);
}
// Application of delta might have removed values therefore leaving empty items.
// Those needs to be cleaned-up (removed) as empty item is not a legal state.
Expand Down
Expand Up @@ -904,8 +904,8 @@ public <X> void addModificationReplaceProperty(QName propertyQName, X... propert
addModificationReplaceProperty(new ItemPath(propertyQName), propertyValues);
}

public <X> void addModificationReplaceProperty(ItemPath propertyPath, X... propertyValues) {
fillInModificationReplaceProperty(this, propertyPath, propertyValues);
public <X> PropertyDelta<X> addModificationReplaceProperty(ItemPath propertyPath, X... propertyValues) {
return fillInModificationReplaceProperty(this, propertyPath, propertyValues);
}

public <X> void addModificationReplaceReference(ItemPath refPath, PrismReferenceValue... refValues) {
Expand Down Expand Up @@ -976,14 +976,16 @@ public static <O extends Objectable, C extends Containerable> ObjectDelta<O> cre
return objectDelta;
}

protected static <O extends Objectable, X> void fillInModificationReplaceProperty(ObjectDelta<O> objectDelta,
protected static <O extends Objectable, X> PropertyDelta<X> fillInModificationReplaceProperty(ObjectDelta<O> objectDelta,
ItemPath propertyPath, X... propertyValues) {
PropertyDelta<X> propertyDelta = objectDelta.createPropertyModification(propertyPath);
if (propertyValues != null) {
Collection<PrismPropertyValue<X>> valuesToReplace = toPrismPropertyValues(objectDelta.getPrismContext(), propertyValues);
propertyDelta.setValuesToReplace(valuesToReplace);
objectDelta.addModification(propertyDelta);
}

return propertyDelta;
}

protected static <O extends Objectable, X> void fillInModificationAddProperty(ObjectDelta<O> objectDelta,
Expand Down
Expand Up @@ -107,11 +107,13 @@ public class ItemDeltaType implements Serializable, Cloneable {

@XmlElement(required = true)
@Raw
protected List<Object> value; // Object is here to show as xsd:anyType in WSDL
@NotNull
protected final List<Object> value = new ArrayList<>(); // Object is here to show as xsd:anyType in WSDL

@XmlElement(required = true)
@Raw
protected List<Object> estimatedOldValue; // Object is here to show as xsd:anyType in WSDL
@NotNull
protected final List<Object> estimatedOldValue = new ArrayList<>(); // Object is here to show as xsd:anyType in WSDL

/**
* Gets the value of the modificationType property.
Expand Down Expand Up @@ -171,9 +173,6 @@ public void setPath(ItemPathType value) {
*/
@NotNull
public List<RawType> getValue() {
if (value == null){
value = new ArrayList<>();
}
return (List<RawType>) (List) value; // brutal hack
}

Expand All @@ -200,9 +199,6 @@ public List<RawType> getValue() {

@NotNull
public List<RawType> getEstimatedOldValue() {
if (estimatedOldValue == null){
estimatedOldValue = new ArrayList<>();
}
return (List<RawType>) (List) estimatedOldValue; // brutal hack
}

Expand Down Expand Up @@ -230,7 +226,7 @@ public List<RawType> getEstimatedOldValue() {
public static class Value implements Serializable, Cloneable {

@XmlAnyElement(lax = true)
protected List<Object> any;
protected final List<Object> any = new ArrayList<>();

/**
* Gets the value of the any property.
Expand All @@ -255,10 +251,8 @@ public static class Value implements Serializable, Cloneable {
*
*
*/
@NotNull
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}

Expand All @@ -274,7 +268,7 @@ public Value clone() {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((any == null) ? 0 : any.hashCode());
result = prime * result + any.hashCode();
return result;
}

Expand All @@ -287,10 +281,7 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return false;
Value other = (Value) obj;
if (any == null) {
if (other.any != null)
return false;
} else if (!JAXBUtil.compareElementList(any, other.any, false))
if (!JAXBUtil.compareElementList(any, other.any, false))
return false;
return true;
}
Expand Down Expand Up @@ -562,7 +553,7 @@ public int hashCode() {
result = prime
* result
+ ((modificationType == null) ? 0 : modificationType.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
result = prime * result + value.hashCode();
return result;
}

Expand All @@ -582,15 +573,10 @@ public boolean equals(Object obj) {
return false;
} else if (!path.equals(other.path))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!MiscUtil.unorderedCollectionEquals(value, other.value))
// use of isEmpty is a hack: should be fixed soon!
if (!MiscUtil.unorderedCollectionEquals(value, other.value))
return false;
if (estimatedOldValue == null) {
if (other.estimatedOldValue != null)
return false;
} else if (!MiscUtil.unorderedCollectionEquals(estimatedOldValue, other.estimatedOldValue))
if (!MiscUtil.unorderedCollectionEquals(estimatedOldValue, other.estimatedOldValue))
return false;
return true;
}
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Vzorový objekt
AssignmentType.focusType.help=Typ vzorového objektu, na který se toto přiřazení nebo indukce aplikuje - například UserType, RoleType, OrgType.
AssignmentType.tenant=Klient
AssignmentType.tenantReference=Klient
AssignmentType.tenantReference.help=Odkaz na klienta, ke které je toto přiřazení přidruženo. Je to parametr cíle tohoto přiřazení. Toho je například často použito k parametrizaci role, která je přiřazena tímto přiřazením.
AssignmentType.tenantReference.help=Odkaz na klienta, ke kterému je toto přiřazení přidruženo. Jedná se o parametr cíle tohoto přiřazení. Tohoto mechanismu je například často použito k parametrizaci role, která je přiřazena tímto přiřazením.
AssignmentType.orgReference=Odkaz na organizaci
AssignmentType.orgReferenceShorten=Odkaz na organizaci
AssignmentType.orgReference.help=Odkaz na organizaci (organizační jednotku, projekt, atd), ke které je toto přiřazení přidruženo. Je to parametr cíle tohoto přiřazení. Toho je například často použito k parametrizaci role, která je přiřazena tímto přiřazením.
AttributeFetchStrategyType.EXPLICIT=Explicitní
AttributeFetchStrategyType.IMPLICIT=Implicitní
Expand Down Expand Up @@ -687,4 +688,4 @@ relation.approver=schvalovatel
relation.owner=vlastník
relation.consent=souhlas
AbstractCredentialType.forceChange=Vynucení změny hesla při příštím přihlášení uživatele
PasswordType.value=Hodnota (2x)
PasswordType.value=Nové heslo (2x)
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Fokustyp
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Besitzer
AssignmentType.tenantReference=Untergeordnete Referenz
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organization reference
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Explizit
AttributeFetchStrategyType.IMPLICIT=Implizit
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Focus type
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Tenant
AssignmentType.tenantReference=Tenant reference
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organization reference
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Explicit
AttributeFetchStrategyType.IMPLICIT=Implicit
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Focus type
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Ocupante
AssignmentType.tenantReference=Tenant reference
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organization reference
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Explícito
AttributeFetchStrategyType.IMPLICIT=Implícito
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Fookuse tüüp
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Rentnik
AssignmentType.tenantReference=Rentniku viide
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organisatsiooni viide
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Otsene
AttributeFetchStrategyType.IMPLICIT=Kaudne
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Fokus tyyppi
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Haltija
AssignmentType.tenantReference=Tenant reference
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organization reference
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Tarkka
AttributeFetchStrategyType.IMPLICIT=Epäsuora
Expand Down
Expand Up @@ -72,8 +72,9 @@ AssignmentType.focusType=Focus type
AssignmentType.focusType.help=Type of focal object that this assignment/inducement applies to. E.g UserType, RoleType, OrgType, ...
AssignmentType.tenant=Tenant
AssignmentType.tenantReference=Tenant reference
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of thisassignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.tenantReference.help=Reference to the tenant to which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AssignmentType.orgReference=Organization reference
AssignmentType.orgReferenceShorten=Org. reference
AssignmentType.orgReference.help=Reference to the organization (org. unit, project, ...) which this assignment is associated with. This is an argument to the target of this assignment. E.g. is if frequently used to parametrize the role which is assigned by this assignment.
AttributeFetchStrategyType.EXPLICIT=Explicit
AttributeFetchStrategyType.IMPLICIT=Implicit
Expand Down

0 comments on commit 0038571

Please sign in to comment.