Interface UserServiceAssociationRecordFormFactory
public interface UserServiceAssociationRecordFormFactory
This interface defines a factory to create a
UserService
replacing
the default record form in the context of an associated object to be created
or accessed.
Definition in the data model
The factory must be declared under the element
<osd:association>
. For example:
where<xs:annotation> <xs:appinfo> <osd:association> <recordForm osd:class="com.foo.MyFactory"/> ... </osd:association> </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(UserServiceAssociationRecordFormFactoryContext)
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(UserServiceAssociationRecordFormContext.ForCreate)
is called each time a record view must be displayed for creating a record in the context of an association.newUserServiceForDefault(UserServiceAssociationRecordFormContext.ForDefault)
is called each time a record view must be displayed for modifying a record in the context of an association.newUserServiceForDuplicate(UserServiceAssociationRecordFormContext.ForDuplicate)
is called each time a record view must be displayed for duplicating a record in the context of an association.
- Since:
- 5.9.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new instance ofUserService
for creating a record in the context of an association.Creates and returns a new instance ofUserService
for displaying a record on consultation or on modification in the context of an association.Creates and returns a new instance ofUserService
for duplicating a record in the context of an association.void
This method is called when the data model is loaded.
-
Method Details
-
newUserServiceForCreate
UserService<AssociationEntitySelection> newUserServiceForCreate(UserServiceAssociationRecordFormContext.ForCreate aContext) Creates and returns a new instance ofUserService
for creating a record in the context of an association.If this method returns
null
then the default model-driven form will be used for creating a record.- See Also:
-
newUserServiceForDefault
UserService<AssociationRecordEntitySelection> newUserServiceForDefault(UserServiceAssociationRecordFormContext.ForDefault aContext) Creates and returns a new instance ofUserService
for displaying a record on consultation or on modification in the context of an association.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<AssociationRecordEntitySelection> newUserServiceForDuplicate(UserServiceAssociationRecordFormContext.ForDuplicate aContext) Creates and returns a new instance ofUserService
for duplicating a record in the context of an association.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 association 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.
-