What Is a Macro?

A macro is a variable with a fixed name and value. If a string or numeric value is used many times or in many places in portlets, you can add it to a custom Closedmacros list.

Example of a macros list.

Any changes to a macro will be automatically applied to all portlets using the macro.

Built-in macros

DivePort has two types of built-in macros: 

  • Global macros—Available for use on any page in your portal. Global macros work in image portlets and HTML portlets, and in the property–value tables of other portlets and indicators.
  • Limited macros—Available for use in specified portlet instances only.

Custom macros

Custom macros provide an easy way for you to define and maintain portal-wide settings. At any time, you can change the macro definition and the new value automatically updates in all dialogs that use that macro.

You can use two types of custom macros:

  • Internal macros—Are defined by you using the ADMIN menu, Macros dialog box, and stored in the portaldb.json file.
  • External macros—Are defined outside the portal and stored in a text file called macros.txt, which is located in the DI\Solution\webdata\<diveport>\ directory.

CAUTION: Macros are implemented client-side. Do not use macros for storing sensitive information. Browsers have the ability to access the names and values of all macros in order to enable portlets to resolve a string with a macro reference.

IMPORTANT: Do not create an internal macro and an external macro with the same name. If this occurs, the internal macro overrides the external macro.

See also: