Chapter 16
Site Utilities

[p]This chapter documents the [code]Utility[/code] section in Site Administration, which provides the administrator with tools for managing and maintaining the Lasso Professional Server server. This chapter describes the following: [/p]

SQL Browser

[p]The [code]SQL[/code] section provides a Web-based interface that allows one to issue SQL queries to Lasso-accessible SQL databases. A Lasso-accessible SQL database is any SQLite, MySQL, or SQL-compliant JDBC database that has been set up and enabled in the Setup > Data Sources section of Site Administration. [/p]

Issuing SQL Statements

[p]The [code]SQL Browser[/code] page is where SQL statements can be entered. The results of the query will be presented at the bottom of the page with one column for each field that is returned. The results could contain actual field data from a database search, or could contain synthetic field data which is generated by the database in order to format the results of various SQL statements and functions. See the examples that follow for more information. [/p]

Figure 1: SQL Browser Page

To issue a SQL statement:

  1. Select a data source connector from the [code]Connector[/code] pull-down menu. Only connectors to data sources that support SQL will be shown.
  1. Select a data source host from the [code]Host [/code]pull-down menu.
  1. Select a database to issue a SQL statement from the [code]Database[/code] pull-down menu. Only databases enabled in the Setup > Data Sources section will be shown.
  1. Enter a SQL query in the [code]SQL Statement[/code] field.

SQL Statement History

[p]A special feature of the SQL Browser is that the last ten statements entered into the [code]SQL Statement [/code]field will be displayed in a pull-down menu that appears to the right of[code] History[/code]. In order to issue a statement stored in the [code]History[/code] pull-down menu, simply select the statement from the pull-down menu, and it will automatically appear in the [code]SQL Query[/code] field. Then select [code]Issue SQL Query. [/code][/p]

SQL Export

[p]Selecting the Export area in the sidebar allows the results of a [code]SELECT[/code] statement to be exported. Setting one or more options and then selecting Export Results will result in a text file being sent to the browser containg the current result set. [/p]

SQL Options

[p]Selecting the[code] Options[/code] area in the sidebar allows the following options to be set: [/p]

Email

[p]The Email section allows the administrator to manage the site Lasso email queue, send email, and set site email options in Lasso Professional Server. Full documentation for sending an email in Lasso Professional Server can be found in the Email chapter in the Lasso 8.5 Language Guide. [/p]

[p]The email queue can be monitored in several different ways. This section provides an overview of the tabs in the Utility > Email section, followed by more in depth information about each sub-section. [/p]

Email Queue

[p]The email queue logs all email messages that are sent from within Site Administration or via the [code][Email_Send][/code] tag. Messages remain in the queue while they are being sent to the SMTP mail server looked up by Lasso or specified in the [code][Email_Send][/code] tag by the developer. For more information, see the Email chapter in the Lasso 8.5 Language Guide. [/p]

[p]Selecting the [code]Stop Queue[/code] temporarily suspends email from sending. This allows the administrator to inspect the state of the email queue without messages sending. The button then changes to [code]Start Queue, [/code]and can be re-selected to start email sending again. Emails are sent when the server is restarted even if the email queue is stopped. [/p]

[p]Each message may include one or more parts depending on the recipients of the message. A message to one recipient always has one part. If a message has several recipients who are in different domains then the message will be split into one part per domain. Information about the first part of a message is shown inline within the message display. The message display also includes the most recent error returned for the message. [/p]

[p]Messages in the queue can be viewed by status by selecting a message category from the pull-down menu in top panel, and then selecting the [code]Select[/code] button. These categories are as listed below. [/p]

Figure 2: Email Queue Page

[p]The following actions can be performed on a single message or on multiple messages using the controls to the left. [/p]

Email Parts

[p]This section lists all of the message parts which Lasso currently has in its queue. The same controls as shown above for the email queue also work in this section. By default the parts of all messages are shown, but if a [code]Show All[/code] link is followed from a message part in the email queue then only parts for that message are shown. [/p]

Email Errors

[p]This section lists all of the errors which the email sending system has encountered. It works similarly to the Utility > Errors section which shows general Lasso errors. By default the errors encountered while sending all messages are shown, but if a [code]Show All[/code] link is followed from a message error in the email or parts queues then only errors for that message are shown. [/p]

