Skip to Content
avatar image
Former Member

EP6 Service with localization.properties problem

We are developing a service which will include localized text, and are running into issues with it locating the text.

We have already some JSP-Dynpage based iViews with localized text working, it is just the service that is not functioning properly.

The iView project layout was generated from the Eclipse Portal-Plugin, and we have the code layout as follows:

<SERVICE> \src.core\com\etc\etc\<SERVICE>.java

<SERVICE> \src.api\com\etc\etc\I<SERVICE>.java

<SERVICE> \dist\scripts\helperscriptsinhere.js

<SERVICE> \dist\PORTAL-INF\portal.xml (see contents of file below)

I have placed localization.properties (which in the documentation is said to be the default name)

into:

<SERVICE> \dist\PORTAL-INF\classes

and/or

<SERVICE> \dist\PORTAL-INF\private\clasess

but neither have helped the problem.

Localized text is being retrieved in the .java file as:

ResourceBundle objBundle = componentRequest.getResourceBundle();

objBundle.getString(strKey)

where strKey does exist in the localization.properties file.

-


PortalApp.xml -


<?xml version="1.0" encoding="ISO-8859-1"?>

<application>

<application-config>

<property name="SharingReference" value="landscape,htmlb"/>

</application-config>

<components>

<component name="MYService">

<component-config>

<property name="ClassName" value="com.etc.etc.MYService"/>

<property name="SecurityZone" value="com.sap.portal.pdk/low_safety"/>

</component-config>

<component-profile>

<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

</component-profile>

</component>

</components>

<services>

<service name="MYService">

<service-config>

<property name="className" value="com.etc.etc.MYService"/>

<property name="startup" value="true"/>

</service-config>

<service-profile>

<property name="Version" value="1.1.0"/>

</service-profile>

</service>

</services>

</application>

-


Can the following be answered:

A) What should the portalapp.xml file look like?

B) How should the packaged par look like after its archived from Eclipse or ANT? (Can you give a sample directory listing)

C) Once the Service is uploaded to the portal, does it have to always be restarted?

If so, is restart enough or does the Portal have to be restarted as well for changes to take effect?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 02, 2004 at 05:39 PM

    Long time since I've been involved with services (and only on EP5) but I have some remarks:

    You say that localized text is found by :

    ResourceBundle objBundle = componentRequest.getResourceBundle();

    objBundle.getString(strKey)

    But how do you get the componentRequest ? Most probably you are getting the resourcebundle for the dynpage which has called your service.

    I would imagine that you have to intialize the resource bundle manually in the init method of the service (using ResourceBundle.getBundle(...), see javadoc http://java.sun.com/j2se/1.3/docs/api/java/util/ResourceBundle.html)

    Add comment
    10|10000 characters needed characters exceeded