Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/hibernate5
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Jan 5, 2018
2 parents d54e748 + 7f73c4c commit 97b5c6f
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 4 deletions.
Expand Up @@ -172,6 +172,8 @@ protected boolean getSpecificContainersItemsVisibility(ItemWrapper itemWrapper,
}
List<ItemPath> pathsToHide = new ArrayList<>();
pathsToHide.add(parentAssignmentPath.append(AssignmentType.F_CONSTRUCTION).append(ConstructionType.F_RESOURCE_REF));
pathsToHide.add(parentAssignmentPath.append(AssignmentType.F_CONSTRUCTION).append(ConstructionType.F_AUXILIARY_OBJECT_CLASS));
pathsToHide.add(parentAssignmentPath.append(AssignmentType.F_CONSTRUCTION).append(ConstructionType.F_STRENGTH));
return PropertyOrReferenceWrapper.class.isAssignableFrom(itemWrapper.getClass()) && !WebComponentUtil.isItemVisible(pathsToHide, itemWrapper.getPath());
}

Expand Down
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2010-2018 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.web.component.assignment;

import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import org.apache.wicket.model.IModel;

/**
* Created by honchar.
*/
public class InducedEntitlementDetailsPanel<R extends AbstractRoleType> extends InducementDetailsPanel<R> {
private static final long serialVersionUID = 1L;

public InducedEntitlementDetailsPanel(String id, Form<?> form, IModel<ContainerValueWrapper<AssignmentType>> assignmentModel) {
super(id, form, assignmentModel);
}

}
Expand Up @@ -7,6 +7,8 @@
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.prism.query.builder.QueryBuilder;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper;
import com.evolveum.midpoint.web.component.prism.ContainerWrapper;
import com.evolveum.midpoint.web.session.AssignmentsTabStorage;
import com.evolveum.midpoint.web.session.UserProfileStorage;
Expand Down Expand Up @@ -61,6 +63,9 @@ protected ObjectQuery createObjectQuery() {
return query;
}


@Override
protected InducementDetailsPanel createDetailsPanel(String idAssignmentDetails, Form<?> form, IModel<ContainerValueWrapper<AssignmentType>> model) {
return new InducedEntitlementDetailsPanel(ID_ASSIGNMENT_DETAILS, form, model);
}

}
Expand Up @@ -30,7 +30,7 @@
/**
* Created by honchar.
*/
public class InducementDetailsPanel<R extends AbstractRoleType, C extends Containerable> extends AbstractRoleAssignmentDetailsPanel<R> {
public class InducementDetailsPanel<R extends AbstractRoleType> extends AbstractRoleAssignmentDetailsPanel<R> {
private static final long serialVersionUID = 1L;

public InducementDetailsPanel(String id, Form<?> form, IModel<ContainerValueWrapper<AssignmentType>> assignmentModel) {
Expand Down
Expand Up @@ -34,6 +34,7 @@
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.util.ExpressionUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.commons.collections4.CollectionUtils;
Expand Down Expand Up @@ -148,6 +149,28 @@ public <C extends Containerable> AbstractAssociationWrapper createAssociationWra
itemPath = associationValue.getPath();
shadowAss.add(associationValue.findReference(ShadowAssociationType.F_SHADOW_REF).getValue().clone());
}
} else if (association.getDefinition().getCompileTimeClass().equals(ResourceObjectAssociationType.class)){
//for now Induced entitlements gui should support only targetRef expression value
//that is why no need to look for another expression types within association
ResourceObjectAssociationType resourceAssociation = (ResourceObjectAssociationType) associationValue.asContainerable();
if (resourceAssociation.getRef() == null || resourceAssociation.getRef().getItemPath() == null){
continue;
}
if (resourceAssociation.getRef().getItemPath().asSingleName().equals(refinedAssocationDefinition.getName())){
itemPath = associationValue.getPath();
MappingType outbound = ((ResourceObjectAssociationType)association.getValue().asContainerable()).getOutbound();
if (outbound == null){
continue;
}
ExpressionType expression = outbound.getExpression();
if (expression == null){
continue;
}
ObjectReferenceType shadowRef = ExpressionUtil.getShadowRefValue(expression);
if (shadowRef != null) {
shadowAss.add(shadowRef.asReferenceValue().clone());
}
}
}
}

Expand Down
Expand Up @@ -19,7 +19,7 @@
*/
public class ResourceAssociationWrapper extends AbstractAssociationWrapper<ResourceObjectAssociationType> {

private static transient Trace LOGGER = TraceManager.getTrace(ShadowAssociationWrapper.class);
private static transient Trace LOGGER = TraceManager.getTrace(ResourceAssociationWrapper.class);

ResourceAssociationWrapper(PrismContainer<ResourceObjectAssociationType> container, ContainerStatus objectStatus, ContainerStatus status, ItemPath path) {
super(container, objectStatus, status, path);
Expand Down
Expand Up @@ -183,7 +183,7 @@ public void setCanAdd(boolean val) {
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
int result = 17;
result = prime * result + ((layer == null) ? 0 : layer.hashCode());
result = prime * result + ((refinedAttributeDefinition == null) ? 0 : refinedAttributeDefinition.hashCode());
return result;
Expand Down

0 comments on commit 97b5c6f

Please sign in to comment.