User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:adminmanual:businessmappings [2019/10/06 16:17]
joebordes [Types of Business Mappings]
en:adminmanual:businessmappings [2019/12/14 19:05] (current)
joebordes [How to add a Business Mapping Type Generator]
Line 123: Line 123:
 <code PHP>​$focus->​search_fields = $cbMap->​ListColumns()->​getSearchFields();</​code>​ <code PHP>​$focus->​search_fields = $cbMap->​ListColumns()->​getSearchFields();</​code>​
  
 +===== How to add a Business Mapping Type Generator =====
  
 +Each Business Map record has an action link named "​Generate Map". This link opens a window with a specific editor for each type of map which will help us construct the map in a more or less graphical way.
 +
 +coreBOS gives the programmer of the map the necessary infrastructure to simply implement the editor and not have to worry about the details.
 +
 +If you want to create an editor for your map you must:
 +
 +  * create a class named <​code>​gen<​MapName></​code>​ inside the directory modules/​cbMap/​generatemap
 +  * the class extends **generatecbMap**:​ <​code>​ class genModuleSetMapping extends generatecbMap {</​code>​
 +  * the class must contain two methods:
 +    * **generateMap()** this method will be called once the editor window is opened and will be in charge of sending to the screen all the editor contents.
 +      * The method should include the file **modules/​cbMap/​generatemap/​GenMapHeader.php** before any output. This script will output the normal coreBOS includes like LDS (among others).
 +      * The method should include the file **$smarty->​display('​modules/​cbMap/​GenMapFooter.tpl'​);​** at the end which will close the HTML and BODY opened in the header
 +      * The contents generated by the method must contain a javascript function that captures all the required information and sends it to the **saveMapAction(params);​** function. params is the typical parameter/​value query string used in the browser (separated by &) and will be sent to coreBOS as the POST body of the save event
 +    * **convertToMap()** which will have to read from the $_REQUEST the values it needs and return the constructed map that will be saved by coreBOS
 +
 +You can find an example in the Module Set Mapping