KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > i18n > TemplateMessagesUtil


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.i18n;
14
15 /**
16  * This class helps to get the messages used in templates (paragraphs, dialogs, ..). First it make a lookup in
17  * messages_templating_custom and then in messages_templating..<br>
18  * If a string is not found it returns directly the key without ?
19  * <p>
20  * This class is depricated use the fallBackMessages property of the Message class to make chains.
21  * @author philipp
22  */

23 public final class TemplateMessagesUtil {
24
25     /**
26      * Use this basename if the string is not found in the custom basename
27      */

28     public static final String JavaDoc DEFAULT_BASENAME = "info.magnolia.module.admininterface.messages_templating"; //$NON-NLS-1$
29

30     /**
31      * Name of the custom basename
32      */

33     public static final String JavaDoc CUSTOM_BASENAME = "info.magnolia.module.admininterface.messages_templating_custom"; //$NON-NLS-1$
34

35     /**
36      * Util has no public constructor
37      */

38     private TemplateMessagesUtil() {
39     }
40
41     /**
42      * Get the messages for the templates
43      * @return
44      */

45     public static Messages getMessages() {
46         return MessagesUtil.chain(new String JavaDoc[]{
47             TemplateMessagesUtil.CUSTOM_BASENAME,
48             TemplateMessagesUtil.DEFAULT_BASENAME});
49     }
50 }
Popular Tags