nrio.LPInterface is an interface that must implement the following method:
Object[][] processRequest(String sCommand, String sDBSource, String sDBTarget, Object[][] otherParams)
This interface is here only to set a standard way of passing requests among instances of MaxBase. What use does it have? If the object that creates a MaxBase instance (could be an applet, a program, or simply another class) implements this interface, you will be able to use it as a "dispatching center" for multi-db operations from your VFD components and/or AMInterface objects.
Let's suppose you want to use some fields of a database in another one, e.g. supplier names in an item database. You would, most probably, let the user choose from a list of suppliers instead of having him/her enter a name by hand, so you can ask (from inside the add/modify panel of the items database) the LPInterface object to send requests to the suppliers database ("send all suppliers' names"). Normally there will be an object implementing LPInterface and launching several instances of MaxBase and serving the cross-database requests of these MaxBase instances.
MaxBase uses its LPInterface property (called LPParent) to notify the world about important events; such events are:
db loaded (other parameters: name of the db) db closed (other parameters: name of the db) form opened (other parameters: name of the db:form, form mode, form components) form closed (other parameters: name of the db:form).
Note about parameters: name of the db is a string representing the file name (ending with the .dat extension) or the URL of the database. name of the db:form is a string with two parts; the first is the name of the db, the second is the form init string. A ":" character divides the two parts. form mode is a string, and can be one of the following: DATAINPUT, DATAEDIT, VIEW. form components is an MBIOComponent double array (MBIOComponent[][]). All of the components of the form are stored in the array; the first index (ranging from 0 to max page number - 1) is the page number, the second is the component number (different pages can contain different amounts of components). Example: element [3][2] means the third (2+1) component of the fourth (3+1) page.
Using this object is not compulsory, of course, and you can choose to implement your own way to make more DBs communicate. |