Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Sep 22, 2022
2 parents b98e83a + 29c1c9d commit 06e83dc
Show file tree
Hide file tree
Showing 71 changed files with 853 additions and 479 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ protected String getSpecialButtonClass() {
}

protected String getSpecialDropdownMenuClass() {
return "pull-right";
return "dropdown-menu-right";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<button aria-expanded="false" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="sr-only"><wicket:message key="SplitButtonDropDown.toggle"/></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li wicket:id="menuItems">
<div wicket:id="menuItem"/>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void editRawPerformed(AjaxRequestTarget target) {

@Override
public void yesPerformed(AjaxRequestTarget target) {
editRawPerformed(target);
editRawPerformedConfirmed();
}

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private void loggerEditPerformed(AjaxRequestTarget target, IModel<PrismContainer
logger.setSelected(true);
}
}
getTable().goToLastPage();
target.add(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public class BoxedTablePanel<T> extends BasePanel<T> implements Table {
private String additionalBoxCssClasses = null;
private boolean isRefreshEnabled;
private List<IColumn<T, String>> columns;
private ISortableDataProvider provider;

//interval in seconds
private static final int DEFAULT_REFRESH_INTERVAL = 60;
Expand All @@ -81,6 +80,18 @@ public BoxedTablePanel(String id, ISortableDataProvider provider, List<IColumn<T
initLayout(columns, provider);
}

public void goToLastPage() {
long size = getDataTable().getDataProvider().size();
int itemsPerPage = getItemsPerPage();

long page = size / itemsPerPage;
if (size % itemsPerPage != 0) {
page++;
}

setCurrentPage(page);
}

public void setShowAsCard(boolean showAsCard) {
this.showAsCard = showAsCard;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void onClick(AjaxRequestTarget target) {
new DropdownButtonDto(String.valueOf(tasksList.size()), icon, label, items)) {
@Override
protected String getSpecialDropdownMenuClass() {
return "pull-left";
return "dropdown-menu-left";
}
};
taskButtonsContainer.add(button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ interface ProtectedStringProcessor {

private static class CombinedVisitor implements ConfigurableVisitor, JaxbVisitor {

private ProtectedStringProcessor processor;
private final ProtectedStringProcessor processor;
private String lastPropName = "?";

private CombinedVisitor(ProtectedStringProcessor processor) {
Expand All @@ -253,6 +253,7 @@ public void visit(JaxbVisitable visitable) {
MiscUtil.throwExceptionAsUnchecked(e);
}
} else {
// Should we parse not-yet-parsed RawType here?
JaxbVisitable.visitPrismStructure(visitable, this);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1571,10 +1571,10 @@
</p>
<p>
The relation in linkRef has the following meaning: org:default means that
that the shadow the link is pointing to is "live", i.e. the corresponding
the shadow the link is pointing to is "live", i.e. the corresponding
object exists on the resource. On the other hand, org:related means that
the shadow exists in repo, but with dead = true, i.e. the corresponding
object is not existing on the resource any more.
object is not existing on the resource anymore.
</p>
<p>
Especially, when the shadow is in the Reaping state (see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@
<xsd:documentation>
Specification of items that must be modified (all of them) in order for this
constraint be triggered. If no items are specified then any modification will
trigger this constraint.
trigger this constraint. The item paths should not contain container value IDs.
</xsd:documentation>
<xsd:appinfo>
<a:displayName>ModificationPolicyConstraintType.item</a:displayName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public LensContext(Class<F> focusClass) {

/**
* TODO not sure if this method should be here or in {@link ProjectionsLoadOperation} (that is currently the only client)
* The reason for being here is the similarity to {@link #getOrCreateProjectionContext(LensContext, ConstructionTargetKey)}
* The reason for being here is the similarity to {@link #getOrCreateProjectionContext(LensContext, ConstructionTargetKey, boolean)}
* and coupling with {@link #getOrCreateProjectionContext(LensContext, HumanReadableDescribable, Supplier, Supplier)}.
*/
public @NotNull static <F extends ObjectType> GetOrCreateProjectionContextResult getOrCreateProjectionContext(
Expand All @@ -288,11 +288,11 @@ public LensContext(Class<F> focusClass) {
}

public @NotNull static <F extends ObjectType> GetOrCreateProjectionContextResult getOrCreateProjectionContext(
LensContext<F> context, ConstructionTargetKey targetKey) {
LensContext<F> context, ConstructionTargetKey targetKey, boolean acceptReaping) {
return getOrCreateProjectionContext(
context,
targetKey,
() -> context.findFirstProjectionContext(targetKey),
() -> context.findFirstProjectionContext(targetKey, acceptReaping),
() -> context.createProjectionContext(targetKey.toProjectionContextKey()));
}

Expand Down Expand Up @@ -494,10 +494,13 @@ public LensProjectionContext findFirstNotCompletedProjectionContext(@NotNull Con
/**
* TODO
*/
public LensProjectionContext findFirstProjectionContext(@NotNull ConstructionTargetKey targetKey) {
public LensProjectionContext findFirstProjectionContext(
@NotNull ConstructionTargetKey targetKey,
boolean acceptReaping) {
return getProjectionContexts().stream()
.filter(p -> !p.isGone())
.filter(p -> p.matches(targetKey))
.filter(p -> !p.isReaping() || acceptReaping)
.min(Comparator.comparing(LensProjectionContext::getOrder))
.orElse(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ public boolean isGone() {
return key.isGone();
}

public boolean isGoneOrReaping() {
return isGone() || isReaping();
}

public boolean isReaping() {
return getCurrentShadowState() == ShadowLifecycleStateType.REAPING;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class EvaluatedAssignedResourceObjectConstructionImpl<AH extends Assignme
protected void initializeProjectionContext() {
// projection context may not exist yet (existence might not be yet decided)
setProjectionContext(
construction.getLensContext().findFirstProjectionContext(targetKey));
construction.getLensContext().findFirstProjectionContext(targetKey, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ private void handleProvisioningError(ResourceType resource, Throwable t, Task ta
SchemaException {
ErrorSelectorType errorSelectorType = ResourceTypeUtil.getConnectorErrorCriticality(resource);
CriticalityType criticality = ExceptionUtil.getCriticality(errorSelectorType, t, CriticalityType.FATAL);
RepoCommonUtils.processErrorCriticality(task, criticality, t, result);
RepoCommonUtils.processErrorCriticality(resource, criticality, t, result);
if (criticality == CriticalityType.IGNORE) {
result.muteLastSubresultError();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,6 @@ private <T> PropertyDelta<T> consolidatePropertyWithSync(LensProjectionContext a
/**
* This method consolidate property delta against account absolute state which came from sync (not as delta)
*
* @param accCtx
* @param delta
* @return method return updated delta, or null if delta was empty after filtering (removing unnecessary values).
*/
private <T> PropertyDelta<T> consolidateWithSyncAbsolute(LensProjectionContext accCtx, PropertyDelta<T> delta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ private <F extends FocusType> void processProjectionValues(LensContext<F> contex
if (policyDecision == SynchronizationPolicyDecision.UNLINK) {
// We will not update accounts that are being unlinked.
// we cannot skip deleted accounts here as the delete delta will be skipped as well
LOGGER.trace("Skipping processing of value for {} because the decision is {}", projContext.getHumanReadableName(), policyDecision);
LOGGER.trace("Skipping processing of values for {} because the decision is {}",
projContext.getHumanReadableName(), policyDecision);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,14 @@ private <F extends ObjectType> void projectProjection(LensContext<F> context, Le
parentResult.addParam("resourceName", projectionContext.getResourceName());

if (projectionContext.getWave() != context.getProjectionWave()) {
LOGGER.trace("Skipping projection of {} because its wave ({}) is different from current projection wave ({})",
projectionContext, projectionContext.getWave(), context.getProjectionWave());
parentResult.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Wave of the projection context differs from current projector wave");
recordSkipReason(parentResult,
"Skipping projection because the wave of the projection context (" + projectionContext.getWave() +
") differs from current projector wave (" + context.getProjectionWave() + ")");
return;
}

if (projectionContext.isCompleted()) {
LOGGER.trace("Skipping projection of {} because it's already completed", projectionContext);
parentResult.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Projection context is already completed");
recordSkipReason(parentResult, "Skipping projection because the projection context is already completed");
return;
}

Expand All @@ -277,18 +276,24 @@ private <F extends ObjectType> void projectProjection(LensContext<F> context, Le
context.checkAbortRequested();

if (!projectionContext.isCanProject()) {
result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Skipping projection because of limited propagation");
recordSkipReason(result, "Skipping projection because of limited propagation");
return;
}

if (projectionContext.getSynchronizationPolicyDecision() == SynchronizationPolicyDecision.BROKEN ||
projectionContext.getSynchronizationPolicyDecision() == SynchronizationPolicyDecision.IGNORE) {
result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Skipping projection because it is " + projectionContext.getSynchronizationPolicyDecision());
recordSkipReason(result,
"Skipping projection because it is " + projectionContext.getSynchronizationPolicyDecision());
return;
}

if (projectionContext.isGone()) {
result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Skipping projection because it is gone");
recordSkipReason(result, "Skipping projection because it is gone");
return;
}

if (projectionContext.isReaping()) {
recordSkipReason(result, "Skipping projection because it is being reaped");
return;
}

Expand All @@ -300,7 +305,7 @@ private <F extends ObjectType> void projectProjection(LensContext<F> context, Le
context.checkConsistenceIfNeeded();

if (!dependencyProcessor.checkDependencies(projectionContext)) {
result.recordNotApplicable("Skipping projection because it has unsatisfied dependencies");
recordSkipReason(result, "Skipping projection because it has unsatisfied dependencies");
return;
}

Expand All @@ -313,7 +318,7 @@ private <F extends ObjectType> void projectProjection(LensContext<F> context, Le
Projector.class, context, projectionContext, activityDescription, now, task, result);

if (projectionContext.isGone()) {
result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Skipping projection because it is gone");
recordSkipReason(result, "Skipping projection because it is gone");
return;
}

Expand Down Expand Up @@ -351,6 +356,11 @@ private <F extends ObjectType> void projectProjection(LensContext<F> context, Le
}
}

private static void recordSkipReason(OperationResult result, String message) {
LOGGER.trace("{}", message);
result.recordStatus(OperationResultStatus.NOT_APPLICABLE, message);
}

private <F extends ObjectType> void addConflictingContexts(LensContext<F> context) {
for (LensProjectionContext conflictingContext : context.getConflictingProjectionContexts()) {
LOGGER.trace("Adding conflicting projection context {}", conflictingContext.getHumanReadableName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ public void check(Task task, OperationResult result)
LOGGER.trace("No contexts found for {}; this looks like a real constraint violation", candidateOid);
return true;
}
if (matchingContexts.stream().allMatch(LensProjectionContext::isGone)) {
LOGGER.trace("All {} context(s) of {} are gone. This looks like a phantom constraint violation",
if (matchingContexts.stream().allMatch(LensProjectionContext::isGoneOrReaping)) {
LOGGER.trace("All {} context(s) of {} are gone or being reaped. This looks like a phantom constraint violation",
matchingContexts.size(), candidateOid);
return false;
} else {
LOGGER.trace("There are {} context(s) for {}, not all gone. Confirming the constraint violation.",
LOGGER.trace("There are {} context(s) for {}, not all gone or being reaped. Confirming the constraint violation.",
matchingContexts.size(), candidateOid);
return true;
}
Expand Down

0 comments on commit 06e83dc

Please sign in to comment.