AU Services"

From Documentation
m (remove empty version history (via JWB))
 
(4 intermediate revisions by 2 users not shown)
Line 13: Line 13:
 
If you want to plug a particular component, you could invoke <javadoc method="setAuService(org.zkoss.zk.au.AuService)" type="interface">org.zkoss.zk.ui.Component</javadoc>. Unlike desktops, a component can have at most one AU service.
 
If you want to plug a particular component, you could invoke <javadoc method="setAuService(org.zkoss.zk.au.AuService)" type="interface">org.zkoss.zk.ui.Component</javadoc>. Unlike desktops, a component can have at most one AU service.
  
If you want to plug an AU service, you could implement <javadoc type="interface">org.zkoss.zk.ui.util.DesktopInit</javadoc> and register it in zk.xml as described in [[ZK Developer's Reference/Customization/Init and Cleanup|the Init and Cleanup section]].
+
If you want to plug an AU service, you could implement <javadoc type="interface">org.zkoss.zk.ui.util.DesktopInit</javadoc> and register it in zk.xml as described in [[ZK Developer's Reference/Customization/Life Cycle Listener|Life Cycle Listener]].
  
 
<source lang="java">
 
<source lang="java">
 +
public class MyDesktopInit implements DesktopInit {
 +
    public void init(Desktop desktop, Object request) {
 +
        desktop.addListener(new MyAuService()); //assume you have an AU service called MyAuService
 +
    }
 +
}
 
</source>
 
</source>
  
=Version History=
+
 
{{LastUpdated}}
 
{| border='1px' | width="100%"
 
! Version !! Date !! Content
 
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|}
 
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 04:33, 5 February 2024

An AU service (AuService) is a plugin used to intercept the AU requests (AuRequest) sent from the client.

By plugging in an AU service, you could

  • Ignore some AU requests (such as hostile requests)
  • Change the default way of handling an AU request
  • Handle application-specific AU requests

To plug an AU service to a desktop, you could invoke Desktop.addListener(Object). You could plug as many AU services as you want. Once plugged, all AU requests will go through the AU services (unless it was ignored by other AU service).

If you want to plug a particular component, you could invoke Component.setAuService(AuService). Unlike desktops, a component can have at most one AU service.

If you want to plug an AU service, you could implement DesktopInit and register it in zk.xml as described in Life Cycle Listener.

public class MyDesktopInit implements DesktopInit {
    public void init(Desktop desktop, Object request) {
        desktop.addListener(new MyAuService()); //assume you have an AU service called MyAuService
    }
}




Last Update : 2024/02/05

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