Difference between revisions of "SHOWDOCUMENT()"

From Lianjapedia
Jump to: navigation, search
 
(45 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Function to displays a document in its associated plugin/application
+
Function to perform a Lianja UI action or display a document in its associated plugin/application
  
 
==Syntax==
 
==Syntax==
SHOWDOCUMENT(<expC1>[, <expC2>[, <expC3>]])
+
SHOWDOCUMENT(<expC>)
  
 
==See Also==
 
==See Also==
[[GETFILE()]]
+
[[GETFILE()]], [[SHOWHELP()]]
  
 
==Description==
 
==Description==
The SHOWDOCUMENT() function displays a document in its associated plugin/application.
+
The SHOWDOCUMENT() function displays a document in its associated plugin/application or performs a Lianja UI action.  The <expC> is a URL, a file name or a Lianja UI Action.
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!width=30%|Parameter||Description
+
!width="40%"|Action||Description
 
|-
 
|-
|<expC1>||A URL or the name of a file.
+
|valign="top"|app:<appid>||Switch to the specified App <appid>
 
|-
 
|-
|valign=top|<expC2>||The target frame for browser based URLs.  If omitted the document is loaded into a new browser window.  Ignored for non-browser based URLs.  Required if <expC3> is specified.
+
|valign="top"|applyrules||Applies UI presentation rules for all pages, their sections and the fields/gadgets/columns in the sections.
 
|-
 
|-
|valign=top|<expC3>||A templatefile for use with XML or XLS files. This is a text file containing comma separated data that is loaded into the XML or XLS file specified in <expC1>.
+
|valign="top"|page:<pageid>||Select the specified Page <pageid>
 +
|-
 +
|valign="top"|page:<pageid>?action=<actionid>||Perform the specified Action <actionid> on the specified Page <pageid>
 +
|-
 +
|valign="top"|page:<pageid>.<sectionid>?action=<actionid>||Perform the specified Action <actionid> on the specified Section <sectionid>
 +
|-
 +
|valign="top"|section:<sectionid>?action=<actionid>||Perform the specified Action <actionid> on the specified Section <sectionid> in the current Page.
 +
|-
 +
|valign="top"|changestate:<state>||Sets the specified UI state <state>
 +
|-
 +
|valign="top"|resetstate||Causes all UI components to revert back to their default attributes (no UI state set)
 +
|-
 +
|valign="top"|back:||Navigates to the previous Page in the history.  Note the trailing colon.
 +
|-
 +
|valign="top"|forward:||Navigates to the next Page in the history  Note the trailing colon.
 
|-
 
|-
 
|}
 
|}
  
If <expC1> specifies an Excel spreadsheet file additional options can be included as arguments.  The arguments follow the XLS file name and are preceded by a '?'. For further configuration, directives may be included in the template file.
+
The SHOWDOCUMENT() functionality is also provided in the [[Lianja]] system object showDocument() method.
 +
 
 +
See [[Using the showdocument() function and Lianja.showDocument() method]] for details of additional Actions and supported <actionid> values.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
// Accessing local files using '.pdf' and '.doc' file associations
+
// Lianja UI Actions
showdocument("file://C:Documents and SettingsAll UsersDocumentsAcrobat.pdf")
+
showdocument("app:myapp")
showdocument("file://C:Documents and SettingsAll UsersDocumentsWordDoc.doc")
+
showdocument("page:page1")
 +
showdocument("page:page1?action=hide")
 +
showdocument("page:page1?action=show")
 +
showdocument("section:section1?action=select&text=Order Details")
 +
showdocument("section:section5?action=print")
 +
showdocument("section:section6?action=last")
  
// Remote ftp URL
+
// Accessing local files using '.pdf' and '.docx' file associations
showdocument("ftp://ftp.recital.com/LianjaUpdate-Win.exe")
+
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.pdf")
 +
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.docx")
  
// Remote http URL
+
// Remote ftp URL
showdocument("http://www.recital.com", "_top")
+
showdocument("ftp://ftp.mycompany.com/latest.txt")
 
+
// Loading a template of comma-separated text into an XML file
+
// and then displaying the XML file
+
showdocument("file://C:Customers.xml", "_blank", "custdata.txt")
+
 
+
// Example to download an Excel file, load comma delimited data into it
+
// and then display it on the client in Microsoft Excel
+
open database southwind
+
use suppliers
+
copy to datafile&(getpid()).txt type delimited
+
showDocument("myExcelReport.xls?command=create;row=4;col=2", "_blank", "datafile&(getpid()).txt")
+
  
// Example to create an HTML file on the server and
+
// Example to create an HTML file display in the default browser
// then invoke the browser on the client to display it
+
 
fp = fcreate("htmlfile&(getpid()).htm")
 
fp = fcreate("htmlfile&(getpid()).htm")
 
fwrite(fp, "<html>")
 
fwrite(fp, "<html>")
Line 61: Line 71:
 
fwrite(fp, "</html>")
 
fwrite(fp, "</html>")
 
fclose(fp)
 
fclose(fp)
showDocument("htmlfile&(getpid()).htm")
+
showdocument("htmlfile&(getpid()).htm")
 
</code>
 
</code>
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 08:58, 22 April 2016

Purpose

Function to perform a Lianja UI action or display a document in its associated plugin/application

Syntax

SHOWDOCUMENT(<expC>)

See Also

GETFILE(), SHOWHELP()

Description

The SHOWDOCUMENT() function displays a document in its associated plugin/application or performs a Lianja UI action. The <expC> is a URL, a file name or a Lianja UI Action.

Action Description
app:<appid> Switch to the specified App <appid>
applyrules Applies UI presentation rules for all pages, their sections and the fields/gadgets/columns in the sections.
page:<pageid> Select the specified Page <pageid>
page:<pageid>?action=<actionid> Perform the specified Action <actionid> on the specified Page <pageid>
page:<pageid>.<sectionid>?action=<actionid> Perform the specified Action <actionid> on the specified Section <sectionid>
section:<sectionid>?action=<actionid> Perform the specified Action <actionid> on the specified Section <sectionid> in the current Page.
changestate:<state> Sets the specified UI state <state>
resetstate Causes all UI components to revert back to their default attributes (no UI state set)
back: Navigates to the previous Page in the history. Note the trailing colon.
forward: Navigates to the next Page in the history Note the trailing colon.

The SHOWDOCUMENT() functionality is also provided in the Lianja system object showDocument() method.

See Using the showdocument() function and Lianja.showDocument() method for details of additional Actions and supported <actionid> values.

Example

// Lianja UI Actions
showdocument("app:myapp")
showdocument("page:page1")
showdocument("page:page1?action=hide")
showdocument("page:page1?action=show")
showdocument("section:section1?action=select&text=Order Details")
showdocument("section:section5?action=print")
showdocument("section:section6?action=last")
 
// Accessing local files using '.pdf' and '.docx' file associations
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.pdf")
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.docx")
 
// Remote ftp URL
showdocument("ftp://ftp.mycompany.com/latest.txt")
 
// Example to create an HTML file display in the default browser
fp = fcreate("htmlfile&(getpid()).htm")
fwrite(fp, "<html>")
fwrite(fp, "<body>")
fwrite(fp, "<table>")
fwrite(fp, "<tr>")
fwrite(fp, "<td>Field1</td>")
fwrite(fp, "<td>Field2</td>")
fwrite(fp, "</tr>")
fwrite(fp, "</table>")
fwrite(fp, "</body>")
fwrite(fp, "</html>")
fclose(fp)
showdocument("htmlfile&(getpid()).htm")