CCM NG: ccm/admin Configuration tab (not tested yet)
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4064 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
fe93154ceb
commit
394fa73b85
|
|
@ -48,12 +48,24 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
private final StringParameter selectedSettingParam;
|
private final StringParameter selectedSettingParam;
|
||||||
private final ParameterSingleSelectionModel<String> selectedSetting;
|
private final ParameterSingleSelectionModel<String> selectedSetting;
|
||||||
|
|
||||||
|
private final StringParameter selectedValueParam;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedValue;
|
||||||
|
|
||||||
private final Label confClassesFilterHeading;
|
private final Label confClassesFilterHeading;
|
||||||
private final Form confClassesFilterForm;
|
private final Form confClassesFilterForm;
|
||||||
private final ConfigurationsTable configurationsTable;
|
private final ConfigurationsTable configurationsTable;
|
||||||
|
|
||||||
private final ConfigurationTable configurationTable;
|
private final ConfigurationTable configurationTable;
|
||||||
|
|
||||||
|
private final SettingFormBoolean settingFormBoolean;
|
||||||
|
private final SettingFormLong settingFormLong;
|
||||||
|
private final SettingFormDouble settingFormDouble;
|
||||||
|
private final SettingFormBigDecimal settingFormBigDecimal;
|
||||||
|
private final SettingFormString settingFormString;
|
||||||
|
private final SettingEditorLocalizedString settingEditorLocalizedString;
|
||||||
|
private final SettingEditorStringList settingEditorStringList;
|
||||||
|
private final SettingEditorEnum settingEditorEnum;
|
||||||
|
|
||||||
public ConfigurationTab() {
|
public ConfigurationTab() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|
@ -66,6 +78,9 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
selectedSetting = new ParameterSingleSelectionModel<>(
|
selectedSetting = new ParameterSingleSelectionModel<>(
|
||||||
selectedSettingParam);
|
selectedSettingParam);
|
||||||
|
|
||||||
|
selectedValueParam = new StringParameter("selectedValue");
|
||||||
|
selectedValue = new ParameterSingleSelectionModel<>(selectedValueParam);
|
||||||
|
|
||||||
final SegmentedPanel left = new SegmentedPanel();
|
final SegmentedPanel left = new SegmentedPanel();
|
||||||
|
|
||||||
confClassesFilterHeading = new Label(new GlobalizedMessage(
|
confClassesFilterHeading = new Label(new GlobalizedMessage(
|
||||||
|
|
@ -97,6 +112,43 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
selectedSetting);
|
selectedSetting);
|
||||||
body.add(configurationTable);
|
body.add(configurationTable);
|
||||||
|
|
||||||
|
settingFormBoolean = new SettingFormBoolean(this,
|
||||||
|
selectedConf,
|
||||||
|
selectedSetting);
|
||||||
|
body.add(settingFormBoolean);
|
||||||
|
|
||||||
|
settingFormLong = new SettingFormLong(this,
|
||||||
|
selectedConf,
|
||||||
|
selectedSetting);
|
||||||
|
body.add(settingFormLong);
|
||||||
|
|
||||||
|
settingFormDouble = new SettingFormDouble(this,
|
||||||
|
selectedConf,
|
||||||
|
selectedSetting);
|
||||||
|
body.add(settingFormDouble);
|
||||||
|
|
||||||
|
settingFormBigDecimal = new SettingFormBigDecimal(this,
|
||||||
|
selectedConf,
|
||||||
|
selectedSetting);
|
||||||
|
body.add(settingFormBigDecimal);
|
||||||
|
|
||||||
|
settingFormString = new SettingFormString(this,
|
||||||
|
selectedConf,
|
||||||
|
selectedSetting);
|
||||||
|
body.add(settingFormString);
|
||||||
|
|
||||||
|
settingEditorLocalizedString = new SettingEditorLocalizedString(
|
||||||
|
this, selectedConf, selectedSetting, selectedValue);
|
||||||
|
body.add(settingEditorLocalizedString);
|
||||||
|
|
||||||
|
settingEditorStringList = new SettingEditorStringList(
|
||||||
|
this, selectedConf, selectedSetting, selectedValue);
|
||||||
|
body.add(settingEditorStringList);
|
||||||
|
|
||||||
|
settingEditorEnum = new SettingEditorEnum(
|
||||||
|
this, selectedConf, selectedSetting, selectedValue);
|
||||||
|
body.add(settingEditorEnum);
|
||||||
|
|
||||||
setBody(body);
|
setBody(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,18 +158,39 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
|
|
||||||
page.addGlobalStateParam(selectedConfParam);
|
page.addGlobalStateParam(selectedConfParam);
|
||||||
page.addGlobalStateParam(selectedSettingParam);
|
page.addGlobalStateParam(selectedSettingParam);
|
||||||
|
page.addGlobalStateParam(selectedValueParam);
|
||||||
|
|
||||||
page.setVisibleDefault(confClassesFilterHeading, true);
|
page.setVisibleDefault(confClassesFilterHeading, true);
|
||||||
page.setVisibleDefault(confClassesFilterForm, true);
|
page.setVisibleDefault(confClassesFilterForm, true);
|
||||||
page.setVisibleDefault(configurationsTable, true);
|
page.setVisibleDefault(configurationsTable, true);
|
||||||
|
|
||||||
page.setVisibleDefault(configurationTable, false);
|
page.setVisibleDefault(configurationTable, false);
|
||||||
|
|
||||||
|
page.setVisibleDefault(settingFormBoolean, false);
|
||||||
|
page.setVisibleDefault(settingFormLong, false);
|
||||||
|
page.setVisibleDefault(settingFormDouble, false);
|
||||||
|
page.setVisibleDefault(settingFormBigDecimal, false);
|
||||||
|
page.setVisibleDefault(settingFormString, false);
|
||||||
|
page.setVisibleDefault(settingEditorLocalizedString, false);
|
||||||
|
page.setVisibleDefault(settingEditorStringList, false);
|
||||||
|
page.setVisibleDefault(settingEditorEnum, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showConfigurationsTable(final PageState state) {
|
protected void showConfigurationsTable(final PageState state) {
|
||||||
confClassesFilterHeading.setVisible(state, true);
|
confClassesFilterHeading.setVisible(state, true);
|
||||||
confClassesFilterForm.setVisible(state, true);
|
confClassesFilterForm.setVisible(state, true);
|
||||||
configurationsTable.setVisible(state, true);
|
configurationsTable.setVisible(state, true);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void hideConfigurationsTable(final PageState state) {
|
protected void hideConfigurationsTable(final PageState state) {
|
||||||
|
|
@ -128,6 +201,7 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
|
|
||||||
protected void showConfiguration(final PageState state) {
|
protected void showConfiguration(final PageState state) {
|
||||||
hideConfigurationsTable(state);
|
hideConfigurationsTable(state);
|
||||||
|
hideSettingForms(state);
|
||||||
|
|
||||||
configurationTable.setVisible(state, true);
|
configurationTable.setVisible(state, true);
|
||||||
}
|
}
|
||||||
|
|
@ -135,44 +209,167 @@ public class ConfigurationTab extends LayoutPanel {
|
||||||
protected void hideConfiguration(final PageState state) {
|
protected void hideConfiguration(final PageState state) {
|
||||||
configurationTable.setVisible(state, false);
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
selectedConf.clearSelection(state);
|
||||||
|
|
||||||
showConfigurationsTable(state);
|
showConfigurationsTable(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showBigDecimalSettingForm(final PageState state) {
|
protected void showBigDecimalSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, true);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showBooleanSettingForm(final PageState state) {
|
protected void showBooleanSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, true);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDoubleSettingForm(final PageState state) {
|
protected void showDoubleSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, true);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showEnumSettingForm(final PageState state) {
|
protected void showEnumSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showLocalizedStringSettingForm(final PageState state) {
|
protected void showLocalizedStringSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, true);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showLongSettingForm(final PageState state) {
|
protected void showLongSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, true);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showStringListSettingForm(final PageState state) {
|
protected void showStringListSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, true);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showStringSettingForm(final PageState state) {
|
protected void showStringSettingForm(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, true);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void hideSettingForms(final PageState state) {
|
protected void hideSettingForms(final PageState state) {
|
||||||
|
confClassesFilterHeading.setVisible(state, false);
|
||||||
|
confClassesFilterForm.setVisible(state, false);
|
||||||
|
configurationsTable.setVisible(state, false);
|
||||||
|
|
||||||
|
configurationTable.setVisible(state, false);
|
||||||
|
|
||||||
|
settingFormBoolean.setVisible(state, false);
|
||||||
|
settingFormLong.setVisible(state, false);
|
||||||
|
settingFormDouble.setVisible(state, false);
|
||||||
|
settingFormBigDecimal.setVisible(state, false);
|
||||||
|
settingFormString.setVisible(state, false);
|
||||||
|
settingEditorLocalizedString.setVisible(state, false);
|
||||||
|
settingEditorStringList.setVisible(state, false);
|
||||||
|
settingEditorEnum.setVisible(state, false);
|
||||||
|
|
||||||
|
selectedSetting.clearSelection(state);
|
||||||
|
selectedValue.clearSelection(state);
|
||||||
|
|
||||||
showConfiguration(state);
|
showConfiguration(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,419 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2016 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package com.arsdigita.ui.admin.configuration;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.ActionLink;
|
||||||
|
import com.arsdigita.bebop.BoxPanel;
|
||||||
|
import com.arsdigita.bebop.Component;
|
||||||
|
import com.arsdigita.bebop.ControlLink;
|
||||||
|
import com.arsdigita.bebop.Form;
|
||||||
|
import com.arsdigita.bebop.FormData;
|
||||||
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||||
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
|
import com.arsdigita.bebop.Table;
|
||||||
|
import com.arsdigita.bebop.Text;
|
||||||
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
import com.arsdigita.bebop.event.TableActionListener;
|
||||||
|
import com.arsdigita.bebop.form.TextField;
|
||||||
|
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||||
|
import com.arsdigita.bebop.table.TableColumn;
|
||||||
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class SettingEditorEnum extends BoxPanel {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger(
|
||||||
|
SettingEditorEnum.class);
|
||||||
|
|
||||||
|
private static final int COL_VALUE = 0;
|
||||||
|
private static final int COL_EDIT = 1;
|
||||||
|
private static final int COL_DEL = 2;
|
||||||
|
|
||||||
|
private final ConfigurationTab configurationTab;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedConf;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedSetting;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedValue;
|
||||||
|
|
||||||
|
public SettingEditorEnum(
|
||||||
|
final ConfigurationTab configurationTab,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedConf,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedSetting,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedValue) {
|
||||||
|
|
||||||
|
super(BoxPanel.VERTICAL);
|
||||||
|
|
||||||
|
this.configurationTab = configurationTab;
|
||||||
|
this.selectedConf = selectedConf;
|
||||||
|
this.selectedSetting = selectedSetting;
|
||||||
|
this.selectedValue = selectedValue;
|
||||||
|
|
||||||
|
final ActionLink backLink = new ActionLink(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.localized_string.back",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
backLink.addActionListener(e -> {
|
||||||
|
configurationTab.hideSettingForms(e.getPageState());
|
||||||
|
});
|
||||||
|
add(backLink);
|
||||||
|
|
||||||
|
add(new SettingFormHeader(selectedConf, selectedSetting));
|
||||||
|
|
||||||
|
add(new ValuesTable());
|
||||||
|
|
||||||
|
add(new ValueForm());
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTable extends Table {
|
||||||
|
|
||||||
|
public ValuesTable() {
|
||||||
|
|
||||||
|
super();
|
||||||
|
|
||||||
|
setIdAttr("enumValues");
|
||||||
|
|
||||||
|
setEmptyView(new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.no_values", ADMIN_BUNDLE)));
|
||||||
|
|
||||||
|
final TableColumnModel columnModel = getColumnModel();
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_VALUE,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.col_value",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_EDIT,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.col_edit",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_DEL,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.col_del",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
|
||||||
|
columnModel.get(COL_EDIT).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
return new ControlLink((Component) value);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
columnModel.get(COL_DEL).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
if (value == null) {
|
||||||
|
return new Text("");
|
||||||
|
} else {
|
||||||
|
final ControlLink link = new ControlLink(
|
||||||
|
(Component) value);
|
||||||
|
link.setConfirmation(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.del_confirm",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
addTableActionListener(new TableActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void cellSelected(final TableActionEvent event) {
|
||||||
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil
|
||||||
|
.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final Set<String> values;
|
||||||
|
try {
|
||||||
|
values = (Set<String>) confClass.getField(
|
||||||
|
selectedSetting.getSelectedKey(state)).get(config);
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.getColumn()) {
|
||||||
|
case COL_EDIT: {
|
||||||
|
selectedValue.setSelectedKey(state, event
|
||||||
|
.getRowKey());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case COL_DEL: {
|
||||||
|
values.remove(event.getRowKey());
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void headSelected(final TableActionEvent event) {
|
||||||
|
//Notthing
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
setModelBuilder(new ValuesTableModelBuilder());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTableModelBuilder
|
||||||
|
extends LockableImpl
|
||||||
|
implements TableModelBuilder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableModel makeModel(final Table table,
|
||||||
|
final PageState state) {
|
||||||
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
|
|
||||||
|
return new ValuesTableModel(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTableModel implements TableModel {
|
||||||
|
|
||||||
|
private final List<String> values;
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public ValuesTableModel(final PageState state) {
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(confClass);
|
||||||
|
try {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
final Set<String> valuesSet = (Set<String>) confClass.getField(
|
||||||
|
selectedSetting
|
||||||
|
.getSelectedKey(state)).get(config);
|
||||||
|
|
||||||
|
values = new ArrayList<>(valuesSet);
|
||||||
|
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn("Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColumnCount() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean nextRow() {
|
||||||
|
index++;
|
||||||
|
return index < values.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getElementAt(final int columnIndex) {
|
||||||
|
switch (columnIndex) {
|
||||||
|
case COL_VALUE:
|
||||||
|
return values.get(index);
|
||||||
|
case COL_EDIT:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.value.edit",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
case COL_DEL:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.value.del",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Not a valid column index");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getKeyAt(final int columnIndex) {
|
||||||
|
return values.get(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValueForm extends Form {
|
||||||
|
|
||||||
|
private final String VALUE = "value";
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public ValueForm() {
|
||||||
|
|
||||||
|
super("settingEnumValueForm");
|
||||||
|
|
||||||
|
final TextField valueField = new TextField(VALUE);
|
||||||
|
valueField.setLabel(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.enum.value.label",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
add(valueField);
|
||||||
|
|
||||||
|
final SaveCancelSection saveCancelSection = new SaveCancelSection();
|
||||||
|
add(saveCancelSection);
|
||||||
|
|
||||||
|
addInitListener(e -> {
|
||||||
|
final PageState state = e.getPageState();
|
||||||
|
|
||||||
|
if (selectedValue.getSelectedKey(state) != null) {
|
||||||
|
|
||||||
|
valueField.setValue(state, selectedValue.getSelectedKey(
|
||||||
|
state));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
addProcessListener(e -> {
|
||||||
|
final PageState state = e.getPageState();
|
||||||
|
|
||||||
|
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final Set<String> enumSetting;
|
||||||
|
try {
|
||||||
|
final Object value = confClass.getField(selectedSetting
|
||||||
|
.getSelectedKey(state)).get(config);
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
enumSetting = new HashSet<>();
|
||||||
|
confClass.getField(selectedSetting.getSelectedKey(
|
||||||
|
state)).set(config, enumSetting);
|
||||||
|
} else {
|
||||||
|
enumSetting = (Set<String>) value;
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final FormData data = e.getFormData();
|
||||||
|
final String valueData = data.getString(VALUE);
|
||||||
|
if (selectedValue.getSelectedKey(state) == null) {
|
||||||
|
enumSetting.add(valueData);
|
||||||
|
} else {
|
||||||
|
final String selected = selectedValue.getSelectedKey(
|
||||||
|
state);
|
||||||
|
enumSetting.remove(selected);
|
||||||
|
enumSetting.add(valueData);
|
||||||
|
}
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -49,7 +49,6 @@ import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
import org.libreccm.configuration.ConfigurationManager;
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
import org.libreccm.configuration.SettingManager;
|
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -58,7 +57,6 @@ import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TooManyListenersException;
|
import java.util.TooManyListenersException;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||||
|
|
||||||
|
|
@ -119,29 +117,29 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
setIdAttr("localizedStringSettingValues");
|
setIdAttr("localizedStringSettingValues");
|
||||||
|
|
||||||
setEmptyView(new Label(new GlobalizedMessage(
|
setEmptyView(new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.no_values",
|
"ui.admin.configuration.setting.localized_string.no_values",
|
||||||
ADMIN_BUNDLE)));
|
ADMIN_BUNDLE)));
|
||||||
|
|
||||||
final TableColumnModel columnModel = getColumnModel();
|
final TableColumnModel columnModel = getColumnModel();
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_LOCALE,
|
COL_LOCALE,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.col_lang",
|
"ui.admin.configuration.setting.localized_string.col_lang",
|
||||||
ADMIN_BUNDLE))));
|
ADMIN_BUNDLE))));
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_VALUE,
|
COL_VALUE,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.col_value",
|
"ui.admin.configuration.setting.localized_string.col_value",
|
||||||
ADMIN_BUNDLE))));
|
ADMIN_BUNDLE))));
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_EDIT,
|
COL_EDIT,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.col_del",
|
"ui.admin.configuration.setting.localized_string.col_del",
|
||||||
ADMIN_BUNDLE))));
|
ADMIN_BUNDLE))));
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_DEL,
|
COL_DEL,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.col_del",
|
"ui.admin.configuration.setting.localized_string.col_del",
|
||||||
ADMIN_BUNDLE))));
|
ADMIN_BUNDLE))));
|
||||||
|
|
||||||
columnModel.get(COL_EDIT).setCellRenderer(new TableCellRenderer() {
|
columnModel.get(COL_EDIT).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
@ -154,7 +152,7 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
final Object key,
|
final Object key,
|
||||||
final int row,
|
final int row,
|
||||||
final int column) {
|
final int column) {
|
||||||
return new ControlLink((String) value);
|
return new ControlLink((Component) value);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -175,7 +173,7 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
final ControlLink link = new ControlLink(
|
final ControlLink link = new ControlLink(
|
||||||
(Component) value);
|
(Component) value);
|
||||||
link.setConfirmation(new GlobalizedMessage(
|
link.setConfirmation(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.del_confirm",
|
"ui.admin.configuration.setting.localized_string.del_confirm",
|
||||||
ADMIN_BUNDLE));
|
ADMIN_BUNDLE));
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +187,62 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
public void cellSelected(final TableActionEvent event) {
|
public void cellSelected(final TableActionEvent event) {
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
selectedValue.setSelectedKey(state, event.getRowKey());
|
switch (event.getColumn()) {
|
||||||
|
case COL_EDIT:
|
||||||
|
selectedValue.setSelectedKey(state,
|
||||||
|
event.getRowKey());
|
||||||
|
break;
|
||||||
|
case COL_DEL:
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil
|
||||||
|
.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final LocalizedString localizedStr;
|
||||||
|
try {
|
||||||
|
final Object value = confClass.getField(
|
||||||
|
selectedSetting
|
||||||
|
.getSelectedKey(state)).get(config);
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
localizedStr = new LocalizedString();
|
||||||
|
confClass.getField(selectedSetting
|
||||||
|
.getSelectedKey(
|
||||||
|
state)).set(config, localizedStr);
|
||||||
|
} else {
|
||||||
|
localizedStr = (LocalizedString) value;
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException | SecurityException | IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Locale locale = new Locale((String) event
|
||||||
|
.getRowKey());
|
||||||
|
|
||||||
|
localizedStr.removeValue(locale);
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -285,7 +338,7 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
ADMIN_BUNDLE));
|
ADMIN_BUNDLE));
|
||||||
case COL_DEL:
|
case COL_DEL:
|
||||||
return new Label(new GlobalizedMessage(
|
return new Label(new GlobalizedMessage(
|
||||||
"ui.admin.categories.setting.localized_string.title.del",
|
"ui.admin.configuration.setting.localized_string.title.del",
|
||||||
ADMIN_BUNDLE
|
ADMIN_BUNDLE
|
||||||
));
|
));
|
||||||
default:
|
default:
|
||||||
|
|
@ -473,7 +526,8 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
} else {
|
} else {
|
||||||
localizedStr = (LocalizedString) value;
|
localizedStr = (LocalizedString) value;
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException | SecurityException | IllegalAccessException | ClassCastException ex) {
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"Failed to read setting {} from configuration {}",
|
"Failed to read setting {} from configuration {}",
|
||||||
selectedSetting.getSelectedKey(state),
|
selectedSetting.getSelectedKey(state),
|
||||||
|
|
@ -488,6 +542,8 @@ public class SettingEditorLocalizedString extends BoxPanel {
|
||||||
LOCALE_SELECT));
|
LOCALE_SELECT));
|
||||||
final String valueData = data.getString(VALUE);
|
final String valueData = data.getString(VALUE);
|
||||||
localizedStr.addValue(locale, valueData);
|
localizedStr.addValue(locale, valueData);
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,567 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2016 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package com.arsdigita.ui.admin.configuration;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.ActionLink;
|
||||||
|
import com.arsdigita.bebop.BoxPanel;
|
||||||
|
import com.arsdigita.bebop.Component;
|
||||||
|
import com.arsdigita.bebop.ControlLink;
|
||||||
|
import com.arsdigita.bebop.Form;
|
||||||
|
import com.arsdigita.bebop.FormData;
|
||||||
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||||
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
|
import com.arsdigita.bebop.Table;
|
||||||
|
import com.arsdigita.bebop.Text;
|
||||||
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
import com.arsdigita.bebop.event.TableActionListener;
|
||||||
|
import com.arsdigita.bebop.form.TextField;
|
||||||
|
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||||
|
import com.arsdigita.bebop.table.TableColumn;
|
||||||
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class SettingEditorStringList extends BoxPanel {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger(
|
||||||
|
SettingEditorStringList.class);
|
||||||
|
|
||||||
|
private static final int COL_VALUE = 0;
|
||||||
|
private static final int COL_UP = 1;
|
||||||
|
private static final int COL_DOWN = 2;
|
||||||
|
private static final int COL_EDIT = 3;
|
||||||
|
private static final int COL_DEL = 4;
|
||||||
|
|
||||||
|
private final ConfigurationTab configurationTab;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedConf;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedSetting;
|
||||||
|
private final ParameterSingleSelectionModel<String> selectedValue;
|
||||||
|
|
||||||
|
public SettingEditorStringList(
|
||||||
|
final ConfigurationTab configurationTab,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedConf,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedSetting,
|
||||||
|
final ParameterSingleSelectionModel<String> selectedValue) {
|
||||||
|
|
||||||
|
super(BoxPanel.VERTICAL);
|
||||||
|
|
||||||
|
this.configurationTab = configurationTab;
|
||||||
|
this.selectedConf = selectedConf;
|
||||||
|
this.selectedSetting = selectedSetting;
|
||||||
|
this.selectedValue = selectedValue;
|
||||||
|
|
||||||
|
final ActionLink backLink = new ActionLink(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.localized_string.back",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
backLink.addActionListener(e -> {
|
||||||
|
configurationTab.hideSettingForms(e.getPageState());
|
||||||
|
});
|
||||||
|
add(backLink);
|
||||||
|
|
||||||
|
add(new SettingFormHeader(selectedConf, selectedSetting));
|
||||||
|
|
||||||
|
add(new ValuesTable());
|
||||||
|
|
||||||
|
add(new ValueForm());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTable extends Table {
|
||||||
|
|
||||||
|
public ValuesTable() {
|
||||||
|
|
||||||
|
super();
|
||||||
|
|
||||||
|
setIdAttr("stringListValues");
|
||||||
|
|
||||||
|
setEmptyView(new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.no_values",
|
||||||
|
ADMIN_BUNDLE)));
|
||||||
|
|
||||||
|
final TableColumnModel columnModel = getColumnModel();
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_VALUE,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.col_value",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_UP,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.col_up",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_DOWN,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.col_down",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_EDIT,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.col_edit",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
columnModel.add(new TableColumn(
|
||||||
|
COL_DEL,
|
||||||
|
new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.col_delete",
|
||||||
|
ADMIN_BUNDLE))));
|
||||||
|
|
||||||
|
columnModel.get(COL_UP).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
if (row > 0) {
|
||||||
|
return new ControlLink((Component) value);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
columnModel.get(COL_DOWN).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil
|
||||||
|
.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final List<String> values;
|
||||||
|
try {
|
||||||
|
values = (List<String>) confClass.getField(
|
||||||
|
selectedSetting.getSelectedKey(state)).get(config);
|
||||||
|
} catch (NoSuchFieldException | SecurityException | IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row < values.size()) {
|
||||||
|
return new ControlLink((Component) value);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
columnModel.get(COL_EDIT).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
return new ControlLink((Component) value);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
columnModel.get(COL_DEL).setCellRenderer(new TableCellRenderer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getComponent(final Table table,
|
||||||
|
final PageState state,
|
||||||
|
final Object value,
|
||||||
|
final boolean isSelected,
|
||||||
|
final Object key,
|
||||||
|
final int row,
|
||||||
|
final int column) {
|
||||||
|
if (value == null) {
|
||||||
|
return new Text("");
|
||||||
|
} else {
|
||||||
|
final ControlLink link = new ControlLink(
|
||||||
|
(Component) value);
|
||||||
|
link.setConfirmation(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.del_confirm",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
addTableActionListener(new TableActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cellSelected(final TableActionEvent event) {
|
||||||
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil
|
||||||
|
.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final List<String> values;
|
||||||
|
try {
|
||||||
|
values = (List<String>) confClass.getField(
|
||||||
|
selectedSetting.getSelectedKey(state)).get(config);
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.getColumn()) {
|
||||||
|
case COL_UP: {
|
||||||
|
|
||||||
|
final int currentIndex = (int) event.getRowKey();
|
||||||
|
final int previousIndex = currentIndex - 1;
|
||||||
|
|
||||||
|
final String currentValue = values.get(currentIndex);
|
||||||
|
final String previousValue = values.get(
|
||||||
|
previousIndex);
|
||||||
|
|
||||||
|
values.set(previousIndex, currentValue);
|
||||||
|
values.set(currentIndex, previousValue);
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case COL_DOWN: {
|
||||||
|
|
||||||
|
final int currentIndex = (int) event.getRowKey();
|
||||||
|
final int nextIndex = currentIndex + 1;
|
||||||
|
|
||||||
|
final String currentValue = values.get(currentIndex);
|
||||||
|
final String nextValue = values.get(nextIndex);
|
||||||
|
|
||||||
|
values.set(nextIndex, currentValue);
|
||||||
|
values.set(currentIndex, nextValue);
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case COL_EDIT: {
|
||||||
|
selectedValue.setSelectedKey(state,
|
||||||
|
event.getRowKey());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case COL_DEL: {
|
||||||
|
values.remove((int) event.getRowKey());
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void headSelected(final TableActionEvent event) {
|
||||||
|
//Notthing
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
setModelBuilder(new ValuesTableModelBuilder());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTableModelBuilder
|
||||||
|
extends LockableImpl
|
||||||
|
implements TableModelBuilder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableModel makeModel(final Table table,
|
||||||
|
final PageState state) {
|
||||||
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
|
|
||||||
|
return new ValuesTableModel(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValuesTableModel implements TableModel {
|
||||||
|
|
||||||
|
private final List<String> values;
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public ValuesTableModel(final PageState state) {
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(confClass);
|
||||||
|
|
||||||
|
try {
|
||||||
|
values = (List<String>) confClass.getField(selectedSetting
|
||||||
|
.getSelectedKey(state)).get(config);
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn("Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColumnCount() {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean nextRow() {
|
||||||
|
index++;
|
||||||
|
return index < values.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getElementAt(final int columnIndex) {
|
||||||
|
switch (columnIndex) {
|
||||||
|
case COL_VALUE:
|
||||||
|
return values.get(index);
|
||||||
|
case COL_UP:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.value.up",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
case COL_DOWN:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.value.down",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
case COL_EDIT:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.value.edit",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
case COL_DEL:
|
||||||
|
return new Label(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.value.del",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Not a valid column index");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getKeyAt(final int columnIndex) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ValueForm extends Form {
|
||||||
|
|
||||||
|
private final String VALUE = "value";
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public ValueForm() {
|
||||||
|
super("settingStringListValueForm");
|
||||||
|
|
||||||
|
final TextField valueField = new TextField(VALUE);
|
||||||
|
valueField.setLabel(new GlobalizedMessage(
|
||||||
|
"ui.admin.configuration.setting.stringlist.value.label",
|
||||||
|
ADMIN_BUNDLE));
|
||||||
|
add(valueField);
|
||||||
|
|
||||||
|
final SaveCancelSection saveCancelSection = new SaveCancelSection();
|
||||||
|
add(saveCancelSection);
|
||||||
|
|
||||||
|
addInitListener(e -> {
|
||||||
|
final PageState state = e.getPageState();
|
||||||
|
|
||||||
|
if (selectedValue.getSelectedKey(state) != null) {
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
try {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
final List<String> stringList = (List<String>) confClass
|
||||||
|
.getField(selectedSetting.getSelectedKey(state))
|
||||||
|
.get(config);
|
||||||
|
|
||||||
|
final String str = stringList.get(Integer.parseInt(
|
||||||
|
selectedValue.getSelectedKey(state)));
|
||||||
|
|
||||||
|
valueField.setValue(state, str);
|
||||||
|
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
addProcessListener(e -> {
|
||||||
|
final PageState state = e.getPageState();
|
||||||
|
|
||||||
|
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
||||||
|
|
||||||
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
|
final Class<?> confClass;
|
||||||
|
try {
|
||||||
|
confClass = Class
|
||||||
|
.forName(selectedConf.getSelectedKey(state));
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
|
||||||
|
final Object config = confManager.findConfiguration(
|
||||||
|
confClass);
|
||||||
|
|
||||||
|
final List<String> stringList;
|
||||||
|
try {
|
||||||
|
final Object value = confClass.getField(selectedSetting
|
||||||
|
.getSelectedKey(state)).get(config);
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
stringList = new ArrayList<>();
|
||||||
|
confClass.getField(selectedSetting.getSelectedKey(
|
||||||
|
state)).set(config, stringList);
|
||||||
|
} else {
|
||||||
|
stringList = (List<String>) value;
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException | SecurityException |
|
||||||
|
IllegalAccessException | ClassCastException ex) {
|
||||||
|
LOGGER.warn(
|
||||||
|
"Failed to read setting {} from configuration {}",
|
||||||
|
selectedSetting.getSelectedKey(state),
|
||||||
|
selectedConf.getSelectedKey(state));
|
||||||
|
LOGGER.warn(ex);
|
||||||
|
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
final FormData data = e.getFormData();
|
||||||
|
final String valueData = data.getString(VALUE);
|
||||||
|
|
||||||
|
if (selectedValue.getSelectedKey(state) == null) {
|
||||||
|
stringList.add(valueData);
|
||||||
|
} else {
|
||||||
|
final int selected = Integer.parseInt(selectedValue
|
||||||
|
.getSelectedKey(state));
|
||||||
|
stringList.set(selected, valueData);
|
||||||
|
}
|
||||||
|
|
||||||
|
confManager.saveConfiguration(config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -425,9 +425,27 @@ ui.admin.configuration.setting.edit.heading=Edit setting {0}/{1}
|
||||||
ui.admin.configuration.setting.edit.current_value=Current value
|
ui.admin.configuration.setting.edit.current_value=Current value
|
||||||
ui.admin.configuration.setting.edit.new_value=New value
|
ui.admin.configuration.setting.edit.new_value=New value
|
||||||
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
||||||
ui.admin.categories.setting.localized_string.no_values=No values for this setting.
|
ui.admin.configuration.setting.localized_string.no_values=No values for this setting.
|
||||||
ui.admin.categories.setting.localized_string.del_confirm=Are you sure to delete this value?
|
ui.admin.configuration.setting.localized_string.del_confirm=Are you sure to delete this value?
|
||||||
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
||||||
ui.admin.categories.setting.localized_string.title.del=Delete
|
ui.admin.configuration.setting.localized_string.title.del=Delete
|
||||||
ui.admin.configuration.setting.localized_string.back=Back
|
ui.admin.configuration.setting.localized_string.back=Back
|
||||||
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
||||||
|
ui.admin.configuration.setting.stringlist.no_values=No values for this setting.
|
||||||
|
ui.admin.configuration.setting.stringlist.col_value=Value
|
||||||
|
ui.admin.configuration.setting.stringlist.col_up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.col_down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.col_delete=Delete
|
||||||
|
ui.admin.configuration.setting.stringlist.del_confirm=Are you sure to delete this value?
|
||||||
|
ui.admin.configuration.setting.stringlist.value.up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.value.down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.no_values=No values for this enum setting.
|
||||||
|
ui.admin.configuration.setting.enum.col_value=Value
|
||||||
|
ui.admin.configuration.setting.enum.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.col_del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.label=Value
|
||||||
|
|
|
||||||
|
|
@ -428,9 +428,27 @@ ui.admin.configuration.setting.edit.heading=Parameter {0}/{1} bearbeiten
|
||||||
ui.admin.configuration.setting.edit.current_value=Aktueller Wert
|
ui.admin.configuration.setting.edit.current_value=Aktueller Wert
|
||||||
ui.admin.configuration.setting.edit.new_value=Neuer Wert
|
ui.admin.configuration.setting.edit.new_value=Neuer Wert
|
||||||
ui.admin.configuration.setting.error.blank=Der neue Wert darf nicht leer sein.
|
ui.admin.configuration.setting.error.blank=Der neue Wert darf nicht leer sein.
|
||||||
ui.admin.categories.setting.localized_string.no_values=Keine Werte f\u00fcr diesen Parameter.
|
ui.admin.configuration.setting.localized_string.no_values=Keine Werte f\u00fcr diesen Parameter.
|
||||||
ui.admin.categories.setting.localized_string.del_confirm=Sind Sie sicher, dass Sie diesen Wert entfernen wollen?
|
ui.admin.configuration.setting.localized_string.del_confirm=Sind Sie sicher, dass Sie diesen Wert entfernen wollen?
|
||||||
ui.admin.configuration.setting.localized_string.value.edit=Bearbeiten
|
ui.admin.configuration.setting.localized_string.value.edit=Bearbeiten
|
||||||
ui.admin.categories.setting.localized_string.title.del=L\u00f6schen
|
ui.admin.configuration.setting.localized_string.title.del=L\u00f6schen
|
||||||
ui.admin.configuration.setting.localized_string.back=Zur\u00fcck
|
ui.admin.configuration.setting.localized_string.back=Zur\u00fcck
|
||||||
ui.admin.configuration.setting.localized_string.locale.label=Sprache
|
ui.admin.configuration.setting.localized_string.locale.label=Sprache
|
||||||
|
ui.admin.configuration.setting.stringlist.no_values=Keine Werte f\u00fcr diesen Parameter.
|
||||||
|
ui.admin.configuration.setting.stringlist.col_value=Wert
|
||||||
|
ui.admin.configuration.setting.stringlist.col_up=Hoch
|
||||||
|
ui.admin.configuration.setting.stringlist.col_down=Runter
|
||||||
|
ui.admin.configuration.setting.stringlist.col_edit=Bearbeiten
|
||||||
|
ui.admin.configuration.setting.stringlist.col_delete=L\u00f6schen
|
||||||
|
ui.admin.configuration.setting.stringlist.del_confirm=Sind Sie sicher, dass Sie diesen Wert entfernen wollen?
|
||||||
|
ui.admin.configuration.setting.stringlist.value.up=Hoch
|
||||||
|
ui.admin.configuration.setting.stringlist.value.down=Runter
|
||||||
|
ui.admin.configuration.setting.stringlist.value.edit=Bearbeiten
|
||||||
|
ui.admin.configuration.setting.stringlist.value.del=L\u00f6schen
|
||||||
|
ui.admin.configuration.setting.enum.no_values=Keine Werte f\u00fcr diesen Parameter.
|
||||||
|
ui.admin.configuration.setting.enum.col_value=Wert
|
||||||
|
ui.admin.configuration.setting.enum.col_edit=Bearbeiten
|
||||||
|
ui.admin.configuration.setting.enum.col_del=L\u00f6schen
|
||||||
|
ui.admin.configuration.setting.enum.value.edit=Bearbeiten
|
||||||
|
ui.admin.configuration.setting.enum.value.del=L\u00f6schen
|
||||||
|
ui.admin.configuration.setting.enum.value.label=Wert
|
||||||
|
|
|
||||||
|
|
@ -401,9 +401,27 @@ ui.admin.configuration.setting.edit.heading=Edit setting {0}/{1}
|
||||||
ui.admin.configuration.setting.edit.current_value=Current value
|
ui.admin.configuration.setting.edit.current_value=Current value
|
||||||
ui.admin.configuration.setting.edit.new_value=New value
|
ui.admin.configuration.setting.edit.new_value=New value
|
||||||
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
||||||
ui.admin.categories.setting.localized_string.no_values=No values for this setting.
|
ui.admin.configuration.setting.localized_string.no_values=No values for this setting.
|
||||||
ui.admin.categories.setting.localized_string.del_confirm=Are you sure to delete this value?
|
ui.admin.configuration.setting.localized_string.del_confirm=Are you sure to delete this value?
|
||||||
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
||||||
ui.admin.categories.setting.localized_string.title.del=Delete
|
ui.admin.configuration.setting.localized_string.title.del=Delete
|
||||||
ui.admin.configuration.setting.localized_string.back=Back
|
ui.admin.configuration.setting.localized_string.back=Back
|
||||||
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
||||||
|
ui.admin.configuration.setting.stringlist.no_values=No values for this setting.
|
||||||
|
ui.admin.configuration.setting.stringlist.col_value=Value
|
||||||
|
ui.admin.configuration.setting.stringlist.col_up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.col_down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.col_delete=Delete
|
||||||
|
ui.admin.configuration.setting.stringlist.del_confirm=Are you sure to delete this value?
|
||||||
|
ui.admin.configuration.setting.stringlist.value.up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.value.down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.no_values=No values for this enum setting.
|
||||||
|
ui.admin.configuration.setting.enum.col_value=Value
|
||||||
|
ui.admin.configuration.setting.enum.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.col_del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.label=Value
|
||||||
|
|
|
||||||
|
|
@ -392,9 +392,27 @@ ui.admin.configuration.setting.edit.heading=Edit setting {0}/{1}
|
||||||
ui.admin.configuration.setting.edit.current_value=Current value
|
ui.admin.configuration.setting.edit.current_value=Current value
|
||||||
ui.admin.configuration.setting.edit.new_value=New value
|
ui.admin.configuration.setting.edit.new_value=New value
|
||||||
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
ui.admin.configuration.setting.error.blank=New value can't be blank.
|
||||||
ui.admin.categories.setting.localized_string.no_values=No values for this setting.
|
ui.admin.configuration.setting.localized_string.no_values=No values for this setting.
|
||||||
ui.admin.categories.setting.localized_string.del_confirm=Are you sure to delete this value?
|
ui.admin.configuration.setting.localized_string.del_confirm=Are you sure to delete this value?
|
||||||
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
ui.admin.configuration.setting.localized_string.value.edit=Edit
|
||||||
ui.admin.categories.setting.localized_string.title.del=Delete
|
ui.admin.configuration.setting.localized_string.title.del=Delete
|
||||||
ui.admin.configuration.setting.localized_string.back=Back
|
ui.admin.configuration.setting.localized_string.back=Back
|
||||||
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
ui.admin.configuration.setting.localized_string.locale.label=Locale
|
||||||
|
ui.admin.configuration.setting.stringlist.no_values=No values for this setting.
|
||||||
|
ui.admin.configuration.setting.stringlist.col_value=Value
|
||||||
|
ui.admin.configuration.setting.stringlist.col_up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.col_down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.col_delete=Delete
|
||||||
|
ui.admin.configuration.setting.stringlist.del_confirm=Are you sure to delete this value?
|
||||||
|
ui.admin.configuration.setting.stringlist.value.up=Up
|
||||||
|
ui.admin.configuration.setting.stringlist.value.down=Down
|
||||||
|
ui.admin.configuration.setting.stringlist.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.stringlist.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.no_values=No values for this enum setting.
|
||||||
|
ui.admin.configuration.setting.enum.col_value=Value
|
||||||
|
ui.admin.configuration.setting.enum.col_edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.col_del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.edit=Edit
|
||||||
|
ui.admin.configuration.setting.enum.value.del=Delete
|
||||||
|
ui.admin.configuration.setting.enum.value.label=Value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue