The Library Properties"

From Documentation
 
(45 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
Here is a list of properties that ZK depends on.
+
__TOC__
  
== How to Define ==
+
Here is a list of supported library properties that ZK supports. There are several different scopes you can configure for a library property. All properties support '''system/application''' scope, but some properties support '''page/component''' scope. Please check each property's page to know its supported scope.
To define a library property, you can configure it in <code>WEB-INF/zk.xml</code>.
 
[[ZK Configuration Reference/zk.xml/The library-property Element | The library-property Element]] for more information. For example,
 
  
<source lang="xml">
+
= System Scope =
<library-property>
+
If you define a library property as a system property within the configuration file of your web server, though the system property affects the whole system, not just one web application.
<name>org.zkoss.zul.Button.mold</name>
 
<value>trendy</value>
 
</library-property>
 
</source>
 
  
Alternatively, you can define it as a system property with the configuration file of your Web server, though the system property affects the whole system, not just one Web application.
+
= Application Scope =
 +
To make a library property effective for the whole application, configure it in <code>WEB-INF/zk.xml</code>. For more information, please refer to [[ZK Configuration Reference/zk.xml/The library-property Element | zk.xml]].
  
== <i>class</i>.mold ==
+
For example,
Default: none
 
[Since 5.0.0]
 
 
 
It specified the default mold of the specified component. The property name is a concatenation of the class name of the component and <tt>mold</tt>. For example, the property for the button's default mold is called <tt>org.zkoss.zul.Button.mold</tt>.
 
  
 +
'''Single value'''
 
<source lang="xml">
 
<source lang="xml">
 
<library-property>
 
<library-property>
Line 29: Line 21:
 
</source>
 
</source>
  
== org.zkoss.net.URLEncoder ==
+
'''Multiple values'''
Default: java.net.URLEncoder
 
[Since 3.6.3]
 
 
 
It defines the class that implements the <javadoc type="interface">org.zkoss.net.URLEncoder</javadoc> interface. By default, it uses <tt>java.net.URLEncoder(s, "UTF-8")</tt> to encode the URL string. However, if you want to use a different encoder, you can implement one and specify with this property.
 
 
 
== org.zkoss.util.label.classpath.charset ==
 
Default: UTF-8
 
[since 3.6.0]
 
 
 
It defines the charset used to encode i3-label.properties if the file is located in classpath.
 
 
 
== org.zkoss.util.label.web.charset ==
 
Default: UTF-8
 
[since 3.6.2]
 
 
 
It defines the charset used to encode i3-label.properties if the file is located in a Web application.
 
 
 
Prior to 3.6.2, the property is called org.zkoss.util.label.WEB-INF.charset.
 
 
 
== org.zkoss.util.label.web.location ==
 
Default: /WEB-INF/i3-label.properties
 
[Since 3.6.2]
 
 
 
It specifies where i3-label.properties are named and located.
 
 
 
== org.zkoss.util.logging.realCauseBriefly ==
 
Default: 6
 
[Since 3.6.1]
 
 
 
It defines the number of lines to log an error message.
 
 
 
If nonpositive is specified, the full stack traces are logged. Notice that # of lines don't include packages starting with <tt>java</tt>, <tt>javax</tt>, <tt>sun</tt>, or <tt>bsh</tt>.
 
 
 
 
 
== org.zkoss.util.logging.warningBriefly ==
 
Default: 3
 
[Since 3.6.1]
 
 
 
It defines the number of lines to log a warning message.
 
 
 
If nonpositive is specified, the full stack traces are logged. Notice that # of lines don't include packages starting with <tt>java</tt>, <tt>javax</tt>, <tt>sun</tt>, or <tt>bsh</tt>.
 
 
 
== org.zkoss.web.classWebResource.cache ==
 
Default: true
 
[Since 3.6.3]
 
 
 
It specifies whether to allow the browsers to cache the so-called class Web resources<ref>Class Web resources are resources that can be loaded by use of "~./*".</ref>.
 
 
 
By default, it is true. It means the static class Web resources are cached in browsers if possible, unless you upgrade ZK to a different version.
 
 
 
Notice the you can control the immutable period of the CSS files of class Web resources with
 
another property called <code>org.zkoss.web.classWebResource.cache.CSS.hours</code>.
 
 
 
If you are developing a component, it is better to turn it off (so you can force browser to load modified CSS and JS files by pressing F5).
 
 
 
 
<source lang="xml">
 
<source lang="xml">
 
<library-property>
 
<library-property>
<name>org.zkoss.web.classWebResource.cache</name>
+
<name>org.zkoss.bind.proxy.IgnoredProxyClasses</name>
<value>false</value>
+
<appendable>true</appendable>
 +
<list>
 +
<value>java.util.Date</value>
 +
<value>java.sql.Date</value>
 +
<value>java.sql.Timestamp</value>
 +
<value>java.math.BigDecimal</value>
 +
<value>java.math.BigInteger</value>
 +
</list>
 
</library-property>
 
</library-property>
 
</source>
 
</source>
  
<blockquote>
 
----
 
<references/>
 
</blockquote>
 
  
== org.zkoss.web.classWebResource.cache.CSS.hours ==
+
= Page scope =
Default: 8760
+
Notice that '''not all properties support this scope''', please check each property's page.
[Since 3.6.3]
+
Put  <code><custom-attributes></code> in a zul out of any component:
 +
<source lang='xml'>
 +
<custom-attributes org.zkoss.zul.listbox.rod="false"/>
  
It specifies the number of hours in that period the CSS files of class Web resources won't be changed.
+
<listbox id="box1">
 +
</listbox>
  
By default, it is 8760 (the same as other class Web resources). Notice that the resource is reloaded. If you want to turn off the cache of the CSS files of class Web resources, you can specify a non-positive value.
+
<listbox id="box2">
 
+
</listbox>
<source lang="xml">
 
<library-property>
 
<name>org.zkoss.web.classWebResource.cache.CSS.hours</name>
 
<value>8760</value>
 
</library-property>
 
 
</source>
 
</source>
  
== org.zkoss.web.classWebResource.cache.etag ==
 
Default: false
 
[Since 5.0.1]
 
  
It specifies whether to use ETag to detect and return 304 for matched resource.
+
= Component Scope =
 +
Notice that '''not all properties support this scope''', please check each property's page.
 +
Put <code><custom-attributes></code> under a specific component:
 +
<source lang='xml'>
  
If turned on, the cached resource won't be reloaded if the user presses F5 to reload.
+
<listbox>
 
+
    <custom-attributes org.zkoss.zul.listbox.rod="false"/>
== org.zkoss.web.util.resource.dir ==
+
    ...
Default: <i>none</i>
+
</listbox>
[Since 5.0.0]
+
</source>
 
 
It specifies a directory, where ZK will load the so-called Class-Web Resources (CWR), in addition to the class path. CWR includes JavaScript files, CSS files, and other resources that are specified in the form of <tt>~./xxx</tt>.
 
 
 
By default, ZK only searches the class path for the required CWR. By specifying a directory here, ZK will search the directory first and then the class path. It implies a developer can override the default behavior by providing a file with the same name.
 
 
 
Notice: don't put security sensitive files in the directory specified here, since they can be accessed externally.
 
 
 
== org.zkoss.web.servlet.http.URLEncoder ==
 
Default: <code>javax.servlet.http.HttpServletResponse.encodeURL</code>
 
[Since 5.0.0]
 
 
 
It specifies the class used to encode URL by including the session ID and the Servlet's context path, if necessary. The specified class must implement the <javadoc type="interface">org.zkoss.web.servlet.http.Encodes.URLEncoder</javadoc> interface.
 
 
 
In a sophisticated environment, e.g., [http://en.wikipedia.org/wiki/Reverse_proxy Reverse Proxy], the encoded URL might have to be prefixed with some special prefix. To do that, you can implement the <javadoc type="interface">org.zkoss.web.servlet.http.Encodes.URLEncoder</javadoc> interface, and then specify the class with this library property.
 
 
 
 
 
 
 
== org.zkoss.zk.ui.EmulateIE7 ==
 
Default: false
 
[since 5.0.2]
 
 
 
It specifies whether to make Internet Explorer 8 running in IE7 compatible mode. It is used if some of your JavaScript code doesn't work well in IE8.
 
 
 
Refer to [http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx Introducing IE=EmulateIE7]
 
 
 
== org.zkoss.zk.ui.event.EventQueueProvider.class ==
 
Default: <i>none</i> (it implies <javadoc>org.zkoss.zk.ui.event.impl.EventQueueProviderImpl</javadoc>)
 
[since 5.0.0]
 
 
 
It specifies the name of the class used to provide the event queue. The class must implement the <javadoc type="interface">org.zkoss.zk.ui.event.impl.EventQueueProvider</javadoc> interface.
 
 
 
== org.zkoss.zk.ui.uuidRecycle.disabled ==
 
Default: <i>false</i> (i.e., UUID recycle is enabled)
 
[since 5.0.3]
 
 
 
It specifies whether to disable the recycle of UUID. By recycling UUID will reduce the memory use of the browser. It is enabled by default.
 
 
 
== org.zkoss.zk.ui.sys.XMLResourcesLocator.class ==
 
Default: <i>none</i> (it implies <javadoc>org.zkoss.util.resource.ClassLocator</javadoc>)
 
[since 5.5.0]
 
 
 
It specifies the name of the class used to load <code>metainfo/config.xml</code>, <code>metainfo/lang.xml</code> and <code>metainfo/lang-addon.xml</code>. By default, they are loaded from the class path. If you prefer to load them from other location, implement the <javadoc>org.zkoss.util.resource.XMLResourcesLocator</javadoc> interface.
 
 
 
* Notice that you can specify the property in <code>WEB-INF/zk.xml</code>, since it is too late. Rather, you have to specify in the server's configuration (as a system property).
 
 
 
== org.zkoss.zkmax.zul.FiledownloadListener.class ==
 
Default: <i>none</i>
 
[Enterprise Edition]
 
[Since 3.5.0]
 
 
 
It specifies the name of the class that will be notified when a file download is happening. The class must implement the <javadoc type="interface">org.zkoss.zkmax.zul.FiledownloadListener</javadoc> interface.
 
 
 
A developer usually uses it to reject a download if the user tried to resume it in an unacceptable situation. For example, a developer can limit the user from downloading within upcoming 24 hours.
 
 
 
== org.zkoss.zul.client.rod ==
 
Default: <i>true</i>
 
[Enterprise Edition]
 
[since 5.0.0]
 
 
 
It specifies whether to apply [[Performance Tip#Client Render on Demand | Client Render on Demand]].
 
 
 
Notice that you can enable or disable this feature a particular component and all its descendants by specifying a custom attribute called <code>org.zkoss.zul.client.rod</code>.
 
 
 
== org.zkoss.zul.include.mode ==
 
Default: defer (3.x)
 
Default: auto (5.0)
 
[Since 3.6.2]
 
 
 
It specifies the default mode of the <tt>include</tt> component. In ZK 3, the default mode is <tt>defer</tt>, which is backward-compatible with the prior version. Since ZK 5, the default mode is <tt>auto</tt> for easier control.
 
 
 
== org.zkoss.zul.progressbox.position ==
 
Default: left, top
 
[Since 5.0.1]
 
 
 
It specifies how to display the progress box at the client. The progress box is a message used to indicate the AU requests have being processed by the server. By default, it is displayed at the left, top corner.
 
 
 
Here is a list of allowed values. If you want to specify two of them, separate them with a comma, such as <tt>left,top</tt>.
 
 
 
{|border="1" cellspacing="0" width="100%"
 
|+ Allowed Values
 
|-
 
! Value
 
! Description
 
|-
 
| bottom
 
| Align the progress box at the bottom edge of the browser window.
 
|-
 
| center
 
| Align the progress box at the center of the browser window. If it is used with left and top, it means the center in the vertical orientation.
 
|-
 
| left
 
| Align the progress box at the left edge of the browser window.
 
|-
 
| mouse
 
| Align the progress box near by the mouse pointer. If specified, it ignores all other values.
 
|-
 
| right
 
| Align the progress box at the right edge of the browser window.
 
|-
 
| top
 
| Align the progress box at the top edge of the browser window.
 
|}
 
 
 
== org.zkoss.zul.theme.browserDefault ==
 
Default: false (override browser default with ours)
 
[Since 3.6.0]
 
 
 
It specifies whether not to override the standard HTML tags, such as body's margin and padding.
 
 
 
== org.zkoss.zul.theme.fontFamilyC ==
 
Default: arial, sans-serif
 
[Since 3.6.0]
 
 
 
It specifies the font used for the content in the ZUL CSS file.
 
 
 
== org.zkoss.zul.theme.fontFamilyT ==
 
Default: arial, sans-serif
 
[Since 3.6.0]
 
 
 
It specifies the font used for the title in the ZUL CSS file.
 
 
 
== org.zkoss.zul.theme.fontSizeM ==
 
Default: 12px
 
[Since 3.6.0]
 
 
 
It specifies the size of the middle font used in the ZUL CSS file.
 
 
 
== org.zkoss.zul.theme.fontSizeMS ==
 
Default: 11px
 
[Since 3.6.0]
 
 
 
It specifies the size of the middle-smaller font used in the ZUL CSS file.
 
 
 
== org.zkoss.zul.theme.fontSizeS ==
 
Default: 11px
 
[Since 3.6.0]
 
 
 
It specifies the size of the smaller font used in the ZUL CSS file.
 
  
== org.zkoss.zul.theme.fontSizeXS ==
 
Default: 10px
 
[Since 3.6.0]
 
  
It specifies the size of the extreme small font used in the ZUL CSS file.
 
  
==Version History==
+
{{ZKConfigurationReferenceHeadingToc}}
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 09:30, 25 October 2022


The Library Properties


Here is a list of supported library properties that ZK supports. There are several different scopes you can configure for a library property. All properties support system/application scope, but some properties support page/component scope. Please check each property's page to know its supported scope.

System Scope

If you define a library property as a system property within the configuration file of your web server, though the system property affects the whole system, not just one web application.

Application Scope

To make a library property effective for the whole application, configure it in WEB-INF/zk.xml. For more information, please refer to zk.xml.

For example,

Single value

<library-property>
	<name>org.zkoss.zul.Button.mold</name>
	<value>trendy</value>
</library-property>

Multiple values

<library-property>
	<name>org.zkoss.bind.proxy.IgnoredProxyClasses</name>
	<appendable>true</appendable>
	<list>
		<value>java.util.Date</value>
		<value>java.sql.Date</value>
		<value>java.sql.Timestamp</value>
		<value>java.math.BigDecimal</value>
		<value>java.math.BigInteger</value>
	</list>
</library-property>


Page scope

Notice that not all properties support this scope, please check each property's page. Put <custom-attributes> in a zul out of any component:

<custom-attributes org.zkoss.zul.listbox.rod="false"/>

<listbox id="box1">
</listbox>

<listbox id="box2">
</listbox>


Component Scope

Notice that not all properties support this scope, please check each property's page. Put <custom-attributes> under a specific component:

<listbox>
    <custom-attributes org.zkoss.zul.listbox.rod="false"/>
    ...
</listbox>



Subsections:




Last Update : 2022/10/25

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