Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
nuBuilder4-cloner
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
nuBuilder4-cloner
Hi guys,
Here comes the "nuBuilder cloner".
It allows you to clone a nuBuilder Form with all its objects, events etc.
Features:
* Clone/Duplicate Forms with all PHP events, select, select clause, browse, tabs etc.
* Clone Objects with their events etc.
* Include only certain form tabs
* Copy objects to a new or existing form
* Dump the SQL INSERT statements to the browser window instead of executing them
Some Use cases:
* Clone a form to test changes before they are integrated into the productive system
* Export a form from one database and import it into another one
* You created a form and want to duplicate it because you need a similar form (Instead of recreating it from scratch)
* You want to copy a bunch of controls from one form to another
* You want other users than globeadmin (e.g. supervisors/managers) to manage the nuBuilder users. Clone nuBuilder's user form, customize it and give access to any users.
https://github.com/smalos/nuBuilder4-cloner
Here comes the "nuBuilder cloner".
It allows you to clone a nuBuilder Form with all its objects, events etc.
Features:
* Clone/Duplicate Forms with all PHP events, select, select clause, browse, tabs etc.
* Clone Objects with their events etc.
* Include only certain form tabs
* Copy objects to a new or existing form
* Dump the SQL INSERT statements to the browser window instead of executing them
Some Use cases:
* Clone a form to test changes before they are integrated into the productive system
* Export a form from one database and import it into another one
* You created a form and want to duplicate it because you need a similar form (Instead of recreating it from scratch)
* You want to copy a bunch of controls from one form to another
* You want other users than globeadmin (e.g. supervisors/managers) to manage the nuBuilder users. Clone nuBuilder's user form, customize it and give access to any users.
https://github.com/smalos/nuBuilder4-cloner
Last edited by kev1n on Thu Oct 29, 2020 10:53 pm, edited 3 times in total.
Re: nuBuilder4-cloner
Thanks, Ke1vin for your hard work and time, the nubuilder4 cloner would really save time now as we don't have to recreate the forms from the scratch. I have tested it and it works like charm.
Cheers
nc07
Cheers
nc07
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: nuBuilder4-cloner
To confirm - I tested it as well - and works very well. It's really helpful tool. Thanks kev1n.
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: nuBuilder4-cloner
Thank you for your kind words, I truly appreciate it!
Any other comments/suggesions? (Especially from the nuBuilder specialists)
BTW, there has been an update:
Any other comments/suggesions? (Especially from the nuBuilder specialists)
BTW, there has been an update:
* Fix cloner_tabs: Include only those specified with nuSetProperty()
* Added: cloneFormSelect(), cloneFormSelectClause() to clone a form's select and select clause.
* Added: If the Hash Cookie #cloner_open_new_form# is set to '0', the new form is not displayed
* Changed : If the Hash Cookie #cloner_without_objects# is set to '1', the objects on the form are not cloned
-
- Posts: 115
- Joined: Tue Dec 12, 2017 11:28 pm
- Location: Aberdeen, UK
- Has thanked: 9 times
- Been thanked: 12 times
Re: nuBuilder4-cloner
Hello kev1n,
As others have said, this works really well and is a very welcome addition. Thanks for your efforts on this.
One suggestion - as it works by building a series of SQL INSERT statements, why not have an option that directs these to a .SQL text (dump) file rather than executing them in the current database? This would then allow the user to create a simple export file to copy a form and all its components to a different nuBuilder instance. I can see that you are using prepared statements with parameters in function insertRecord and so adding an option to create the equivalent insert statement with literals should be quite straightforward (I think!).
Even in the same database, it can sometimes be faster to dump some of the zzzz* records as a set of SQL statements, edit values and then re-import - if you know what you are doing.
Thanks again.
Neil
As others have said, this works really well and is a very welcome addition. Thanks for your efforts on this.
One suggestion - as it works by building a series of SQL INSERT statements, why not have an option that directs these to a .SQL text (dump) file rather than executing them in the current database? This would then allow the user to create a simple export file to copy a form and all its components to a different nuBuilder instance. I can see that you are using prepared statements with parameters in function insertRecord and so adding an option to create the equivalent insert statement with literals should be quite straightforward (I think!).
Even in the same database, it can sometimes be faster to dump some of the zzzz* records as a set of SQL statements, edit values and then re-import - if you know what you are doing.
Thanks again.
Neil
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: nuBuilder4-cloner
Hi Neil,
Thanks for your feedback! Actually that's an excellent idea. I had actually started another project ("nuBuilder Exporter") that does just that.
However, I was not yet able to finish it completely. I'll see what can be done.
Thanks for your feedback! Actually that's an excellent idea. I had actually started another project ("nuBuilder Exporter") that does just that.
However, I was not yet able to finish it completely. I'll see what can be done.
-
- Posts: 115
- Joined: Tue Dec 12, 2017 11:28 pm
- Location: Aberdeen, UK
- Has thanked: 9 times
- Been thanked: 12 times
Re: nuBuilder4-cloner
You are very welcome, kev1n . I have been doing a bit more work with nuBuilder recently and have found a number of your code snippets to be very useful. Thanks once again.
It strikes me that you have already done the heavy lifting for a form exporter with the cloning code. It could easily be adapted for other objects as well.
Neil
PS I followed the Discord link in your signature but the invitation is not valid. I have never used Discord and so there may be something else going wrong.
It strikes me that you have already done the heavy lifting for a form exporter with the cloning code. It could easily be adapted for other objects as well.
Neil
PS I followed the Discord link in your signature but the invitation is not valid. I have never used Discord and so there may be something else going wrong.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: nuBuilder4-cloner
Neil,
I updated the discord link. I hope it works now.
And...
I also updated the cloner. It's now possible to dump the SQL statements instead of executing them.
Note: Instead of nuRunPHPHidden() use nuRunPHP(). This allows us to output the statements in a new browser tab.
I updated the discord link. I hope it works now.
And...
I also updated the cloner. It's now possible to dump the SQL statements instead of executing them.
Code: Select all
nuSetProperty('cloner_dump_statements','1');
nuSetProperty('cloner_without_objects', "0");
nuSetProperty('cloner_tabs','');
nuSetProperty('cloner_f1','');
nuSetProperty('cloner_f2','');
nuRunPHP('cloner', '',1);
You do not have the required permissions to view the files attached to this post.
-
- Posts: 115
- Joined: Tue Dec 12, 2017 11:28 pm
- Location: Aberdeen, UK
- Has thanked: 9 times
- Been thanked: 12 times
Re: nuBuilder4-cloner
Hi kev1n,
I have been doing a few tests using version 1.07 (https://github.com/smalos/nuBuilder4-cl ... cloner.php) and it looks good. As you mentioned, the hash cookie flag is now the shorter '#cloner_dump#' (rather than the earlier '#cloner_dump_statements#') . The JS code ..
.. generates all the SQL statements to create the complete form.
Great job.
Neil
I have been doing a few tests using version 1.07 (https://github.com/smalos/nuBuilder4-cl ... cloner.php) and it looks good. As you mentioned, the hash cookie flag is now the shorter '#cloner_dump#' (rather than the earlier '#cloner_dump_statements#') . The JS code ..
Code: Select all
nuSetProperty('cloner_dump','1');
nuSetProperty('cloner_without_objects', '0');
nuSetProperty('cloner_tabs','');
nuSetProperty('cloner_f1','');
nuSetProperty('cloner_f2','');
nuRunPHP('cloner', '',1);
Great job.
Neil
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact: