Portlet resource bundle

Hi,
I have written and deployed a portlet.
which works very fine with the default language (english)
I want to make the same portlet available in multiple languages, rather I want to provide internationalization over this.
I have prepared a resource bundle to tackle the scene.
I have few questions based on this -
1. Where do I put this resource bundle file
2. Will the portal server be able to pick the title of the portlet from the resource bundle.
Any pointers to this will be highly appreciated.
Thanks,
Abhi

Please check portal developer doc http://docs.sun.com/app/docs/doc/817-7695 from p.83 to 85
How to add resource bundle into portlet war file and deploy. Jerry

Similar Messages

  • resource-bundle tag of portlet.xml

    Hi.
    I'd like to use resource bundle. Therefore I add following tags inside <portlet> tag of portlet.xml and create 'testprofile.properties' file.
    <resource-bundle>testprofile</resource-bundle>
    But when I start tomcat, the error occured like following.
    2004-08-05 12:01:45,437 ERROR [main]
    java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:61)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:80)
    at java.util.Properties.load(Properties.java:189)
    at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:96)
    at com.plumtree.portlet.util.PortletInfo.addPropertyBundles(PortletInfo.java:425)
    at com.plumtree.portlet.servlet.PortletServlet.digestPortletXml(PortletServlet.java:527)
    at com.plumtree.portlet.servlet.PortletServlet.initDigester(PortletServlet.java:651)
    at com.plumtree.portlet.servlet.PortletServlet.init(PortletServlet.java:60)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex ...
    So I modified portlet.xml like following and try to start tomcat again.
    <resource-bundle>testprofile.properties</resource-bundle>
    Tomcat can be started successfully.
    But when I display the portlet, error occured.
    java.util.MissingResourceException: Can't find resource for bundle com.plumtree.portlet.util.PortletResourceBundle, key LogLevel at java.util.ResourceBundle.getObject(ResourceBundle.java:314) at java.util.ResourceBundle.getString(ResourceBundle.java:274) at portlet.TWNewMailPortlet.init(TWNewMailPortlet.java:45) at com.plumtree.portlet.servlet.BaseServlet.init(BaseServlet.java:522) at com.plumtree.portlet.servlet.PortletServlet.service(PortletServlet.java:136)
    The properties file 'testprofile.properties' is not loaded successfully, maybe.
    Do you know how to specify or use ResouceBundle in using Plumtree JSR168?
    The tips of source code is following
    In Portlet class which extends GenericPortlet
    public void init(PortletConfig config) throws PortletException {  super.init(config);  PortletLogger.init("Test", getPortletContext());  ResourceBundle rb = getResourceBundle(Locale.getDefault());  for (Enumeration e = rb.getKeys(); e.hasMoreElements(); ) {   String str = (String)e.nextElement();   System.out.println(str);  } String level = rb.getString("LogLevel"); PortletLogger.setLevel(level); }

    Are you naming your resource bundles something like:
    1. messages_en.properties (for English)
    2. messages_de.properties (for German)
    and so on.
    Also, do you include these properties files in your final deployment package, because if they're not there then the messages won't be displayed.

  • Binding Resource Bundle to Portlet

    When i place resource bundle in my webroot resources folder,and i added the tag resource-bundle for my portlet.
    Its throwing exception can't find resources bundle exception.Anyone knows how to bundle resources to portlet.
    Please help me.

    For 903 codeline, you'd have to implement db lookups for resources in each message bundle. The message bundle has to be a subclass of JBoResourceBundle, but you can re-implement getContents() to go to DB to buildup the messsages.
    For a future release, we're working on a more 'global' override for all message lookups. There's a class called StringManager which is used for all framework String lookups and that is being made overridable to allow for 'one-point-of-override' for all message bundles within the framework.

  • Database resource bundles

    Hi, our ADF developers have proposed moving to database resource bundles and was wondering if this was something we could consider for our portal Java portlets as well? Is this technique unique to ADF or should it be applicable across all Java development?

    Interestingly, the guys that proposed using Database resource bundles were talking about their main issue being that they could not invalidate the cache in order to have the ADF pick up changes in the bundle unless they bounced the APP server.

  • Please : WWC-43273 - ContainerException: Unable to load resource bundle

    Please Help :(
    Development Environment:
    Application : Hello World Portlet
    OAS : 10.1.2.0.2 Installed on LocalHost
    Development Tool : JDeveloper 10.1.3.2.0
    Portal Server : 10.1.4 Installed on LocalHost
    I have followed following Tutorial for the same : http://www.oracle.com/technology/obe/obe1014portal/standards_portlets/stdsplts.htm
    My EAR WSDL (http://localhost/HelloWorld/portlets?WSDL) in OAS is working perfectly fine yeilding following output :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bind="urn:oasis:names:tc:wsrp:v1:bind" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:oasis:names:tc:wsrp:v1:wsdl">
    <import namespace="urn:oasis:names:tc:wsrp:v1:bind" location="http://www.oasis-open.org/committees/wsrp/specifications/version1/wsrp_v1_bindings.wsdl"/>
    <wsdl:service name="WSRPService">
    <wsdl:port binding="bind:WSRP_v1_Markup_Binding_SOAP" name="WSRPBaseService">
    <soap:address location="http://infra:80/HelloWorld/portlets/WSRPBaseService"/>
    </wsdl:port>
    <wsdl:port binding="bind:WSRP_v1_ServiceDescription_Binding_SOAP" name="WSRPServiceDescriptionService">
    <soap:address location="http://infra:80/HelloWorld/portlets/WSRPServiceDescriptionService"/>
    </wsdl:port>
    <wsdl:port binding="bind:WSRP_v1_Registration_Binding_SOAP" name="WSRPRegistrationService">
    <soap:address location="http://infra:80/HelloWorld/portlets/WSRPRegistrationService"/>
    </wsdl:port>
    <wsdl:port binding="bind:WSRP_v1_PortletManagement_Binding_SOAP" name="WSRPPortletManagementService">
    <soap:address location="http://infra:80/HelloWorld/portlets/WSRPPortletManagementService"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    However when i try to access the same via Register Provider wizard in Portal Server 10.1.4 i get this exception.
    An error occurred during the call to the WSRP Provider: Java stack trace from root exception:
    java.rmi.ServerException: Internal Server Error (java.lang.RuntimeException: oracle.webdb.wsrp.server.ContainerException: Unable to load resource bundle "portlet.resource.CHelloWorldBundle")
    at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:384)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:245)
    at oracle.webdb.wsrp.WSRP_v1_ServiceDescription_PortType_Stub.getServiceDescription(WSRP_v1_ServiceDescription_PortType_Stub.java:63)
    at oracle.webdb.wsrp.client.design.v1.OraWSRP_v1_ServiceDescription_PortType.getServiceDescription(Unknown Source)

    Found the solution:
    I needed to choose the Servlet 2.3/JSP 1.2 (J2EE 1.3) when creating my JSR268 Portlet.
    Also the second change I needed to make was to use J2SE ver. 1.4.2_12. To do this change the default j2se ver. of JDeveloper(i.e ver. 1.5) from project properties > libraries node > edit/change j2se definitions screen and select java.exe from j2se1.4.2_12/bin

  • File not found, Missing resource bundle

    Hi
    I have a problem in accessing files (XML and Resource bundles) in Java projects. I used to access these files in WD Java. The same piece of code does not work here.
    e.g. When I create a new file object by providing the path name I get a file not found exception. The file exists in my package and I call it this way:
    File f = new File("file.txt"); then in an input stream but it doesnt work. However in a J2EE project the same code works.
    Similarly the resouce bundle never seems to work even if I give the fully classified class name for the property file. I can access property files in WD Java with ease. I understand that the root path changes and hence the problem. How should I solve it? Is there an elegant way which makes it work in all cases? Please throw some light on the root path for these projects. Thank you.
    regards
    LNV
    Edited by: vln on Jan 16, 2008 9:34 AM

    You should be using
    <b>this.getClass().getResourceAsStream(filePath)</b>
    which will return you an InputStream.
    Check the JDK documentation for the respective methods in java.lang.Class and java.lang.ClassLoader.
    HTH!
    \-- Vladimir

  • How to compare and edit Resource bundle file using java programe

    Hi All
    I have two resource bundle with key, value and some comments. I need to write a java code to compare both of the values of the keys and if the values are different then i want to replace the second value with the first value.
    Its a programe which will udpate the second file with the first file values.
    I tried using Properties class but it didnt worked because when i am saving the file using store method it removes all the comments and the order of text also got disturbed.
    How I need to do this any help appriciated.
    Please elt me know if someone needs more info.
    Thanks in advance.

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • Resource bundle in shared library?

    Is it possible to create a resource bundle in a shared library so you can use the same resource bundle in different application?
    We are creating different ADF application and each of them should use the same resource bundle.
    I tried creating a new project that only contains the resource bundle and then add this to my jspx page:
    <c:set var="res"
             value="#{adfBundle['general.resources.generalBundle]}"/>When i do this, he can't find any entries. When i change the project properties and configure to use a single bundle for the entire project, this works.
    How can i share a bundle so each application does not need to create or copy/paste the bundle?
    Is it possible to deploy the bundle as a shared library? Even if their is nothing else, not even a single java class?
    Edited by: Yannick.O on Jul 28, 2010 10:45 AM

    Try to create a JAR with the resource file in it (under /META-INF) and add it as a library in your project.
    If it does not work, try to create a faces-config.xml file inside that directory that declares the resource file.
    I think it gets merged at runtime with the config of your application and resource bundle should be available.

  • How to deal with resource bundle in multiple applications system

    Hi all,
    I'm building new system depend on the method of
    one common model with multiple applications for the view objects
    my JDeveloper version 11.1.2.3
    my Question
    How can i merge the resource bundle for these applications
    as in the common model exists file for resouce bundle
    and each other applications contains resource bundle files how can i merge all these file in one Resource bundle file ?
    Edited by: 985756 on Apr 2, 2013 12:39 AM

    Hi,
    Please check anerjusb blog for your answer
    Hoping this will help you.
    http://andrejusb.blogspot.in/2009/12/reusing-resource-bundles-from-different.html
    Thanks & Regards,
    Vikas

  • Problem using Resource Bundle in XSLT File

    Hi All,
    I've been trying to use Resource Bundle on my XSLT file with no success for the last 2 weeks. So I would like some help to definitely end this problem.
    The fact is that i have a property file that i would like to read and it works fine when i use jsp or a servlet however when i try to call the same property file using my XSL i get the message below:
    java.util.MissingResourceException: Can't find bundle for base name thoth, locale en_US
    Follow the code from my Stylesheet that i'm calling the resource bundle:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="java.util.ResourceBundle" exclude-result-prefixes="java" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:output encoding="ISO-8859-1"/>
    <xsl:template match="page">
    <html>
    <body>
    <xsl:apply-templates select="paragraph"/>
    <xsl:variable name="resources" select="java:getBundle('thoth')"/>
    <xsl:value-of select="java:getString($resources,'general.title')"/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet. Should i have to put it some other place? Do i have some other way to read this file and show the information from the file?
    I would appreciate any help
    thanks in advance and Regards
    Fabio

    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet.
    Is the property file in your classpath? or whether the directory where the property file is residing is in your classpath. Please put only the directory where the property file is located in the classpath and try again.
    It may be working fine with the servlet because j2ee servlet containers put the classes and lib directory automatically in the classpath therefore resource bundle gets loaded even without putting it explicitly in the classpath. This doesn't happen when you try to test some component from the console.
    Let me know if this does not work.
    regards,
    Abhishek.

  • How to enumerate keys in Resource Bundle?

    Is there any way to enumerate all the keys (but not the values) of resource bundle?

    If rb is a ResourceBundle, you can enumerate the keys and values in its 'content' property with the following code:
    for (var key:String in rb.content)
        var value:* = rb.content[key];
    Gordon Smith
    Adobe Flex SDK Team

  • How to use a resource bundle in viewcontroller project

    How can I create a resource bundle for a viewcontroller project ? Is there any way to add entries to it other than adding manually editing the property file ? so that all the key generated will be unique? How to access a message in the resource bundle in my backing bean so that I can display it in my screen ?
    Thanks
    Suneesh

    Suneesh Raman wrote:
    How to access a message in the resource bundle in my backing bean so that I can display it in my screen ?Take a look at this: http://adfcodebits.blogspot.com/2010/04/bit-5-accessing-resource-bundle-from.html

  • [ERROR] could not find source for resource bundle modules.

    We are in the process of upgrading our flex application from SDK3.6 to SDK4.5.0.17899.
    Flexmojos version used for compilation is 3.9.
    The flex library project is complied with SDK4.5.0 version but BUILD is not getting SUCESS from maven.
    The following is the reason is showing and unable to find out the root cause.
    [ERROR] could not find source for resource bundle modules.
    Can you please help me out.
    Thanks,

    Copying
    /Software/FB\ Eclipse\ Plugin/Adobe\ Flex\ Builder\ 3\ Plug-in/sdks/2.0.1/frameworks/locale/en_US/charts_rb.swc into
    the 3.5 SDK directory
    /usr/local/lib/flex_sdk/3.5.0/frameworks/locale/en_US
    solves the problem.
    Not sure why as the charts_rb.swc comes from Flex 2.0

  • Error: could not find source for resource bundle charts

    I am trying to upgrade from Flex SDk 3.4 to 3.5.
    I have copied the Data Visualisation SWCs under libs, locale and rlsls folders as suggested by adobe.
    I get the following error when building the application
    flex-library:
         [java] Loading configuration file /usr/local/lib/flex_sdk/3.5.0/frameworks/flex-config.xml
         [java] Error: could not find source for resource bundle charts.
         [java]
    What am I missing? Any help is highly appreciated.
    Thanks

    Copying
    /Software/FB\ Eclipse\ Plugin/Adobe\ Flex\ Builder\ 3\ Plug-in/sdks/2.0.1/frameworks/locale/en_US/charts_rb.swc into
    the 3.5 SDK directory
    /usr/local/lib/flex_sdk/3.5.0/frameworks/locale/en_US
    solves the problem.
    Not sure why as the charts_rb.swc comes from Flex 2.0

  • Custom error messages - resource bundle

    Greetings everyone!
    My JDev version is:  11.1.2.3.0
    I've seen several threads in OTN and outside about this topic, but they seem confused (or may be it's me that is missing something).
    I have this current situation, when because of the presence of a FK in the database, when a try to delete a certain record, a popUp shows up ORA-02292 error code. I don't want to enable cascade deletion (i don't want anything to be deleted in that case at all), so i was trying to customize the error message. I've created a java class and declared it as a resource bundle in the Model project. The content is this:
    public class CustomErrorMessages extends ListResourceBundle {
        private static final Object[][] sMessageStrings = new String[][] {
    {"25014", "Another user has made a modification to this record meanwhile. Please cancel your changes!"},
        {"CREDITOR", "This party is assigned as a creditor/debtor in this contract. It cannot be deleted!"},
        {"DEBTOR", "This party is assigned as a creditor/debtor in this contract. It cannot be deleted!"}
        /**Return String Identifiers and corresponding Messages in a two-dimensional array.
        protected Object[][] getContents() {
            return sMessageStrings;
    25014 - refers to JBO-25014 and it works fine. Now CREDITOR/DEBTOR are the FK mentioned above. If i put 02292  or ORA-02292  instead of them it doesn't work at all. If i let them just like this, it works if i run the Application Module only, but not when i run the application. What does it mean?
    Also, i've noticed that the ViewController project has also a "Resource Bundle" section in the properties, but the content is disabled. Should i do any kind of configuration to make it work?
    Thank you in advance.

    Hi,
    this blog is as close as it gets to your requirement
    http://www.jobinesh.com/2011/03/customizing-business-components-error.html
    Frank

Maybe you are looking for

  • Which license to use ?

    When installing 11G XE beta on Windows following license is displayed: > Oracle Technology Network Early Adopter License Terms Export Controls on the Programs Selecting the "Accept License Agreement" button is a confirmation of your agreement that yo

  • Problem in saving tiff from PS

    I am using LR 4.1, and PS6 with ACR 7.1, although I have this same issue PS 5.1 and ACR 6.7.  I select "edit in Photoshop", and when finished save as a tiff (same problem with PSD) in the same folder where the raw file (in my case CR2) is.  The saved

  • Detail info needed in the report

    Hi , We have a summary infomation for one key figures(say sales value for item - "T-shirt" for example), but I don't have the info about the detail level info inside the item("T-shirt" -- color red, yellow or green). I want to know in the report abou

  • Moving files in Unix

    I'm stuck in a hole ....... I have a socket program, on the client's side all they do is knock on the server side, when the server accepts ..... I need to be able to move a file I have found to a certain directory. I've try to use RunTime() with proc

  • Problems importing files.

    Hi all, I'm having problems with my lightroom cc when importing files from my desktop. First, the lightroom is not generating thumbnails from those files (which I edited the metadata using the Bridge), than, when I try to import them, the software st