browseLib Functions

 

browseLib Overview

The browseLib creates, maintains, and services multiple Analytic Information Server Lambda repositories (also known as the File Cabinets). The browseLib manages all Lambda source code stored in the file cabinets. This includes checking source in and out of the file cabinest, importing, exporting, and deleting source from each file cabinet. Each Lambda file cabinet contains either the actual compiled Lambdas (binary) or a script (source) for the Lambdas. Once compiled, each Lambda is stored in its compiled Lambda form so that compilation need not occur twice.

Multiple file cabinet extents are supported. These are known as file cabinet extents or just file cabinets when the meaning is clear from the context. The browseLib also supports multiple non-Lambda file cabinet extents, registered to the browseLib, but managed by a foreign extent manager Lambda (see Extent Manager Lambda Templates).

The browseLib also contains an extent manager which allows one to browse the contents of the Analytic Information Server's working context memory

BrowseLib Special Features

Text Directive:

For File Cabinets managed by the browseLib (file cabinets managed by foreign extent managers may or may not provide this feature). The text directive ;#text# as the first seven characters of any Lambda script informs the browseLib never to compile this source code. Source code with text directives are always stored in the Lambda file cabinet as source code. They are never compiled into Lambdas.

Language Directive:

For File Cabinets managed by the browseLib (file cabinets managed by foreign extent managers may or may not provide this feature). The language directive #javaScript#, as the first few characters of any Lambda script informs the browseLib to use the specified language to compile this source code. The absence of a language directive causes the browseLib to use the lisp compiler.

Cabinet Search:

For all File Cabinets, during checkout operations, the browseLib will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during checkout.

Lambda Clusters:

For all File Cabinets, during checkout/checkin operations, the browseLib will treat all Lambdas, with compound names, whose component names are separated by the ":" character, as members of the same Lambda cluster. This supports the storing of Lambda clusters in file cabinets.

browseLib

The browseLib function registers a new file cabinet extent to the browseLib, and then compiles and loads each and every Lambda in the newly registered file cabinet extent.

Type: Function

Syntax: (browseLib extentName extentFileName)
extentName The name of the file cabinet extent.
extentFileName The path and file name of the file cabinet extent.
Returns true

Syntax: (browseLib extentName extentMgrLambda)
extentName The name of the file cabinet extent.
extentMgrLambda The Lambda which will manage the file cabinet extent. It must support the API documented in Extent Manager Templates.
Returns true

addExtent

The addExtent function registers a new file cabinet extent to the browseLib.

Type: Function

Syntax: (browseLib.addExtent databaseDirectory)
databaseDirectory Directory with cabinet/source files to be registered.
Returns true

Syntax: (browseLib.addExtent extentName extentFileName sourceFileName storageScope importSynch exportSync autoCompileFlag)
extentName The name of the file cabinet extent.
extentFileName The path and file name of the file cabinet extent.
sourceFileName The path and file name of the source file.
storageScope Storage scope either "file" or "folder".
importSync Valid values for import synchronization are: auto, ask, none, notify.
exportSync Valid values for export synchronization are: auto, ask, none, notify.
autoCompileFlag Automatically compiles the source after an import, valid values are "true" or "false".
Returns true

Syntax: (browseLib.addExtent extentName extentFileName sourceFileName storageScope)
extentName The name of the file cabinet extent.
extentFileName The path and file name of the file cabinet extent.
sourceFileName The path and file name of the source file.
storageScope Storage scope either "file" or "folder".
Returns true

Syntax: (browseLib.addExtent extentName extentMgrLambda)
extentName The name of the file cabinet extent.
extentMgrLambda The Lambda which will manage the file cabinet extent. It must support the API documented in Extent Manager Templates.
Returns true

bind

The bind function binds all of the unbound Lambdas assigned to global symbols with the global symbol name in the Lambda.In.Bindings element of the Lambda. All unbound child Lambdas are also bound in their childLambda.In.Bindings elements.

