Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Mar 7, 2015
2 parents 1ce7204 + b7c4d2d commit 0bf5b53
Show file tree
Hide file tree
Showing 162 changed files with 17,861 additions and 4,971 deletions.
16 changes: 13 additions & 3 deletions build-system/pom.xml
Expand Up @@ -52,7 +52,7 @@
<jaxb.version>2.2.10-b140310.1920</jaxb.version>
<jaxb-xjc.version>2.2.10-b140310.1920</jaxb-xjc.version>
<junit.version>4.8.2</junit.version>
<opendj.version>2.4.3</opendj.version>
<opendj.version>2.6.2</opendj.version>
<mockito.version>1.10.8</mockito.version>
<quartz.version>2.1.3</quartz.version>
<selenium.version>1.0.1</selenium.version>
Expand All @@ -67,7 +67,7 @@
<jdbc.postgres>9.3-1102-jdbc41</jdbc.postgres>
<jdbc.mysql>5.1.31</jdbc.mysql>
<wicket.version>6.17.0</wicket.version>
<groovy.version>1.8.6</groovy.version>
<groovy.version>2.4.0</groovy.version>
<activiti-engine.version>5.17.0</activiti-engine.version>
<activiti-spring.version>5.17.0</activiti-spring.version>
<commons-email.version>1.3</commons-email.version>
Expand Down Expand Up @@ -150,6 +150,16 @@
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -178,7 +188,7 @@
<dependency>
<groupId>com.sleepycat</groupId>
<artifactId>je</artifactId>
<version>4.1.10</version>
<version>5.0.103</version>
</dependency>
<dependency>
<artifactId>jaxb-api</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions dist/pom.xml
Expand Up @@ -85,14 +85,14 @@
<artifactItem>
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>prism</artifactId>
<version>3.2-SNAPSHOT</version>
<version>${project.version}</version>
<type>jar</type>
<catalog>META-INF/catalog-runtime.xml</catalog>
</artifactItem>
<artifactItem>
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>schema</artifactId>
<version>3.2-SNAPSHOT</version>
<version>${project.version}</version>
<type>jar</type>
<catalog>META-INF/jax-ws-catalog.xml</catalog>
</artifactItem>
Expand Down
Expand Up @@ -59,7 +59,7 @@ public class ObjectPolicyConfigurationEditor extends SimplePanel<List<ObjectPoli

private static final String OPERATION_LOAD_OBJECT_TEMPLATE = DOT_CLASS + "loadObjectTemplate";

private static final String ID_MODAL_WINDOW = "templateConfigModal";
private static final String ID_TEMPLATE_CONFIG_MODAL = "templateConfigModal";

private static final String ID_LABEL = "label";
private static final String ID_REPEATER = "repeater";
Expand Down Expand Up @@ -149,7 +149,7 @@ public String getObject() {
}

private void initDialog(){
ModalWindow editor = new ObjectPolicyDialog(ID_MODAL_WINDOW, null){
ModalWindow editor = new ObjectPolicyDialog(ID_TEMPLATE_CONFIG_MODAL, null){

@Override
protected void savePerformed(AjaxRequestTarget target){
Expand Down Expand Up @@ -299,7 +299,7 @@ private void removePerformed(AjaxRequestTarget target, ListItem item){
}

private void editPerformed(AjaxRequestTarget target, ListItem item){
ObjectPolicyDialog window = (ObjectPolicyDialog) get(ID_MODAL_WINDOW);
ObjectPolicyDialog window = (ObjectPolicyDialog) get(ID_TEMPLATE_CONFIG_MODAL);
window.updateModel(target, (ObjectPolicyConfigurationTypeDto)item.getModelObject());
window.show(target);
}
Expand Down
Expand Up @@ -100,14 +100,9 @@ protected DropDownChoice createDropDown(String id, IModel<List<T>> choices, ICho
boolean required) {
DropDownChoice choice = new DropDownChoice<T>(id, getModel(), choices, renderer){

@Override
protected CharSequence getDefaultChoice(String selectedValue) {
return getString("DropDownChoicePanel.notDefined");
}

@Override
protected String getNullValidDisplayValue() {
return getString("DropDownChoicePanel.notDefined");
return getString("DropDownChoicePanel.empty");
}
};
choice.setNullValid(!required);
Expand Down
Expand Up @@ -14,6 +14,4 @@
# limitations under the License.
#

DropDownChoicePanel.notDefined=Undefined
nullValid=Choose one
select.null=Choose one
DropDownChoicePanel.empty=Choose one
Expand Up @@ -24,7 +24,6 @@
import com.evolveum.midpoint.prism.Objectable;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.match.MatchingRuleRegistry;
import com.evolveum.midpoint.report.api.ReportManager;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
Expand All @@ -39,6 +38,8 @@
import com.evolveum.midpoint.web.security.SecurityUtils;
import com.evolveum.midpoint.web.security.WebApplicationConfiguration;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.validation.MidpointFormValidatorImpl;
import com.evolveum.midpoint.web.util.validation.MidpointFormValidatorRegistry;
import com.evolveum.midpoint.wf.api.WorkflowManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import org.apache.commons.lang.Validate;
Expand All @@ -48,7 +49,6 @@
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

Expand Down Expand Up @@ -81,6 +81,8 @@ public abstract class PageBase extends PageTemplate {
private ReportManager reportManager;
@SpringBean(name = "accessDecisionManager")
private SecurityEnforcer securityEnforcer;
@SpringBean
private MidpointFormValidatorRegistry formValidatorRegistry;

public PageBase(PageParameters parameters) {
super(parameters);
Expand Down Expand Up @@ -148,6 +150,10 @@ protected ModelDiagnosticService getModelDiagnosticService() {
return modelDiagnosticService;
}

public MidpointFormValidatorRegistry getFormValidatorRegistry() {
return formValidatorRegistry;
}

public static StringResourceModel createStringResourceStatic(Component component, String resourceKey, Object... objects) {
return new StringResourceModel(resourceKey, component, new Model<String>(), resourceKey, objects);
}
Expand Down
Expand Up @@ -32,9 +32,13 @@ public class PageInternals extends PageAdminConfiguration {

private static final Trace LOGGER = TraceManager.getTrace(PageInternals.class);

private static final String ID_MAIN_FORM = "mainForm";
private static final String ID_OFFSET = "offset";
private static final String ID_BUTTON_SAVE = "save";
private static final String ID_BUTTON_RESET = "reset";
private static final String ID_DEBUG_UTIL_FORM = "debugUtilForm";
private static final String ID_SAVE_DEBUG_UTIL = "saveDebugUtil";
private static final String ID_INTERNALS_CONFIGFORM = "internalsConfigForm";
private static final String ID_INTERNALS_CONFIG_FORM = "internalsConfigForm";
private static final String ID_UPDATE_INTERNALS_CONFIG = "updateInternalsConfig";
private static final String ID_CONSISTENCY_CHECKS = "consistencyChecks";
private static final String ID_ENCRYPTION_CHECKS = "encryptionChecks";
Expand All @@ -52,26 +56,28 @@ public class PageInternals extends PageAdminConfiguration {
private IModel<InternalsConfigDto> internalsModel;

public PageInternals() {
initLayout();
}

private void initLayout() {
model = new LoadableModel<XMLGregorianCalendar>() {

@Override
protected XMLGregorianCalendar load() {
return clock.currentTimeXMLGregorianCalendar();
}
};

internalsModel = new Model<>(new InternalsConfigDto());

Form mainForm = new Form("mainForm");
initLayout();
}

private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);

DatePanel offset = new DatePanel("offset", model);
DatePanel offset = new DatePanel(ID_OFFSET, model);
mainForm.add(offset);

AjaxSubmitButton saveButton = new AjaxSubmitButton("save", createStringResource("PageInternals.button.changeTime")) {
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("PageInternals.button.changeTime")) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
Expand All @@ -85,7 +91,7 @@ protected void onError(AjaxRequestTarget target, Form<?> form) {
};
mainForm.add(saveButton);

AjaxSubmitButton resetButton = new AjaxSubmitButton("reset", createStringResource("PageInternals.button.resetTimeChange")) {
AjaxSubmitButton resetButton = new AjaxSubmitButton(ID_BUTTON_RESET, createStringResource("PageInternals.button.resetTimeChange")) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
Expand All @@ -105,6 +111,7 @@ protected void onError(AjaxRequestTarget target, Form<?> form) {

private void initDebugUtilForm() {
Form form = new Form(ID_DEBUG_UTIL_FORM);
form.setOutputMarkupId(true);
add(form);

CheckFormGroup detailed = new CheckFormGroup(ID_DETAILED_DEBUG_DUMP,
Expand All @@ -117,9 +124,7 @@ private void initDebugUtilForm() {

@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
internalsModel.getObject().saveDebugUtil();

LOGGER.trace("Updated debug util, detailedDebugDump={}", DebugUtil.isDetailedDebugDump());
updateDebugPerformed(target);
}

@Override
Expand All @@ -131,7 +136,8 @@ protected void onError(AjaxRequestTarget target, Form<?> form) {
}

private void initInternalsConfigForm() {
Form form = new Form(ID_INTERNALS_CONFIGFORM);
Form form = new Form(ID_INTERNALS_CONFIG_FORM);
form.setOutputMarkupId(true);
add(form);

CheckFormGroup consistency = new CheckFormGroup(ID_CONSISTENCY_CHECKS,
Expand All @@ -156,11 +162,7 @@ private void initInternalsConfigForm() {

@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
internalsModel.getObject().saveInternalsConfig();

LOGGER.trace("Updated internals config, consistencyChecks={},encryptionChecks={},readEncryptionChecks={}",
new Object[]{InternalsConfig.consistencyChecks, InternalsConfig.encryptionChecks,
InternalsConfig.readEncryptionChecks});
updateInternalConfig(target);
}

@Override
Expand All @@ -171,6 +173,37 @@ protected void onError(AjaxRequestTarget target, Form<?> form) {
form.add(update);
}

private Form getMainForm(){
return (Form) get(ID_MAIN_FORM);
}

private Form getDebugUtilForm(){
return (Form) get(ID_DEBUG_UTIL_FORM);
}

private Form getInternalsConfigForm(){
return (Form) get(ID_INTERNALS_CONFIG_FORM);
}

private void updateDebugPerformed(AjaxRequestTarget target){
internalsModel.getObject().saveDebugUtil();

LOGGER.trace("Updated debug util, detailedDebugDump={}", DebugUtil.isDetailedDebugDump());
success(getString("PageInternals.message.debugUpdatePerformed", DebugUtil.isDetailedDebugDump()));
target.add(getFeedbackPanel(), getDebugUtilForm());
}

private void updateInternalConfig(AjaxRequestTarget target){
internalsModel.getObject().saveInternalsConfig();

LOGGER.trace("Updated internals config, consistencyChecks={},encryptionChecks={},readEncryptionChecks={}",
new Object[]{InternalsConfig.consistencyChecks, InternalsConfig.encryptionChecks,
InternalsConfig.readEncryptionChecks});
success(getString("PageInternals.message.internalsConfigUpdate", InternalsConfig.consistencyChecks,
InternalsConfig.encryptionChecks, InternalsConfig.readEncryptionChecks));
target.add(getFeedbackPanel(), getInternalsConfigForm());
}

private void savePerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(PageInternals.class.getName() + ".changeTime");
XMLGregorianCalendar offset = model.getObject();
Expand All @@ -180,8 +213,7 @@ private void savePerformed(AjaxRequestTarget target) {

result.recordSuccess();
showResult(result);
target.add(getFeedbackPanel());

target.add(getFeedbackPanel(), getMainForm());
}

private void resetPerformed(AjaxRequestTarget target) {
Expand All @@ -190,7 +222,7 @@ private void resetPerformed(AjaxRequestTarget target) {
model.reset();
result.recordSuccess();
showResult(result);
target.add(this);
target.add(getMainForm());
target.add(getFeedbackPanel());
}
}
Expand Up @@ -25,5 +25,6 @@ PageInternals.checkEncryption=Check encryption
PageInternals.checkReadEncrypion=Check read encryption
PageInternals.tolerateUndeclaredPrefixes=Tolerate undeclared prefixes in QNames and paths
PageInternals.detailedDebugDump=Detailed debug dump

PageInternals.message.debugUpdatePerformed=Debug util updated. New value: {0}
PageInternals.message.internalsConfigUpdate=Internals config update. consistencyChecks: {0},encryptionChecks: {1}, readEncryptionChecks: {2}

Expand Up @@ -35,6 +35,7 @@ <h3 style="margin-left: 20px;">
<div class="form-group">
<label class="col-lg-4 control-label">
<wicket:message key="SystemConfigPanel.title.userTemplate"/>
<i wicket:id="userTemplateDeprecatedWarning" wicket:message="title:SystemConfigPanel.deprecated.objectPolicy"/>
</label>
<div wicket:id="userTemplateChooser" />
</div>
Expand Down
Expand Up @@ -54,6 +54,7 @@ public class SystemConfigPanel extends SimplePanel<SystemConfigurationDto> {
private static final String ID_CLEANUP_CLOSED_TASKS = "closedTasksCleanup";
private static final String ID_CLEANUP_AUDIT_RECORDS_TOOLTIP = "auditRecordsCleanupTooltip";
private static final String ID_CLEANUP_CLOSED_TASKS_TOOLTIP = "closedTasksCleanupTooltip";
private static final String ID_OBJECT_POLICY_DEPRECATED_WARNING = "userTemplateDeprecatedWarning";

private static final String ID_DEFAULT_FROM = "defaultFrom";
private static final String ID_DEBUG = "debugCheckbox";
Expand Down Expand Up @@ -90,12 +91,25 @@ protected void initLayout(){

ChooseTypePanel passPolicyChoosePanel = new ChooseTypePanel(ID_GLOBAL_PASSWORD_POLICY_CHOOSER,
new PropertyModel<ObjectViewDto>(getModel(), SystemConfigurationDto.F_PASSWORD_POLICY));

// TODO - remove this before 3.2 release, this is kept only for compatibility reasons. ObjectPolicyConfigurationEditor
// is new incarnation of this deprecated config option.
ChooseTypePanel userTemplateChoosePanel = new ChooseTypePanel(ID_GLOBAL_USER_TEMPLATE_CHOOSER,
new PropertyModel<ObjectViewDto>(getModel(), SystemConfigurationDto.F_OBJECT_TEMPLATE));

form.add(passPolicyChoosePanel);
form.add(userTemplateChoosePanel);

Label objectPolicyDeprecationWarningTooltip = new Label(ID_OBJECT_POLICY_DEPRECATED_WARNING);
objectPolicyDeprecationWarningTooltip.add(new InfoTooltipBehavior(){

@Override
public String getCssClass() {
return "fa fa-fw fa-exclamation-triangle text-danger";
}
});
form.add(objectPolicyDeprecationWarningTooltip);

ObjectPolicyConfigurationEditor objectPolicyEditor = new ObjectPolicyConfigurationEditor(ID_OBJECT_POLICY_EDITOR,
new PropertyModel<List<ObjectPolicyConfigurationTypeDto>>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
form.add(objectPolicyEditor);
Expand Down
Expand Up @@ -41,4 +41,5 @@ SystemConfigPanel.mail.transportSecurity=Transport security
SystemConfigPanel.notification.redirectToFile=Redirect to file
SystemConfigPanel.notification.redirectToFile.placeholder=Filename
SystemConfigPanel.tooltip.duration=Format: P[n][p], n-number, p-period (d - days, m - months, ...), P3M - cleanup every 3 months
SystemConfigPanel.deprecated.objectPolicy=This part of configuration is deprecated. It is kept here for compatibility purposes. Please, use the component below to define object policies.
mainForm.mailServer.nullValid=Choose One

0 comments on commit 0bf5b53

Please sign in to comment.