Email Routes

[p]When Lasso sends an email message it first looks up the SMTP server for the recipient of the message using a domain name server. The address of that SMTP server is stored as the route for the domain. The email routes section can be used to view the Cached Routes which Lasso has looked up. [/p]

[p]The User Routes allow custom routes to be specified for particular domains. For example, the local domain may need to route to an internal SMTP server rather than the Internet-facing server. The email routes section allows user routes to be created for these special cases. A user route includes the following fields. [/p]

Figure 3: Email Routes Page

Sending Email

[p]The [code]Send Email[/code] page allows email messages to be sent. After the message is queued, one returns to the [code]Email Queue[/code] page. While Lasso Professional Server provides robust support for custom email sending programmed within your Lasso pages, the [code]Send Mail [/code]form allows the administrator to quickly test email sending. [/p]

Figure 4: Send Email Page

To send an email:

  1. Enter the email host name in the [code]SMTP Host [/code]field and the [code]SMTP Port[/code] and [code]SMTP AUTH Username[/code] and [code]Password[/code] if required.
  1. Enter the recipient’s email address in the [code]To[/code] field.
  1. Enter the email address of any blind carbon-copy recipients in the [code]BCC[/code] field (optional).
  1. Select the [code]Send Message[/code] button. The message will be inserted into the email queue database and sent out per settings specified on the [code]Email Setup [/code]page.

Email Setup

[p]The[code] Setup [/code]page allows one to set preferences for the[code] [Email_Send] [/code]tag. This includes setting the administrator email address, default host IP address, message retention, and system automation. [/p]

Figure 4: Setup Page

[p]The following describes the options in the [code]Send Email [/code]page: [/p]

[p]Email settings can be changed by entering new values for the options above and selecting the [code]Update[/code] button. Selecting the [code]Stop Mail Queue[/code] button stops the email queue while site options are being set. [/p]

Events

[p]The [code]Events[/code] section allows the administrator to list events, get the status of an event, clear the event queue, or delete events that have been scheduled. Additional documentation on events and the [code][Event_Schedule] [/code]tag can be found in the Control Tags chapter in the Lasso Professional Server Language Guide. [/p]

Introduction to Events

[p]Events in Lasso Professional Server take the form of URL requests. For user-defined URL requests, the event scheduler can operates as a virtual site visitor which visits specific URLs at specific times. The event scheduler can be used to schedule page loads on the local server or even on remote servers. [/p]

[p]Normally, the pages which the event scheduler has been programmed to visit will be pages which perform specific tasks that only the event scheduler has access to. For example, a folder named [code]Events[/code] could be created, and all pages that the event scheduler calls could be placed in it. A file [code]SendEmail.lasso[/code] would then be scheduled as: [/p]

[pre]http://www.example.com/Events/SendEmail.lasso [/pre]

[p]Events can be scheduled to execute at a specific time, but the actual time the event is executed may vary based on server traffic and other conditions. Events can only be certain to execute within one minute of their scheduled time. [/p]

Event Queue

[p]The [code]Event Queue[/code] page provides a list of scheduled events. The events can be filtered by type, and events can be deleted if they have not yet been performed. [/p]

[p]All events that have been scheduled and not performed yet are shown in the queue. If an event repeats over time, then it will remain in the queue until the administrator-defined period for that event has ended. Once an event has ended, it is removed from the queue. [/p]

Figure 5: Event Queue Page

[p]The last error for each event is shown inline within the event display. Each event also supports the following actions. [/p]

[p]Selecting the [code]Pause All Events[/code] temporarily suspends all queued events from being executed. This allows the administrator to delete events that are causing problems or schedule a batch of events. The button then changes to [code]Resume Events, [/code]and can be re-selected to start event execution again. Events are restarted when the server is restarted even if the event queue is stopped. [/p]

[p]The panel shows all queued events for the selected queue that have not been performed yet. The URL, time of next run, start and end dates (for repeating events), options, and username are shown for each event. The administrator may delete an event from the current queue by selecting the [code]Delete[/code] link under [code]Actions[/code] for that event. [/p]

[p]Selecting the [code]Delete All Events [/code]button in the sidebar removes all shown events from the queue shown. [/p]

Event Errors

