Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Nov 13, 2017
2 parents c5d79d8 + 16a3e3f commit 1424c87
Show file tree
Hide file tree
Showing 185 changed files with 4,250 additions and 2,716 deletions.
2 changes: 2 additions & 0 deletions dist/src/main/bin/stop.bat
@@ -0,0 +1,2 @@
echo "Stopping midPoint"
FOR /F "usebackq tokens=5" %%i IN (`netstat -aon ^| find "8080"`) DO taskkill /F /PID %%i
4 changes: 3 additions & 1 deletion dist/src/main/bin/stop.sh
@@ -1 +1,3 @@
TODO
#!/bin/bash
echo "Stopping midPoint"
jps -v | grep midpoint.war | awk '{print $1}' | xargs kill -9
11 changes: 0 additions & 11 deletions gui/admin-gui/pom.xml
Expand Up @@ -717,17 +717,6 @@
<version>3.7-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.tools</groupId>
<artifactId>test-ng</artifactId>
Expand Down
Expand Up @@ -99,7 +99,7 @@ public ObjectListPanel(String id, Class<? extends O> defaultType, TableId tableI
* @param defaultType specifies type of the object that will be selected by default. It can be changed.
*/
ObjectListPanel(String id, Class<? extends O> defaultType, boolean multiselect, PageBase parentPage) {
this(id, defaultType, null, false, parentPage, null);
this(id, defaultType, null, multiselect, parentPage, null);
}

public ObjectListPanel(String id, Class<? extends O> defaultType, Collection<SelectorOptions<GetOperationOptions>> options,
Expand Down Expand Up @@ -134,7 +134,7 @@ public List<O> getSelectedObjects() {
}

private void initLayout() {
Form<O> mainForm = new Form<O>(ID_MAIN_FORM);
Form<O> mainForm = new com.evolveum.midpoint.web.component.form.Form<O>(ID_MAIN_FORM);
add(mainForm);

searchModel = initSearchModel();
Expand Down
Expand Up @@ -17,12 +17,14 @@
<body>
<wicket:panel>
<div class="feedback-message box box-solid" wicket:id="detailsBox">
<div class="box-header with-border">
<div class="box-header">
<i class="icon fa " wicket:id="iconType"></i>
<b class="box-title" wicket:id="message">
</b>
<div class="box-tools pull-right">
<div wicket:id="close" data-widget="remove" class="btn btn-box-tool fa fa-times"></div>
<div wicket:id="close" data-widget="remove" class="btn btn-box-tool">
<i class="fa fa-times"/>
</div>
</div>
</div>

Expand Down
Expand Up @@ -121,8 +121,6 @@ public void onClick(AjaxRequestTarget target) {
};

box.add(close);


}

public void close(AjaxRequestTarget target){
Expand Down
Expand Up @@ -18,12 +18,10 @@

import com.evolveum.midpoint.gui.impl.util.ReportPeerQueryInterceptor;
import com.evolveum.midpoint.prism.schema.CatalogImpl;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
import com.evolveum.midpoint.web.util.MidPointProfilingServletFilter;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.apache.wicket.Application;
import org.apache.wicket.protocol.http.WicketFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
Expand Down Expand Up @@ -81,7 +79,8 @@
PropertyPlaceholderAutoConfiguration.class,
SecurityAutoConfiguration.class,
SecurityFilterAutoConfiguration.class,
ServerPropertiesAutoConfiguration.class
ServerPropertiesAutoConfiguration.class,
MultipartAutoConfiguration.class
})
@SpringBootConfiguration
public class MidPointSpringApplication extends SpringBootServletInitializer {
Expand Down
Expand Up @@ -16,6 +16,9 @@

package com.evolveum.midpoint.web.boot;

import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.web.util.validation.MidpointFormValidatorRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
Expand All @@ -24,4 +27,13 @@
@Configuration
public class WebConfig {

@Bean
public MidPointApplication midpointApplication() {
return new MidPointApplication();
}

@Bean
public MidpointFormValidatorRegistry midpointFormValidatorRegistry() {
return new MidpointFormValidatorRegistry();
}
}
Expand Up @@ -49,7 +49,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AuthenticationProvider authenticationProvider;

@Value("${auth.logout.url}")
@Value("${security.enable-csrf:true}")
private boolean csrfEnabled;
@Value("${auth.logout.url:/}")
private String authLogoutUrl;

@Bean
Expand Down Expand Up @@ -118,7 +120,10 @@ protected void configure(HttpSecurity http) throws Exception {
http.exceptionHandling()
.authenticationEntryPoint(wicketAuthenticationEntryPoint());

http.csrf().disable();
if (!csrfEnabled) {
http.csrf().disable();
}

http.headers().disable();
}

Expand Down
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.xml.namespace.QName;
import javax.xml.validation.Schema;
Expand All @@ -27,6 +28,9 @@
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.*;
import com.evolveum.midpoint.web.page.admin.PageAdminFocus;
import com.evolveum.midpoint.web.page.admin.users.component.AssignmentPreviewDialog;
import com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto;
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 @@ -132,8 +136,16 @@ private DropDownChoicePanel<RelationTypes> getRelationPanel() {
}


protected void showAllAssignments(AjaxRequestTarget target) {
}
protected void showAllAssignments(AjaxRequestTarget target) {
PageBase pageBase = getPageBase();
List<AssignmentsPreviewDto> previewAssignmentsList = new ArrayList<>();
if (pageBase instanceof PageAdminFocus){
previewAssignmentsList = ((PageAdminFocus) pageBase).recomputeAssignmentsPerformed(target);
}
AssignmentPreviewDialog assignmentPreviewDialog = new AssignmentPreviewDialog(pageBase.getMainPopupBodyId(), previewAssignmentsList,
new ArrayList<>(), pageBase);
pageBase.showMainPopup(assignmentPreviewDialog, target);
}

@Override
protected void newAssignmentClickPerformed(AjaxRequestTarget target) {
Expand Down
Expand Up @@ -56,7 +56,7 @@ protected void initLayout() {
popover.setOutputMarkupId(true);
add(popover);

Form form = new Form(ID_FORM);
Form form = new com.evolveum.midpoint.web.component.form.Form(ID_FORM);
popover.add(form);

AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
Expand Down
Expand Up @@ -95,7 +95,7 @@ private void initPopoverLayout() {
popover.setOutputMarkupId(true);
add(popover);

Form form = new Form(ID_FORM);
Form form = new com.evolveum.midpoint.web.component.form.Form(ID_FORM);
popover.add(form);

AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
Expand Down
Expand Up @@ -16,57 +16,48 @@

package com.evolveum.midpoint.web.component.form;

import com.evolveum.midpoint.web.security.SecurityUtils;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.Response;


/**
* @author shood
* @author Radovan Semancik
* @author Viliam Repan (lazyman)
* @author shood
* @author Radovan Semancik
*/
public class Form<T> extends org.apache.wicket.markup.html.form.Form<T> {

private boolean addFakeInputFields = false;

public Form(String id) {
super(id);
}

public Form(String id, final IModel<T> model) {
super(id);
super(id);
}

/**
* Use this constructor when a form needs to display empty input field:
* &lt;input style="display:none"&gt;
* &lt;input type="password" style="display:none"&gt;
*
* To overcome Chrome auto-completion of password and other form fields
* Use this constructor when a form needs to display empty input field:
* &lt;input style="display:none"&gt;
* &lt;input type="password" style="display:none"&gt;
* <p>
* To overcome Chrome auto-completion of password and other form fields
*/
public Form(String id, boolean addFakeInputFields){
public Form(String id, boolean addFakeInputFields) {
super(id);
this.addFakeInputFields = addFakeInputFields;
}

public boolean isAddFakeInputFields() {
return addFakeInputFields;
}

public void setAddFakeInputFields(boolean addFakeInputFields) {
this.addFakeInputFields = addFakeInputFields;
}

@Override
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
super.onComponentTagBody(markupStream, openTag);

Response resp = getResponse();

// add hidden input for CSRF
SecurityUtils.appendHiddenInputForCsrf(resp);

if (addFakeInputFields) {
final Response response = getResponse();
response.write("<input style=\"display:none\">\n" +
"<input type=\"password\" style=\"display:none\">");
resp.write("<input style=\"display:none\">\n<input type=\"password\" style=\"display:none\">");
}
}

}
Expand Up @@ -18,6 +18,7 @@

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.util.logging.LoggingUtils;
Expand Down Expand Up @@ -78,7 +79,7 @@ public class ExpressionEditorPanel extends BasePanel<ExpressionType> {
private IModel<ExpressionTypeDto> dtoModel;
private Map<String, String> policyMap = new HashMap<>();

public ExpressionEditorPanel(String id, IModel<ExpressionType> model, PageResourceWizard parentPage) {
public ExpressionEditorPanel(String id, IModel<ExpressionType> model, PageBase parentPage) {
super(id, model);
initLayout(parentPage);
}
Expand All @@ -98,9 +99,7 @@ protected ExpressionTypeDto load() {
}
}

protected void initLayout(PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);

protected void initLayout(PageBase parentPage) {
setOutputMarkupId(true);

loadDtoModel();
Expand Down Expand Up @@ -216,7 +215,10 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
Label updateLabel = new Label(ID_LABEL_UPDATE, createStringResource(getUpdateLabelKey()));
updateLabel.setRenderBodyOnly(true);
update.add(updateLabel);
parentPage.addEditingVisibleBehavior(update);
if (parentPage instanceof PageResourceWizard) {
((PageResourceWizard)parentPage).addEditingEnabledBehavior(this);
((PageResourceWizard)parentPage).addEditingVisibleBehavior(update);
}
add(update);

add(WebComponentUtil.createHelp(ID_T_TYPE));
Expand Down
Expand Up @@ -26,6 +26,8 @@
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.component.input.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.lang.ClassUtils;
import org.apache.commons.lang.Validate;
import org.apache.wicket.AttributeModifier;
Expand Down Expand Up @@ -82,27 +84,11 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.LockoutStatusPanel;
import com.evolveum.midpoint.web.component.form.ValueChoosePanel;
import com.evolveum.midpoint.web.component.input.DatePanel;
import com.evolveum.midpoint.web.component.input.TextAreaPanel;
import com.evolveum.midpoint.web.component.input.TextPanel;
import com.evolveum.midpoint.web.component.input.TriStateComboPanel;
import com.evolveum.midpoint.web.component.input.UploadDownloadPanel;
import com.evolveum.midpoint.web.component.model.delta.DeltaDto;
import com.evolveum.midpoint.web.component.model.delta.ModificationsPanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.model.LookupPropertyModel;
import com.evolveum.midpoint.web.util.DateValidator;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPoliciesType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LockoutStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableRowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import com.evolveum.prism.xml.ns._public.query_3.QueryType;
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
Expand Down Expand Up @@ -446,6 +432,9 @@ private Panel createTypedInputComponent(String id) {
return new LockoutStatusPanel(id, valueWrapperModel.getObject(),
new PropertyModel<LockoutStatusType>(valueWrapperModel, baseExpression));
}
if (ExpressionType.COMPLEX_TYPE.equals(valueType)) {
return new ExpressionEditorPanel(id, new PropertyModel<ExpressionType>(valueWrapperModel, baseExpression), pageBase);
}

if (DOMUtil.XSD_DATETIME.equals(valueType)) {
panel = new DatePanel(id, new PropertyModel<XMLGregorianCalendar>(valueWrapperModel, baseExpression));
Expand Down
Expand Up @@ -176,7 +176,7 @@ protected void createBreadcrumb() {
}

private void initLayout() {
Form mainForm = new Form("mainForm");
Form mainForm = new com.evolveum.midpoint.web.component.form.Form("mainForm");
mainForm.setMultiPart(true);
add(mainForm);

Expand Down
Expand Up @@ -37,7 +37,7 @@ public SearchFormPanel(String id, IModel<Search> model) {
}

protected void initLayout() {
final Form searchForm = new Form(ID_SEARCH_FORM);
final Form searchForm = new com.evolveum.midpoint.web.component.form.Form(ID_SEARCH_FORM);
add(searchForm);
searchForm.setOutputMarkupId(true);

Expand Down
Expand Up @@ -130,7 +130,7 @@ protected MoreDialogDto load() {
}
};

Form form = new Form(ID_FORM);
Form form = new com.evolveum.midpoint.web.component.form.Form(ID_FORM);
add(form);

ListView items = new ListView<SearchItem>(ID_ITEMS,
Expand Down
Expand Up @@ -44,7 +44,7 @@ public Wizard(String id, IModel<IWizardModel> model, @NotNull NonEmptyModel<Wiza
}

protected void initLayout() {
Form form = new Form(ID_FORM);
Form form = new com.evolveum.midpoint.web.component.form.Form(ID_FORM);
add(form);

IModel<List<WizardStepDto>> stepsModel = new LoadableModel<List<WizardStepDto>>() {
Expand Down

0 comments on commit 1424c87

Please sign in to comment.