Export & Import of JCB mapped component. #53

Closed
opened 2017-03-14 13:41:56 +00:00 by ro-ot · 24 comments
ro-ot commented 2017-03-14 13:41:56 +00:00 (Migrated from github.com)

The feature request has been made to export JCB mapped components, and the ability to import that exported package.

The feature request has been made to export JCB mapped components, and the ability to import that exported package.

This will be amazing :) are you up for the challenge?

I think it should be a Json or SQL dump file (with a possible key for encryption and decryption), and that the import should make use of the default import of each view.

I will add a new custom admin view to import and export components. @ro-ot you will need to build the import and export logic. I will bump the private repo with the changes, or lets use a branch.

Let me know.

This will be amazing :) are you up for the challenge? I think it should be a Json or SQL dump file (with a possible key for encryption and decryption), and that the import should make use of the default import of each view. I will add a new custom admin view to import and export components. @ro-ot you will need to build the import and export logic. I will bump the private repo with the changes, or lets use a branch. Let me know.
ro-ot commented 2017-03-16 10:14:33 +00:00 (Migrated from github.com)

Yes I think this is a very needed feature. I will start with the logic.

Lets do a public branch called dev or staging

Yes I think this is a very needed feature. I will start with the logic. Lets do a public branch called dev or staging
ro-ot commented 2017-03-16 10:20:10 +00:00 (Migrated from github.com)

The zipped json file seems best. What do you mean with

a possible key for encryption and decryption

The zipped json file seems best. What do you mean with > a possible key for encryption and decryption

okay so json it is... how will we deal with the images, files and folders linked to the component? that would need to be part of the zip file.

The ability to lock the data so no one can use it unless they have the key used to export it. There should be the option for a global key per component. Basically to insure if you use this feature as a backup of your components, it is secure where ever you store it.

That brings up another feature, the option to setup this concept to constantly run and with this feature run backups to an FTP location or local folder, like that used during compilation.

I can add the above feature once we have the basic functionality in place.

okay so json it is... how will we deal with the images, files and folders linked to the component? that would need to be part of the zip file. The ability to lock the data so no one can use it unless they have the key used to export it. There should be the option for a global key per component. Basically to insure if you use this feature as a backup of your components, it is secure where ever you store it. That brings up another feature, the option to setup this concept to constantly run and with this feature run backups to an FTP location or local folder, like that used during compilation. I can add the above feature once we have the basic functionality in place.
ro-ot commented 2017-03-16 10:39:40 +00:00 (Migrated from github.com)

Yes that is why I said zipped. So we can add other files,folders and images to this package.

The locking option is great, but could be to much for the initial development. I will see what is the time frame I have to do this.

Yes that is why I said zipped. So we can add other files,folders and images to this package. The locking option is great, but could be to much for the initial development. I will see what is the time frame I have to do this.
ro-ot commented 2017-03-16 11:33:03 +00:00 (Migrated from github.com)

You said to use the default import option per view, does that not work with CSV's instead of json?

You said to use the default import option per view, does that not work with CSV's instead of json?

Wow you are right... so let me take a look at this, csv could work.... but then we will have one per view, which is not a problem.

I will get back to you on that one.

Wow you are right... so let me take a look at this, csv could work.... but then we will have one per view, which is not a problem. I will get back to you on that one.

I think the csv could work, we will just have to insure that the code data remains in base64 as it is stored in the DB, so we will need some tweaking there.

I think the csv could work, we will just have to insure that the code data remains in base64 as it is stored in the DB, so we will need some tweaking there.
ro-ot commented 2017-03-18 16:22:59 +00:00 (Migrated from github.com)

I think we should still use JSON as the data storage, it seems like the easiest way, and it is much more stable.

I main the data linking is in json objects in the DB and all those ids in those objects will all change in most cases during importing of a component. I think we can better manage the relationships in json.

I think we should still use JSON as the data storage, it seems like the easiest way, and it is much more stable. I main the data linking is in json objects in the DB and all those ids in those objects will all change in most cases during importing of a component. I think we can better manage the relationships in json.

I have used serialized on the db data and stored it in our own db.vdm file since in the long run this data should only work in JCB right.

I will still add the images, that has not been done as yet.

Next the import part, this will be tricky 🥇

I have used serialized on the db data and stored it in our own db.vdm file since in the long run this data should only work in JCB right. I will still add the images, that has not been done as yet. Next the import part, this will be tricky :1st_place_medal:
ro-ot commented 2017-03-21 15:53:16 +00:00 (Migrated from github.com)

Great work @Llewellynvdm I agree with the direction you took. I think we have an amazing feature here. This can become a key aspect!

