Difference between revisions of "Org Chart Options"

From Lianjapedia
Jump to: navigation, search
Line 1: Line 1:
 
''Under Construction''
 
''Under Construction''
 +
==See Also==
 +
[[Org Chart Section Attributes]]
 +
 +
==Overview==
 +
 +
[[{{ns:file}}:orgchart_web.png|450px|thumb|left|link={{filepath:orgchart_web.png}}|Org Chart Section in Lianja Web Client]]
 +
 +
 +
 +
 +
Org Chart Sections are used to display an organization chart with clickable nodes.
 +
 +
In the 'Lianja Org Chart Demo' here, clicking a node displays the details for that employee.
 +
 +
 +
<br clear=all>
 +
 +
==Lianja Org Chart Demo==
 +
[[{{ns:file}}:orgchart1.png|450px|thumb|left|link={{filepath:orgchart1.png}}|example_orgchart App]]
 +
 +
 +
 +
 +
The 'Lianja Org Chart Demo' (example_orgchart) is included in the Lianja App Builder distribution to demonstrate the use of an Org Chart Section.
 +
 +
<br clear=all>
 +
 +
[[{{ns:file}}:orgchart2.png|450px|thumb|left|link={{filepath:orgchart2.png}}|example_orgchart App]]
 +
<br clear=all>
 +
 +
==Org Chart Section options==
 +
 +
[[{{ns:file}}:orgchart_options.png|450px|thumb|left|link={{filepath:orgchart_options.png}}|Org Chart Section options]]
 +
 +
 +
 +
 +
Double-click the Section header or click the cog icon to access the Section Attributes.
 +
 +
The Details section at the top of the attributes dialog holds the specification of the '''database''' and '''table'''.
 +
 +
The Org Chart Section options are described here.
 +
 +
<br clear=all>
 +
 +
===Child ID column===
 +
The '''Child ID column''' Attribute specifies the column name for the Child ID column (this must be numeric).
 +
 +
The 'Lianja Org Chart Demo' App uses the unique employee ID column:
 +
 +
<pre>employeeid</pre>
 +
 +
===Parent ID column===
 +
The '''Parent ID column''' Attribute specifies the column name for the Parent ID column (this must be numeric).
 +
 +
The 'Lianja Org Chart Demo' App uses the numeric reference for the person the employee reports to.
 +
 +
<pre>reportsto</pre>
 +
 +
===Caption expression===
 +
The '''Caption expression''' Attribute specifies an expression that will be evaluated and displayed as the node caption (may contain HTML).
 +
 +
The 'Lianja Org Chart Demo' App uses the employee's first and last names:
 +
 +
<pre>trim(firstname)+' '+trim(lastname)</pre>
 +
 +
===Details expression===
 +
The '''Details expression''' Attribute specifies an expression that will be evaluated and displayed as the node details beneath the caption (may contain HTML).
 +
 +
The 'Lianja Org Chart Demo' App uses the employee's job title:
 +
 +
<pre>title</pre>
 +
 +
===Child key column===
 +
The '''Child key column''' Attribute specifies the column that will be passed to the Click and DblClick delegates as an argument.
 +
 +
The 'Lianja Org Chart Demo' App uses the employee's last name:
 +
 +
<pre>lastname</pre>
 +
 +
===Node width===
 +
The optional '''Node width''' Attribute specifies the display width of the nodes in pixels.  The default is 160.
 +
 +
The 'Lianja Org Chart Demo' App specifies a width of 150 pixels:
 +
 +
<pre>150</pre>
 +
 +
===Node height===
 +
The optional '''Node height''' Attribute specifies the display height of the nodes in pixels.  The default is 60.
 +
 +
The 'Lianja Org Chart Demo' App specifies a height of 60 pixels:
 +
 +
<pre>60</pre>
 +
 +
===Dynamic node backcolor===
 +
The optional '''Dynamic node backcolor''' Attribute specifies the delegate to return the background color for the node for the current record being processed.
 +
 +
The 'Lianja Org Chart Demo' App specifies a delegate:
 +
 +
<pre>oc_getBackColor</pre>
 +
 +
