Class BGEditorInfoBase
java.lang.Object
ru.bitel.bgbilling.kernel.editor.server.bean.BGEditorInfoBase
- All Implemented Interfaces:
BGEditorInfo
Базовый класс серверных диалогов (редакторов) - по аналогии с
Наследник обязан определить раскладку (
BGTableInfoBase.
Наследник обязан определить раскладку (
getLayout()) и сохранение (save(BGUEditorParams)).
По умолчанию: текущие значения берутся из значений по умолчанию раскладки,
справочник поля - из статического набора значений раскладки,
валидация проверяет обязательные поля. Всё это можно переопределить/расширить.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ru.bitel.bgbilling.common.model.KeyValueaddValidationError(String name, String message) Добавление ошибки валидации (имя поля→сообщение)protected intcontractId(BGUEditorParams editorParams) Идентификатор контракта контекстаprotected intИдентификатор компонента (модуль/плагин), запросившего диалог; для таблиц вида "<таблица>_" protected Connectionprotected ru.bitel.bgbilling.kernel.container.managed.ServerContextgetDirectory(Class<K> clazz, int moduleId) List<ru.bitel.bgbilling.common.model.KeyValue> getDirectory(BGUEditorField field, BGUEditorParams editorParams) Загрузка справочника для поля.Заголовок диалогаРаскладка параметров диалогаList<ru.bitel.bgbilling.common.model.KeyValue> getValues(BGUEditorParams editorParams) Загрузка текущих значений полей.protected intobjectId(BGUEditorParams editorParams) Идентификатор объекта, редактируемого диалогомprotected Optional<ru.bitel.bgbilling.common.model.KeyValue> optValueSet(BGUEditorField field, String value) protected Stringparam(BGUEditorParams editorParams, String name) Дополнительный параметр из параметров запросаprotected Stringparam(BGUEditorParams editorParams, String name, String defaultValue) abstract Stringsave(BGUEditorParams editorParams) Сохранение результата.voidsetComponentId(int componentId) Идентификатор компонента (модуль/плагин), который запросил диалог - для таблиц вида "<таблица>_" voidsetConnection(Connection connection) voidsetUserId(int userId) List<ru.bitel.bgbilling.common.model.KeyValue> validate(BGUEditorParams editorParams) Валидация параметров.protected Stringvalue(BGUEditorParams editorParams, String name) protected Stringvalue(BGUEditorParams editorParams, String name, String defaultValue) protected booleanvalueBoolean(BGUEditorParams editorParams, String name) protected booleanvalueBoolean(BGUEditorParams editorParams, String name, boolean defaultValue) protected BigDecimalvalueDecimal(BGUEditorParams editorParams, String name) protected BigDecimalvalueDecimal(BGUEditorParams editorParams, String name, BigDecimal defaultValue) protected intvalueInt(BGUEditorParams editorParams, String name) protected intvalueInt(BGUEditorParams editorParams, String name, int defaultValue)
-
Field Details
-
userId
protected int userId -
connection
-
componentId
protected int componentId
-
-
Constructor Details
-
BGEditorInfoBase
public BGEditorInfoBase()
-
-
Method Details
-
setUserId
public void setUserId(int userId) - Specified by:
setUserIdin interfaceBGEditorInfo
-
setConnection
- Specified by:
setConnectionin interfaceBGEditorInfo
-
setComponentId
public void setComponentId(int componentId) Description copied from interface:BGEditorInfoИдентификатор компонента (модуль/плагин), который запросил диалог - для таблиц вида "<таблица>_" - Specified by:
setComponentIdin interfaceBGEditorInfo
-
getConnection
-
getComponentId
protected int getComponentId()Идентификатор компонента (модуль/плагин), запросившего диалог; для таблиц вида "<таблица>_" -
getEditorTitle
Description copied from interface:BGEditorInfoЗаголовок диалога- Specified by:
getEditorTitlein interfaceBGEditorInfo
-
getLayout
Description copied from interface:BGEditorInfoРаскладка параметров диалога- Specified by:
getLayoutin interfaceBGEditorInfo- Throws:
ru.bitel.bgbilling.common.BGException
-
getValues
public List<ru.bitel.bgbilling.common.model.KeyValue> getValues(BGUEditorParams editorParams) throws ru.bitel.bgbilling.common.BGException Загрузка текущих значений полей. По умолчанию - значения по умолчанию раскладки.- Specified by:
getValuesin interfaceBGEditorInfo- Throws:
ru.bitel.bgbilling.common.BGException
-
getDirectory
public List<ru.bitel.bgbilling.common.model.KeyValue> getDirectory(BGUEditorField field, BGUEditorParams editorParams) throws ru.bitel.bgbilling.common.BGException Загрузка справочника для поля. По умолчанию - статический набор значений раскладки.- Specified by:
getDirectoryin interfaceBGEditorInfo- Throws:
ru.bitel.bgbilling.common.BGException
-
validate
public List<ru.bitel.bgbilling.common.model.KeyValue> validate(BGUEditorParams editorParams) throws ru.bitel.bgbilling.common.BGException Валидация параметров. По умолчанию проверяются обязательные поля. Возврат name→сообщение об ошибке (пустой список - ошибок нет).- Specified by:
validatein interfaceBGEditorInfo- Throws:
ru.bitel.bgbilling.common.BGException
-
save
public abstract String save(BGUEditorParams editorParams) throws ru.bitel.bgbilling.common.BGException Description copied from interface:BGEditorInfoСохранение результата. Возврат результата (например, id объекта)- Specified by:
savein interfaceBGEditorInfo- Throws:
ru.bitel.bgbilling.common.BGException
-
value
-
value
-
valueInt
-
valueInt
-
valueBoolean
-
valueBoolean
-
valueDecimal
-
valueDecimal
protected BigDecimal valueDecimal(BGUEditorParams editorParams, String name, BigDecimal defaultValue) -
objectId
Идентификатор объекта, редактируемого диалогом -
contractId
Идентификатор контракта контекста -
param
Дополнительный параметр из параметров запроса -
param
-
getContext
protected ru.bitel.bgbilling.kernel.container.managed.ServerContext getContext() -
getDirectory
protected <K extends Id> Directory<K> getDirectory(Class<K> clazz, int moduleId) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getUserInfoDirectory
- Throws:
ru.bitel.bgbilling.common.BGException
-
addValidationError
Добавление ошибки валидации (имя поля→сообщение) -
optValueSet
protected Optional<ru.bitel.bgbilling.common.model.KeyValue> optValueSet(BGUEditorField field, String value)
-