Type: Function

Syntax: (browseLib.bind)
Returns true

checkin

The checkin function stores the specified Lambda source into the file cabinet under the specified Lambda name.

Type: Function

Syntax: (browseLib.checkin LambdaName LambdaSource)
LambdaName The name of the Lambda in the file cabinet currently in focus.
LambdaScript The source string for the Lambda.
Returns true

Syntax: (browseLib.checkin cabinetName LambdaName LambdaSource)
cabinetName The name of the file cabinet the Lambda is to be checked into.
LambdaName The name of the Lambda in the specified file cabinet.
LambdaScript The source string for the Lambda.
Returns true

checkout

The checkout function returns the Lambda source stored, in the file cabinet, under the specified Lambda name.

Type: Function

Syntax: (browseLib.checkout LambdaName)
LambdaName The name of the Lambda in the file cabinet.
Returns The source string for the Lambda.

Syntax: (browseLib.checkout cabinetName LambdaName)
cabinetName The name of the extent in the file cabinet.
LambdaName The name of the Lambda in the file cabinet.
Returns The source string for the Lambda.

Cabinet Search:

For all File Cabinets, during checkout operations without a cabinet name argument, the browseLib will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during checkout.

checkoutParent

The checkoutParent function returns the Lambda source, for the specified name and all its children, stored in the file cabinet, under the specified Lambda name.

Type: Function

Syntax: (browseLib.checkoutParent LambdaName)
LambdaName The name of the Lambda in the file cabinet.
Returns The source string for the Lambda.

Syntax: (browseLib.checkoutParent cabinetName LambdaName)
cabinetName The name of the extent in the file cabinet.
LambdaName The name of the Lambda in the file cabinet.
Returns The source string for the Lambda.

Cabinet Search:

For all File Cabinets, during checkoutParent operations without a cabinet name argument, the browseLib will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during checkout.

checkStatus

The checkStatus function returns the current import/export synchronization status for a cabinet.

Type: Function

Syntax: (browseLib.checkStatus cabinetName)
cabinetName The name of the cabinet.
Returns Tab delimited string of the cabinet's current import/export synchronization status.

childCreate

The childCreate function creates the specified child repository within the currently focused file cabinet.

Type: Function

Syntax: (browseLib.childCreate childName size)
childName The name of the child repository to create within the current focused file cabinet.
size The size of the child repository (in bytes).
Returns The child repository now in focus.

childFocus

The childFocus function sets the specified child repository to be the current file cabinet.

Type: Function

Syntax: (browseLib.childFocus childName)
childName The name of the child repository within the current focused file cabinet.
Returns The child repository now in focus.

compileAll

The compileAll function compiles and loads every Lambda in the currently focused file cabinet. The compiled Lambdas are loaded into RAM memory.

Type: Function

Syntax: (browseLib.compileAll loadSwitch)
loadSwitchs Always recompile (true), load only do not recompile (false)
Returns true

compileSource

The compileSource function compiles the specified Lambda and loads the compiled Lambda into RAM memory.

Type: Function

Syntax: (browseLib.compileSource LambdaName)
LambdaName The name of the Lambda in the file cabinet.
Returns true (if there is no error)

delimitedGlobals

The delimitedGlobals function returns a tab delimited string containing global variables and their current contents. The delimitedGlobals function allows the client to browse the current workspace using the browseLib.

Type: Function

Syntax: (browseLib.delimitedGlobals showCFuncs showLocked)
showCFuncs A value of 1 if C functions are to be displayed, 0 if they are not.
showLocked A value of 1 if locked globals are to be displayed, 0 if they are not.
Returns A tab delimited string of global variable names along with their current contents. Each entry has the following format: globalName = value

delimitedString

The delimitedString converts the specified object into a delimited string using the specified delimiters.

Type: Function

