Skip to content

Commit

Permalink
Merge branch 'post-3.7-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Feb 16, 2018
2 parents 30e1533 + 1e22a1f commit 6e49c9c
Show file tree
Hide file tree
Showing 30 changed files with 771 additions and 295 deletions.
Expand Up @@ -53,9 +53,7 @@
import com.evolveum.midpoint.schema.util.LocalizationUtil;
import com.evolveum.midpoint.util.*;
import com.evolveum.midpoint.web.component.data.SelectableBeanObjectDataProvider;
import com.evolveum.midpoint.web.component.prism.InputPanel;
import com.evolveum.midpoint.web.component.prism.ItemWrapper;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.prism.*;
import com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.collections4.CollectionUtils;
Expand Down Expand Up @@ -835,6 +833,22 @@ public List<DisplayableValue> getObject() {
}


public static <IW extends ItemWrapper, C extends Containerable> PropertyModel createPrismPropertySingleValueModel(IModel<ContainerValueWrapper<C>> containerModel,
QName attributeName){
//todo should be refactored: wrap with some new model
PropertyModel<List<IW>> propertiesModel = new PropertyModel<>(containerModel, "properties");
List<IW> propertiesList = propertiesModel.getObject();
for (final IW property : propertiesList){
if (property.getName().equals(attributeName)){
List<ValueWrapper> valuesList = property.getValues();
if (valuesList.size() == 1) {
return new PropertyModel<>(valuesList.get(0).getValue(), "value");
}

}
}
return null;
}

