This shows you the differences between two versions of the page.
— | siremis:install53x:new-views [2020/02/26 14:32] (current) – created admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Siremis v5.3.x - Adding New DB Table Views ====== | ||
+ | |||
+ | Siremis offers a flexible way of managing the records inside database tables used by Kamailio. Most of them are covered by existing Siremis distribution, | ||
+ | |||
+ | Starting with this version, Siremis comes with several PHP tools that allows you to generate views for tables in Kamailio database in no time. | ||
+ | |||
+ | ===== Preparing The Tools ===== | ||
+ | |||
+ | First you have to install Siremis so that Kamailio' | ||
+ | |||
+ | < | ||
+ | make toolsx | ||
+ | </ | ||
+ | |||
+ | To run the db table view generation tool, you have to install command line php - php5-cli or php7.0-cli. On Debian/ | ||
+ | |||
+ | < | ||
+ | apt-get install php-cli | ||
+ | # or | ||
+ | apt-get install php5-cli | ||
+ | # or | ||
+ | apt-get install php7.0-cli | ||
+ | </ | ||
+ | |||
+ | ===== Generating New Table View ===== | ||
+ | |||
+ | From Siremis' | ||
+ | |||
+ | You have to execute **gen_meta.php**, | ||
+ | |||
+ | Next command shows how the view for **mtree** table was generated. | ||
+ | |||
+ | < | ||
+ | cd siremis/ | ||
+ | php gen_meta.php Sipdb mtree sipadmin.rtg.mtree | ||
+ | </ | ||
+ | |||
+ | In this example, Siremis submodule ID is **sipadmin.srv.mtree**, | ||
+ | |||
+ | * it is part of Siremis module **sipadmin** (where all components related to Kamailio are located) | ||
+ | * generated forms should be inside directory **siremis/ | ||
+ | * practically, | ||
+ | |||
+ | If you look inside **siremis/ | ||
+ | * **do** - data object specifications | ||
+ | * **form** - web forms specifications - adding new, editing, copying, viewing or seaching mtree records | ||
+ | |||
+ | Another file that was generated is the Siremis Web View for mtree management. It is located at: | ||
+ | |||
+ | < | ||
+ | siremis/ | ||
+ | </ | ||
+ | |||
+ | It includes the references to the Form objects used for this view. | ||
+ | |||
+ | ===== Inserting New View In Menu ===== | ||
+ | |||
+ | All that is needed to manage the records in **mtree** table was generated in previous step, Missing part is linking it from Siremis menu in order to access the operations to manage **mtree** table. | ||
+ | |||
+ | The menu of Siremis module **sipadmin** is located at: | ||
+ | |||
+ | < | ||
+ | siremis/ | ||
+ | </ | ||
+ | |||
+ | Edit it and add a new entry in the XML tree. For **mtree**, we added it to **Server Services**: | ||
+ | |||
+ | <code xml> | ||
+ | ... | ||
+ | < | ||
+ | < | ||
+ | ... | ||
+ | < | ||
+ | ... | ||
+ | < | ||
+ | URL=" | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | The mtree entry is the last **MenuItem** node in the above snippet. The main attributes for it are: | ||
+ | |||
+ | * name - it has to be an unique identifier in the menu | ||
+ | * title - it is the text that appears in the menu | ||
+ | * url - it is the web URL of the view for mtree management | ||
+ | * **{@home: | ||
+ | * **sipadmin** is the name of the Siremis module which includes the view | ||
+ | * **mtree_list** - is built from the name of the view file (in this case MtreeListView.xml), | ||
+ | * order - set the order in the menu | ||
+ | |||
+ | ===== Removing The Tools ===== | ||
+ | |||
+ | The tools files are available via web browser. Although they require command line interaction, | ||
+ | |||
+ | < | ||
+ | make cleantoolsx | ||
+ | </ | ||
+ | |||
+ | ===== More Docs ===== | ||
+ | |||
+ | Siremis is built on top of **phpopenbiz** and **cubi** frameworks, you can read more documentation about how to extend it at: | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | * http:// | ||
+ | |||
+ | Many tutorials are available in project' | ||
+ | |||
+ | * http:// | ||