[p]This section lists all of the errors which the event scheduling system has encountered. It works similarly to the Utility > Errors section which shows general Lasso errors. By default the errors encountered while executing all events are shown, but if a [code]Show All[/code] link is followed from an event in the event queue then only errors for that event are shown. [/p]

Scheduling Events

[p]The [code]Schedule Event [/code]page provides a convenient interface for scheduling events. Events can also be scheduled programmatically via the [code][Event_Schedule][/code] tag, as discussed in the Control Tags chapter in the Lasso 8.5 Language Guide. All scheduled events can be viewed in the [code]Event Queue[/code] page. [/p]

Figure 6: Schedule Event Page

[p]The [code]Perform Event[/code] pull-down menu specifies how often an event should be run. The remaining fields in the [code]Schedule Event[/code] page will vary depending on which option is selected for [code]Perform Event[/code], and the options are as follows: [/p]

To schedule an event to be performed once:

  1. Enter the URL address of the event in the [code]Event URL[/code] field.
  1. Select [code]Yes[/code] or [code]No[/code] from the pull-down menu in the [code]Continue After Restart[/code] field. If set to [code]Yes[/code], the event will continue after the Web server is stopped and restarted.
  1. Enter any username required to perform the event in the [code]Username[/code] field (optional). An event will require a username if the page to be loaded is protected by Lasso Security, and requires a username for access. For more information on usernames, see the Setting Up Security chapter.
  1. Enter any password required to perform the event in the [code]Password[/code] field (optional). The same conditions apply to passwords as for usernames.

To schedule a weekly event:

  1. Enter the URL address of the event in the [code]Event URL[/code] field.
  1. Enter the time of day on which the event will be performed from the [code]Time of Day[/code] pull-down menu (24-hour [code]hh:mm:ss[/code] format).
  1. Enter the ending date of the event in the [code]End Date/Time[/code] field. The date when a repeating event is scheduled to end. The format is the same as[code] Start Date/Time[/code].
  1. Select [code]Yes[/code] or [code]No[/code] from the pull-down menu in the [code]Continue After Restart[/code] field. If set to [code]Yes[/code], the event will continue after the Web server is stopped and restarted.
  1. Enter any username required to perform the event in the [code]Username[/code] field (optional). An event will require a username if the page to be loaded is protected by Lasso Security, and requires a username for access. For more information on usernames, see the Setting Up Security chapter.
  1. Enter any password required to perform the event in the [code]Password[/code] field (optional). The same conditions apply to passwords as for usernames.
  1. Select [code]Schedule Event[/code].

To schedule a daily event:

  1. Enter the URL address of the event in the [code]Event URL[/code] field.
  1. Enter the time of day on which the event will be performed from the [code]Time of Day[/code] pull-down menu (24-hour [code]hh:mm:ss[/code] format).
  1. Enter the ending date of the event in the [code]End Date/Time[/code] field. The date when a repeating event is scheduled to end. The format is the same as[code] Start Date/Time[/code].
  1. Select [code]Yes[/code] or [code]No[/code] from the pull-down menu in the [code]Continue After Restart[/code] field. If set to [code]Yes[/code], the event will continue after the Web server is stopped and restarted.
  1. Enter any username required to perform the event in the [code]Username[/code] field (optional). An event will require a username if the page to be loaded is protected by Lasso Security, and requires a username for access. For more information on usernames, see the Setting Up Security chapter.
  1. Enter any password required to perform the event in the [code]Password[/code] field (optional). The same conditions apply to passwords as for usernames.
  1. Select [code]Schedule Event[/code].

To schedule a custom repeating event:

  1. Enter the URL address of the event in the [code]Event URL[/code] field.
  1. Enter the ending date of the event in the [code]End Date/Time[/code] field. The date when a repeating event is scheduled to end. The format is the same as[code] Start Date/Time[/code].
  1. Select [code]Yes[/code] or [code]No[/code] from the pull-down menu in the [code]Continue After Restart[/code] field. If set to [code]Yes[/code], the event will continue after the Web server is stopped and restarted.
  1. Enter any username required to perform the event in the [code]Username[/code] field (optional). An event will require a username if the page to be loaded is protected by Lasso Security, and requires a username for access. For more information on usernames, see the Setting Up Security chapter.
  1. Enter any password required to perform the event in the [code]Password[/code] field (optional). The same conditions apply to passwords as for usernames.
  1. Select [code]Schedule Event[/code].