I can't help with the import at this time, so if you want to do it go right head. But it seems little complicated!

Great work @Llewellynvdm I agree with the direction you took. I think we have an amazing feature here. This can become a key aspect! I can't help with the import at this time, so if you want to do it go right head. But it seems little complicated!
ro-ot commented 2017-03-27 18:56:48 +00:00 (Migrated from github.com)

Wow this is amazing stuff. Thanks @Llewellynvdm for making this happen!

Wow this is amazing stuff. Thanks @Llewellynvdm for making this happen!

https://youtu.be/lkE0ZiSWufg see it in action...

https://youtu.be/lkE0ZiSWufg see it in action...
mwweb commented 2017-04-03 00:27:25 +00:00 (Migrated from github.com)

I just decided to give this a test, and getting an error. I downloaded a fresh copy of Joomla and did a compare between my installed version, and the fresh download, and the files match.

Warning: Header may not contain more than a single header, new line detected in C:\xampp\htdocs\dev\libraries\joomla\application\web.php on line 947

Error
An error has occurred.
1054 Unknown column 'a.*' in 'field list' SQL=SELECT a.* FROM gax8s_componentbuilder_joomla_component AS a WHERE a.id IN (25) ORDER BY a.ordering ASC
Call stack

Function Location

1 JApplicationCms->execute() C:\xampp\htdocs\dev\administrator\index.php:51
2 JApplicationAdministrator->doExecute() C:\xampp\htdocs\dev\libraries\cms\application\cms.php:261
3 JApplicationAdministrator->dispatch() C:\xampp\htdocs\dev\libraries\cms\application\administrator.php:152
4 JComponentHelper::renderComponent() C:\xampp\htdocs\dev\libraries\cms\application\administrator.php:98
5 JComponentHelper::executeComponent() C:\xampp\htdocs\dev\libraries\cms\component\helper.php:380
6 require_once() C:\xampp\htdocs\dev\libraries\cms\component\helper.php:405
7 JControllerLegacy->execute() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\componentbuilder.php:56
8 ComponentbuilderControllerJoomla_components->smartExport() C:\xampp\htdocs\dev\libraries\legacy\controller\legacy.php:702
9 ComponentbuilderModelJoomla_components->getSmartExport() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\controllers\joomla_components.php:160
10 JDatabaseDriverMysqli->execute() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\models\joomla_components.php:122

I just decided to give this a test, and getting an error. I downloaded a fresh copy of Joomla and did a compare between my installed version, and the fresh download, and the files match. Warning: Header may not contain more than a single header, new line detected in C:\xampp\htdocs\dev\libraries\joomla\application\web.php on line 947 Error An error has occurred. 1054 Unknown column 'a.*' in 'field list' SQL=SELECT `a`.`*` FROM `gax8s_componentbuilder_joomla_component` AS `a` WHERE a.id IN (25) ORDER BY a.ordering ASC Call stack # Function Location 1 JApplicationCms->execute() C:\xampp\htdocs\dev\administrator\index.php:51 2 JApplicationAdministrator->doExecute() C:\xampp\htdocs\dev\libraries\cms\application\cms.php:261 3 JApplicationAdministrator->dispatch() C:\xampp\htdocs\dev\libraries\cms\application\administrator.php:152 4 JComponentHelper::renderComponent() C:\xampp\htdocs\dev\libraries\cms\application\administrator.php:98 5 JComponentHelper::executeComponent() C:\xampp\htdocs\dev\libraries\cms\component\helper.php:380 6 require_once() C:\xampp\htdocs\dev\libraries\cms\component\helper.php:405 7 JControllerLegacy->execute() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\componentbuilder.php:56 8 ComponentbuilderControllerJoomla_components->smartExport() C:\xampp\htdocs\dev\libraries\legacy\controller\legacy.php:702 9 ComponentbuilderModelJoomla_components->getSmartExport() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\controllers\joomla_components.php:160 10 JDatabaseDriverMysqli->execute() C:\xampp\htdocs\dev\administrator\components\com_componentbuilder\models\joomla_components.php:122

Did you do a fresh install of JCB? on a Joomla website that is also fresh?

Did you do a fresh install of JCB? on a Joomla website that is also fresh?
ro-ot commented 2017-04-03 07:18:08 +00:00 (Migrated from github.com)

@mwweb to test pull request is little more tricky then what you did. @Llewellynvdm can you not make a quick video on how this should be done... please 👍

@mwweb to test pull request is little more tricky then what you did. @Llewellynvdm can you not make a quick video on how this should be done... please :+1:
mwweb commented 2017-04-03 07:28:30 +00:00 (Migrated from github.com)

