Zimlet Developers Guide:Application Context: Difference between revisions

No edit summary
No edit summary
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{BC|Community Sandbox}}
__FORCETOC__
<div class="col-md-12 ibox-content">
= Zimlet Developers Guide: Application Context  =
{{KB|{{Unsupported}}|{{ZCS 8.0}}|{{ZCS 7.0}}|}}
{{Archive}}
{{warning|1=You are looking at legacy Zimlet documentation. For Zimbra Modern UI Zimlet development go to: https://wiki.zimbra.com/wiki/DevelopersGuide#Zimlet_Development_Guide.}}
{| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);"
{| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);"
|[[Image:zdg-6-menu-icon-zimbra.jpg|20px]]
|[[Image:zdg-6-menu-icon-zimbra.jpg|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]]
|[[Zimlet Developers Guide:Introduction|Introduction]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-green-flag.png|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-green-flag.png|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Getting Started|Getting Started]]
|[[Zimlet Developers Guide:Getting Started|Getting Started]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-terminal.png|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-terminal.png|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Dev Environment Setup|Dev Environment Setup]]
|[[Zimlet Developers Guide:Dev Environment Setup|Dev Environment Setup]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-gear.png|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-gear.png|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Developing Zimlets|Developing Zimlets]]
|[[Zimlet Developers Guide:Developing Zimlets|Developing Zimlets]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-advanced.jpg|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-advanced.jpg|20px]]
|
|
     {|
     {|
     |[[ZCS 6.0:Zimlet Developers Guide:Advanced Concepts|Advanced Concepts]]
     |[[Zimlet Developers Guide:Advanced Concepts|Advanced Concepts]]
     |-
     |-
     |'''Application Context'''
     |'''Application Context'''
     |-
     |-
     |[[ZCS 6.0:Zimlet Developers Guide:Templates|Templates]]
     |[[Zimlet Developers Guide:Templates|Templates]]
    |-
    |[[Zimlet Developers Guide:Java and JSP|Java & JSP]]
    |-
    |[[Zimlet Developers Guide:Portal|Portal]]
     |-
     |-
     |[[ZCS 6.0:Zimlet Developers Guide:Java and JSP|Java & JSP]]
     |[[Zimlet Developers Guide:Zimlet Tab|Zimlet Tab]]
     |-
     |-
     |[[ZCS 6.0:Zimlet Developers Guide:Internationalization|Internationalization]]
     |[[Zimlet Developers Guide:Internationalization|Internationalization]]
     |}
     |}


|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-library.jpg|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-library.jpg|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Zimlet API Specifications|API Specifications]]
|[[Zimlet Developers Guide:Zimlet API Specifications|API Specifications]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-checkbox.jpg|20px]]
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-checkbox.jpg|20px]]
|[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]]
|[[Zimlet Developers Guide:Example Zimlets|Example Zimlets]]
|}
|}


== Overview ==
== Overview ==
Line 34: Line 45:
   
   
<pre>
<pre>
com_zimbra_test.prototype.myMethod =  
com_zimbra_mytestzimlet.prototype.myMethod =  
function() {
function() {
   var dialog = appCtxt.getMsgDialog(); //get a simple message dialog
 
   var dialog = appCtxt.getMsgDialog(); // get a simple message dialog


   dialog.reset(); // reset the dialog
   dialog.reset(); // reset the dialog
   dialog.setMessage("Hello World!", DwtMessageDialog.INFO_STYLE); // set the message "info" style
   dialog.setMessage("Hello World!", DwtMessageDialog.INFO_STYLE); // set the message "info" style
   dialog.popup(); // display the dialog
   dialog.popup(); // display the dialog


Line 46: Line 60:


== Accessing Dialogs ==
== Accessing Dialogs ==
The following describes some of the <code>appCtxt</code> methods for accessing dialogs:
{| cellpadding="5" cellspacing="0" border="1" width="70%"
|style="background-color:#ffffcc;" width="20%"|'''Class Method'''
|style="background-color:#ffffcc;"|'''Description'''
|-
|<code>appCtxt.getMsgDialog()</code>
|Gets the message dialog (with "OK" button).
|-
|<code>appCtxt.getYesNoMsgDialog()</code>
|Gets the message dialog (with "Yes"/"No" buttons).
|-
|<code>appCtxt.getYesNoCancelMsgDialog()</code>
|Gets the message dialog (with "Yes"/"No"/"Cancel" buttons).
|-
|<code>appCtxt.getErrorDialog()</code>
|Gets the error dialog (with "Error Report"/"Details"/"OK" buttons).
|}


== Application Information ==
== Application Information ==
Line 51: Line 84:
The following describes some of the <code>appCtxt</code> methods for accessing application information:
The following describes some of the <code>appCtxt</code> methods for accessing application information:


{|
{| cellpadding="5" cellspacing="0" border="1" width="70%"
|Method
|style="background-color:#ffffcc;" width="20%"|'''Class Method'''
|Description
|style="background-color:#ffffcc;"|'''Description'''
|-
|-
|appCtxt.getCurrentApp()
|<code>appCtxt.getCurrentApp()</code>
|Gets the current application object.
|Gets the current application object.
|-
|-
|appCtxt.getCurrentAppName()
|<code>appCtxt.getCurrentAppName()</code>
|Gets current application name.
|Gets current application name.
|-
|-
|appCtxt.getCurrentController()
|<code>appCtxt.getCurrentController()</code>
|Gets the current application controller.
|Gets the current application controller.
|}
|}


== Account Information ==
== Account Information ==
The following describes some of the <code>appCtxt</code> methods for accessing account information:
{| cellpadding="5" cellspacing="0" border="1" width="70%"
|style="background-color:#ffffcc;" width="20%"|'''Class Method'''
|style="background-color:#ffffcc;"|'''Description'''
|-
|<code>appCtxt.getActiveAccount()</code>
|Gets the active account.
|-
|<code>appCtxt.getUsername(account)</code>
|Gets the username for the specified account.
|-
|<code>appCtxt.getUserDomain(account)</code>
|Gets the user domain for the specified account.
|}


== API Documentation ==
== API Documentation ==


JavaScript documentation for the Application Context class is available at:
The complete JavaScript documentation for the Application Context class is available at:
 
[[Zimlet Developers Guide:Zimbra_JavaScript_API_Reference|Zimbra JavaScript API Reference]]


http://files.zimbra.com/docs/zimlet/zcs/6.0/jsdocs/symbols/ZmAppCtxt.html


{{Article Footer|Zimbra Collaboration Server 7.0|12/22/2009}}




{{Article Footer|Zimbra Collaboration Suite 6.0|12/22/2009}}
[[Category:Developers]]
[[Category:Zimlets]]
[[Category:ZCS 7.0]]
[[Category:ZCS 6.0]]

Latest revision as of 06:02, 17 July 2021

Zimlet Developers Guide: Application Context

   KB 3276        Last updated on 2021-07-17  




0.00
(0 votes)
Warning: You are looking at legacy Zimlet documentation. For Zimbra Modern UI Zimlet development go to: https://wiki.zimbra.com/wiki/DevelopersGuide#Zimlet_Development_Guide.
Zdg-6-menu-icon-zimbra.jpg Introduction Zdg-6-menu-icon-green-flag.png Getting Started Zdg-6-menu-icon-terminal.png Dev Environment Setup Zdg-6-menu-icon-gear.png Developing Zimlets Zdg-6-menu-icon-advanced.jpg
Advanced Concepts
Application Context
Templates
Java & JSP
Portal
Zimlet Tab
Internationalization
Zdg-6-menu-icon-library.jpg API Specifications Zdg-6-menu-icon-checkbox.jpg Example Zimlets

Overview

The Application Context is a global object available via JavaScript from your Zimlet Handler Object. Using the Application Context object, you can access various application information, dialog boxes, and user preferences. The Application Context is accessed via the appCtxt object. For example, the following shows how to access the simple message dialog from the application context:

com_zimbra_mytestzimlet.prototype.myMethod = 
function() {

  var dialog = appCtxt.getMsgDialog(); // get a simple message dialog

  dialog.reset(); // reset the dialog

  dialog.setMessage("Hello World!", DwtMessageDialog.INFO_STYLE); // set the message "info" style

  dialog.popup(); // display the dialog

};

Accessing Dialogs

The following describes some of the appCtxt methods for accessing dialogs:

Class Method Description
appCtxt.getMsgDialog() Gets the message dialog (with "OK" button).
appCtxt.getYesNoMsgDialog() Gets the message dialog (with "Yes"/"No" buttons).
appCtxt.getYesNoCancelMsgDialog() Gets the message dialog (with "Yes"/"No"/"Cancel" buttons).
appCtxt.getErrorDialog() Gets the error dialog (with "Error Report"/"Details"/"OK" buttons).

Application Information

The following describes some of the appCtxt methods for accessing application information:

Class Method Description
appCtxt.getCurrentApp() Gets the current application object.
appCtxt.getCurrentAppName() Gets current application name.
appCtxt.getCurrentController() Gets the current application controller.

Account Information

The following describes some of the appCtxt methods for accessing account information:

Class Method Description
appCtxt.getActiveAccount() Gets the active account.
appCtxt.getUsername(account) Gets the username for the specified account.
appCtxt.getUserDomain(account) Gets the user domain for the specified account.

API Documentation

The complete JavaScript documentation for the Application Context class is available at:

Zimbra JavaScript API Reference


Verified Against: Zimbra Collaboration Server 7.0 Date Created: 12/22/2009
Article ID: https://wiki.zimbra.com/index.php?title=Zimlet_Developers_Guide:Application_Context Date Modified: 2021-07-17



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search