Hello Dan,
I solved this problem in another way.
I just changed a bit of code in
templates\vm\controls\html\jetspeed.vm
In the place, where Portlet title is output, I placed this code:
#if($l10n.get($portlet_instance.Title))
$l10n.get($portlet_instance.Title)
#else
$portlet_instance.Title
#end
Portlet's title is a key for Localization resources file. If resource
isn't found, than just portlet's title is shown as is.
Wednesday, November 17, 2004, 11:52:12 PM, you wrote:
DM> Hi folks,
DM> I'm interested in having localized titles for the portlets, but not
DM> really interested in maintaining different psml files, since the layout
DM> for each locale the same.
DM> I saw some pointers in this thread:
DM> http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&by=thread&from=305498
DM> And have been sucessful in overriding the getTitle() method on the
DM> VelocityPortlet. However, Kim asks the $64000 question:
DM> "Any pointers on how to get [the locale] inside the getTitle() method?"
DM> I was looking through some of the other Jetspeed source code and saw
DM> this kind of call:
DM> this.runDataService =
DM> (JetspeedRunDataService)TurbineServices.getInstance()
DM> .getService(RunDataService.SERVICE_NAME);
DM> rundata = this.runDataService.getCurrentRunData();
DM> This seemed like it would work, since if the rundata can give me the
DM> user object. However, when I put this code in my subclass of
DM> VelocityPortlet, I don't get a JetspeedRunDataService back from
DM> TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME)
DM> Instead, I get an instance of
DM> org.apache.jetspeed.services.resources.JetspeedResourceService, even
DM> though RunDataService.SERVICE_NAME is "RunDataService".
DM> I tried just instantiating JetspeedRunDataService and calling init on
DM> it, but that give me a null pointer exception (and the Turbine services
DM> webpage implies that that is not what I should be doing, since services
DM> are singletons:
DM>
http://jakarta.apache.org/turbine/turbine/development/turbine-2.3/services/index.html).
DM> What's the proper way to get the User object from a VelocityPortlet?
DM> I'm overriding getTitle(), so I need to get the User object in there.
DM> Thanks,
DM> Dan
DM> ---------------------------------------------------------------------
DM> To unsubscribe, e-mail:
DM> [EMAIL PROTECTED]
DM> For additional commands, e-mail:
DM> [EMAIL PROTECTED]
--
Best regards,
Peter mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]