Class SplibGeneralController.ControllerContext
- Enclosing class:
SplibGeneralController<S extends SplibGeneralService>
Since properties are many, the properties are passed not by the constructor, but by method chains.
-
Method Summary
Modifier and TypeMethodDescriptionfunction()Returns a name that describes its functionality.Storesfunctionand returnsControllerContext.String[]ReturnsfunctionKinds.functionKinds(String... functionKinds) StoresfunctionKindand returnsControllerContext.Returns a html filename linked to the controller.htmlFilenamePostfix(String htmlFilenamePostfix) StoreshtmlFilenamePostfixand returnsControllerContext.Returns a rootRecordName linked to the controller.mainRootRecordName(String rootRecordName) StoresrootRecordNameand returnsControllerContext.Returns a name that classifies the functions specified infunctionfield.subFunction(String subFunction) StoressubFunctionand returnsControllerContext.
-
Method Details
-
functionKinds
StoresfunctionKindand returnsControllerContext.- Parameters:
functionKinds- functionKinds
-
functionKinds
ReturnsfunctionKinds.functionKinddesignates a kind of functions.
It's used for paths of html files. If the default url path is/public/account/pageand functionKind ismaster-maintenance, the resultant URL would be/public/master-maintenance/account/page.You can specify multiple clasification strings like
"master-maintenance", "account-related-master".- Returns:
- functionKinds functionKinds
-
function
- Parameters:
function- function- Returns:
- ControllerContext
-
function
Returns a name that describes its functionality.It is used for the prefix of various classes such as form and record, and the "xxx" part of URLs such as /account/xxx/search.
It is not possible to have the same function name for multiple functions.It is recommended to use the same name as the entity name, such as "accGroup". (Due to implementation, the entity name is given to the function name and each class, which makes it easier to understand)
However, in reality, there can be multiple screens in which the same entity is mainly used. In that case you can change the name, like "accGroupManagement" and "accGroupReference".It is not possible to specify the same function in different Controllers. The value of this field is also passed to the html side and used with the same parameter name.
- Returns:
- function
-
subFunction
@Nonnull public SplibGeneralController.ControllerContext subFunction(@RequireNonnull String subFunction) - Parameters:
subFunction- subFunction- Returns:
- ControllerContext
-
subFunction
Returns a name that classifies the functions specified infunctionfield.It is used when a function includes a series of functions such as search-list-edit, the name for each function (edit).
It cannot be
null. Even if not specified, it's "" by default.
There is usually no problem in not specifying it unless there are multiple controllers with the same function.
- Returns:
- subFunction
-
htmlFilenamePostfix
@Nonnull public SplibGeneralController.ControllerContext htmlFilenamePostfix(String htmlFilenamePostfix) - Parameters:
htmlFilenamePostfix- htmlFilenamePostfix- Returns:
- ControllerContext
-
htmlFilenamePostfix
Returns a html filename linked to the controller.Normally, an html filename is specified as
function + capitalize(subFunction). But if there are multiple controllers on one screen (= means "for one html file"), the subFunction of each controller and the postfix of the html file name may be different.
In that case, specify postfix withhtmlFilePostfix.
The filename would befunction + capitalize(htmlFilenamePostfix).It may be
null. In that caseSplibGeneralController.getDefaultHtmlPageName()takes care.- Returns:
- htmlFilenamePostfix
-
mainRootRecordName
- Parameters:
rootRecordName- rootRecordName- Returns:
- ControllerContext
-
mainRootRecordName
Returns a rootRecordName linked to the controller.The Field name of the record directly defined in the form normally uses the corresponding entity name.
Especially when you use the list-edit template, there is a rule that only one record is kept under the form, so it is recommended to make it the same as the entity name.
(In list-edit template, other patterns are not supported as they are not necessary and have not been implemented before.)On the java side, recordName is used for automatic completion when it is troublesome to write it every time.
The value of this field is also passed to the template on the html side and used with the same parameter name.In the case of page-general, the record may not exist. In that case, rootRecordName field stored in the controller becomes null. If not set, the value which is same as function is returned.
- Returns:
- rootRecordName
-