Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/auth-caching
Browse files Browse the repository at this point in the history
# Conflicts:
#	repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java
  • Loading branch information
1azyman committed Apr 11, 2018
2 parents 39e395e + fa93d13 commit a6bf2e8
Show file tree
Hide file tree
Showing 125 changed files with 1,971 additions and 483 deletions.
5 changes: 3 additions & 2 deletions build-system/pom.xml
Expand Up @@ -49,7 +49,7 @@
<commons.lang.version>2.6</commons.lang.version>
<commons.lang3.version>3.7</commons.lang3.version>
<commons.cli>1.2</commons.cli>
<cxf.version>3.2.1</cxf.version>
<cxf.version>3.2.4</cxf.version>
<cxf-xjc.version>3.2.0</cxf-xjc.version>
<wss4j.version>2.2.0</wss4j.version>
<dbunit.version>2.4.7</dbunit.version>
Expand All @@ -63,7 +63,8 @@
<selenium.version>1.0.1</selenium.version>
<slf4j.version>1.7.25</slf4j.version>
<logback.version>1.2.3</logback.version>
<spring.boot.version>1.5.8.e1</spring.boot.version>
<spring.boot.version>1.5.8.e1</spring.boot.version> <!-- can be replaced by a stock version;
ideally after https://github.com/spring-projects/spring-boot/issues/11367 is resolved but it should be OK even before that -->
<spring.version>4.3.14.RELEASE</spring.version>
<spring.security.version>4.2.4.RELEASE</spring.security.version>
<cas.client.version>3.5.0</cas.client.version>
Expand Down
Expand Up @@ -256,7 +256,7 @@ protected void onUpdate(AjaxRequestTarget target) {
}
}

private class PasswordModel implements IModel<String> {
private static class PasswordModel implements IModel<String> {

IModel<ProtectedStringType> psModel;

Expand Down
Expand Up @@ -713,8 +713,7 @@ public static void addIncludeOptionsForExportOrView(Collection<SelectorOptions<G
}
}

public static boolean isEnableExperimentalFeature(ModelServiceLocator pageBase) {
Task task = pageBase.createSimpleTask("Load admin gui config");
public static boolean isEnableExperimentalFeature(Task task, ModelServiceLocator pageBase) {
OperationResult result = task.getResult();

ModelInteractionService mInteractionService = pageBase.getModelInteractionService();
Expand All @@ -737,6 +736,12 @@ public static boolean isEnableExperimentalFeature(ModelServiceLocator pageBase)
return BooleanUtils.isTrue(adminGuiConfig.isEnableExperimentalFeatures());

}

public static boolean isEnableExperimentalFeature(ModelServiceLocator pageBase) {
Task task = pageBase.createSimpleTask("Load admin gui config");
return isEnableExperimentalFeature(task, pageBase);

}

public static AccessCertificationConfigurationType getCertificationConfiguration(PageBase pageBase) {
OperationResult result = new OperationResult(WebModelServiceUtils.class.getName() + ".getCertificationConfiguration");
Expand Down
Expand Up @@ -71,11 +71,11 @@ private void appendOptions(StringBuilder sb) {
}

sb.append('{');
Iterator<String> keys = map.keySet().iterator();
Iterator<Map.Entry<String, String>> keys = map.entrySet().iterator();
while (keys.hasNext()) {
String key = keys.next();
sb.append(key).append(":");
sb.append('\'').append(map.get(key)).append('\'');
final Map.Entry<String, String> key = keys.next();
sb.append(key.getKey()).append(":");
sb.append('\'').append(key.getValue()).append('\'');
if (keys.hasNext()) {
sb.append(",\n");
}
Expand Down
Expand Up @@ -51,6 +51,7 @@
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.prism.query.builder.QueryBuilder;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
Expand Down Expand Up @@ -206,7 +207,6 @@ protected <T extends ObjectType> void addSelectedAssignmentsPerformed(AjaxReques
constructionType.setResourceRef(ref);
constructionType.setKind(kind);
constructionType.setIntent(intent);
initAssociationContainer(constructionType);
assignmentType.setConstruction(constructionType);
} else {
assignmentType.setTargetRef(ref);
Expand All @@ -218,9 +218,6 @@ protected <T extends ObjectType> void addSelectedAssignmentsPerformed(AjaxReques
reloadSavePreviewButtons(target);
}

protected void initAssociationContainer(ConstructionType constructionType){
}

protected List<IColumn<ContainerValueWrapper<AssignmentType>, String>> initColumns() {
List<IColumn<ContainerValueWrapper<AssignmentType>, String>> columns = new ArrayList<>();

Expand All @@ -231,6 +228,25 @@ public void populateItem(Item<ICellPopulator<ContainerValueWrapper<AssignmentTyp
}
});

columns.add(new AbstractColumn<ContainerValueWrapper<AssignmentType>, String>(createStringResource("AssignmentType.tenant")){
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item<ICellPopulator<ContainerValueWrapper<AssignmentType>>> item, String componentId,
final IModel<ContainerValueWrapper<AssignmentType>> rowModel) {
item.add(new Label(componentId, getTenantLabelModel(rowModel.getObject())));
}
});
columns.add(new AbstractColumn<ContainerValueWrapper<AssignmentType>, String>(createStringResource("AssignmentType.orgReferenceShorten")){
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item<ICellPopulator<ContainerValueWrapper<AssignmentType>>> item, String componentId,
final IModel<ContainerValueWrapper<AssignmentType>> rowModel) {
item.add(new Label(componentId, getOrgRefLabelModel(rowModel.getObject())));
}
});

return columns;
}

Expand Down Expand Up @@ -308,30 +324,6 @@ protected AbstractAssignmentDetailsPanel createDetailsPanel(String idAssignmentD
return new AbstractRoleAssignmentDetailsPanel(ID_ASSIGNMENT_DETAILS, form, model);
}

@Override
protected List<IColumn<ContainerValueWrapper<AssignmentType>, String>> initBasicColumns() {
List<IColumn<ContainerValueWrapper<AssignmentType>, String>> columns = super.initBasicColumns();
columns.add(new AbstractColumn<ContainerValueWrapper<AssignmentType>, String>(createStringResource("AssignmentType.tenant")){
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item<ICellPopulator<ContainerValueWrapper<AssignmentType>>> item, String componentId,
final IModel<ContainerValueWrapper<AssignmentType>> rowModel) {
item.add(new Label(componentId, getTenantLabelModel(rowModel.getObject())));
}
});
columns.add(new AbstractColumn<ContainerValueWrapper<AssignmentType>, String>(createStringResource("AssignmentType.orgReferenceShorten")){
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item<ICellPopulator<ContainerValueWrapper<AssignmentType>>> item, String componentId,
final IModel<ContainerValueWrapper<AssignmentType>> rowModel) {
item.add(new Label(componentId, getOrgRefLabelModel(rowModel.getObject())));
}
});
return columns;
}

