Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Macros are based on the Velocity template language. Each of these can be used to insert

Companyname
forms and data into the end user portal. Read more about creating a custom portal in the EUI Portal Tutorial or check out the online training.

The $subtypeName parameter is used in several EUI macros. It refers to the logical table name, which can be found in the Table wizard. For example, the logical table name for the Contracts table is contract. For subtables, the syntax is table.subtype, for example person.employee or ticket.enhancement.

Table of Contents
maxLevel3
minLevel3

ew_chat

#ew_chat($sessionHash)

This macro lets end users start a chat session. It forms a URL with the chat session ID encoded.

...

You can obtain the sessionHash from the Chat setup wizard as follows:

  1. First select "Web page outside the program" on the General tab

...

  1. .
    Image Modified

...

  1. Then copy the session Hash displayed on the HTML tab

...

  1. .
    Image Modified

ew_create_record

#ew_create_record($subtypeName $returnURL $returnFrame)

Use this macro to insert a new record form into an EUI template. It creates a URL that links to the standard record create page for a given table.

Parameter NameDescription

$subtypeName

Logical name of the table in which the new record should be created. The logical name is shown in the tables wizard. Can contain subtable chains like case.question, contact.employee etc.

$returnURL

URL to return to after the ticket is created or cancel is pressed.

$returnFrame

Name of the iframe that contains the view of the table that needs to be refreshed once the operation is completed.

ew_edit_record

#ew_edit_record($subtypeName $recordId $returnURL $returnFrame)

This macro inserts a record edit form into an EUI template. It creates a URL that links to the standard record editing page for a given table and record ID.

Parameter NameDescription

$subtypeName

Logical name of the table in which the new record should be created. The logical name is shown in the tables wizard. Can contain subtable chains like case.question, contact.employee etc.

$recordId

The id ID of the record to edit

$returnURL

URL to return to after the ticket is created or cancel is pressed

$returnFrame

Name of the iframe that contains the view of the table that needs to be refreshed once the operation is completed.

ew_faq

#ew_faq($subtypeName)

...

ew_forward

$ew_forward($templateName)

This URL simply creates links between EUI template pages without losing the user's session ID. Use this whenever you create links between pages; it creates a URL to forward the user to the specified  template.

...

Code Block
languagexml
<a href="#ew_forward("testContacts.htm")">Contacts</a>

ew_image

#ew_image($imageName)

Forms the URL to the image with the given name. As an admin user, you can upload images to your KB via the staff power user interface in the Look & Feel section. The $imageName parameter should be a relative path to the image from the

Companyname
file directory. For example:

...

Code Block
<img src="#ew_image('/gif/icon%2021.png')" alt="Next" />

ew_include

#ew_include($templateName)

This macro is a shortcut to include the contents of one EUI Template in another.

Parameter NameDescription

$templateName

Includes $templateName into the current one. This allows admins to reuse common pieces of code in different templates. See EUI Template Configuration for an example of how this can be used.

ew_languages

#ew_languages($controlName $onChange $controlStyle)

Renders a list of available languages for the current user with a particular HTML style. The style needs to be passed here as a parameter, because 

Companyname
 will render the HTML control automatically, making it impossible to customize its appearance any other way.

Parameter NameDescription

$controlName

Required name of the HTML select list.

$onChange

JavaScript code to be run when a language is selected.

$controlStyle

CSS class name for the select list control.

ew_languages_all

#ew_languages_all($controlName $onChange $controlStyle)

Renders a list of all languages available in the system with a particular HTML style. We You need to pass the style here as a parameter, because 

Companyname
 will render the HTML control automatically, making it impossible to customize its appearance any other way.

Parameter NameDescription

$controlName

Required name of the HTML select list.

$onChange

JavaScript code to be run when a language is selected.

$controlStyle

CSS class name for the select list control.

ew_locale

#ew_locale($localeName)

Sets the language (locale) for the current user session to the specified one if the language is available for the user.

Parameter NameDescription

$localeName

ISO-639 language code ("en", "de", "fr")

ew_logins

#ew_login($kbName $redirectTo)

Prints the 

Companyname
 login URL. This tag must be enclosed in <form> with input controls "login", "password" inside. If no user and login is passed, then system will attempt to login under the predefined user eui2/qwerty. Create this user in your KB to use this default.

Parameter NameDescription

$kbName

name of KB to login

$redirectTo

name of template to be used after successful login

ew_logout

#ew_logout($url)

Logs out of 

Companyname
 and redirects the user to the specified urlURL.

Parameter NameDescription

$url

URL to be redirected after logout, such as a confirmation message or intranet home page.

Code Block
languagexml
titleExample usage
<a href="#ew_logout("http://www.example.com")">Click to logout</a>
#ew_new_search($subtypeName $frameName $allowSaving $returnURL $params)

Provides a piece of JavaScript, mostly for use in onClick event handlers, that runs the new Saved Search wizard. When returning to $returnURL, an additional request parameter is appended for the created saved search - searchID. You can use it in your own code, for example to update a list of available Saved Searches.

Parameter NameDescription

$subtypeName

Table for which the search should be created

$frameName

The name of HTML iframe in which to display the results after the Wizard has finished.

$allowSaving

"true" if the user should be allowed to save the created search, otherwise "false".

$returnURL

URL that should be applied to $frameName after wizard has finished. If "", than the standard table search will be used.

$params

Visualization Parameters formed as a request query, e.g. "showstatus=false&showpages=false..." etc. They will be applied to the table view for $subtypeName. Use this parameter if you leave $returnURL empty. Otherwise add required Parameters to $returnURL directly.

ewquery

#ew_query($subtypeName $frameName $controlId $params)