Syntax: (browseLib.delimitedString anObj midDel endDel lineNoSW)
anObj An object to be converted into a delimited string.
midDel The delimited to place between the key and the value when converting a Structure or Dictionary object.
endDel The delimited to place at the end of every entry (usually carriage return line feed).
lineNoSw (Optional) If the line number switch is present and true then line numbers will prefix each vector element.
Returns A delimited string representing the contents of the input object.

displayWatchList

The displayWatchList function displays to the console the list of files being watched by the file system watcher class.

Type: Function

Syntax: (browseLib.displayWatchList)
Returns true

dropExtent

The dropExtent function unregisters a file cabinet extent from the browseLib.

Type: Function

Syntax: (browseLib.dropExtent extentName)
extentName The name of the file cabinet extent.
Returns true

eraseChildren

The eraseChildren function deletes the specified Lambda, and all its related children, from the file cabinet.

Type: Function

Syntax: (browseLib.eraseChildren LambdaName)
LambdaName The name of the Lambda to be erased from the file cabinet.
Returns The source code for the last Lambda which has been erased.

eraseSource

The eraseSource function deletes the specified Lambda from the file cabinet.

Type: Function

Syntax: (browseLib.eraseSource LambdaName)
LambdaName The name of the Lambda to be erased from the file cabinet.
Returns The source code for the Lambda which has been erased.

exportDirectory

The exportDirectory function exports all cabinet Lambdas into the specified directory.

Type: Function

Syntax: (browseLib.exportDirectory directory LambdaName saveInfoFlag)
directory The new directory that would contain all source files for the exported cabinet.
LambdaName Specific Lambda to be exported as a source file on the given directory(currently not used).
saveInfoFlag (Optional) If set to "true", it will save the exported cabinet information to the object repository.
Returns true

exportSource

The exportSource function exports the specified Lambda from the file cabinet to the specified ASCII text file. If the Lambda name is "..all Lambdas..", then the entire contents of the file cabinet are exported.

Type: Function

Syntax: (browseLib.exportSource fileName LambdaName)
LambdaName The name of the Lambda whose source code is to be exported. An Lambda name of "..all Lambdas.." will cause all Lambdas in the file cabinet to be exported.
Returns true

getChildNames

The getChildNames function returns a vector of all Lambda's names stored in the file cabinet.

Type: Function

Syntax: (browseLib.getChildNames)
Returns A tab delimited string of all the Lambda's names stored in the file cabinet

getExtentCount

The getExtentCount function returns the number of file cabinet extents currently registered to the Lambda.

Type: Function

Syntax: (browseLib.getExtentCount)
Returns The number of file cabinet extents currently registered to the Lambda.

getExtentNames

The getExtentNames function returns a vector containing file cabinet extent.

Type: Function

Syntax: (browseLib.getExtentNames)
Returns A vector containing file cabinet extent names.

getFocus

The getFocus function returns the name of the file cabinet extent which is currently in focus.

Type: Function

Syntax: (browseLib.getFocus)
Returns The name of the extent now in focus.

getFocusIndex

The getFocusIndex function returns the index of the file cabinet extent which is currently in focus.

Type: Function

Syntax: (browseLib.getFocusIndex)
Returns The index of the extent now in focus.

getNextLevel

The getNextLevel function returns an XPath directory string for all hierarchical descendents of the specified key. The returned directory string will be composed of newline delimited rows and tab delimited columns. There will be one row for each directory entry.

The first row of the directory string will always contain three columns:
   startingLine numLines totalLines

Additional new type rows (see the getTypes function) will contain three columns:
   NewType type action

Thereafter, each row will contain eight columns:
   type value size date time version symbolicKey uniqueKey

Type: Function

Syntax: (browseLib.getNextLevel cabinetName key startLine lineCount options)
cabinetName The name of the file cabinet extent whose descendents are to be returned.
key The symbolic name of the Lambda in the file cabinet extent whose descendents are to be returned.
startLine The starting line, of the descendents list, to be returned.
lineCount The number of lines, of the descendents list, to be returned.
options (Optional) Any additional arguments required by the extent manager.
Returns an XPath directory string for all hierarchical descendents of the specified key.

