Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Oct 5, 2017
2 parents 4a7f2eb + e638d98 commit 776dd7d
Show file tree
Hide file tree
Showing 80 changed files with 5,163 additions and 849 deletions.
4 changes: 2 additions & 2 deletions build-system/pom.xml
Expand Up @@ -662,12 +662,12 @@
<dependency>
<groupId>com.evolveum.polygon</groupId>
<artifactId>connector-csv</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.evolveum.polygon</groupId>
<artifactId>connector-ldap</artifactId>
<version>1.5-SNAPSHOT</version>
<version>1.5</version>
<exclusions>
<exclusion> <!-- Version in dependency of org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j conflicts with xalan. Can be removed when connector version is bumped beyond 1.4.2.17 -->
<groupId>xml-apis</groupId>
Expand Down
Expand Up @@ -20,6 +20,9 @@

import javax.xml.namespace.QName;

import com.evolveum.midpoint.prism.PrismContainer;
import com.evolveum.midpoint.prism.PrismContainerValue;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.*;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.list.ListItem;
Expand Down Expand Up @@ -77,7 +80,7 @@ protected <C extends Containerable> void initLayout(){
@Override
public C getObject() {
AssignmentType assignment = getModelObject().getContainerValue().getValue();
if (AssignmentsUtil.isAssignableObject(assignment)) {
if (assignment.getTargetRef() != null) {
Task task = getPageBase().createSimpleTask("Load target");
com.evolveum.midpoint.schema.result.OperationResult result = task.getResult();
return (C) WebModelServiceUtils.loadObject(assignment.getTargetRef(), getPageBase(), task, result).asObjectable();
Expand All @@ -103,13 +106,17 @@ public C getObject() {

PageAdminObjectDetails<F> pageBase = (PageAdminObjectDetails<F>)getPageBase();

ItemPath assignmentPath = getAssignmentPath();
ItemPath assignmentPath = getModelObject().getPath();
// ContainerValueWrapperFromObjectWrapperModel<AssignmentType, F> assignmentModel =
// new ContainerValueWrapperFromObjectWrapperModel<AssignmentType, F>(pageBase.getObjectModel(), assignmentPath);

Form form = new Form<>("form");

ContainerValueWrapper<AssignmentType> containerWrapper = getModelObject();
if (containerWrapper == null){}

ContainerValuePanel<AssignmentType> assignmentPanel = new ContainerValuePanel("basic", getModel(), true, form, itemWrapper -> getAssignmentBasicTabVisibity(itemWrapper, assignmentPath), pageBase);
ContainerValuePanel<AssignmentType> assignmentPanel = new ContainerValuePanel("basic", getModel(), true, form,
itemWrapper -> getAssignmentBasicTabVisibity(itemWrapper, assignmentPath), pageBase);
add(assignmentPanel);


Expand Down Expand Up @@ -173,6 +180,4 @@ protected IModel<String> getAdditionalNameLabelStyleClass(){
return Model.of("");
}



}
Expand Up @@ -23,11 +23,10 @@
import javax.xml.namespace.QName;
import javax.xml.validation.Schema;

import com.evolveum.midpoint.prism.PrismContainerValue;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper;
import com.evolveum.midpoint.web.component.prism.ContainerWrapper;
import com.evolveum.midpoint.web.component.prism.ContainerWrapperFactory;
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.web.component.prism.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.lang.StringUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -63,6 +62,7 @@
import com.evolveum.midpoint.web.page.admin.users.dto.UserDtoStatus;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId;
import org.springframework.expression.spel.ast.Assign;

/**
* Created by honchar.
Expand All @@ -75,9 +75,8 @@ public class AbstractRoleAssignmentPanel extends AssignmentPanel {
private static final String ID_SHOW_ALL_ASSIGNMENTS_BUTTON = "showAllAssignmentsButton";


public AbstractRoleAssignmentPanel(String id, IModel<List<ContainerValueWrapper<AssignmentType>>> assignmentsModel,
ContainerWrapper assignmentContainerWrapper){
super(id, assignmentsModel, assignmentContainerWrapper);
public AbstractRoleAssignmentPanel(String id, IModel<ContainerWrapper<AssignmentType>> assignmentContainerWrapperModel){
super(id, assignmentContainerWrapperModel);
}

protected void initCustomLayout(WebMarkupContainer assignmentsContainer){
Expand Down Expand Up @@ -152,17 +151,21 @@ protected <T extends ObjectType> void addSelectedAssignmentsPerformed(AjaxReques
target.add(getPageBase().getFeedbackPanel());
return;
}
ContainerWrapperFactory factory = new ContainerWrapperFactory(getPageBase());
for (T object : assignmentsList){
try {
AssignmentType assignment = ObjectTypeUtil.createAssignmentTo(object.asPrismObject(), relation);
assignment.asPrismContainerValue().applyDefinition(assignmentContainerWrapper.getItem().getDefinition(), false);
ContainerValueWrapper<AssignmentType> newAssignmentContainerWrapper = assignmentContainerWrapper.createItem(false);
newAssignmentContainerWrapper.setStatus(ValueStatus.ADDED);
newAssignmentContainerWrapper.getContainerValue().getValue().setupContainerValue(assignment.asPrismContainerValue());
getModelObject().add(0, newAssignmentContainerWrapper);
} catch (SchemaException ex){
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(object.getOid());
ort.setRelation(SchemaConstants.ORG_DEFAULT);
ort.setType(WebComponentUtil.classToQName(getPageBase().getPrismContext(), object.getClass()));

}

PrismContainerValue<AssignmentType> newAssignment = getModelObject().getItem().createNewValue();
newAssignment.asContainerable().setTargetRef(ort);


ContainerValueWrapper<AssignmentType> valueWrapper = factory.createContainerValueWrapper(getModelObject(), newAssignment,
ValueStatus.ADDED, new ItemPath(FocusType.F_ASSIGNMENT));
getModelObject().getValues().add(valueWrapper);
}

refreshTable(target);
Expand Down
Expand Up @@ -337,7 +337,7 @@ public void onClick(AjaxRequestTarget target, IModel<AssignmentEditorDto> rowMod
@Override
public void populateItem(Item<ICellPopulator<AssignmentEditorDto>> cellItem, String componentId,
final IModel<AssignmentEditorDto> rowModel) {
IModel<String> activationLabelModel = AssignmentsUtil.createActivationTitleModel(rowModel,"", AssignmentDataTablePanel.this);
IModel<String> activationLabelModel = AssignmentsUtil.createActivationTitleModel(rowModel.getObject().getActivation(),"", AssignmentDataTablePanel.this);
cellItem.add(new Label(componentId, StringUtils.isEmpty(activationLabelModel.getObject()) ?
createStringResource("AssignmentEditorPanel.undefined") : activationLabelModel));
}
Expand Down
Expand Up @@ -267,7 +267,7 @@ public boolean isVisible() {
nameLabel.setOutputMarkupId(true);
name.add(nameLabel);

Label activation = new Label(ID_ACTIVATION, AssignmentsUtil.createActivationTitleModel(getModel(), "-", AssignmentEditorPanel.this));
Label activation = new Label(ID_ACTIVATION, AssignmentsUtil.createActivationTitleModel(getModel().getObject().getActivation(), "-", AssignmentEditorPanel.this));
headerRow.add(activation);

ToggleIconButton expandButton = new ToggleIconButton(ID_EXPAND, GuiStyleConstants.CLASS_ICON_EXPAND,
Expand Down

0 comments on commit 776dd7d

Please sign in to comment.