@ro-ot... this was testing the export component feature in jcb 2.4.0. That's where the error is occurring.

@ro-ot... this was testing the export component feature in jcb 2.4.0. That's where the error is occurring.

Please make the comments on the pull request that is being tested. Here is a quick tutorial.. hope it helps!

@mwweb the bug that you found does not exist that is why I asked if it is a fresh install :)

If you open the code of \com_componentbuilder\models\joomla_components.php on line 104 you will see that the Unknown column 'a.*' that it is giving as a warning is not an error, but normal JDatabase syntax that is used in all over the place.

Check your local file if it is the same on that line ;)

Please make the comments on the pull request that is being tested. Here is a [quick tutorial](https://youtu.be/cxryVA5Cni8).. hope it helps! @mwweb the bug that you found does not exist that is why I asked if it is a fresh install :) If you open the code of [\com_componentbuilder\models\joomla_components.php](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/models/joomla_components.php#L104) on line 104 you will see that the `Unknown column 'a.*'` that it is giving as a warning is not an error, but normal JDatabase syntax that is used in all over the place. Check your local file if it is the same on that line ;)
mwweb commented 2017-04-03 20:27:42 +00:00 (Migrated from github.com)

Fresh Joomla install on CentOs (account on my web server).
Fresh install of JCB 2.4.1
Went to Components -> Component Builder -> Joomla Components
Selected Demo Component
Click Export Components button

Result:

An error has occurred.
1054 Unknown column 'a.*' in 'field list' SQL=SELECT a.* FROM #__componentbuilder_joomla_component AS a WHERE a.id IN (25) ORDER BY a.ordering ASC

Fresh Joomla install on CentOs (account on my web server). Fresh install of JCB 2.4.1 Went to Components -> Component Builder -> Joomla Components Selected Demo Component Click Export Components button Result: An error has occurred. 1054 Unknown column 'a.*' in 'field list' SQL=SELECT `a`.`*` FROM `#__componentbuilder_joomla_component` AS `a` WHERE a.id IN (25) ORDER BY a.ordering ASC

I am sorry, I will look at this again, not sure how we missed this. Will get back to you soon. Thanks!

I am sorry, I will look at this again, not sure how we missed this. Will get back to you soon. Thanks!

@mwweb, hi Download this version and let me know if your error is resolved.

@mwweb, hi Download [this version](https://github.com/vdm-io/Joomla-Component-Builder/archive/master.zip) and let me know if your error is resolved.
mwweb commented 2017-04-05 07:34:09 +00:00 (Migrated from github.com)

That works. No error, and it created the zip file in the tmp folder.

That works. No error, and it created the zip file in the tmp folder.
mwweb commented 2017-04-08 20:08:44 +00:00 (Migrated from github.com)

I know is a closed issue, but I just tested it and noticed some "odd" behavior. When attempting to export, all of the images (component image and dashboard images) are throwing errors. See a sample below:

JFile: :copy(/var/www/mwredev/images/component_images/MWR_3D_Box-right.png, /var/www/mwredev/tmp//JCB_mostWantedRealEstate/images/component_images/MWR_3D_Box-right.png): copy(/var/www/mwredev//tmp//JCB_mostWantedRealEstate/images/component_images/MWR_3D_Box-right.png): failed to open stream: No such file or directory

Notice that when it's attempting to "create" the tmp path that it is adding double // rather than a single( mwredev//tmp// )

I know is a closed issue, but I just tested it and noticed some "odd" behavior. When attempting to export, all of the images (component image and dashboard images) are throwing errors. See a sample below: JFile: :copy(/var/www/mwredev/images/component_images/MWR_3D_Box-right.png, /var/www/mwredev/tmp//JCB_mostWantedRealEstate/images/component_images/MWR_3D_Box-right.png): copy(/var/www/mwredev//tmp//JCB_mostWantedRealEstate/images/component_images/MWR_3D_Box-right.png): failed to open stream: No such file or directory Notice that when it's attempting to "create" the tmp path that it is adding double // rather than a single( mwredev//tmp// )

Okay, I have added some new code to try and fix this. But we need to look little closer at this, the fix is not ideal. It will work but ugly 👎

I will add the fix to the active pull request, then you can test it there and comment on it there 👍

Okay, I have added some new code to try and fix this. But we need to look little closer at this, the fix is not ideal. It will work but ugly :-1: I will add the fix to the active [pull request](https://github.com/vdm-io/Joomla-Component-Builder/pull/67), then you can test it there and comment on it there :+1:
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#53
No description provided.