getParentNames

The getParentNames function returns a vector of all parent Lambda's names stored in the file cabinet.

Type: Function

Syntax: (browseLib.getParentNames)
Returns A tab delimited string of all the parent Lambda's names stored in the file cabinet

getTypes

The getTypes function returns an XPath directory type list string for all possible types in a hierarchical descendents list (see the getNextLevel function). The returned directory directory type list string will be composed of newline delimited rows and tab delimited columns. There will be one row for each type list entry.

Each row of the type list will contain two columns:  Type Features

There will be eight feature options. Features not present will have a value of off. All features present will have a value of on. The first feature listed will be the default feature. The default type will have a name of .default.. The eight valid features are as follows:
   descend Allow descent into node.
   edit Allow display in edit tab.
   popup Allow display in popup dialog.
   erase Allow this type to be erased.
   export Allow this type to be exported.
   import Allow this type to be imported.
   compile Allow this type to be compiled.
   checkin Allow this type to be checked in.

Some examples would be:
   String "edit,popup"
   Vector "descend"
   Lambda "descend,edit"

Type: Function

Syntax: (browseLib.getTypes cabinetName)
cabinetName The name of the Lambda file cabinet whose XPath directory type list is to be returned.
Returns an XPath directory type list string.

htmlPageRegistry

The htmlPageRegistry property contains the dictionary of Analytic Information Server URL names bound with the Lambdas which such URL's are to be routed.

Type: Property

Syntax: browseLib.htmlPageRegistry
Returns The dictionary of Analytic Information Server URL names bound to their servicing Lambdas.

htmlPageServer

The htmlPageServer function routes a message, from an html page, to an html server Lambda (see the htmlPageRegistry property).

Type: Function

Syntax: (browseLib.htmlPageServer pageName pageParms)
pageName The name of the page where the message originated.
Returns The parameter structure associated with this message.
Returns The URL name of the html page created as a response.

htmlParmToStructure

The htmlParmToStructure function converts a message parameter string, from an html page, into an html server parameter structure (see the htmlPageServer function).

Type: Function

Syntax: (browseLib.htmlParmToStructure htmlParameterString)
htmlParameterString The name of the page where the message originated.
Returns An html parameter structure.

importDirectory

The importDirectory function imports all valid source files in the specified directory.

Type: Function

Syntax: (browseLib.importDirectory directory saveInfoFlag)
directory The directory containing all source files for a cabinet. The directory should be exported by the exportDirectory function.
saveInfoFlag (Optional) If set to "true", it will save the loaded source files to the object repository.
Returns true

importSource

The importSource function imports the specified Lambda library text file into the file cabinet. The specified Lambda library file should have been created by a previous exportSource command.

Type: Function

Syntax: (browseLib.importSource fileName)
fileName The path and file name of the Lambda library text file to be imported into the file cabinet.
Returns true

inspect

The inspect function returns a tab delimited string of statistics from the workspace. The single argument specifies the type of workspace inspection desired.

Type: Function

Syntax: (parseLib.apply theType)
theType The type of workspace inspection desired. A value of Lambdas: returns a tab delimited string of Lambda names in the file cabinet. A value of globals: returns a tab delimited string of global variables and their current values. A value of stats: returns a tab delimited string showing the current workspace memory and object usage.
Returns A tab delimited string of workspace statistics.

precompiler

The precompiler function provides a pre-compiler for adding C-like pre-compiler directives to any source file. One note of caution, the pre-compiler directives use Lisp S-expressions instead of tiny C expressions.
Provides the following C-like precompiler directives to any source file.


#define name S-expression
#ifdef S-expression
#ifndef S-expression
#if S-expression
#else
#endif

