Hello,
Is there some overview of the possible operations on the "helper" JS object ?
All methods provided by the
helper instance is explained in the sample javascript file
./sample/custom_script.js of your QxEntityEditor package.
There is no documentation or manual of QxEntityEditor yet : but I plan to write a manual (like QxOrm manual) dedicated to QxEntityEditor.
This manual will describe all operations provided by the javascript
helper instance.
I would like to obtain an array of all entity_table_names.
There is no method to get this list automatically.
But you can implement it quite easily :
1- in your javascript file, define a global variable.
2- then, on each call of the
customProcess : function(params) function, just insert the entity id or entity table name in your global array.
3- then, when the *.pro file is written (which means that all entities have been processed) ==> your global array contains all entities.
Something like this :
- Code: Select all
var allEntities = new Array(); // global variable
customProcess : function(params)
{
try
{
allEntities.push(params[13]); // Add current entity id to the global array
// Write the pro file ==> so all entities have been processed
if (params[4].endsWith(".pro"))
{
// Here you can iterate over all entities
for (i = 0; i < allEntities.length; i++)
{ /* ... */ }
}
}
catch (err)
{ return ("[CustomScriptError] an unexpected error occurred : " + err); }
}
Note : for the next version of QxEntityEditor, I will add a method to the
helper instance to get all entities id of a project.
it would be cool to get the C++ project location out of the helper object to write files directly there.
Ok I will add a method to get the output location to the
helper instance for the next QxEntityEditor version.
For now, you can wait for the
*.pro project file processed by the javascript (like example in my previous answer) ==> this way you can get the project location and you can write your own file there.