private IModel<String> getTenantLabelModel(ContainerValueWrapper<AssignmentType> assignmentContainer){
if (assignmentContainer == null || assignmentContainer.getContainerValue() == null){
return Model.of("");
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.evolveum.midpoint.prism.query.builder.QueryBuilder;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.data.column.IsolatedCheckBoxPanel;
Expand Down Expand Up @@ -171,13 +172,15 @@ private void onPolicyAddedOrRemoved(PrismObject<AbstractRoleType> assignmentTarg
assignmentsModel.getObject().getValues().remove(assignmentToRemove);
} else {
if (added){
//TODO: not sure if this is correct way of creating new value.. this value is added directly to the origin object... what about deltas??
PrismContainerValue<AssignmentType> newAssignment = assignmentsModel.getObject().getItem().createNewValue();
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(assignmentTargetObject);
AssignmentType assignmentType = newAssignment.asContainerable();
assignmentType.setTargetRef(ref);
Task task = getPageBase().createSimpleTask("Creating new applicable policy");
ContainerWrapperFactory factory = new ContainerWrapperFactory(getPageBase());
ContainerValueWrapper<AssignmentType> valueWrapper = factory.createContainerValueWrapper(assignmentsModel.getObject(), newAssignment,
assignmentsModel.getObject().getObjectStatus(), ValueStatus.ADDED, assignmentsModel.getObject().getPath());
assignmentsModel.getObject().getObjectStatus(), ValueStatus.ADDED, assignmentsModel.getObject().getPath(), task);
valueWrapper.setShowEmpty(true, false);
assignmentsModel.getObject().getValues().add(valueWrapper);
}
Expand Down
Expand Up @@ -50,6 +50,7 @@
import com.evolveum.midpoint.prism.query.ObjectPaging;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.AjaxIconButton;
import com.evolveum.midpoint.web.component.data.BoxedTablePanel;
Expand Down Expand Up @@ -224,7 +225,7 @@ protected AssignmentsTabStorage getAssignmentsStorage() {

protected abstract ObjectQuery createObjectQuery();

protected List<IColumn<ContainerValueWrapper<AssignmentType>, String>> initBasicColumns() {
private List<IColumn<ContainerValueWrapper<AssignmentType>, String>> initBasicColumns() {
List<IColumn<ContainerValueWrapper<AssignmentType>, String>> columns = new ArrayList<>();

columns.add(new CheckBoxHeaderColumn<>());
Expand Down Expand Up @@ -459,8 +460,9 @@ protected void deleteAssignmentPerformed(AjaxRequestTarget target, List<Containe

protected ContainerValueWrapper<AssignmentType> createNewAssignmentContainerValueWrapper(PrismContainerValue<AssignmentType> newAssignment) {
ContainerWrapperFactory factory = new ContainerWrapperFactory(getPageBase());
Task task = getPageBase().createSimpleTask("Creating new assignment");
ContainerValueWrapper<AssignmentType> valueWrapper = factory.createContainerValueWrapper(getModelObject(), newAssignment,
getModelObject().getObjectStatus(), ValueStatus.ADDED, getModelObject().getPath());
getModelObject().getObjectStatus(), ValueStatus.ADDED, getModelObject().getPath(), task);
valueWrapper.setShowEmpty(true, false);
getModelObject().getValues().add(valueWrapper);
return valueWrapper;
Expand Down
Expand Up @@ -237,11 +237,13 @@ public List<ObjectReferenceType> load() {
PrismContainerValue associationValue = ((ContainerValueWrapper) associationValueWrapper).getContainerValue();
ResourceObjectAssociationType assoc = (ResourceObjectAssociationType) associationValue.asContainerable();
if (assoc == null || assoc.getOutbound() == null || assoc.getOutbound().getExpression() == null
|| ExpressionUtil.getShadowRefValue(assoc.getOutbound().getExpression()) == null) {
|| (ExpressionUtil.getShadowRefValue(assoc.getOutbound().getExpression()) == null
&& !ValueStatus.ADDED.equals(((ContainerValueWrapper) associationValueWrapper).getStatus()))) {
return;
}
QName assocRef = ItemPathUtil.getOnlySegmentQName(assoc.getRef());
if (defName != null && defName.equals(assocRef)) {
if ((defName != null && defName.equals(assocRef))
|| (assocRef == null && ValueStatus.ADDED.equals(((ContainerValueWrapper) associationValueWrapper).getStatus()))) {
shadowsList.add(ExpressionUtil.getShadowRefValue(assoc.getOutbound().getExpression()));
}
});
Expand Down Expand Up @@ -279,6 +281,7 @@ private List<ObjectReferenceType> getAssociationsShadowRefs(boolean compareName,
private void addNewShadowRefValuePerformed(AjaxRequestTarget target, RefinedAssociationDefinition def){
ObjectFilter filter = WebComponentUtil.createAssociationShadowRefFilter(def,
getPageBase().getPrismContext(), resourceModel.getObject().getOid());
Task task = getPageBase().createAnonymousTask("Adding new shadow");
ObjectBrowserPanel<ShadowType> objectBrowserPanel = new ObjectBrowserPanel<ShadowType>(
getPageBase().getMainPopupBodyId(), ShadowType.class, Arrays.asList(ShadowType.COMPLEX_TYPE),
false, getPageBase(),
Expand All @@ -302,7 +305,7 @@ protected void onSelectPerformed(AjaxRequestTarget target, ShadowType object) {
ContainerWrapperFactory factory = new ContainerWrapperFactory(getPageBase());
ContainerValueWrapper<ResourceObjectAssociationType> valueWrapper =
factory.createContainerValueWrapper(associationWrapper, newAssociation,
associationWrapper.getObjectStatus(), ValueStatus.ADDED, associationWrapper.getPath());
associationWrapper.getObjectStatus(), ValueStatus.ADDED, associationWrapper.getPath(), task);
// valueWrapper.setShowEmpty(true, false);
associationWrapper.getValues().add(valueWrapper);

Expand Down

0 comments on commit a6bf2e8

Please sign in to comment.