Updated 044 Hello World Component with Joomla Component Builder Creator Extended (markdown)

Amigo 2019-08-16 09:55:12 +02:00
parent 1289cdb5d2
commit 08f29e12ff

@ -183,7 +183,7 @@ We're just going to create a Linked Fields. Linked Fields are the Fields that we
[00:30:30](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m30s) [00:30:30](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m30s)
There is the Name Field and that is a text field. We want it to show in the Admin List View and to show first in the Order in List views. I should behave as a Title and must be Sortable, Searchable not Filterable, because then every name would be a filter, but definitely Linkable. This means if someone clicks on the Name, it will open the Greeting, and can then be edited. There are only two Tabs at this stage. [00:31:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m07s) If you want to know more about the Tabs, please go through the tutorials and look up Tabs to see more on this subject. I am going to let it be Left in the Tab and in the Tab(Order in Edit) and let it to be the first item. No Permissions will be added to this, but there is an Editing Permission available at this stage. [00:31:33](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m33s) That would create Permissions around this Field, which can be tweaked, as to who can edit it, and who can not. This can also be controlled from a Global view perspective or on a field level. These are some of the hidden advantages the JCB has in handling permissions across your component quite easily. There is the Name Field and that is a text field. We want it to show in the Admin List View and to show first in the Order in List views. I should behave as a Title and must be Sortable, Searchable not Filterable, because then every name would be a filter, but definitely Linkable. This means if someone clicks on the Name, it will open the Greeting, and can then be edited. There are only two Tabs at this stage. [00:31:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m07s) If you want to know more about the Tabs, please go through the tutorials and look up Tabs to see more on this subject. I am going to let it be Left in the Tab and in the Tab(Order in Edit) and let it be the first item. No Permissions will be added to this, but there is an Editing Permission available at this stage. [00:31:33](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h31m33s) That would create Permissions around this Field, which can be tweaked, as to who can edit it, and who can not. This can also be controlled from a Global view perspective or on a field level. These are some of the hidden advantages the JCB has in handling permissions across your component quite easily.
* ### Example Greetings Field * ### Example Greetings Field
@ -231,15 +231,15 @@ The 'Has Metadata' adds the metadata Fields to the view. You do not need to add
[00:38:55](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m55s) [00:38:55](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m55s)
This View has an Access function, here all these Access levels can be set which are Public, Special or Registered. Do you want to implement these levels of access to this view? Usually, this is used if you want the view to be editable on the front end of the Site because then you will use the Access to control some of these. More of that as we continue. If you need an Import/Export function, tick it accordingly and likewise do if we want to add an Edit/Create Site View for this Admin View. [00:39:38](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m38s) If we want it to be first, then set it in the 'Order' column. This Admin View has all the features that an Admin View can have by Default in JCB. The code that JCB is going to write to do this implementation, is quite stable, and yet dynamic, that as Joomla evolves and changes, we can tweak these codes in the Compiler and make sure that it remains stable this way. [00:40:15](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m15s) Save and close. Now that this Admin View has been linked to the Component, we can go to Admin Views and see this Admin View as well the Icon. Click on this pencil and it will take you to the Admin View. Make sure that all your work has been saved in this area, click OK, if it is, and it opens the Admin View where we linked the Fields. [00:40:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m48s) and You can work in the Admin View from the Component. <<<< This View has an Access function, here all these Access levels can be set which are Public, Special or Registered. Do you want to implement these levels of access to this view? Usually, this is used if you want the view to be editable on the front end of the Site because then you will use the Access to control some of these. More of that as we continue. If you need an Import/Export function, tick it accordingly and likewise do if we want to add an Edit/Create Site View for this Admin View. [00:39:38](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m38s) If we want it to be first, then set it in the 'Order' column. This Admin View has all the features that an Admin View can have by Default in JCB. The code that JCB is going to write to do this implementation, is quite stable, and yet dynamic, that as Joomla evolves and changes, we can tweak these codes in the Compiler and make sure that it remains stable this way. [00:40:15](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m15s) Save and close. Now that this Admin View has been linked to the Component, we can go to Admin Views and see this Admin View as well the Icon. Click on this pencil and it will take you to the Admin View. Make sure that all your work has been saved in this area, click OK, if it is, and it opens the Admin View where we linked the Fields. [00:40:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m48s) and You can work in the Admin View from the Component.
### Adding Permissions ### Adding Permissions
[00:41:03](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m03s) [00:41:03](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m03s)
I'm just going to add some Permissions because I want to demonstrate the Permission Structure regarding the front end Management of Editing these items. I'm just going to use the Core. There is the option of using what is known as the view.edit [00:41:22](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m22s) instead of core.edit then it means its relationship is just for this view. If I want it to be related to the Core which means that it's not going to be only related to this view, but whatever I change in the Core will affect this view. For more explanation on the permissions, there is this tutorial which is available in the Description. You can go watch this tutorial and also maybe do some changes. Compile the Component and look at the code. [00:41:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m54s) Look at the code and look at the code. That's all I can say for most questions being asked because the code really tells you what has been done. There are many ways for you to learn how JCB does things by making changes and then compiling your component and looking at what changed. Usually using something like Git will be very useful in discovering the changes. There's also a way for you to know where in the Compiler specific code is being created which I will show you as we continue. I am adding some Permissions to demonstrate the Permission Structure regarding the front end Management of Editing these items. I am going to use the Core. There is the option of using what is known as the 'view.edit' [00:41:22](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m22s) instead of 'core.edit' then it means its relationship is just for this view. If I want it to be related to the Core which means that it is not going to be only related to this view, but whatever I change in the Core will affect this view. For more explanation on the permissions, there is this tutorial which is available in the Description. Watch this tutorial and also maybe do some changes. Compile the Component and look at the code. [00:41:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m54s) The code really tells you what has been done. There are many ways to learn how JCB does things when you make changes and then to compile the component and to look at what has changed. Usually using something like Git will be very useful in discovering the changes. There is also a way for you to know where in the Compiler's specific code is being created which I will show you as we continue.
Since we've made changes, I'll simply click on save and close. [00:42:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h42m36s) This will take us back to the Component. Being back in the component, we'll see that everything is still the way we left it. There are quite a few things around the Admin View which I'm not going to go into depth during this tutorial. I would encourage you to watch the tutorials that are already online for an actual explanation on all these features. [00:43:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m04s) But to demonstrating a Hello World Component we have done quite enough regarding the back end. All that now remains is to compile, so we'll click save and close and we'll go to the Compiler. Select our Component and Compile. That means we've just written 9000 lines of code, [00:43:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m36s) created 51 folders and 122 files. If we were to have manually written this without any boilerplate tool or wire script that could help us write all the classes and tables and stuff and it took us 5 seconds to write one line, it would have taken us 25 hours or about three 8 hour days. [00:44:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m07s) That's a long it would have taken you to do this manually. So just right there JCB has already saved you quite a lot of time. Since changes were made, save and close it. [00:42:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h42m36s) This will take us back to the Component where everything is still the way we left it. [00:43:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m04s) In the demonstration of a Hello World Component we have done quite enough regarding the back end. All that now remains is to compile. Click Save and Close, go to the Compiler and select the Component and Compile. That means that 9000 lines of code have just been written, 51 folders and 122 files were created.[00:43:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m36s) If we were to have manually written this without any boilerplate tool or wire script that could help us write all the classes and tables and stuff and it took us 25 hours. [00:44:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m07s) That's a long it would have taken you to do this manually. So just right there JCB has already saved you quite a lot of time.
### Installing The Component ### Installing The Component