Errors

[p]The [code]Errors[/code] section allows the administrator to view and delete errors, warnings detail messages, deprecated functionality warnings, and action statements that have been logged both internally in Lasso Professional Server and via the [code][Log][/code] tag, as well as set site logging options. For more information on the [code][Log][/code] tag, see the Files and Logging chapter in the Lasso 8.5 Language Guide. [/p]

[note][b]Important: [/b]Configuring error logging in Site Administration is not the same thing as configuring page-level error handling, such as for syntax errors and security errors. Page-level error handling is described in the Error Reporting chapter of the Lasso 8.5 Language Guide. The default Lasso error page can be configured in the Setup > Site > Syntax section of Site Administration. [/note]

Lasso Errors

[p]The [code]Lasso Errors[/code] page lists all errors and system messages stored in the [code]Lasso_Internal[/code] database. Errors and system messages can also be deleted within this interface. [/p]

Figure 7: Errors Page

[p]The[code] Lasso Errors [/code]page contains a list of all error messages received by their date, time, level, and message. The list is navigable via the[code] Prev[/code] and [code]Next [/code]buttons at the bottom of the panel. [/p]

Filtering Messages

[p]The[code] Lasso Errors[/code] pull-down menu allows messages to be filtered by level, which includes [code]Critical Errors[/code], [code]Warnings[/code], [code]Details[/code], [code]Action Statements[/code], and [code]Deprecated[/code]. Each error level is described individually in the following Error Log Setup section. Individual Lasso page and database errors are not logged here, but are rather controlled using the [code][Error…][/code] tags. For more information, see the Error Control chapter in the Lasso 8.5 Language Guide. [/p]

Deleting Messages

[p]Selecting the [code]Delete Errors Shown[/code] button deletes only the errors shown in the current panel, while selecting the[code] Delete All Errors [/code]button deletes all errors in the current selected category. Aconfirmation dialog box will be displayed upon selecting either of these buttons. [/p]

Error Log Setup

[p]The [code]Setup[/code] page allows the administrator to set site logging options for Lasso Professional Server. These logging options are not limited to errors, and any feedback that occurs within the Lasso Service console can be logged for display in the [code]Lasso Errors[/code] page. [/p]

Figure 8: Error Setup Page

[p]The [code]Error Setup[/code] panel allows the administrator to set unique log routing for the five log levels: [/p]

[p]For each feedback type, the administrator can choose to log or display feedback in any of the following three places: [/p]
  1. [note][b]Note: [/b]The _Errors table will store a maximum of 10,000 records. Once this limit has been reached, the oldest records will automatically be deleted. [/note]
[p]Options are changed by checking or unchecking the desired values in the [code]Error Setup[/code] panel and selecting the [code]Update[/code] button. The [code]Reset[/code] button returns all options to their default values. Selecting the [code]Refresh [/code]button reloads the[code] Setup[/code] page with its currently stored values. [/p]

[note][b]Note: [/b]For information on how to programmatically log custom data to the logs described above, see the Files and Logging chapter in the Lasso 8.5 Language Guide. [/note]

LassoApps

[p][code]The [/code]Utility > LassoApps[code] [/code]section in Site Administration allows administrators to create and manage LassoApps. The following is an introduction to LassoApps, and describes how they can be used. [/p]

Introduction to LassoApps

[p]LassoApps (short for “Lasso Applications”) allow entire Lasso solutions—including Lasso pages, html pages, images, and any other files—to be compiled into a single file called a LassoApp. Once a LassoApp has been compiled, the original Lasso code can no longer be viewed (client-side or server-side). LassoApps are served from a Web server using Lasso Professional Server, and are capable of the same functionality as traditional Lasso pages. [/p]

[note][b]Important [/b]– Although it is difficult to extract the original LassoScript from a LassoApp it is possible to see the strings that are referenced within the LassoApp. LassoApps should be used to protect your LassoScript code, but are not a recommended method of storing passwords or other sensitive data. [/note]

LassoApp Advantages

[p]LassoApps are useful for hiding implementation details, locking Lasso pages, selling locked solutions, and installing pre-compiled solutions. Just like regular Lasso pages, LassoApps are portable and cross-platform compatible. LassoApps also offer the following advantages over regular Lasso pages. [/p]

LassoApp Characteristics

[p]LassoApp file names end with the [code].LassoApp[/code] extension, instead of [code].html[/code] or [code].lasso[/code]. The ability to serve LassoApps must be enabled within Lasso Professional Server site settings in order to serve LassoApps. If LassoApp serving is not enabled in Site Administration, then the user will receive a security error. [/p]

[p]The functionality within LassoApps is only effective if the functions being performed by the LassoApp are permitted by Site Administration. LassoApp developers have the ability to create routines for checking whether or not the necessary permissions and settings are enabled, and instruct the administrator on what to do to configure Lasso Professional Server settings for use with specific LassoApps. For further information on LassoApps, see the LassoApps chapter in the Lasso 8.5 Language Guide. [/p]

Building LassoApps

[p]LassoApps can be created by the Lasso site administrator in the Utility > LassoApps > Build section of Site Administration. Creating a LassoApp involves supplying three pieces of information: [/p]

Preparing source files for LassoApp Builder

[p]Before building a LassoApp, all links to files within the LassoApp root folder must be replaced with the [code][LassoApp_Link][/code] Lasso tag. The [code][LassoApp_Link] [/code]Lasso tag is what allows internal navigation between pages in a LassoApp. Links to files outside of the LassoApp root folder do not need to be formatted with this tag. Below are examples of how to express links within Lasso pages contained within a LassoApp. [/p]

[pre]<a href="page.html">Link</a> [/pre]

[pre] <a href="[LassoApp_Link:'page.html']">Link</a> [/pre]

[pre]<Form Action="page.html"> … </Form> [/pre]

[pre] <Form Action="[LassoApp_Link:'page.html']"> … </Form> [/pre]

[pre]<Img src="/folder/picture.jpg"> [/pre]

[pre] <Img src="[LassoApp_Link:'/folder/picture.jpg']"> [/pre]

[p]All links to files within the LassoApp root folder need to be formatted as shown above before using [code]LassoApp Builder[/code]. Not doing this will prevent the LassoApp from being created. For more information on preparing Lasso pages to be converted into a LassoApp, see the LassoApps chapter in the Lasso 8.5 Language Guide. [/p]

[note][b]Note: [/b]Adding these tags in regular Lasso pages will not affect how the links, forms, and images function. Lasso will ignore these tags until they are compiled into a LassoApp using [code]LassoApp Builder[/code]. [/note]

Using LassoApp Builder

[p]The Utility > LassoApps > Build[code] [/code]section of Site Administration is where LassoApps can be compiled. [/p]

Figure 9: LassoApp Build Page

To create a LassoApp:

  1. Format all links to files within the LassoApp source files using the [code][LassoApp_Link][/code] tag as shown previously.
  1. The folder containing the LassoApp should be located within your Web server root. Note the URL that would be used to access these LassoApp files. For example:
[pre]http://www.example.com/myLassoApp/default.lasso [/pre]
  1. Go to the Utility > LassoApps > Build section of Site Administration.
  1. Select [code]Custom Root…[/code] from the [code]LassoApp Folder[/code] pop-up menu. Specify the path to the folder containing your LassoApp from the root of the Web server. The for the example URL shown above the path would be:
[pre]/myLassoApp/ [/pre]
  1. Enter the name of the default page for the solution in the [code]Entry File[/code] field. The [code]Entry File[/code] is the first page the user will see when accessing the LassoApp. For the example URL shown above the entry file would be::
[pre] default.lasso [/pre]
  1. Select [code]Create LassoApp[/code]. This will create a LassoApp with the same name as the folder that contains the LassoApp files within your Web server root. The LassoApp created using the instructions above would be located at this URL:
[pre]http://www.example.com/myLassoApp.LassoApp [/pre] [p]For more information on creating LassoApps, see the LassoApps chapter. in the Lasso 8.5 Language Guide. [/p]

[note][b]Note: [/b]It is also possible to create LassoApps by placing the LassoApp folder in a [code]BuildLassoApps[/code] folder within the [code]LassoAdmin[/code] folder of the current site. The current site must have been granted permission to access this folder by the server administrator. For the default site the full path to this folder would be: [/note]

[pre]…/Lasso Professional 8/LassoSites/1-default/LassoAdmin/BuildLassoApps/ [/pre]

Viewing and Dumping LassoApps

[p]When a LassoApp is first called in a Web browser, it gets cached in the computers’s RAM for efficient serving. If a new version of a particular LassoApp is loaded to the Web server, then the LassoApp will need to be removed from the system cache before the new version can be accessed. [/p]

[p]The Utility > LassoApps > List section is where the administrator can view the names of LassoApps that have been loaded on the server, and dump them from the system cache. [/p]

Figure 10: List LassoApps Page

To remove a LassoApp from the system memory cache:

[p]In the [code]LassoApp Cache[/code] panel, select the [code]minus (-)[/code] button next to the name of the LassoApp (e.g.[code] MyLassoApp.LassoApp[/code]) to dump from memory. This panel contains all LassoApps that have been served by Lasso Professional Server since startup. [/p]

[p]Selecting [code]Dump All LassoApps[/code] will remove all LassoApps from the system cache. After LassoApps have been dumped from the system cache, new versions of the LassoApps may be loaded. [/p]

LassoApp Settings

[p]The Utility > LassoApps > Setup section is where the administrator can enable or disable LassoApps in Lasso Professional Server. [/p]

Figure 11: LassoApp Settings Page

[p]Disabling LassoApps prevents the execution of any custom or third party LassoApp not included with Lasso Professional Server. The LassoApps that cannot be disabled are [code]Admin.LassoApp[/code], [code]GroupAdmin.LassoApp[/code], [code]LassoScriptReference.LassoApp[/code], and [code]Setup.LassoApp[/code] in the [code]LassoStartup [/code]folder. [/p]

To enable or disable LassoApps:

  1. In the [code]Settings[/code] panel, select [code]Enabled[/code] or [code]Disabled[/code] from the [code]LassoApps[/code] pull down menu.
  1. Select the [code]Update[/code] button.

Caches

[p]New caching tags in Lasso Professional Server make it possible for developers to cache content in their pages using the [code][Cache] … [/Cache][/code] tags. These custom caches are stored in memory on the server. These caching tags allow developers to reduce database and server load by having Lasso only recalculate various portions of a page periodically. [/p]

[p]The Lasso site administrator has global control over all caches stored on the Lasso Professional Server server. The Utility > Cache section of Site Administration provides information about all current caches, allows caches to be reset, and allows preferences for the caching mechanism to be set. [/p]

Viewing and Dumping Caches

[p]The Utility > Cache > List page in Site Administration provides a list of active caches on the server, including cache name, the size of cached data, and the efficiency of the cache. This page also provides total cache usage statistics since Lasso was started (cache statistics always reset when Lasso Service is restarted). [/p]

Figure 12: Cache List Page

[p]The [code]Cache List [/code]panel displays a list of all caches that have been served by Lasso Professional Server since startup, the size and data type of cached data, and an efficiency score. A cache’s efficiency score is the number of times the cache has been loaded minus the number of times it has been refreshed or expired, then divided by the number of loads (loads - stores / loads). Clicking the [code]Refresh[/code] button updates the panel with the latest information. [/p]

[p]Clicking on the name of a cache shows the[code] Cache Detail [/code]panel to the right, where statistics about the cache may be viewed, and the cache can be deleted or refreshed. Refreshing a cache allows cache statistics to persist, whereas deleting a cache does not. [/p]

To refresh a cache:

  1. Select the name of the cache to reset from memory in the [code]Cache List [/code]panel. This panel contains the names of all caches that have been loaded on the Lasso Professional Server server.
  1. In the [code]Cache Detail[/code] panel, Select the [code]Expire Now[/code] button. Once a cache is manually expired, its contents will be refreshed the next time it is loaded.

To delete a cache:

  1. Select the name of the cache to delete from memory in the [code]Cache List [/code]panel.
  1. In the [code]Cache Detail[/code] panel, Select the [code]Delete[/code] button. Once a cache is deleted, it is completely removed from the system memory (including the statistics for the cache) until it is loaded again.

Cache Settings

[p]The Utility > Cache > List page in Site Administration allows site cache preferences to be set. These preferences apply to all caches loaded on the server, and will override any preferences set by developers. [/p]

Figure 13: Cache Settings

[p]The following cache preferences may be set: [/p]