Interface UserServiceRecordFormFactory
UserService
replacing
the default model-driven record form. Regarding UIForm
, it allows
implementing more advanced user interfaces, for instance navigating between
multiple pages, or accessing and manipulating
multiple records and dynamic objects.
In the context of an association, the user service can be further refined by
implementing UserServiceAssociationRecordFormFactory
.
Definition in the data model
The factory must be declared under the element
<osd:table>
. For example:
where<xs:annotation> <xs:appinfo> <osd:table> <primaryKeys>/id</primaryKeys> <recordForm osd:class="com.foo.MyFactory"/> </osd:table> </xs:appinfo> </xs:annotation>
com.foo.MyFactory
is
the fully qualified name of a class implementing this interface.
The declaration may also use parameters:
where<recordForm class="com.foo.MyFactory"> <param1>...</param1> <param2>...</param2> </recordForm>
param1
and param2
are JavaBean properties
of the com.foo.MyFactory
class.
For more information, see the JavaBean specification.
Life cycle
- If the concrete factory is referenced by a data model element, then,
when the data model is loaded:
- the specified factory class is instantiated through its default
constructor and the setters of the JavaBean properties
are called (in the example above,
setParam1(...)
andsetParam2(...)
); - then, the method
setup(UserServiceRecordFormFactoryContext)
is called for the new instance).
- the specified factory class is instantiated through its default
constructor and the setters of the JavaBean properties
are called (in the example above,
- During the operational phase: the method:
newUserServiceForCreate(UserServiceRecordFormContext.ForCreate)
is called each time a record view must be displayed for creating a record.newUserServiceForDefault(UserServiceRecordFormContext.ForDefault)
is called each time a record view must be displayed for modifying a record.newUserServiceForDuplicate(UserServiceRecordFormContext.ForDuplicate)
is called each time a record view must be displayed for duplicating a record.
- Since:
- 5.9.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new instance ofUserService
for creating a record.Creates and returns a new instance ofUserService
for displaying a record on consultation or on modification.Creates and returns a new instance ofUserService
for duplicating a record.void
setup
(UserServiceRecordFormFactoryContext aContext) This method is called when the data model is loaded.
-
Method Details
-
newUserServiceForCreate
UserService<TableViewEntitySelection> newUserServiceForCreate(UserServiceRecordFormContext.ForCreate aContext) Creates and returns a new instance ofUserService
for creating a record.If this method returns
null
, then the default model-driven form will be used for creating a record.In order to improve the integration of the service, it is recommended to implement
UserServiceForCreate
rather thanUserService
.- See Also:
-
newUserServiceForDefault
UserService<RecordEntitySelection> newUserServiceForDefault(UserServiceRecordFormContext.ForDefault aSelection) Creates and returns a new instance ofUserService
for displaying a record on consultation or on modification.If this method returns
null
then the default model-driven form will be used for displaying a record on consultation or on modification.- See Also:
-
newUserServiceForDuplicate
UserService<RecordEntitySelection> newUserServiceForDuplicate(UserServiceRecordFormContext.ForDuplicate aSelection) Creates and returns a new instance ofUserService
for duplicating a record.If this method returns
null
then the default model-driven form will be used for duplicating a record.- See Also:
-
setup
This method is called when the data model is loaded. It may be used to check that this factory supports the table that references it.Do note that during this step, all models may not be properly loaded. Thus, the repository should not be accessed during this step.
-