Updated 033 Export Import of fully mapped components (markdown)

Amigo 2019-07-17 11:13:08 +02:00
parent c81324b4ee
commit 49a4090cc5

@ -34,23 +34,29 @@ During this process an account is taken of a specific value. That value's name i
[00:05:12](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m12s) [00:05:12](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m12s)
If any keys has been found, the array is going to be imploded and converted to a 'md5' string.<<<<<<<<< If any keys has been found, the array is going to be imploded and converted to a 'md5' string. We will then use this 'md5' string with an 'Aes' encryption cipher to lock the data. [00:05:37](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m37s) There is the data(See video). Above here the whole data set has already been changed to a serialized string. There is a string in this(data) variable and here is the whole string encrypted. In this(data) variable is the encrypted value. If there are not any keys, even if that means if none of the components that was selected had any keys set, then it will default simply to do a 'base64_encode'. [00:06:09](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m09s) That as well,gets written to the file that is part of the package. That is how it exports the data. [00:06:43](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m43s) So it exports the data and then checks whether there is any keys. So if there is, for example: Export five components, and all five components have keys, all five keys will create a very long string, and then that whole string will be changed into an 'md5' string which is 32 characters. That 32 characters is then used to encrypt the data.
We will then use this md5 string with an Aes encryption cypher to lock the data. [00:05:37](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m37s) So there is the data. Now above here we already changed the whole data set to a serialized string. So we have a string in this(data) variable. And here we are encrypting the whole string. In this(data) variable we have the encrypted value. If we don't have any keys, even if that means if none of the components that was selected had any keys set, then it will default to simply [00:06:09](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m09s) do a base64_encode. If that is well, then it gets written to the file that's part of the package. So that is how it exports the data. I'm not going to explain much about the actual mechanics that's happening here in the bottom of the file. You're welcome to look through it. If you see any room for improvements, you're welcome to make a pull request. [00:06:43](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m43s) So it exports the data and then checks whether we have any keys. So if you have, for example exporting five components, and all five components have keys, in all five keys will create a very long string, and then that whole string will be changed into an md5 string which is 32 characters. And that 32 characters is then used to encrypt the data. [00:07:13](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m13s)
Basically
### Exporting A Component - Generating A Key ### Exporting A Component - Generating A Key
This actual key which we then end up using to do the encryption, will be shown to you in the interface after the data is being exported. Let's go back to the user interface and let's export a component. I have this(Learning Manager) component, and it has a key. I have other components that has no keys at this stage. I'll select Learning Manager as a demonstration. [00:07:52](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m52s) Then I'll click export component. As you can see it generated a key for me, which I can then use to import this package into another JCB. I can import it into the same JCB. But it's obviously not necessary. I could use it as a backup. Now [00:08:19](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m19s) It is storing the compiled package in the temporary folder at this stage. I am working to determine whether we should make this placement of the file dynamic, that you could change it. I think it will be ideal if it automatically becomes a kind of backup method. We're even thinking of setting up a timer that could run backups of your components using this method. Anyway that's future planning. [00:08:55](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m55s) You have an exported component at the moment, if your data sets are not too big and your memory settings on your PHP and so forth is allowing this kind of compilation, you could select all components and export them. The same will be the result. Since I have only one component set with a key, [00:09:26](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m26s) they all will be encrypted with the same key. They all will be stored in this package. I have exported all my components into this one package. [00:07:13](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m13s)
This key which is used to do the encryption, will be shown in the interface after the data has been exported. Go back to the user interface and export a component. The(Learning Manager) component has a key. There are other components that has no keys at this stage.
Learning Manager is used as a demonstration. [00:07:52](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m52s)
Click 'export component' and as may be seen it generated a key, which can then be used to import this package into another JCB. It may be imported it into the same JCB, but it is obviously not necessary. It could also be used as a backup. It is storing the compiled package in the temporary folder at this stage. [00:08:55](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m55s) Here is a exported component at the moment, if the data sets are not too large and the memory settings on PHP and so forth are allowing this kind of compilation, all components can then be selected and exported. The result will be same. Since only one component is set with a key, all of them will be encrypted with the same key. All of them will be stored in this package. All the components have been exported into this one package.
### Importing Components - JCB_smartPackage.zip ### Importing Components - JCB_smartPackage.zip
Now to demonstrate the importing of this(JCB_smartPackage.zip) data set, I have a blank website ready. [00:09:49](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m49s) Here's my blank website, it has no special JCB components. The first thing I'll do is I'm going to install JCB from GitHub. I'm going to GitHub and I will open the releases. [00:10:14](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m14s) I'll just copy the link to the latest release. Go back, paste that in here(Install From URL). And install it. The installation was successful. I'm going to Component Builder, then I'll open the components. As you can see [00:10:43](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m43s) I have only the demo component. I would like to move all these components that I have, over to the new install. I'm going to click on import components. Then I'm going to browse to that package that we've just exported. I'm going to upload it. [00:11:13](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m13s) [00:09:41](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m41s)
To demonstrate the importing of this(JCB_smartPackage.zip) data set, a blank website is used. [00:09:49](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m49s) This blank website, has no special JCB components. First, JCB has to be installed from GitHub. On GitHub the releases should be opened. [00:10:14](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m14s) The link is copied to the latest release. Go back, paste that in here(Install From URL) and install it. The installation was successful. Go to Component Builder, and open the components. As may be seen [00:10:43](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m43s) there is only the demo component. If all these components need to be moved to the new install, click on 'Import Components'. Browse to that package that have just been exported and upload it.
### Two Features - Force Local Update - Use Key ### Two Features - Force Local Update - Use Key
[00:11:13](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m13s) <<<<<<<<<<<<<<<<
We have two features here. This force local update, what it will do, is on normal circumstances if you do a import, the import function looks at the data that are currently in this JCB install. For example we're talking about field types, fields, admin views and site views. [00:11:42](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m42s) If it finds a site view that is being installed, that is already in the current database, it looks at the last modified date, and then by that determines whether the current installed version is newer. If it's newer it will by default ignore the new data and not install it. Sometimes you might get a package where you would like to force that it updates the current data even though it may be all the data. So this is why we have the switch, you can then click yes to force the update. [00:12:20](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m20s) We have a key for this package, so we'll leave this to yes. I'll just come over here(Joomla Components) and copy that key. This key will then always be necessary if you're importing this package. That will be it and we'll click continue. It might take a time since this is quite a huge dataset. You could just patiently wait. At last it is installed, it tells us that the install is being successful. You might get these warnings. We have two features here. This force local update, what it will do, is on normal circumstances if you do a import, the import function looks at the data that are currently in this JCB install. For example we're talking about field types, fields, admin views and site views. [00:11:42](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m42s) If it finds a site view that is being installed, that is already in the current database, it looks at the last modified date, and then by that determines whether the current installed version is newer. If it's newer it will by default ignore the new data and not install it. Sometimes you might get a package where you would like to force that it updates the current data even though it may be all the data. So this is why we have the switch, you can then click yes to force the update. [00:12:20](https://www.youtube.com/watch?v=lkE0ZiSWufg&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m20s) We have a key for this package, so we'll leave this to yes. I'll just come over here(Joomla Components) and copy that key. This key will then always be necessary if you're importing this package. That will be it and we'll click continue. It might take a time since this is quite a huge dataset. You could just patiently wait. At last it is installed, it tells us that the install is being successful. You might get these warnings.
### Warnings - Remapped ### Warnings - Remapped