Search in sources :

Example 1 with AppenderConfiguration

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

the class ProfilingConfigPanel method createAppendersListModel.

private IModel<List<String>> createAppendersListModel() {
    return new AbstractReadOnlyModel<List<String>>() {

        @Override
        public List<String> getObject() {
            List<String> list = new ArrayList<>();
            ProfilingDto dto = getModel().getObject();
            for (AppenderConfiguration appender : dto.getAppenders()) {
                list.add(appender.getName());
            }
            return list;
        }
    };
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) ProfilingDto(com.evolveum.midpoint.web.page.admin.configuration.dto.ProfilingDto) ArrayList(java.util.ArrayList)

Example 2 with AppenderConfiguration

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

the class LoggingConfigPanel method appenderEditPerformed.

private void appenderEditPerformed(AjaxRequestTarget target, IModel<AppenderConfiguration> model) {
    AppenderConfiguration config = model.getObject();
    config.setEditing(true);
    target.add(getAppendersTable());
}
Also used : AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration)

Example 3 with AppenderConfiguration

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

the class LoggingConfigPanel method initAppenders.

private void initAppenders() {
    ISortableDataProvider<AppenderConfiguration, String> provider = new ListDataProvider<>(this, new PropertyModel<List<AppenderConfiguration>>(getModel(), LoggingDto.F_APPENDERS));
    TablePanel table = new TablePanel<>(ID_TABLE_APPENDERS, provider, initAppenderColumns());
    table.setOutputMarkupId(true);
    table.setShowPaging(false);
    add(table);
    AjaxButton addConsoleAppender = new AjaxButton(ID_BUTTON_ADD_CONSOLE_APPENDER, createStringResource("LoggingConfigPanel.button.addConsoleAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addConsoleAppenderPerformed(target);
        }
    };
    add(addConsoleAppender);
    AjaxButton addFileAppender = new AjaxButton(ID_BUTTON_ADD_FILE_APPENDER, createStringResource("LoggingConfigPanel.button.addFileAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addFileAppenderPerformed(target);
        }
    };
    add(addFileAppender);
    AjaxButton deleteAppender = new AjaxButton(ID_BUTTON_DELETE_APPENDER, createStringResource("LoggingConfigPanel.button.deleteAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            deleteAppenderPerformed(target);
        }
    };
    add(deleteAppender);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) List(java.util.List) ArrayList(java.util.ArrayList) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 4 with AppenderConfiguration

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

the class LoggingConfigPanel method createAppendersListModel.

private IModel<List<String>> createAppendersListModel() {
    return new AbstractReadOnlyModel<List<String>>() {

        @Override
        public List<String> getObject() {
            List<String> list = new ArrayList<>();
            LoggingDto dto = getModel().getObject();
            for (AppenderConfiguration appender : dto.getAppenders()) {
                list.add(appender.getName());
            }
            return list;
        }
    };
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) ArrayList(java.util.ArrayList) LoggingDto(com.evolveum.midpoint.web.page.admin.configuration.dto.LoggingDto)

Example 5 with AppenderConfiguration

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

the class LoggingConfigPanel method createNewLoggerAppendersListModel.

private IModel<List<String>> createNewLoggerAppendersListModel() {
    return new AbstractReadOnlyModel<List<String>>() {

        @Override
        public List<String> getObject() {
            List<String> list = new ArrayList<>();
            LoggingDto dto = getModel().getObject();
            for (AppenderConfiguration appender : dto.getAppenders()) {
                list.add(appender.getName());
            }
            return list;
        }
    };
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) ArrayList(java.util.ArrayList) LoggingDto(com.evolveum.midpoint.web.page.admin.configuration.dto.LoggingDto)

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