[opencms-dev] What sis wrong with"OpenCms.getWorkplaceManager().getMessages(locale)"? (inCmsExplorerContextMenu.java)

Shi Yusen shiys at langhua.cn
Mon Jul 17 15:48:22 CEST 2006


Hi Harald,

Nothing wrong, it's a how to.

I guess you want to use your own function in the context menu and need to
show your own i18n message, isn't it?

If so, I think you'd better create your module com.mypackage, and under the
/system/modules/com.mypackage/classes/com/mypackage/ create
messages.properties, messages_de.properties and etc. Publish the module, the
properties should be export to rfs. Restart tomcat, you should see the
message value in context menu correctly.

In /org/opencms/workplace/CmsWorkplaceMessages.java:
    public CmsWorkplaceMessages(Locale locale) {
        super(locale);
        setBundleName(WORKPLACE_BUNDLE_NAME);
        addMessages(collectModuleMessages(locale));
    }
Have a look on the implement of collectModuleMessages(locale). That's why.

Regards,

Shi Yusen/Beijing Langhua Ltd.
--------------------------------------------------------------
Tel: 86-10-88514088, 88514099
Fax: 86-10-88514099
Email: shiys at langhua.cn
Website: http://www.langhua.cn/
--------------------------------------------------------------
 
-----邮件原件-----
发件人: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.
org] 代表 Brabenetz, Harald
发送时间: 2006年7月17日 18:58
收件人: opencms-dev at opencms.org
抄送: Alexander Kandzior
主题: [opencms-dev] What sis wrong
with"OpenCms.getWorkplaceManager().getMessages(locale)"?
(inCmsExplorerContextMenu.java)

What is wrong with "OpenCms.getWorkplaceManager().getMessages(locale)" ?



in CmsExplorerContextMenu.CmsExplorerContextMenu has changed the
following lines:
6.0.X:
CmsMessages messages =
OpenCms.getWorkplaceManager().getMessages(locale);
into (6.2.X):
CmsMessages messages = Messages.get().getBundle(locale);




I have the following Problem:
I have create my own messages.properties into my Package
(com.mypackage.messages.properties)

Since 6.2.X The ContextMenue cannot interpret my Message-Resource-Keys
placed in my messages.properties:

The following Code doesn't work since 6.2.X:
<entry key="%MyMessageResourceKey%" uri="commons/myAction.jsp%" rules="d
d iiii iiii dddd" order="2" />




Thanks for your reply anyway.

With friendly regards,
Harald Brabenetz


****************************************************************************
***********************
The information in this email is confidential and may be legally privileged
Access to this email by anyone other than the intended addressee is
unauthorized. If you are not the intended recipient of this message, any
review, disclosure, copying, distribution, retention, or any action taken or
omitted to be taken in reliance on it is prohibited and may be unlawful. If
you are not the intended recipient, please reply to or forward a copy of
this message to the sender and delete the message, any attachments, and any
copies thereof from your system.
****************************************************************************
***********************


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list