Specifications contained herein are subject to change and these changes will be reported in subsequent release notes or new editions. All rights reserved. Other company and product names mentioned herein may be trademarks of their respective owners. Getting Started with Web Application Development. Developing Web Applications. Working with Application Servers.

Author:Moogumi Dairr
Language:English (Spanish)
Published (Last):8 June 2016
PDF File Size:20.21 Mb
ePub File Size:8.82 Mb
Price:Free* [*Free Regsitration Required]

Manually Externalizing Strings from View Files. Associate the Message Bundle with the Application Bean. Configuring the Application's Default and Supported Locales. Adding a Session Bean for Locale Management. Steps to Localize the Sample Application. To localize Composite Application Framework CAF application projects, you must externalize the strings that the application displays. You externalize strings by placing them in to ResourceBundle files, also known as message bundles.

The localized application uses references to the hardcoded strings contained in your application. These references point to the localized strings in the message bundle. You create these references using binding expressions. After you have the original application strings in message bundles, you can then translate the strings to the language you want.

At run time, the server retrieves the appropriate strings from the message bundle. For example, you might have a user interface that includes a text box with a label and a button.

The application issues an error message when the user fails to supply a valid value in the text box. To localize this application, you would externalize the label for the text box, the label for the button, and the error message string.

At run time, when rendering the user interface, the server retrieves the labels for the text box and the button from the message bundle containing the translated strings. If the user clicks the button without supplying a value in the text box, the server also retrieves the error message from the message bundle.

If your users require different languages, you can translate the strings into multiple languages, each with their own message bundle. At run time, the server determines the appropriate language for the logged in user and retrieves strings from the message bundle that corresponds to the user's language preference or locale setting.

Be aware that using CAF for the development of Web applications has been deprecated in webMethods version 8. If you are working with CAF version 8. Note: This tutorial includes a sample project that you can use to experiment with the localization process. A finished, localized version of the sample is also provided so you can see what the application should look like when it is localized. For information about downloading and importing the example project, see The Localization Example Project.

You externalize strings from Java code for a CAF portlet application in the same manner you would externalize strings for any Java code. For information about localizing Java code, see Java documentation about the basics of using ResourceBundle files. You need to use the proper locale information, which for a portlet application, you obtain from the FacesContext when you invoke ResourceBundle. There are two methods for obtaining the localization of FacesContext.

Your application view files can contain strings to localize. For example, you might want to localize the value of an output text or the label of a user interface control. To localize the strings in the. The following lists the tasks you perform to manually externalize strings from view files. Alternatively, webMethods CAF provides a localization tool that you can use to externalize strings from a view file.

The default message bundle for a CAF portlet application is com. If you want to change it, update the Faces Configuration. Locate the hardcoded strings in your view file and add them to the message bundle.

To add strings to the message bundle:. When you focus on the view file again, the Bindings view will show the strings you added under the Resources node.

After you add the strings into the message bundle, you can bind the strings to user interface controls via binding expressions. At run time, the application server uses the binding expression to locate the string to use for a control in the view. To add binding expressions to bind strings in the message bundle to user interface controls:.

The localization tool automatically replaces the hardcoded strings that it externalizes with the appropriate binding expressions. For each user interface control for which the tool externalizes a string, it uses the following format for the binding expression where project identifies the name of the project, viewFilename is the name of the view file, and stringID is based on the first four words of the original string:.

For example, if the project is named Sample, the view file is named default. After selecting the localization tool from the menu, the tool immediately externalizes the strings from the view file. You cannot revert this process. If you need to recover the original view file and properties for the user interface controls, use the Eclipse Local History feature. To use the localization tool to programmatically externalize strings from a view file:.

The tool externalizes the strings and adds them as resources to the message bundle associated with the page bean. When defining the page navigation, you can specify the titles to use for each page. Additionally, you can use the page titles for user interface controls, for example in bread crumbs. This step is required for CAF Web applications only. If you are creating a portlet application, you do not need to perform this step.

When you are not localizing a page title, you leave the Resource Key attribute blank. However, if you want to localize a page title, you specify the Resource Key attribute. When you specify the Resource Key attribute, rather than use the value in the Title attribute, webMethods CAF uses the specified resource key to obtain the localized title. It searches the message bundle that is associated with the application bean to find the string in the message bundle that is identified by the resource key.

As a result, to localize a page title, you need to externalize the string used for the page title by placing it in the message bundle and configure the resource key for the page in the navigation configuration.

You use the faces configuration file faces-config. For more information about how the server uses the default and supported locales at run time, see Managing the Language Used for a CAF Web Application. To configure the default and supported locales for a CAF Web application:. If you use a language for which a language pack is provided, the libraries for JSF have already been localized for you.

Download the seed language pack and unzip the file into an empty directory. The seed language pack includes an ant build. Edit the build. Run 'generate.

The steps above will generate refactored lang. Using a text editor, edit the refactored lang. Remove the refactored lang. Run build. Deploy the language pack as described in the following procedure. Stop My webMethods Server. Run "mws. Start My webMethods Server. At run time, the application server determines which language pack to use for a Web application as follows:. You can have more control over the locale that an application server selects for a user.

For CAF Web applications, a developer handles locale management by first adding a session bean for handling locale management to the application. Then the developer can override the locale for a view by binding the locale property for the view to the session bean that handles locale management. After determining the locale, the application server must obtain the resource bundle to use for that locale. You override the locale for a view by binding the view's Locale property to the session bean that you added for locale management.

To bind the Locale property for a view to the session bean for locale management:. My webMethods Server determines the language pack to use for a portlet application based on the session locale of the user who is accessing the application.

To determine the language to use for a portlet application, My webMethods Server performs the following steps:. To have more control over the locale that My webMethods Server uses for a particular user, a My webMethods Server administrator can use Locale Administration to configure locale rules.

For instructions, see Using Locale Rules below. After determining the locale, My webMethods Server must obtain the resource bundle to use for that locale. To change it, perform the following procedure. Then select fr : French for Result. After determining the session locale, the application server or My webMethods Server obtains the resource bundle to use for that locale. For more information about how to determine the session locale, see one of the following:.

You can have multiple resource bundles for the same application, each supporting a different locale. When naming the set of resource bundles for a locale, you assign them each the same base name. For example, the following resource bundles have the base name "ViewStrings":. To obtain the appropriate resource bundle, the application server or My webMethods Server invokes the standard Java ResourceBundle.

If a resource bundle does not exist for the specified locale, the ResourceBundle. If the ResourceBundle. To avoid this exception and always have a resource bundle returned, create a resource bundle and assign it the base name without a language code or country code extension. This is the fallback resource bundle.

For example, continuing with the example, you would create a resource bundle named ViewStrings.


webMethods Designer Composite Application Framework Help

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy. See our Privacy Policy and User Agreement for details. Published on Jan 22, Introduction to webMethods and CAF.


Applicable versions

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. What is not smart is to use log method from com. BaseFacesBean , beause it logs as jsf logger, so it shares configuration for logging with other things in jsf - it's not application specific.


Subscribe to RSS

The scope of the test is webMethods CAF 8. The test assumes a general understanding of Java, Web services and Internet. The test is designed to test for skills of how to implement webMethods CAF applications in an organization. Individuals who successfully complete the webMethods 8.


webMethods 8.x Certified CAF Developer - Software AG


Related Articles