Warning: Each compiler directive MUST start at the very beginning of the source line or it will NOT be recognized as a pre-compiler directive.

Type: Function

Syntax: (browseLib.precompiler inSource)
inSource The input source to be precompiled.
Returns The pre-compiled source string ready for compilation.

readSourceFile

The readSourceFile function reads the specified source file and returns a string.

Type: Function

Syntax: (browseLib.readSourceFile filePathName)
filePathName The path and file name of the file to be read.
Returns A sting containing the contents of the file.

registerDirectory

The registerDirectory registers/imports all source and cabinet files inside a directory.

Type: Function

Syntax: (browseLib.registerDirectory cabinetDirectory sourceDirectory)
cabinetDirectory Directory containing cabinet and source files to be registered to browseLib.
sourceDirectory (Optional) If specified browseLib will load all source from this directory.
Returns true

removeDelimiters

The removeDelimiters function removes all carriage returns, line feeds, and tabs from the string.

Type: Function

Syntax: (browseLib.removeDelimiters aString)
aString The string whose delimiters are to be removed.
Returns A sting with the delimiters removed.

showGlobals

The showGlobals function produces a report that shows globals accessed by a specified agency.

Type: Function

Syntax: (browseLib.showGlobals rootLambda)
rootLambda The name of a Lambda in memory.
Returns true

This function shows globals except the following:

Use this function to check your Lambdas for unwanted global references.

setFocus

The setFocus function sets the specified extent to be the current file cabinet.

Type: Function

Syntax: (browseLib.setFocus extentName)
extentName The name of the file cabinet extent to be made the focused file cabinet.
Returns The repository extent now in focus.

stripAll

The stripAll function removes the source code from every Lambda in the currently focused file cabinet. The stripped Lambdas are saved back into the file cabinet without their source.

Type: Function

Syntax: (browseLib.stripAll)
Returns true

tabbedNameList

The tabbedNameList function returns a tab delimited string containing the names of all child Lambdas stored in the file cabinet.

Type: Function

Syntax: (browseLib.tabbedNameList)
Returns A tab delimited string of all child Lambdas stored in the file cabinet.

takeout

The takeout function returns the acutal Lambda stored, in the file cabinet, under the specified Lambda name.

Type: Function

Syntax: (browseLib.takeout LambdaName)
LambdaName The name of the Lambda in the file cabinet.
Returns The actual Lambda stored in the file cabinet.

Syntax: (browseLib.takeout cabinetName LambdaName)
cabinetName The name of the extent in the file cabinet.
LambdaName The name of the Lambda in the file cabinet.
Returns The actual Lambda stored in the file cabinet.

Cabinet Search:

For all File Cabinets, during takeout operations without a cabinet name argument, the browseLib will not search file cabinet extents whose names begin with the "~" character. This prevents the needless automatic searching of unwarrented file cabinets during takeout.

updateMetaData

The updateMetaData function updates the metadata information in the object repository.

Type: Function

Syntax: (browseLib.updateMetaData extentName extentFileName sourceFileName storageScope importSynch exportSync autoCompileFlag)
extentName The name of the cabinet extent to be updated.
extentFileName The path and file name of the file cabinet extent.
sourceFileName The path and file name of the source file.
storageScope Storage scope either "file" or "folder".
importSync Valid values for import synchronization are: auto, ask, none, notify.
exportSync Valid values for export synchronization are: auto, ask, none, notify.
autoCompileFlag Valid values are "true" or "false".
Returns true

validateMetadata

The validateMetadata function validates the passed metadata information.

Type: Function

Syntax: (browseLib.validateMetadata extentInfo)
extentInfo This should be a structure containing the metadata information to be validated.
Returns true if metadata information is valid, false if not.

writeSourceFile

The writeSourceFile function writes the specified source file and returns a string.

Type: Function

Syntax: (browseLib.writeSourceFile filePathName textString)
filePathName The path and file name of the file to be read.
textString The string to be written to the file.
Returns true.