Class SplibGeneralForm
- Direct Known Subclasses:
AdminLoginForm, ConfigForm, LoginForm, SplibEditForm, SplibListForm, SplibSearchForm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStores common info. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsConfirmedWarning(String messageId) Returns boolean whether specified messageId is contained.Obtains record.Returns already confirmed message ID set.getNotEmptyItemPropertyPathList(HtmlItemContainer rootRecord, String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Supplies NotEmpty fields in rootRecord.protected ObjectgetRootRecord(Field rootRecordField) Gets root record.getRootRecord(String recordName) Gets root record.form配下に存在するrecordを全て取得。booleanhasNotEmptyError(String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Has a notEmpty error.Sets vavlidates = false and returns this for method chain.voidsetConfirmedWarnings(String confirmedWarnings) voidsetControllerContext(SplibGeneralController.ControllerContext controllerContext) voidsetDataKind(String dataKind) validate(org.springframework.validation.BindingResult bindingResult) Sets validates = true and bindingResult, and returns this for method chain.Set<jp.ecuacion.lib.core.jakartavalidation.bean.ConstraintViolationBean> validateNotEmpty(String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Validates notEmpty.Set<jp.ecuacion.lib.core.jakartavalidation.bean.ConstraintViolationBean> validateNotEmpty(Locale locale, String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Validates notEmpty.
-
Field Details
-
dataKind
一つの機能の実装を複数メニューで使い回す場合に使用するメニュー名.使い回しをしない通常機能は、放置しnull(実際にはhtml側でhiddenを持っているのでそれがsubmitされ空文字になる)のままでよい。 searchFormはsessionにformを保持し検索条件を保持するが、複数メニューで使い回す場合は そのメニュー別に検索条件を保持するのが望ましいため、このdataKindもsession保存時のキーとする。
現行設計ではdataKindをrequestで持ち回る形を採用している。 sessionに持たせた方が実装が楽と思われる部分もありながら、navBarから他のメニューを選択された時には sessionに保管されたdataKindではなくrequestの方のdataKindを採用する、あたりをうまく回す必要があり、 その意味ではsessionに持たせるよりrequestで持ち回る方がわかりやすい(dataKindが空ならシステムエラーになるので)ことから まずはrequestで持ち回り、の実装方式としておく。 ※PRGを使用しGETでのアクセスを可としている中で、個々のURLをコピって使用しても使用可能とする意味でも、 全てのURLにdataKindパラメータがついているのが望ましい、という観点もあるので付記。
-
confirmedWarnings
warningを返した際に、それに対してOKした場合は、OKしたという履歴を残さないとまた再度同じチェックに引っかかりワーニングを出してしまう。 それを防ぐため、一度OKしたwarningは、messageIdを本fieldに保管することで避ける.複数のwarnに対する情報を保持できるよう、本項目はcsv形式とする。(対応するhiddenにjavascript側で","とメッセージIDを追加)
-
-
Constructor Details
-
SplibGeneralForm
public SplibGeneralForm()
-
-
Method Details
-
getPrepareSettings
-
validate
Sets validates = true and bindingResult, and returns this for method chain. -
noValidate
Sets vavlidates = false and returns this for method chain. -
getDataKind
-
setDataKind
-
getControllerContext
-
setControllerContext
-
get
public SplibRecord get(String itemName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException Obtains record. -
getRootRecordFields
-
getRootRecord
-
getRootRecord
-
getConfirmedWarnings
-
containsConfirmedWarning
Returns boolean whether specified messageId is contained.- Parameters:
messageId- messageId- Returns:
- boolean
-
getConfirmedWarningMessageSet
-
setConfirmedWarnings
-
hasNotEmptyError
Has a notEmpty error. -
validateNotEmpty
public Set<jp.ecuacion.lib.core.jakartavalidation.bean.ConstraintViolationBean> validateNotEmpty(String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Validates notEmpty. -
validateNotEmpty
public Set<jp.ecuacion.lib.core.jakartavalidation.bean.ConstraintViolationBean> validateNotEmpty(Locale locale, String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Validates notEmpty. -
getNotEmptyItemPropertyPathList
protected List<String> getNotEmptyItemPropertyPathList(HtmlItemContainer rootRecord, String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean) Supplies NotEmpty fields in rootRecord.This became a independent method because some form doesn't use "notEmpty()". For example, searchForm uses "notEmptyOnSearch()", not "notEmpty()".
-