org.zkoss.zk.ui.sys
Class Attributes

java.lang.Object
  extended by org.zkoss.zk.ui.sys.Attributes
Direct Known Subclasses:
Attributes

public class Attributes
extends java.lang.Object

Attributes or library properties to customize the behaviors of ZK, such as page rending, fileupload and so on.

Since:
5.0.0
Author:
tomyeh

Field Summary
static java.lang.String CLIENT_ROD
          A component or page attribute to indicate if the client ROD (render-on-demand) shall be applied.
static java.lang.String GAE_FIX
          A special attribute set to the session to cause Google App Engine to update attributes to the storage.
static java.lang.String ID_TO_UUID_PREFIX
          A library property to indicate that UUID shall be generated by prefixing ID with the value stored in this property.
static java.lang.String INJECT_URI_PREFIX
          A special prefix that is used if you want to inject a special fragment into the URI of a clss Web resource (CWR).
static java.lang.String NO_CACHE
          A request attribute to indicate whether "no-cache" header is generated for the current desktop.
static java.lang.String PAGE_REDRAW_CONTROL
          The execution attribute used to control how to PageCtrl.redraw(java.io.Writer) a page.
static java.lang.String PAGE_RENDERER
          The execution attribute used to control how to render a page.
static java.lang.String PORTLET_RENDER_PATCH_CLASS
          A library property to specify the class used to patch the rendering result of a portlet.
static java.lang.String RENEW_NATIVE_SESSION
          A session attribute used to denote that the invalidation of a native session (such as HttpSession and PortletSession) does not invalidate ZK session.
static java.lang.String RESEND_DELAY
          A library property to indicate the default resend delay (an integer in milliseconds).
static java.lang.String UPLOAD_PERCENT
          A desktop attribute to indicate the completeness percentage of the current file upload.
static java.lang.String UPLOAD_SIZE
          A desktop attribute to indicate the number of bytes of the current file upload.
 
Constructor Summary
Attributes()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPLOAD_PERCENT

public static final java.lang.String UPLOAD_PERCENT
A desktop attribute to indicate the completeness percentage of the current file upload. It is an integer ranging from 0 to 99.

See Also:
Constant Field Values

UPLOAD_SIZE

public static final java.lang.String UPLOAD_SIZE
A desktop attribute to indicate the number of bytes of the current file upload. It is a non-negative long.

See Also:
Constant Field Values

CLIENT_ROD

public static final java.lang.String CLIENT_ROD
A component or page attribute to indicate if the client ROD (render-on-demand) shall be applied.

Default: true.

Applicable: ZK EE

Since:
5.0.0
See Also:
Constant Field Values

PAGE_REDRAW_CONTROL

public static final java.lang.String PAGE_REDRAW_CONTROL
The execution attribute used to control how to PageCtrl.redraw(java.io.Writer) a page. There are three different values: destkop, page, and complete.

Default: null (means auto). In other words, desktop is assumed if this is the top-level page and not being included (and other conditions). Otherwise, it assumes page.

Application developers rarely need to set this attribute, unless ZK Loader cannot decide which control to use correctly.

This control can also be specified as a request parameter called zk.redrawCtrl. For example, if you are using other technology, say jQuery, and want to load a ZUL page dynamically; as shown below:


  jQuery.ajax({
    url: "z5-load-1.zul?zk.redrawCtrl=page",
    success: function (html) {
      jQuery("#myDiv").append(html);
    }
  });

If you prefer to draw the desktop with the page, you can set the vallue to desktop. By drawing the desktop, it means HTML and BODY tags will be generated, too.

If you prefer to draw the page only (such as being included), you can set the value to page.

If the page already contains everything that the client expects such as the HTML and BODY tags, you can set the value to complete.

The difference between page and complete is a bit subtle. They don't generate HTML and BODY tags. However, page generates DIV to represents a page, while complete generates only the root components. Thus, complete is usually used for the situation that HTML and BODY are being generated by other technology, while page for a included ZK page.

Note: if Page.isComplete() is true, it has the same effect of setting PAGE_REDRAW_CONTROL to complete.

Since:
5.0.0
See Also:
ExecutionsCtrl.getPageRedrawControl(org.zkoss.zk.ui.Execution), Constant Field Values

PAGE_RENDERER

public static final java.lang.String PAGE_RENDERER
The execution attribute used to control how to render a page. The value must be an instance of PageRenderer.

Default: null (means auto). It is decided by LanguageDefinition.getPageRenderer().

Since:
5.0.0
See Also:
Constant Field Values

NO_CACHE

public static final java.lang.String NO_CACHE
A request attribute to indicate whether "no-cache" header is generated for the current desktop. If no-cache is generated, ZK will remove a desktop as soon as possible to save the use of memory.

This attribute is set if ZK loader sets Cache-Control=no-cache. However, if a ZUML page is included by other servlet (such as JSP and DSP), this attribute won't be set. If you set Cache-Control manually, you might also set this attribute to save the use of memroy.

request.setAttribute(Attributes.NO_CACHE, Boolean.TRUE);

Since:
3.0.1
See Also:
Constant Field Values

RENEW_NATIVE_SESSION

public static final java.lang.String RENEW_NATIVE_SESSION
A session attribute used to denote that the invalidation of a native session (such as HttpSession and PortletSession) does not invalidate ZK session. Rather it is intended to renew a session (and the ZK session still alive).

A typical case is so-called Session Fixation Protection.

hsess.setAttribute(Attributes.RENEW_NATIVE_SESSION, Boolean.True);
 hsess.invalidate();
 hsess.removeAttribute(Attributes.RENEW_NATIVE_SESSION);
 

Since:
3.5.1
See Also:
Constant Field Values

GAE_FIX

public static final java.lang.String GAE_FIX
A special attribute set to the session to cause Google App Engine to update attributes to the storage.

Since:
5.0.0
See Also:
Constant Field Values

RESEND_DELAY

public static final java.lang.String RESEND_DELAY
A library property to indicate the default resend delay (an integer in milliseconds). If specified, Configuration.getResendDelay() will use it as the default. Otherwise, -1 is assumed.

Notice that this property is ignored after ZK is booted since ZK depends on Configuration.getResendDelay().

Since:
3.0.3
See Also:
Constant Field Values

ID_TO_UUID_PREFIX

public static final java.lang.String ID_TO_UUID_PREFIX
A library property to indicate that UUID shall be generated by prefixing ID with the value stored in this property. This property is used for unit-test purpose.

Note: An empty string means no prefix, while null means UUID is independent of ID (which is the default).

Since:
3.6.1
See Also:
Constant Field Values

PORTLET_RENDER_PATCH_CLASS

public static final java.lang.String PORTLET_RENDER_PATCH_CLASS
A library property to specify the class used to patch the rendering result of a portlet.

Default: null (means no need of patch).

If specified, the class must implement PageRenderPatch. An example implementation is JQueryRenderPatch that delays the rendering of a ZK portlet to avoid the conflicts when using IE.

Since:
5.0.0
See Also:
Constant Field Values

INJECT_URI_PREFIX

public static final java.lang.String INJECT_URI_PREFIX
A special prefix that is used if you want to inject a special fragment into the URI of a clss Web resource (CWR). The fragment is ignored with retrieving the file, so it can be anything to make the browser consider it as a different URI.

For example, ThemeProvider.Aide is based on this prefix.

Notice that this prefix is currently supported only by the WCS files (WcsExtendlet).

See Also:
Constant Field Values
Constructor Detail

Attributes

public Attributes()


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo