Particular business model classes

 

System class

The system class gives information about the current deployment site. It is accessible under the name System and defines the following class (static) operations:

static String getServerName()

Returns the name to the application server for the current deployment site. Property HTTP server name of a deployment site.

static String getRootPath()

Returns the root path ( document root ) of the web application. Always starts and ends with /. Property Root path of a deployment site.

static String getTargetLanguageExtension()

Returns the extension of the name of a target language script file. Property Target language extension of a deployment site. The returned string starts with a dot unless the target language is servlet in which case the string is empty.

static Text toHTML(Text text)

Returns a string whose characters that have special meaning in HTML are converted to their equivalent escape sequences ( & ® &amp; , LF ® <BR> ).

static Text toHTMLInTextArea (Text text)

Returns a string whose characters that have special meaning in HTML are converted to their equivalent escape sequences ( & ® &amp; ), however, LineFeed is not converted. This treatment should be chosen when a string is used to initialize a textarea field in a form.

static Text toText (Text text)

Returns a string whose embedded HTML tags have been removed.

static Void setDatabaseRole (String database, String role)

Switches current database role when the generated application communicates with the database. database is the name of the database as defined in the property Name in the database object under a deployment site. It must be a literal string that is checked at compile time. role is the name of the role defined for this database and can be an expression. A role named default should always be defined because this role is used to initially open a connection to the database to retrieve the session object. setDatabaseRole closes the current connection and opens a new one with the given role. Not only subsequent operations but also every dynamic pages executed in the same session will use the new role to connect to the database.

 

If enabled in the generation directive menu, the following operations are also available

static Boolean onReload()

Indicates if the currently executing web page is the result of a Refresh action from the client.

static Boolean onPrevious ()

Indicates if the currently executing web page is the result of a Previous action from the client.

static Integer getPrevious ()

If the currently executing web page is the result of a Previous action from the client, indicates the number of skipped pages (from last executed web page); elsewhere 0.

static Boolean onCall ()

Indicates if it is the first call of the currently executing web page; in this case, one of onReload, onPrevious or onNext operations return true.

static Boolean onRecall ()

Indicates if it is not the first call of the currently executing web page; in this case, none of onReload, onPrevious or onNext operations return true.

static Void DestroySession ()

Removes from the database the informations of the current session - these informations will no longer be available in the subpages, or linked pages.

 

Search engine class

Netsilon provides an integrated full text search engine that is applicable to every business model objects.

The search engine stores object identifiers associated to a list of words. To be searched, selected textual contents of an object must first be indexed. The search engine class which is created in the business model the first time an analysis is made, provides operations that index text and retrieve objects according to words to find. It is accessible under the name Business_Model::SearchEngine and defines the following class (static) operations:

static Void indexClear(OclObject object)

Removes all indexing information for this business model object. This operation is automatically called when an object is deleted.

static Void indexClearAll()

Removes all indexing information for every business objets.

static Void indexAddText(OclObject object, Text text)

Indexes the words extracted from text and associates them to the business model object.

static Void indexAddHTML(OclObject object, Text text)

Converts the HTML in text to plain text, indexes the words extracted and associates them to the business model object.

static Sequence(OclObject) searchAny(String words)

Parses words into words and returns a sequence of business model objects whose associated contents contains at least one of these words. Objects returned are sorted by the number of occurrence of the words in their associated contents.

static Sequence(OclObject) partialSearchAny (String words)

Parses words into words and returns a sequence of business model objects whose associated contents contains at least one of these words or contains at least one word that starts like these words. Objects returned are sorted by the number of occurrence of the words in their associated contents. In words, some characters have special meaning : _ replaces any other character, % replaces any sequence of characters.

static Sequence(OclObject) searchAll(String words)

Parses words into words and returns a sequence of business model objects whose associated contents contains all of these words.

static Sequence(OclObject) partialSearchAll(String words)

Parses words into words and returns a sequence of business model objects whose associated contents contains all of these words or contains all words that starts like these words. In words, some characters have special meaning : _ replaces any other character, % replaces any sequence of characters.

 
TOC ] Previous ] Next ]