/Alias ODB tree: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:


== Purpose ==
== Purpose ==
The ODB /Alias tree  provides the user with a way to access other webpages via buttons placed on the [[mhttpd]] [[Status Page]]. It can provide links to external webpages, or symbolic links (short-cuts) to ODB sub-trees.
The ODB <span style="color: purple; font-style:italic;">/Alias</span> tree  provides the user with a way to access other webpages via buttons placed on the [[mhttpd]] [[Status Page]]. It can provide links to external webpages, or symbolic links (short-cuts) to ODB sub-trees.


== Creating the /Alias tree ==
== Creating the /Alias tree ==
The /Alias tree is optional, and is not present until created by the user.
The <span style="color: purple; font-style:italic;">/Alias</span> tree is optional, and is not present until created by the user.


;Notes
;Notes
# All examples in this page are shown using [[odbedit]] for simplicity. Alternatively, the [[mhttpd]] ODB page editor can be used.
# All examples in this page are shown using [[odbedit]] for simplicity. Alternatively, the [[mhttpd]] ODB page editor can be used.
# The /Alias tree is used by mhttpd,  and ignored by odbedit.
# The <span style="color: purple; font-style:italic;">/Alias</span> tree is used by <span style="color:darkcyan;">''mhttpd''</span>,  and ignored by <span style="color:darkcyan;">''odbedit''</span>.


<div id="Alias-Button"></div>
== Contents of the /Alias tree ==
== Contents of the /Alias tree ==
Any key created under /Alias will appear as a Button on the [[Status Page]], with the same name as the key (except as noted below).
Any key created under <span style="color: purple; font-style:italic;">/Alias</span> will appear as a button (i.e. '''alias-button''') on the [[Status Page]], with the same name as the key (except as noted below).


By default, the clicking of the alias-button in the web interface will spawn a '''new frame'''. To force the display of the alias page in the '''same frame''', an "&" has to be appended to the name of the alias key. The "&" is stripped off the alias name when it appears as a button on the status page (see [[#Symbolic Links|example]]).
By default, the clicking of an alias-button in the web interface will spawn a '''new frame'''. To force the display of the alias page in the '''same frame''', an "&" has to be appended to the name of the alias key. The "&" is stripped off the alias name when it appears as an alias-button (see [[#Symbolic Links|example]]).


=== External links ===
=== External links ===
Line 36: Line 37:


=== Symbolic Links ===
=== Symbolic Links ===
The /Alias tree may also contain a list of symbolic links to any desired ODB location.
The <span style="color: purple; font-style:italic;">/Alias</span> tree may also contain a list of symbolic links to any desired ODB location.


The following [[odbedit]] commands demonstrate creating alias-buttons linking to ODB keys :
The following [[odbedit]] commands demonstrate creating alias-buttons linking to ODB keys :

Revision as of 15:33, 6 August 2014


Purpose

The ODB /Alias tree provides the user with a way to access other webpages via buttons placed on the mhttpd Status Page. It can provide links to external webpages, or symbolic links (short-cuts) to ODB sub-trees.

Creating the /Alias tree

The /Alias tree is optional, and is not present until created by the user.

Notes
  1. All examples in this page are shown using odbedit for simplicity. Alternatively, the mhttpd ODB page editor can be used.
  2. The /Alias tree is used by mhttpd, and ignored by odbedit.

Contents of the /Alias tree

Any key created under /Alias will appear as a button (i.e. alias-button) on the Status Page, with the same name as the key (except as noted below).

By default, the clicking of an alias-button in the web interface will spawn a new frame. To force the display of the alias page in the same frame, an "&" has to be appended to the name of the alias key. The "&" is stripped off the alias name when it appears as an alias-button (see example).

External links

The following odbedit commands demonstrate how to make a link to an external webpage:

[local:t2kgas:S] cd /Alias
[local:t2kgas:S]create string triumf
String length [32]:
[local:t2kgas:S] set triumf "http://triumf.ca"

This will cause a button triumf on the status page, Clicking on the alias-button triumf will show the contents of the link in a new page.

Symbolic Links

The /Alias tree may also contain a list of symbolic links to any desired ODB location.

The following odbedit commands demonstrate creating alias-buttons linking to ODB keys :


[local:t2kgas:S] cd /Alias
[local:t2kgas:S] ln /Equipment/TpcGasPlc/Common/ "TPC Common"       *** New frame, no &
[local:t2kgas:S] ln /Equipment/TpcGasPlc/Settings/ "TPC Settings&"  *** Same frame, with &
    (comments are preceded by ***)

This would create two alias-buttons TPC Common and TPC Settings. Clicking on TPC Common would open the page in a new frame. Clicking on TPC Settings would open the page in the same frame (see above).