Provides a piece of JavaScript, mostly for use in onClick or onChange event handlers, that runs a search for a table in an iFrameiframe

Parameter NameDescription

$subtypeName

The name of the table to show

$frameName

The name of HTML iframe in which to display the results.

$controlId

The id of the HTML control which contains the query to use (for example a form field)

$params

String of request Parameters that will be passed to the table in $frameName. See the #ew_table macro, and the following parameter list for details.

ew_recordfield 

#ew_recordfield ($fieldName $subtypeName $recordID

...

)

Forms the URL to show the Report report or Chart chart with the given name.

Parameter NameDescription

$fieldName

Field name in the selected table, for example "description" or "attached_files".

$subtypeName

Logical table name containing the record, e.g. "document" or "person.employee".

$recordID

The ID of the record you want to access, e.g. " 224".

$fieldName

Field name in the selected table, for example "description" or "attached_files".

Code Block
titleExample Usage
#ew_recordfield("documents","224","description_text" "document" 224)

ew_repchart 

#ew_repchart ($repchartName $repchartType $tableName)

Forms the URL to show the Report or Chart with the given name from the specified table.

Parameter NameDescription

$repchartName

Name of report or chart as listed in the Table Charts/Reports list.

$repchartType

Type of the report or chart. Allowed values are [html, image, excel, plain/text].

$tableName

Name of the table containing the report or chart.

ew_scripts

#ew_scripts()

Introduces a link to certain required JavaScript functions. The default 

Companyname
 EUI requires some custom JavaScript code. Use it within a page's <head> tag if you are getting strange behavior and / or JavaScript errors about null and undefined objects in your portal templates.

ew_searches_list

#ew_searches_list($subtypeName $frameName $controlName $controlStyle $params $selectedSearch)

Draws an HTML select list control with the Saved Searches available, taking into account access permissions.

Parameter NameDescription

$subtypeName

Name of the table for which to display the appropriate searches.

$frameName

Name of the iframe that contains the view of the table that needs to be refreshed once a search is selected.

$controlName

Required name of the HTML select list.

$controlStyle

CSS class name to be applied to the select list.

$params

String of the request Parameters that will be passed to the table in $frameName. See the #ew_table macro, and the following parameter list for details.

$selectedSearch

Name of the search to be selected in list initially

ew_session

#ew_session()

Prints

Companyname
session ID to screen, and requires no parameters. This may be used to 'manually' construct a URL that contains the session information.

...

Code Block
languagexml
titleOutput
<a href="/gui2/eui2template/testContacts.htm;jsessionid=D7988DF0E8E173...

ew_status

#ew_status()

Prints to screen last operation status stored in the request, ActionStatus. This macro requires no parameters.

ew_table

#ew_table($subtypeName $viewName $searchName $queryString $params $frameName $frameStyle)

Draws an HTML iframe with the specified 

Companyname
 table displayed inside it.

Parameter NameDescription

$subtypeName

The table to show.

$viewName

The view to use for table. Note that it's localized for now, so different names should be used for different languages

$searchName

The search name to apply to the table. Can be used simultaneously with $queryString

$queryString

The query to be applied to the table. When used, the result is the same as if the user had typed the contents of this string into the search box. See the #ew_query macro below.

$params

Visualization Parameters formed as a request query, e.g. "showstatus=false&showpages=false..." etc. Use it for precise tuning of the table's display features. See the parameter list at the end of this section for more details.

$frameName

The required name of the resulting iframe. This is needed so that you can refer to it in other macros or pieces of JavaScript (for example to refresh the table view after a search has been applied - see the tutorial).

$frameStyle

The CSS style name to be applied to the iframe.

ew_user

#ew_user()

Prints the current user login to screen. This macro does not take parameters.

ew_userfield

#ew_userfield($fieldName)

Prints the current user's record field value. This macro is rendered to be human-readable; for example, choice values will be returned as 'Yes'.

Parameter NameDescription

$fieldName

A logical name of the field to return. Example: #ew_userfield("_16_company_name0")

ew_userid

#ew_userid()

Prints the current user ID to screen; requires no parameters.

ew_url

#ew_url($url)
Parameter NameDescription

$url

Prints to screen $url with the application url prefix and session data encoded. If you want to make an asset for your portal page available for portal users but not to anyone else, for example an image logo, then you can upload it to the

Companyname
server, and use this macro to construct a URL, including session information, to retrieve it.

Example usage:

Code Block
languagexml
<img border = "0" src = "#ew_url("images/logo.jpg")"/>

ew_view_record

#ew_view_record($subtypeName $recordId $returnURL $returnFrame)

Creates a URL which links to the record view.

...

Parameter NameValues (default in bold)Description

showSearchCriteria

true, false

Whether used search criteria will be shown to user

workWithPopUp

true, false

Determines whether edit and new operations should be performed within the current frame or the pop-up window

showToolBar

true, false

Show toolbar on top of table.

showLabeltrue, falseShow label for the table

showNavigation

true, false

Show pages navigation above the table

showStatus

true, false

Show status of operations on above the table

showfastsearch

true, false

Show search dialog for the table

search_contexttrue, false

Turn on Context for text searches

Usage: turn on Context for text searches from the EUI 2 EUI2 by using:

#ew_query("contract" "my_table" "queryId" "showToolBar=false&showNavigation=true&showfastsearch=false&search_context=true")

_saved_search_idany saved search id

Filter text searches by a saved search

Usage:

#ew_query("contract" "my_table" "queryId" "showToolBar=false&showNavigation=true&showfastsearch=false&_saved_search_id=12345")

Additional Tools

Some helper macros have been implemented to be used in Velocity templates.

...