The language-config Element"

From Documentation
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
The allowed child elements include <tt>addon-uri</tt>. You might have multiple <tt>language-config</tt> elements in one <tt>zk.xml</tt>.
+
__TOC__
  
 +
'''Syntax:'''
 +
<language-config>
 +
    <addon-uri>''a_uri''</addon-uri>
 +
    <language-uri>''a_uri</language-uri>
 +
</language-config>
 +
 +
The allowed child elements include <code>addon-uri</code>. You might have multiple <code>language-config</code> elements in one <code>zk.xml</code>.
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 12: Line 19:
  
  
'''Note:''' Unlike most other configurations defined in <tt>WEB-INF/zk.xml</tt>, the definitions defined in language addons are applied to all Web applications sharing the same <tt>zk.jar</tt>.
+
'''Note:''' Unlike most other configurations defined in <code>WEB-INF/zk.xml</code>, the definitions defined in the language addons are applied to all Web applications sharing the same <code>zk.jar</code>.
  
In other words, the definitions in language addons are visible to all Web applications sharing the same <tt>zk.jar</tt>. Furthermore, it may cause errors in another Web application, if the classes or resources are available only in the Web application defining this.
+
In other words, the definitions in the language addons are visible to all Web applications sharing the same <code>zk.jar</code>. Furthermore, it may cause errors in another Web application, if the classes or resources are available only in the Web application defining this.
  
Thus, if it is an issue, just put <tt>zk.jar</tt> and relevant ZK libraries under the <tt>WEB-INF/lib</tt> directory.
+
Thus, if this has become an issue, you can  just put <code>zk.jar</code> and relevant ZK libraries under the <code>WEB-INF/lib</code> directory.
  
 
== The addon-uri Element ==
 
== The addon-uri Element ==
 
  [Default: ''none'']
 
  [Default: ''none'']
  
It specifies the URI of language add-on definitions. To specify more than one URIs, you have to define them with multiple <tt>addon-uri</tt>.
+
It specifies the URI of language add-on definitions. To specify more than one URIs, you have to define them with multiple <code>addon-uri</code>.
  
A language addon is used to add new components and override the definitions of existent components. Refer to [[ZK Component Development Essentials]] for details.
+
A language addon is used to add new components and override the definitions of existent components. For more information, please refer to [[ZK Client-side Reference/Language Definition|ZK Client-side Reference: Language Definition]].
  
 
For example,
 
For example,
Line 33: Line 40:
 
</source>
 
</source>
  
Then, the content of <tt>lang-addon.xml</tt> could be
+
==The language-uri Element ==
 +
[Default: ''none'']
 +
{{versionSince| 5.0.7}}
 +
 
 +
It specifies the URI of the language definition.  To specify more than one URIs, you have to define them with multiple <code>language-uri</code>.
 +
 
 +
A language definition is used to define a new set of components. For more information, please refer to [[ZK Client-side Reference/Language Definition|ZK Client-side Reference: Language Definition]].
 +
 
 +
==Acceptable Path ==
 +
Depending on the location of a <code>zk.xml</code>, the paths it can accept are different :
  
 +
===WEB-INF/zk.xml===
 +
It can accept a path that a javax.servlet.ServletContext can access like:
 
<source lang="xml">
 
<source lang="xml">
<language-addon>
+
<language-config>
<addon-name>FooApplication</addon-name>
+
<addon-uri>/WEB-INF/my-addon.xml</addon-uri>
<language-name>xul/html</language-name>
+
</language-config>
</language-addon>
 
 
</source>
 
</source>
  
==Version History==
+
===metainfo/zk/zk.xml===
 +
 
 +
It can accept a path that a class loader can access like:
 +
<source lang="xml">
 +
<language-config>
 +
<addon-uri>/metainfo/zk/my-addon.xml</addon-uri>
 +
</language-config>
 +
</source>
  
{| border='1px' | width="100%"
+
(see [https://github.com/zkoss/zk/blob/master/zk/src/main/java/org/zkoss/zk/ui/http/WebManager.java WebManager])
! Version !! Date !! Content
 
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|}
 
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 03:22, 20 December 2023


The language-config Element


Syntax:

<language-config>
    <addon-uri>a_uri</addon-uri>
    <language-uri>a_uri</language-uri>
</language-config>

The allowed child elements include addon-uri. You might have multiple language-config elements in one zk.xml.

 <language-config>
     <addon-uri>/WEB-INF/lang-addon.xml</addon-uri>
     <addon-uri>/WEB-INF/lang-addon2.xml</addon-uri>
 </language-config>


Note: Unlike most other configurations defined in WEB-INF/zk.xml, the definitions defined in the language addons are applied to all Web applications sharing the same zk.jar.

In other words, the definitions in the language addons are visible to all Web applications sharing the same zk.jar. Furthermore, it may cause errors in another Web application, if the classes or resources are available only in the Web application defining this.

Thus, if this has become an issue, you can just put zk.jar and relevant ZK libraries under the WEB-INF/lib directory.

The addon-uri Element

[Default: none]

It specifies the URI of language add-on definitions. To specify more than one URIs, you have to define them with multiple addon-uri.

A language addon is used to add new components and override the definitions of existent components. For more information, please refer to ZK Client-side Reference: Language Definition.

For example,

<language-config>
	<addon-uri>/WEB-INF/lang-addon.xml</addon-uri>
</language-config>

The language-uri Element

[Default: none]

Since 5.0.7

It specifies the URI of the language definition. To specify more than one URIs, you have to define them with multiple language-uri.

A language definition is used to define a new set of components. For more information, please refer to ZK Client-side Reference: Language Definition.

Acceptable Path

Depending on the location of a zk.xml, the paths it can accept are different :

WEB-INF/zk.xml

It can accept a path that a javax.servlet.ServletContext can access like:

<language-config>
	<addon-uri>/WEB-INF/my-addon.xml</addon-uri>
</language-config>

metainfo/zk/zk.xml

It can accept a path that a class loader can access like:

<language-config>
	<addon-uri>/metainfo/zk/my-addon.xml</addon-uri>
</language-config>

(see WebManager)



Last Update : 2023/12/20

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.