[JBoss Seam] - Dynamic data sources with EntityManager
by wiberto
I have an application where the data source it uses is saved in the database. This is because each user can have its own data source.
So UserA will have an entry in it's user information table that says to use data source jdbc/UserA.
Lets assume that this entry is already configured in the app server itself.
How do I tell the EntityManager at runtime to use that datasource.
If this was a static configuration I know I will have the persistence unit defined in my persistence.xml file and I would set the annotation in my entity. Something like this
| @PersistenceContext(unitName="userAunit")
| private EntityManager em;
|
So how do I make this generic? Do I need to override any EntityManager API to be able to select the unitName at run time? Also, can I create persistence units on the fly?
Thanks in advanced,
Jose
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070241#4070241
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070241
18Â years, 8Â months
[JBoss Portal] - Re: PortletBridge woes
by cdelashmutt
I'm still trying to get a better understanding of why my pages aren't getting transformed properly with the portlet bridge XSLT transform.
At first, I thought it might have had something to do with the uppercase tag names in the XSLT, but I found out that was a conscious choice by the portletbridge folks. Apparently NekoHTML, the library the team uses to try and clean up the HTML code, uppercases all tag names by default. Apparently, this is actually what is defined by the HTML 4 specification, according to their FAQ at http://people.apache.org/~andyc/neko/doc/html/faq.html#uppercase. I'm still trying to get to the root of this issue. If anyone else is interested, I can try to post an example here of the source, and the XSLT.
In any event. I got to thinking about this a bit, and I'm wondering if XSLT will be feasible for a portal user. Although I think that transforming to XHTML and then using XSLT is technically the best way to go for web-clipping, I doubt whether most portal admins will be able to use it. Also, I'm not sure if that the default behavior of simply grabbing a whole page and displaying it in a portlet is the right approach, either. I would think that in a lot of situations, you really want to grab some small piece of a page instead, like a particular paragraph, or a table or something. It would be great if you could have a UI that would let you simply select the sections of the page you wanted to clip out, and let the portlet figure out the best way to grab those elements (by "id" attribute, regexp, XPath, etc).
I think, for now, the portletbridge structurally still makes sense, but it may need to be adjusted to add in some better ease of use and alternate transformation methods.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070239#4070239
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070239
18Â years, 8Â months