Accessing portal content with bookmarkable URLs+Parameters
antoine_h Apr 27, 2011 5:56 AMHello,
Some discussions are on this subject, but quite old and none with GateIn.
See : http://community.jboss.org/message/425500#425500
I really miss the PortalCommandFactory, and URLFactory (URLFactoryDelegate, UrlCodecService, etc...) and the way it was architectured and running in JBoss Portal.
I can see the new architecture is very interesting, to be able to run many kind of "Application" in the portal.
It also allows to run some PortalContainers, with each running several Portals.
So, there is left to retrieve a way to build the URL, and by this way, to be able to manage the access to Pages and Portlets from outside of the Portlet providing it's ActionUrl or RenderUrl.
"Outside" is for Bookmarks, or also for calling another page/portlet ActionUrl from a JSF application running in a Portlet in the portal, with the javax.portlet.faces.ViewLink=true of the JBoss Portlet Bridge, etc...
For the "URLFactory" part, there is the :
- URLBuilder, PortalURLBuilder that can be called with the GateIn Portal WebUI components : UIComponent, UIPage, UIPortlet, etc...
- The PortalContainer, POMDataStorage, that can be called to get the GateIn Portal Config Model Objects (the "Pom") : Page, Application, etc... (the GateIn Portal WebUI components are only for the Pages and Portlet that are in the current active page)
- The PortalDataMapper that provide good methods and samples on how to bridge from the GateIn Portal Config Model Objects to the GateIn Portal WebUI components.
I managed with all this to make some builder for some Url that aims at any Page/Portlet in any Portal.
It is not easy to find the Ids from the names, the UIPortlet "applicationId" from the Application Pom data (see UIPortlet#setState() method), etc... but it works.
First question : Any tip to find the way the Url is parsed, and the process is dispatch in the Portal, then in the Page/Portlet processing ? Where to look for this ? any classes or component or service that are in charge of this ?
I have not looked yet at this part, but I guess it is around the PortalRequestContext etc...
Any clue is welcome...
Second question : Is ther a way, yet built in, or quite ready to make, to have some PortletApplication "clear name or Id" in the Url Paramater, and that is not the database storageName of the Application ?
As far as I can see, the Porlet Action or Render Url is built with this kind of parameter : "portal:componentId=5adf4224-35e9-444b-a65f-95156fb14a86"
The portal:componentId is the storageName of the Pom Application in the Portal configuration (Page.xml, Navigation.xml, and the Portlet.xml in the War Application).
This is annoying : the storageName is changing each time the Portal configuration is changed.
To add a page, I have not found (yet) another way to clear the database, so the storageName and storageId are changed, so the Bookmark won't work anymore.
When going from dev, test, to prod environments, I cannot see a way to modify the portal page structure without reloading the database of PortalConfig from the config files.
Hence, the idea to make a custom delegate "CommandFactory" and "UrlFactory", to build and parse the Url with a custom way.
The custom way would use some "Portlet/Application names/Ids" that would be stable over each config loading in the Portal configuration in the database.
This is yet the case with the Page : the url uses the Page Navigation path, which is stable (unless to change the names and references etc...).
I am quite sure this is possible and I have missed something.
Any indication is very welcomed...
JSF2 : With JSF2 coming, there is some JSF bookmarkable url provided.
It would be worth to allow the full chain of Portal/Page/Application/Jsf content to be bookmarkable, even if the portal configuration have been reloaded in the database, from the config files.
JIRA ? : main focus would be to provide Urls with the Application name/Id independant from the storageName (or Id).
second focus : provide some more structured and module oriented way to code and decode the Url.
If I did not missed these thing in the portal : make some jira ?
Thanks for the answer or participation to the discussion.
Antoine
JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.