The delegate is contained in the [[#Custom delegate library|Custom delegate library]] as described below.
 +
 +
<pre>proc oc_getBackColor()
 +
if lower(title) = "sales representative"
 +
return "lightgreen"
 +
elseif lower(title) = "vice president, sales"
 +
return "lightpink"
 +
elseif lower(title) = "sales manager"
 +
return "lightblue"
 +
elseif lower(title) = "inside sales coordinator"
 +
return "beige"
 +
else
 +
return ""
 +
endif
 +
endproc
 +
</pre>
 +
 +
===Dynamic node forecolor===
 +
The optional '''Dynamic node forecolor''' Attribute specifies the Delegate to return the foreground color for the node for the current record being processed.
 +
 +
This Attribute is not currently supported.
 +
 +
===Custom delegate library===
 +
The optional '''Custom delegate library''' Attribute specifies the custom library containing the dynamic color delegates.  The '''Custom delegate library''' should be the name of a Lianja script file (.prg).  Clicking on the [...] button will automatically generate the name of the script file and take you to the Script Editor in the Apps Workspace to edit the file.  It will be loaded as a procedure library by [[#orgchart.rsp|orgchart.rsp]].
 +
 +
The 'Lianja Org Chart Demo' App specifies a library:
 +
 +
<pre>liboc_page1_section1.prg</pre>
 +
 +
This contains the '''Dynamic node backcolor''' delegate ''oc_getBackColor'' as detailed above.
 +
 +
===Filter===
 +
The optional '''Filter''' Attribute specifies the filter expression that restricts which records will be included in the Org Chart.
 +
 +
The 'Lianja Org Chart Demo' App does not specify a filter, but this could for example be:
 +
 +
<pre>country = 'USA'</pre>
 +
 +
===Other options===
 +
The optional '''Other options''' Attribute specifies other custom Org Chart options as ampersand-separated option=value pairs.
 +
 +
The 'Lianja Org Chart Demo' App does not specify other options, but this could for example be:
 +
 +
<pre>uoption1=value1&uoption2=value2</pre>
 +
 +
==orgchart.rsp==
 +
The rsp Lianja Server Page script (orgchart.rsp) used by the Org Chart Section WebViewWidget is located in the Lianja Library directory. 
 +
 +
{| class="wikitable" width="100%"
 +
!width="20%"|Client||Location
 +
|-
 +
|valign="top"|App Builder||\lianja\library\
 +
|-
 +
|valign="top"|App Center||\lianja\cloudserver\tenants\public\library
 +
|-
 +
|valign="top"|Web/Mobile Clients||\lianja\cloudserver\tenants\public\wwwroot\library
 +
|-
 +
|}
 +
 +
It can be customized if required, but proceed with caution, as the modifications will apply to all Org Chart Sections and will be overwritten by product upgrades.
 +
 +
Alternatively, orgchart.rsp could be used as a template for your own rsp and specified as the URL/source for a WebView Section. The Reports in the 'Lianja Demo' (lianjademo) App use quickreport.rsp in this way.
 +
 +
==Notes on Client Support==
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
 
!width="20%"|Attribute
 
!width="20%"|Attribute
!width="80%"|Description
+
!width="80%"|Notes
 
|-
 
|-
|valign="top"|Child ID column||The column name for the Child ID column (this must be numeric).
+
|valign="top"|Child ID column||-
 
|-
 
|-
|valign="top"|Parent ID column||The column name for the Parent ID column (this must be numeric).
+
|valign="top"|Parent ID column||-
 
|-
 
|-
|valign="top"|Caption expression||An expression that will be evaluated and displayed as the node caption (may contain HTML).
+
|valign="top"|Caption expression||-
 
|-
 
|-
|valign="top"|Details expression||An expression that will be evaluated and displayed as the node details beneath the caption (may contain HTML).
+
|valign="top"|Details expression||-
 
|-
 
|-
|valign="top"|Child key column||The column that will be passed to the Click and DblClick delegates as an argument.
+
|valign="top"|Child key column||-
 
|-
 
|-
|valign="top"|Node width||The display width of the nodes.
+
|valign="top"|Node width||-
 
|-
 
|-
|valign="top"|Node height||The display height of the nodes.
+
|valign="top"|Node height||-
 
|-
 
|-
|valign="top"|Dynamic node backcolor||Delegate to return the background color of the node for the current record being processed.
+
|valign="top"|Dynamic node backcolor||-
 
|-
 
|-
|valign="top"|Dynamic node forecolor||Delegate to return the foreground color of the node for the current record being processed.
+
|valign="top"|Dynamic node forecolor||Not currently supported.
 
|-
 
|-
|valign="top"|Custom delegate library||Custom library containing the dynamic color delegates
+
|valign="top"|Custom delegate library||-
 
|-
 
|-
|valign="top"|Filter||The filter expression that restricts which records will be included in the Org Chart
+
|valign="top"|Filter||-
 
|-
 
|-
|valign="top"|Other options||Other custom Org Chart options, e.g. name=value&name2=value2
+
|valign="top"|Other options||-
 
|-
 
|-
 
|}
 
|}
  
 
[[Category:Attribute Categories]]
 
[[Category:Attribute Categories]]

Revision as of 12:33, 5 January 2016

Under Construction

See Also

Org Chart Section Attributes

Overview

Org Chart Section in Lianja Web Client



Org Chart Sections are used to display an organization chart with clickable nodes.

In the 'Lianja Org Chart Demo' here, clicking a node displays the details for that employee.



Lianja Org Chart Demo

example_orgchart App



The 'Lianja Org Chart Demo' (example_orgchart) is included in the Lianja App Builder distribution to demonstrate the use of an Org Chart Section.


example_orgchart App


Org Chart Section options

Org Chart Section options



Double-click the Section header or click the cog icon to access the Section Attributes.

The Details section at the top of the attributes dialog holds the specification of the database and table.

The Org Chart Section options are described here.


Child ID column

The Child ID column Attribute specifies the column name for the Child ID column (this must be numeric).

The 'Lianja Org Chart Demo' App uses the unique employee ID column:

employeeid

Parent ID column

The Parent ID column Attribute specifies the column name for the Parent ID column (this must be numeric).

The 'Lianja Org Chart Demo' App uses the numeric reference for the person the employee reports to.

reportsto

Caption expression

The Caption expression Attribute specifies an expression that will be evaluated and displayed as the node caption (may contain HTML).

The 'Lianja Org Chart Demo' App uses the employee's first and last names:

trim(firstname)+' '+trim(lastname)

Details expression

The Details expression Attribute specifies an expression that will be evaluated and displayed as the node details beneath the caption (may contain HTML).

The 'Lianja Org Chart Demo' App uses the employee's job title:

title

Child key column

The Child key column Attribute specifies the column that will be passed to the Click and DblClick delegates as an argument.

The 'Lianja Org Chart Demo' App uses the employee's last name:

lastname

Node width

The optional Node width Attribute specifies the display width of the nodes in pixels. The default is 160.

The 'Lianja Org Chart Demo' App specifies a width of 150 pixels:

150

Node height

The optional Node height Attribute specifies the display height of the nodes in pixels. The default is 60.

The 'Lianja Org Chart Demo' App specifies a height of 60 pixels:

60

Dynamic node backcolor

The optional Dynamic node backcolor Attribute specifies the delegate to return the background color for the node for the current record being processed.

The 'Lianja Org Chart Demo' App specifies a delegate:

oc_getBackColor

The delegate is contained in the Custom delegate library as described below.

proc oc_getBackColor()
	if lower(title) = "sales representative"
		return "lightgreen"
	elseif lower(title) = "vice president, sales"
		return "lightpink"
	elseif lower(title) = "sales manager"
		return "lightblue"
	elseif lower(title) = "inside sales coordinator"
		return "beige"
	else
		return ""
	endif
endproc

Dynamic node forecolor

The optional Dynamic node forecolor Attribute specifies the Delegate to return the foreground color for the node for the current record being processed.

This Attribute is not currently supported.

Custom delegate library

The optional Custom delegate library Attribute specifies the custom library containing the dynamic color delegates. The Custom delegate library should be the name of a Lianja script file (.prg). Clicking on the [...] button will automatically generate the name of the script file and take you to the Script Editor in the Apps Workspace to edit the file. It will be loaded as a procedure library by orgchart.rsp.

The 'Lianja Org Chart Demo' App specifies a library:

liboc_page1_section1.prg

This contains the Dynamic node backcolor delegate oc_getBackColor as detailed above.

Filter

The optional Filter Attribute specifies the filter expression that restricts which records will be included in the Org Chart.

The 'Lianja Org Chart Demo' App does not specify a filter, but this could for example be:

country = 'USA'

Other options

The optional Other options Attribute specifies other custom Org Chart options as ampersand-separated option=value pairs.

The 'Lianja Org Chart Demo' App does not specify other options, but this could for example be:

uoption1=value1&uoption2=value2

orgchart.rsp

The rsp Lianja Server Page script (orgchart.rsp) used by the Org Chart Section WebViewWidget is located in the Lianja Library directory.

Client Location
App Builder \lianja\library\
App Center \lianja\cloudserver\tenants\public\library
Web/Mobile Clients \lianja\cloudserver\tenants\public\wwwroot\library

It can be customized if required, but proceed with caution, as the modifications will apply to all Org Chart Sections and will be overwritten by product upgrades.

Alternatively, orgchart.rsp could be used as a template for your own rsp and specified as the URL/source for a WebView Section. The Reports in the 'Lianja Demo' (lianjademo) App use quickreport.rsp in this way.

Notes on Client Support

Attribute Notes
Child ID column -
Parent ID column -
Caption expression -
Details expression -
Child key column -
Node width -
Node height -
Dynamic node backcolor -
Dynamic node forecolor Not currently supported.
Custom delegate library -
Filter -
Other options -