Search in sources :

Example 6 with AppenderConfiguration

use of com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration in project midpoint by Evolveum.

the class LoggingConfigPanel method addConsoleAppenderPerformed.

private void addConsoleAppenderPerformed(AjaxRequestTarget target) {
    LoggingDto dto = getModel().getObject();
    AppenderConfiguration appender = new AppenderConfiguration(new AppenderConfigurationType());
    appender.setEditing(true);
    dto.getAppenders().add(appender);
    target.add(getAppendersTable());
}
Also used : FileAppenderConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.FileAppenderConfigurationType) AppenderConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AppenderConfigurationType) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) LoggingDto(com.evolveum.midpoint.web.page.admin.configuration.dto.LoggingDto)

Example 7 with AppenderConfiguration

use of com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration in project midpoint by Evolveum.

the class LoggingConfigPanel method initAppenderColumns.

private List<IColumn<AppenderConfiguration, String>> initAppenderColumns() {
    List<IColumn<AppenderConfiguration, String>> columns = new ArrayList<>();
    IColumn column = new CheckBoxHeaderColumn<AppenderConfiguration>();
    columns.add(column);
    //name columns (editable)
    column = new EditableLinkColumn<AppenderConfiguration>(createStringResource("LoggingConfigPanel.appenders.name"), "name") {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<AppenderConfiguration> rowModel) {
            appenderEditPerformed(target, rowModel);
        }

        @Override
        protected Component createInputPanel(String componentId, IModel<AppenderConfiguration> model) {
            TextPanel<String> panel = new TextPanel<String>(componentId, new PropertyModel(model, getPropertyExpression()));
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    columns.add(column);
    //pattern column (editable)
    column = new EditablePropertyColumn(createStringResource("LoggingConfigPanel.appenders.pattern"), "pattern") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            InputPanel panel = super.createInputPanel(componentId, model);
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    columns.add(column);
    //file path column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePath"), "filePath");
    columns.add(column);
    //file pattern column (editable)                                                                               jj
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePattern"), "filePattern");
    columns.add(column);
    //max history column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxHistory"), "maxHistory") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            TextPanel panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
            FormComponent component = panel.getBaseFormComponent();
            component.add(new AttributeModifier("size", 5));
            component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            addAjaxFormComponentUpdatingBehavior(component);
            return panel;
        }
    };
    columns.add(column);
    //max file size column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxFileSize"), "maxFileSize") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            TextPanel<String> panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
            FormComponent component = panel.getBaseFormComponent();
            component.add(new AttributeModifier("size", 5));
            component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            component.add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(component);
            return panel;
        }
    };
    columns.add(column);
    CheckBoxColumn check = new EditableCheckboxColumn(createStringResource("LoggingConfigPanel.appenders.appending"), "appending") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            InputPanel panel = super.createInputPanel(componentId, model);
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    check.setEnabled(false);
    columns.add(check);
    return columns;
}
Also used : FormComponent(org.apache.wicket.markup.html.form.FormComponent) ArrayList(java.util.ArrayList) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn) EditablePropertyColumn(com.evolveum.midpoint.web.component.data.column.EditablePropertyColumn) Component(org.apache.wicket.Component) FormComponent(org.apache.wicket.markup.html.form.FormComponent) IModel(org.apache.wicket.model.IModel) InputPanel(com.evolveum.midpoint.web.component.prism.InputPanel) PropertyModel(org.apache.wicket.model.PropertyModel) NotNullValidator(com.evolveum.midpoint.web.component.input.validator.NotNullValidator) AttributeModifier(org.apache.wicket.AttributeModifier) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) EditableCheckboxColumn(com.evolveum.midpoint.web.component.data.column.EditableCheckboxColumn) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)

Example 8 with AppenderConfiguration

use of com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration in project midpoint by Evolveum.

the class LoggingConfigPanel method deleteAppenderPerformed.

private void deleteAppenderPerformed(AjaxRequestTarget target) {
    Iterator<AppenderConfiguration> iterator = getModel().getObject().getAppenders().iterator();
    while (iterator.hasNext()) {
        AppenderConfiguration item = iterator.next();
        if (item.isSelected()) {
            iterator.remove();
        }
    }
    target.add(getAppendersTable());
}
Also used : AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration)

Aggregations

AppenderConfiguration (com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration)8 ArrayList (java.util.ArrayList)5 LoggingDto (com.evolveum.midpoint.web.page.admin.configuration.dto.LoggingDto)3 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)3 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)1 CheckBoxColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxColumn)1 CheckBoxHeaderColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)1 EditableCheckboxColumn (com.evolveum.midpoint.web.component.data.column.EditableCheckboxColumn)1 EditablePropertyColumn (com.evolveum.midpoint.web.component.data.column.EditablePropertyColumn)1 TextPanel (com.evolveum.midpoint.web.component.input.TextPanel)1 NotNullValidator (com.evolveum.midpoint.web.component.input.validator.NotNullValidator)1 InputPanel (com.evolveum.midpoint.web.component.prism.InputPanel)1 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)1 ProfilingDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ProfilingDto)1 AppenderConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.AppenderConfigurationType)1 FileAppenderConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.FileAppenderConfigurationType)1 List (java.util.List)1 AttributeModifier (org.apache.wicket.AttributeModifier)1