| AppliBuilder
User Documentation |
Framework supports initializing the required tables, named queries when the widget is added. Widget developer must make sure he will add the required information to the setup_library.sql and setup_library_mysql.sql.
Here is an example:
Example for UserEditableWidget in setup_library.sql, after inserting to LibWidgetImport.
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.Init1', 'create table AppliWidget_UserEditableText(content text);', 'INITQUERY');
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.Init2', 'drop table AppliWidget_SomeTable; create table
AppliWidget_UserEditableText2(content text);', 'INITQUERY');
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.NQ1', 'select * from AppliWidget_UserEditableText;', 'SQLQUERY');
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.NQ2', 'select * from AppliWidget_UserEditableText;', 'JYTHONQUERY');
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.DS1', 'select * from AppliWidget_UserEditableText;', 'DATASOURCE_SQLQUERY');
When UserEditableWidget is added,
VALID QUERY TYPES
Specifying ScriptValue
You can directly specify the script value in the insert statement or give reference to the sql file.
Use file:widgetinit/<script_filename> if you are specifying script value as a reference to the sql file.
Here <script_filename> will be looked in the widgetinit directory within framework sql directory during widget initialization.
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.Init3', 'file:widgetinit/usereditable.init3.sql', 'INITQUERY');
insert into LibWidgetInit VALUES (@INSERTED_ID, 'AppliWidget.UserEditableText.DS2', 'file:widgetinit/usereditable.ds2.sql', 'DATASOURCE_SQLQUERY');
NOTE: All table created for widget will be present under the application schema of developer database.
SUGGESTION:
| ©
2006 Applibase, Inc. |