Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Oct 20, 2015
2 parents eec04ec + 63ad9f7 commit af7403f
Show file tree
Hide file tree
Showing 39 changed files with 329 additions and 226 deletions.
2 changes: 1 addition & 1 deletion config/initial-objects/090-report-audit.xml

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions config/initial-objects/110-report-user-list.xml
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
Expand Down Expand Up @@ -31,4 +28,3 @@
<maxPages>10000</maxPages>
<timeout>300000</timeout>
</report>
</objects>
Expand Up @@ -2132,6 +2132,7 @@ protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.f
}
};
progressReporter.registerSaveButton(saveButton);
mainForm.setDefaultButton(saveButton);
mainForm.add(saveButton);

AjaxSubmitButton abortButton = new AjaxSubmitButton("abort", createStringResource("pageAdminFocus.button.abort")) {
Expand Down
Expand Up @@ -509,6 +509,7 @@ protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(getFeedbackPanel());
}
};
mainForm.setDefaultButton(saveButton);
mainForm.add(saveButton);

AjaxButton backButton = new AjaxButton(ID_BUTTON_BACK,
Expand Down
Expand Up @@ -927,6 +927,7 @@ public boolean isVisible() {
return edit;
}
});
mainForm.setDefaultButton(saveButton);
mainForm.add(saveButton);

