[
https://issues.jboss.org/browse/GTNPORTAL-3529?page=com.atlassian.jira.pl...
]
Vu Viet Phuong updated GTNPORTAL-3529:
--------------------------------------
Description:
In PortalDataMapper, we have this
{code}
if (UITabContainer.TAB_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UITabContainer.class, null, null);
} else if
(UIColumnContainer.COLUMN_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UIColumnContainer.class, null, null);
} else {
...
{code}
- This should be improved by making it more flexible, and extensible. Using ServiceLoader
to load the factories class that help to create UIContainer by their factory-id
- The proposed solution is: using factory-id attribute of container model to create
corresponding UI container type. And the creation task is delegated to a factory service,
that can be loaded via service loader. This design make gatein ui container creation more
flexible, it's easy to deploy gatein extension which define a new UI container type
with new factory-id
- factory-id has already be used before in gatein, we use it to create UITabContainer,
UIColumnContainer... This issue will add interface for factory service: UIComponentFactory
and a default implementation for create current gatein build-in container:
DefaultUIContainerFactory. It's declared as a service load by java ServiceLoader
- When gatein try to create UI container (from model loaded from database or from xml
config file). ServiceLoader will load registered UIComponentFactory services, then
delegate creation task with factory-id as argument
- A developer can deploy a jar that declare a new ui factory service, then help to create
a new type of UI container easily
was:
In PortalDataMapper, we have this
{code}
if (UITabContainer.TAB_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UITabContainer.class, null, null);
} else if
(UIColumnContainer.COLUMN_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UIColumnContainer.class, null, null);
} else {
...
{code}
This should be improved by making it more flexible, and extensible. Using ServiceLoader to
load the factories class that help to create UIContainer by their factory-id
The proposed solution is: using factory-id attribute of container model to create
corresponding UI container type. And the creation task is delegated to a factory service,
that can be loaded via service loader. This design make gatein ui container creation more
flexible, it's easy to deploy gatein extension which define a new UI container type
with new factory-id
factory-id has already be used before in gatein, we use it to create UITabContainer,
UIColumnContainer... This issue will add interface for factory service: UIComponentFactory
and a default implementation for create current gatein build-in container:
DefaultUIContainerFactory. It's declared as a service load by java ServiceLoader
When gatein try to create UI container (from model loaded from database or from xml config
file). ServiceLoader will load registered UIComponentFactory services, then delegate
creation task with factory-id as argument
A developer can deploy a jar that declare a new ui factory service, then help to create a
new type of UI container easily
Make UIContainer creation more flexible
---------------------------------------
Key: GTNPORTAL-3529
URL:
https://issues.jboss.org/browse/GTNPORTAL-3529
Project: GateIn Portal
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: WebUI
Affects Versions: 3.8.2.Final
Reporter: Vu Viet Phuong
Assignee: Vu Viet Phuong
Fix For: 3.9.0.Final
In PortalDataMapper, we have this
{code}
if (UITabContainer.TAB_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UITabContainer.class, null, null);
} else if
(UIColumnContainer.COLUMN_CONTAINER.equals(container.getFactoryId())) {
uiTempContainer = uiContainer.createUIComponent(context,
UIColumnContainer.class, null, null);
} else {
...
{code}
- This should be improved by making it more flexible, and extensible. Using ServiceLoader
to load the factories class that help to create UIContainer by their factory-id
- The proposed solution is: using factory-id attribute of container model to create
corresponding UI container type. And the creation task is delegated to a factory service,
that can be loaded via service loader. This design make gatein ui container creation more
flexible, it's easy to deploy gatein extension which define a new UI container type
with new factory-id
- factory-id has already be used before in gatein, we use it to create UITabContainer,
UIColumnContainer... This issue will add interface for factory service: UIComponentFactory
and a default implementation for create current gatein build-in container:
DefaultUIContainerFactory. It's declared as a service load by java ServiceLoader
- When gatein try to create UI container (from model loaded from database or from xml
config file). ServiceLoader will load registered UIComponentFactory services, then
delegate creation task with factory-id as argument
- A developer can deploy a jar that declare a new ui factory service, then help to create
a new type of UI container easily
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)