private static List<DisplayableValue> getDisplayableValues(PrismPropertyDefinition def) {
List<DisplayableValue> values = null;
Expand Down
Expand Up @@ -21,127 +21,6 @@
<div wicket:id="specificContainers" />
<div class="container-fluid prism-object" wicket:id="basicAssignmentPanel" />
<div class="container-fluid prism-object" wicket:id="activationPanel" />

<!-- <div class="box-body" > -->
<!-- <div class="container-fluid prism-object"> -->

<!-- <div class="row"> -->
<!-- <div class="container-fluid prism-container"> -->
<!-- <div wicket:id="displayName"/> -->
<!-- <div class="row prism-header"> -->
<!-- <span class="prism-title"> -->
<!-- <wicket:message key="AbstractAssignmentDetailsPanel.properties"/> -->
<!-- </span> -->
<!-- </div> -->

<!-- <div wicket:id="propertiesPanel" class="prism-properties"> -->



<!-- <div wicket:id="descriptionContainer" > -->
<!-- <div class="row prism-property"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.description"/></span> -->
<!-- </div> -->
<!-- <div class="col-xs-8"> -->
<!-- <div class="row"> -->
<!-- <div class="col-xs-9"> -->
<!-- <textarea class="form-control input-sm" rows="2" wicket:id="description"></textarea> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div class="stripe"> -->
<!-- <div class="row prism-property" wicket:id="relationContainer"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.relation"/></span> -->
<!-- </div> -->
<!-- <div class="col-xs-8"> -->
<!-- <div class="row"> -->
<!-- <div class="col-xs-9"> -->
<!-- <div wicket:id="relation" /> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div wicket:id="focusTypeContainer" > -->
<!-- <div class="row prism-property"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.focusType"/></span> -->
<!-- </div> -->
<!-- <div class="col-xs-8"> -->
<!-- <div class="row"> -->
<!-- <div class="col-xs-9"> -->
<!-- <span wicket:id="focusType"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div> -->
<!-- <div class="row prism-property" wicket:id="tenantContainer"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.tenantRef" /></span> -->
<!-- </div> -->
<!-- <div wicket:id="tenant"/> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div class="stripe"> -->
<!-- <div class="row prism-property" wicket:id="projectContainer"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.orgRef" /></span> -->
<!-- </div> -->
<!-- <div wicket:id="project"/> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div class="row prism-property"> -->
<!-- <div class="col-xs-8"> -->
<!-- <div class="row"> -->
<!-- <div class="col-xs-9"> -->
<!-- <span wicket:id="policyRule"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div wicket:id="policySituations" > -->
<!-- <div class="row prism-property"> -->
<!-- <div class="col-xs-4"> -->
<!-- <span><wicket:message key="AssignmentEditorPanel.focusType"/></span> -->
<!-- </div> -->
<!-- <div class="col-xs-8"> -->
<!-- <div class="row"> -->
<!-- <div class="col-xs-9"> -->
<!-- <span wicket:id="policySituations"> -->
<!-- <div wicket:id="policySituation"/> -->
<!-- </span > -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

<!-- </div> -->



<!-- <div class="row"> -->
<!-- <div class="container-fluid prism-container"> -->
<!-- <div wicket:id="activationPanel" /> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
</wicket:panel>
</wicket:panel>
</body>
</html>
@@ -0,0 +1,61 @@
<!--
~ 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.
-->

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="box-body">
<div class="container-fluid prism-object">

<div class="row">
<label class="col-md-1 pull-left"><h4>
<wicket:message key="AssociationDetailsPanel.AssociationHeader" />
</h4></label>
<button wicket:id="removeAssociation" wicket:message="title:PrismObjectPanel.deleteContainer"
class="btn btn-box-tool" trigger="hover"><i class="fa fa-minus-circle"></i></button>
</div>
<div class="row">
<div class="container-fluid prism-container">
<div class="prism-properties">

<div>
<div class="row prism-property">
<div class="col-xs-3">
<span><wicket:message key="ResourceObjectAssociationType.ref"/></span>
</div>
<div class="col-xs-8">
<div wicket:id="refField"/>
</div>
</div>
</div>
<div class="stripe">
<div class="row prism-property">
<div class="col-xs-3">
<span><wicket:message key="AssociationDetailsPanel.expressionPanel"/></span>
</div>
<div class="col-xs-8">
<div wicket:id="expressionPanel"/>
</div>
</div>
</div>

</div>
</div>
</div>
</div>
</div>
</wicket:panel>
</html>
@@ -0,0 +1,102 @@
/**
* Copyright (c) 2015-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.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.component.togglebutton.ToggleIconButton;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.web.component.input.ExpressionValuePanel;
import com.evolveum.midpoint.web.component.input.QNameEditorPanel;
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper;
import com.evolveum.midpoint.web.component.prism.ContainerWrapper;
import com.evolveum.midpoint.web.component.prism.PrismContainerValueHeaderPanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

import javax.xml.namespace.QName;
import java.util.List;

/**
* Created by honchar
*/
public class AssociationDetailsPanel extends BasePanel<ContainerValueWrapper<ResourceObjectAssociationType>>{
private static final long serialVersionUID = 1L;

private static final String ID_REF_FIELD = "refField";
private static final String ID_EXPRESSION_PANEL = "expressionPanel";
private static final String ID_REMOVE_ASSOCIATION = "removeAssociation";

private ConstructionType construction;

public AssociationDetailsPanel(String id, IModel<ContainerValueWrapper<ResourceObjectAssociationType>> associationWrapperModel,
ConstructionType construction){
super(id, associationWrapperModel);
this.construction = construction;
}

@Override
protected void onInitialize(){
super.onInitialize();
initLayout();
}

private void initLayout(){
QNameEditorPanel refField = new QNameEditorPanel(ID_REF_FIELD, WebComponentUtil.createPrismPropertySingleValueModel(getModel(), ResourceObjectAssociationType.F_REF),
null, null, false, false){
private static final long serialVersionUID = 1L;
@Override
protected AttributeAppender getSpecificLabelStyleAppender() {
return AttributeAppender.append("style", "font-weight: normal !important;");
}
};
refField.setOutputMarkupId(true);
add(refField);

ResourceObjectAssociationType resourceObjectAssociationType = getModelObject().getContainerValue().asContainerable();
MappingType outbound = resourceObjectAssociationType.getOutbound();
ExpressionValuePanel expressionValuePanel = new ExpressionValuePanel(ID_EXPRESSION_PANEL,
new PropertyModel<ExpressionType>(outbound, MappingType.F_EXPRESSION.getLocalPart()),
construction, getPageBase());
expressionValuePanel.setOutputMarkupId(true);
add(expressionValuePanel);

ToggleIconButton removeAssociationButton = new ToggleIconButton(ID_REMOVE_ASSOCIATION,
GuiStyleConstants.CLASS_MINUS_CIRCLE_DANGER, GuiStyleConstants.CLASS_MINUS_CIRCLE_DANGER) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
// isChildContainersSelectorPanelVisible = true;
// target.add(PrismContainerValueHeaderPanel.this);
}

@Override
public boolean isOn() {
return true;
}
};
add(removeAssociationButton);


}
}
@@ -0,0 +1,57 @@
<!--
~ 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.
-->

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="box-body">
<div class="container-fluid prism-object">

<div class="row">
<div class="container-fluid prism-container">
<div class="prism-properties">

<div>
<div class="row prism-property">
<div class="col-xs-3">
<span><wicket:message key="ConstructionType.kind"/></span>
</div>
<div class="col-xs-8">
<div wicket:id="kindField"/>
</div>
</div>
</div>
<div class="stripe">
<div class="row prism-property">
<div class="col-xs-3">
<span><wicket:message key="ConstructionType.intent"/></span>
</div>
<div class="col-xs-8">
<div wicket:id="intentField"/>
</div>
</div>
</div>

</div>
</div>
</div>
</div>
</div>
<div wicket:id="associationContainer" >
<div wicket:id="association" />
</div>
</wicket:panel>
</html>

0 comments on commit 6e49c9c

Please sign in to comment.