AjaxButton editButton = new AjaxButton("editButton",
Expand Down

Large diffs are not rendered by default.

@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
Expand Down Expand Up @@ -31,4 +28,3 @@
<maxPages>10000</maxPages>
<timeout>300000</timeout>
</report>
</objects>
Expand Up @@ -1071,7 +1071,7 @@ PageAdmin.menu.top.configuration.shadowsDetails=Shadows details
PageAdmin.menu.top.home=Home
PageAdmin.menu.top.reports.created=Created reports
PageAdmin.menu.top.reports.list=List reports
PageAdmin.menu.top.reports.new=Import report definition
PageAdmin.menu.top.reports.new=Import Jasper report
PageAdmin.menu.top.reports=Reports
PageAdmin.menu.top.resources.import=Import resource definition
PageAdmin.menu.top.resources.list=List resources
Expand Down
Expand Up @@ -1069,7 +1069,7 @@ PageAdmin.menu.top.configuration.shadowsDetails=Shadows details
PageAdmin.menu.top.home=Home
PageAdmin.menu.top.reports.created=Created reports
PageAdmin.menu.top.reports.list=List reports
PageAdmin.menu.top.reports.new=Import report definition
PageAdmin.menu.top.reports.new=Import Jasper report
PageAdmin.menu.top.reports=Reports
PageAdmin.menu.top.resources.import=Import resource definition
PageAdmin.menu.top.resources.list=List resources
Expand Down
Expand Up @@ -196,13 +196,17 @@ public ItemPath getPath() {
}

@Override
public boolean match(PrismContainerValue value, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException {
public boolean match(PrismContainerValue cvalue, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException {
Item filterItem = getFilterItem();
if (!super.match(value, matchingRuleRegistry)){
if (!super.match(cvalue, matchingRuleRegistry)){
return false;
}

List<Object> values = getObjectItem(value).getValues();
Item objectItem = getObjectItem(cvalue);
if (objectItem == null) {
return true;
}
List<Object> values = objectItem.getValues();
if (values == null){
return true;
}
Expand Down
Expand Up @@ -227,9 +227,9 @@ public boolean isRaw() {
}

@Override
public boolean match(PrismContainerValue value, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException {
public boolean match(PrismContainerValue cvalue, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException {

Item item = getObjectItem(value);
Item item = getObjectItem(cvalue);

boolean filterItemIsEmpty = getValues() == null || getValues().isEmpty();
boolean objectItemIsEmpty = item == null || item.isEmpty();
Expand Down
Expand Up @@ -153,9 +153,11 @@ public static boolean hasToLoadPath(ItemPath path, Collection<SelectorOptions<Ge

for (SelectorOptions<GetOperationOptions> option : retrieveOptions) {
ObjectSelector selector = option.getSelector();
ItemPath selected = selector.getPath();
if (!isPathInSelected(path, selected)) {
continue;
if (selector != null) {
ItemPath selected = selector.getPath();
if (!isPathInSelected(path, selected)) {
continue;
}
}

RetrieveOption retrieveOption = option.getOptions().getRetrieve();
Expand Down
Expand Up @@ -453,7 +453,7 @@ public Set<String> asSet(List<Attribute> attributes) {

// Generic utility methods

public SearchResultEntry searchByEntryUuid(String entryUuid) throws DirectoryException {
public Entry searchByEntryUuid(String entryUuid) throws DirectoryException {
InternalSearchOperation op = getInternalConnection().processSearch(
"dc=example,dc=com", SearchScope.WHOLE_SUBTREE, DereferencePolicy.NEVER_DEREF_ALIASES, 100,
100, false, "(entryUUID=" + entryUuid + ")", getSearchAttributes());
Expand All @@ -468,15 +468,15 @@ public SearchResultEntry searchByEntryUuid(String entryUuid) throws DirectoryExc
return searchEntries.get(0);
}

public SearchResultEntry searchAndAssertByEntryUuid(String entryUuid) throws DirectoryException {
SearchResultEntry entry = searchByEntryUuid(entryUuid);
public Entry searchAndAssertByEntryUuid(String entryUuid) throws DirectoryException {
Entry entry = searchByEntryUuid(entryUuid);
if (entry == null) {
AssertJUnit.fail("Entry UUID "+entryUuid+" not found");
}
return entry;
}

public SearchResultEntry searchSingle(String filter) throws DirectoryException {
public Entry searchSingle(String filter) throws DirectoryException {
InternalSearchOperation op = getInternalConnection().processSearch(
getSuffix(), SearchScope.WHOLE_SUBTREE, DereferencePolicy.NEVER_DEREF_ALIASES, 100,
100, false, filter, getSearchAttributes());
Expand All @@ -489,11 +489,11 @@ public SearchResultEntry searchSingle(String filter) throws DirectoryException {
return op.getSearchEntries().get(0);
}

public SearchResultEntry searchByUid(String string) throws DirectoryException {
public Entry searchByUid(String string) throws DirectoryException {
return searchSingle("(uid=" + string + ")");
}

public SearchResultEntry fetchEntry(String dn) throws DirectoryException {
public Entry fetchEntry(String dn) throws DirectoryException {
InternalSearchOperation op = getInternalConnection().processSearch(
dn, SearchScope.BASE_OBJECT, DereferencePolicy.NEVER_DEREF_ALIASES, 100,
100, false, "(objectclass=*)", getSearchAttributes());
Expand All @@ -506,8 +506,8 @@ public SearchResultEntry fetchEntry(String dn) throws DirectoryException {
return op.getSearchEntries().get(0);
}

public SearchResultEntry fetchAndAssertEntry(String dn, String objectClass) throws DirectoryException {
SearchResultEntry entry = fetchEntry(dn);
public Entry fetchAndAssertEntry(String dn, String objectClass) throws DirectoryException {
Entry entry = fetchEntry(dn);
AssertJUnit.assertNotNull("No entry for DN "+dn, entry);
assertDn(entry, dn);
assertObjectClass(entry, objectClass);
Expand All @@ -521,15 +521,15 @@ private LinkedHashSet<String> getSearchAttributes() {
return attrs;
}

public boolean isAccountEnabled(SearchResultEntry ldapEntry) {
public boolean isAccountEnabled(Entry ldapEntry) {
String pwpAccountDisabled = getAttributeValue(ldapEntry, "ds-pwp-account-disabled");
if (pwpAccountDisabled != null && pwpAccountDisabled.equals("true")) {
return false;
}
return true;
}

public static String getAttributeValue(SearchResultEntry response, String name) {
public static String getAttributeValue(Entry response, String name) {
List<Attribute> attrs = response.getAttribute(name.toLowerCase());
if (attrs == null || attrs.size() == 0) {
return null;
Expand All @@ -540,7 +540,7 @@ public static String getAttributeValue(SearchResultEntry response, String name)
return attribute.iterator().next().getValue().toString();
}

public static byte[] getAttributeValueBinary(SearchResultEntry response, String name) {
public static byte[] getAttributeValueBinary(Entry response, String name) {
List<Attribute> attrs = response.getAttribute(name.toLowerCase());
if (attrs == null || attrs.size() == 0) {
return null;
Expand All @@ -552,7 +552,7 @@ public static byte[] getAttributeValueBinary(SearchResultEntry response, String
return value.toByteArray();
}

public static Collection<String> getAttributeValues(SearchResultEntry response, String name) {
public static Collection<String> getAttributeValues(Entry response, String name) {
List<Attribute> attrs = response.getAttribute(name.toLowerCase());
if (attrs == null || attrs.size() == 0) {
return null;
Expand All @@ -569,38 +569,38 @@ public static Collection<String> getAttributeValues(SearchResultEntry response,
return values;
}

public static String getDn(SearchResultEntry response) {
public static String getDn(Entry response) {
DN dn = response.getDN();
return dn.toString();
}

public static void assertDn(SearchResultEntry response, String expected) throws DirectoryException {
public static void assertDn(Entry response, String expected) throws DirectoryException {
DN actualDn = response.getDN();
if (actualDn.compareTo(DN.decode(expected)) != 0) {
AssertJUnit.fail("Wrong DN, expected "+expected+" but was "+actualDn.toString());
}
}

public void assertNoEntry(String dn) throws DirectoryException {
SearchResultEntry entry = fetchEntry(dn);
Entry entry = fetchEntry(dn);
if (entry != null) {
AssertJUnit.fail("Found entry for dn "+dn+" while not expecting it: "+entry);
}
}

public static void assertObjectClass(SearchResultEntry response, String expected) throws DirectoryException {
public static void assertObjectClass(Entry response, String expected) throws DirectoryException {
Collection<String> objectClassValues = getAttributeValues(response, "objectClass");
AssertJUnit.assertTrue("Wrong objectclass for entry "+getDn(response)+", expected "+expected+" but got "+objectClassValues,
objectClassValues.contains(expected));
}

public static void assertNoObjectClass(SearchResultEntry response, String unexpected) throws DirectoryException {
public static void assertNoObjectClass(Entry response, String unexpected) throws DirectoryException {
Collection<String> objectClassValues = getAttributeValues(response, "objectClass");
AssertJUnit.assertFalse("Unexpected objectclass for entry "+getDn(response)+": "+unexpected+", got "+objectClassValues,
objectClassValues.contains(unexpected));
}

public void assertUniqueMember(SearchResultEntry groupEntry, String accountDn) throws DirectoryException {
public void assertUniqueMember(Entry groupEntry, String accountDn) throws DirectoryException {
Collection<String> members = getAttributeValues(groupEntry, "uniqueMember");
assertContainsDn("No member "+accountDn+" in group "+getDn(groupEntry),
members, accountDn);
Expand All @@ -619,22 +619,22 @@ public static void assertContainsDn(String message, Collection<String> actualVal
}

public void assertUniqueMember(String groupDn, String accountDn) throws DirectoryException {
SearchResultEntry groupEntry = fetchEntry(groupDn);
Entry groupEntry = fetchEntry(groupDn);
assertUniqueMember(groupEntry, accountDn);
}

public void assertNoUniqueMember(String groupDn, String accountDn) throws DirectoryException {
SearchResultEntry groupEntry = fetchEntry(groupDn);
Entry groupEntry = fetchEntry(groupDn);
assertNoUniqueMember(groupEntry, accountDn);
}

public void assertNoUniqueMember(SearchResultEntry groupEntry, String accountDn) {
public void assertNoUniqueMember(Entry groupEntry, String accountDn) {
Collection<String> members = getAttributeValues(groupEntry, "uniqueMember");
MidPointAsserts.assertNotContainsCaseIgnore("Member "+accountDn+" in group "+getDn(groupEntry),
members, accountDn);
}

public static void assertAttribute(SearchResultEntry response, String name, String... values) {
public static void assertAttribute(Entry response, String name, String... values) {
List<Attribute> attrs = response.getAttribute(name.toLowerCase());
if (attrs == null || attrs.size() == 0) {
if (values.length == 0) {
Expand Down Expand Up @@ -667,7 +667,7 @@ public static void assertAttribute(SearchResultEntry response, String name, Stri
}
}

public static void assertNoAttribute(SearchResultEntry response, String name) {
public static void assertNoAttribute(Entry response, String name) {
List<Attribute> attrs = response.getAttribute(name.toLowerCase());
if (attrs == null || attrs.size() == 0) {
return;
Expand All @@ -684,7 +684,7 @@ public static void assertNoAttribute(SearchResultEntry response, String name) {
AssertJUnit.fail("Attribute "+name+" exists while not expecting it: "+attribute);
}

public void assertActive(SearchResultEntry response, boolean active) {
public void assertActive(Entry response, boolean active) {
assertEquals("Unexpected activation of entry "+response, active, isAccountEnabled(response));
}

Expand Down Expand Up @@ -797,7 +797,7 @@ public String dumpEntries() throws DirectoryException {
}

public Collection<String> getGroupUniqueMembers(String groupDn) throws DirectoryException {
SearchResultEntry groupEntry = fetchEntry(groupDn);
Entry groupEntry = fetchEntry(groupDn);
if (groupEntry == null) {
throw new IllegalArgumentException(groupDn + " was not found");
}
Expand Down
Expand Up @@ -30,7 +30,7 @@
import com.evolveum.midpoint.model.common.expression.ObjectDeltaObject;
import com.evolveum.midpoint.model.common.mapping.Mapping;
import com.evolveum.midpoint.model.common.mapping.MappingFactory;
import com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluationHelper;
import com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.ItemDefinition;
Expand Down Expand Up @@ -105,7 +105,7 @@ public class AssignmentEvaluator<F extends FocusType> {
XMLGregorianCalendar now;
private boolean evaluateConstructions = true;
private PrismObject<SystemConfigurationType> systemConfiguration;
private MappingEvaluationHelper mappingEvaluationHelper;
private MappingEvaluator mappingEvaluator;

public RepositoryService getRepository() {
return repository;
Expand Down Expand Up @@ -195,12 +195,12 @@ public void setSystemConfiguration(PrismObject<SystemConfigurationType> systemCo
this.systemConfiguration = systemConfiguration;
}

public MappingEvaluationHelper getMappingEvaluationHelper() {
return mappingEvaluationHelper;
public MappingEvaluator getMappingEvaluator() {
return mappingEvaluator;
}

public void setMappingEvaluationHelper(MappingEvaluationHelper mappingEvaluationHelper) {
this.mappingEvaluationHelper = mappingEvaluationHelper;
public void setMappingEvaluator(MappingEvaluator mappingEvaluationHelper) {
this.mappingEvaluator = mappingEvaluationHelper;
}

public EvaluatedAssignmentImpl<F> evaluate(ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> assignmentIdi,
Expand Down Expand Up @@ -345,6 +345,7 @@ private void prepareConstructionEvaluation(EvaluatedAssignmentImpl<F> evaluatedA
construction.setObjectResolver(objectResolver);
construction.setPrismContext(prismContext);
construction.setMappingFactory(mappingFactory);
construction.setMappingEvaluator(mappingEvaluator);
construction.setOriginType(OriginType.ASSIGNMENTS);
construction.setChannel(channel);
construction.setOrderOneObject(orderOneObject);
Expand Down Expand Up @@ -383,7 +384,7 @@ private void evaluateFocusMappings(EvaluatedAssignmentImpl<F> evaluatedAssignmen
continue;
}
// TODO: time constratins?
LensUtil.evaluateMapping(mapping, lensContext, task, result);
mappingEvaluator.evaluateMapping(mapping, lensContext, task, result);
evaluatedAssignment.addFocusMapping(mapping);
}
}
Expand Down Expand Up @@ -656,7 +657,7 @@ public PrismValueDeltaSetTriple<PrismPropertyValue<Boolean>> evaluateMappingAsCo
PrismPropertyDefinition<Boolean> outputDefinition = new PrismPropertyDefinition<Boolean>(CONDITION_OUTPUT_NAME, DOMUtil.XSD_BOOLEAN, prismContext);
mapping.setDefaultTargetDefinition(outputDefinition);

LensUtil.evaluateMapping(mapping, lensContext, task, result);
mappingEvaluator.evaluateMapping(mapping, lensContext, task, result);

return mapping.getOutputTriple();
}
Expand Down

0 comments on commit af7403f

Please sign in to comment.