-
-
Notifications
You must be signed in to change notification settings - Fork 178
012 Component FTP and more
Next we are going to add the README script to a component in the component view. The README script is commonly used as the components homepage. For example: If you go to the demo components page on Github, you'd see that it has this image, some details, and some layout. (See video.) This all is done with the README file. We can open it and look at the 'Raw'. It is the same text that we looked at previously. 00:00:53 Inside component builder you can add this README and README text. These are placeholders. (###version###).
Now (#) is part of the markdown for a header. You need to be acquainted with Markdown to know what is placeholders and what isn't. This script has been added in order for you to get an idea of placeholders. 00:01:27 These placeholders are automatically updated from the details that are in these fields. The actual placeholder names can be seen. If you change the version here it will update there automatically. (See video.)
This is a place to give information to those who are using your application. 00:02:01 You can add links to it, add links to help menus, instructions on installing it, or anything else that you like to share through the README file. Although it is not compulsory , it will be appreciated if this commenting area can be left as it is in order for more people to get involved in the community. Help us to sustain this project. 00:02:36
If you want to know more about markdown, you can open this link: https://www.markdownguide.org/cheat-sheet/
This admin view area and the site view area is a place where you can create new admin views.00:03:06 Realize that if you create a new admin view it's not necessarily linked to this component. You still need to link it in settings under admin view. This is a place to create admin views or edit existing admin views that are linked to this component. The same applies to site views. It's an easy way to gain access to editing the site views that are already linked to this application. 00:03:51
The FTP server had been added to make it possible to move this component to your server and to add the feature of automated updating that is in Joomla. The update server is a Joomla concept. For example: If a component like 'Sermon Distributor' is opened and we look at the XML file of this component in the back end, you'd see that Component Builder had build the whole file. 00:04:39 But at the very bottom you'd see an updates server. It is being added only if you set it. If this is set to 'no', it won't add an update server. 00:05:03 If you add 'yes,' you can set the link to where the update server is going to be hosted. It will automatically take that link and add it into your XML file. Component Builder can also build that file for you. This is what is whould look like. (See video.) 00:05:31 This FTP Binary is usually 21; the default value FTP binary would be 15; and a username and a password. 00:06:04 These FTP details should login directly to this folder that you have up here. (See video.) Component Builder logs into your server, move this file in there, then disconnects. (See video.) This information will make it possible for him to perform that.
The same applies to the sales server which usually would be very much the same concept. You will simply be adding the same kind of string . Except usually the update server and the sales server is not the same place. 00:06:47 The update server, let the user know, that there is an update. Whereas the sales server, let the user know where this component zip file will be stored on the server. In the case of something like WHMCS or another component through which you are selling your extensions, you can use the folder in your server which is looking for the files. You can use that folder, you can create a FTP account in that folder, and then set that details in this field (See video). If 'compile' is clicked, Component Builder shows aan option, 'add backup folder' and 'save sales server' and then click 'yes'. If you compile it now, it will move the 'zip file' to 'sales server', as well as creating a backup. 00:07:30
The 'backup' and the 'Git' folder is set up in your Components Global options. If you open 'Global Options', you will see this area, which shows that this field is encrypted. If you go to global settings in Component Builder it shows the encryption settings. 00:08:18 Once you have added your own key it will encrypt. You must not change it because it will not be able to decrypt, as it is used to encrypt and as well to decrypt the data. Consequently everything that has been encrypted then needs to be redone. In this case it is going to be these login FTP login information. This is the basic encryption which have been mentioned when we talked about storing types. There is basic encryption and advanced encryption. We are dealing here with the basic encryption way which is also called 'basic key.' 00:09:01
These two first folder paths, called 'compiler folder' and 'custom folder', leave them for now, they are not flexible. To move them at this stage is difficult, just leave them blank. Here at 'Backup Folder Path' you should add a backup folder. This should be related to the root of your server, as well as to a 'Git' folder. 00:09:41 The 'Git' folder would be where component builder creates a folder with all the components files without zipping them. You can go to that folder and create a 'Git create'and a 'Git repository'. From that folder you can push it to Github or any other Git server respectively. It's able to create a folder from which you can do Github or any other kind of repository work which are separate from your backup folder and also separate from the temporary folder in which it compiles the component.00:10:17 You can move it out of your Joomla install. That is the function of the folder paths, it does the Git Repository when you compile the component and it will not delete the .Gitfolder, it will just replace all the files in it.
First remove the old ones, then add the new ones and Git will see that only the files that has been changed, will be noticed, and the ones that you need to recommit and do just a normal commit to get it into your repository. If you don't know Git, then possibly it doesn't make sense to you. There is courses about Git on lynda.com as well as Udome. That's a backup folder and the sales server. 00:11:18 The same applies here with this FTP credentials should be that direct folder in which these zip files should be stored. Unfortunately component builder cannot store it in subfolders at this point. The FTP details will just login to that FTP account,
<<<<<<< and in that folder which has the access you'll put the file there. No subfolders or other folders, the FTP details should be going directly to the folder. In the component builder, then will be in the back end components, component builder and then Helpers. There is a file called compiler. If you open that file, 00:12:14 you would see that we have a function here builtme. Here's all the placeholders that you can use in the builtme file, and will be replaced with the relative information.
There is a function here called move file to FTP server. This move file to FTP server, calls another function called: getFTP. Now getFTP is this function here, it takes the signature, checks whether we already made such a connection before. And then loads that object. But here I'm using this parse string function to convert the string into the variables. All the variables in that string is converted to arrays or variables respectively. 00:13:12 That then is used to make use of Joomlas own client FTP class. If you want to know where that is, you can in NetBeans you'd click control spacebar. It shows you it's in libraries/Joomla/client/FTP.PHP. You can click there, open it, so we are using Joomlas built-in FTP client, and we passing the host, the port, the option, the username, the password, and making a connection. Then we sending that off to do this move file, which then takes the file content and moves it to the server. That's just for your own piece of mind that the data itself is not being leaked or compromised. 00:14:04 It's all handled right here and you can follow its events in component builder, from relations to the update server as well as to the sales server.
The other thing that I know is quite in important. Is this update server, it is an XML file. 00:14:25 This XML file is build up of versions and download links to those versions. So like I explain to you in a previous video. There is this reality while you are developing your component. Your users wouldn't need any 00:14:47 change updates or anything. The moment you put your component out there on the web. Immediately you need to consider when you make a change in the application, how will you user be able adapt to that change. The biggest changes you can make 00:15:03 is adding new views or adding new fields to the component. That makes it a little hard. Like I explain previously, with the history component we've done scripting to take control of that problem. 00:15:21 You also need to think about the database. We created this thing called: Version Updates. Which gives you the ability to actually add MySQL scripting, which needs to be executed upon the updating.
Now the way for you to think about this, if you have a new version 1.2.9, 00:15:43 then there needs to be a table alteration. You need to know if MySQL commands to do that. I'm not going to teach you that. You just need to put that MySQL command in here(MySQL - Update Dump) according to the Joomla conventions. The table name must have that #_ _ in front of it and Joomla will dynamically put in the prefix. You might just simply will do a MySQL script here. If you are making a change and the new release is 1.2.9 and 1.0 didn't have that 00:16:23 specific field or view, then you must realize that you're updating this one and the SQL must come next to that specific version. The update must be placed at the version, which needs the update. If you make a change don't put it here(1.2.9), because it won't update correctly. You need to put the update next 00:16:44 to the version(1.0) that needs to be updated. Then over here(Version URL), you would put the link to the respective downloads. Like here we have version 1.2.9 and then we have version 1.3.0 00:16:59and we added the 1.3.0 link heresee video).
I'm using GitHub as my distributing platform of the application. You could use any URL. These URLs is what will be used in your updates server. The update server, 00:17:18 if I was to open that for us. First, we will go to the update server link, copy that. You'd see that it has this URLs here, for the download. As we move on it 1.3.0, 1.3.1, 1.3.2. and it's getting these details. It is getting them 00:17:48 from this version update area. The last version in this list being 1.3.2, must be the same as the one that you set here. That is important. We are at the current version 00:18:07 and it will do the necessary adjustments to that. That is all the concepts that would be necessary to cover regarding the component area. We've looked at adding admin views. 00:18:26 We will again look at site views and adding them as well as your custom admin views. We will possibly going into more depths about this MySQL tweak, what we briefly mentioned. But the for most part that's or the at component area, 00:18:48 and all it's nice features. It all stacks upon each other from the fields then the admin views, and then the components themselves. And if you have come this far you set out your component, you have added some admin views, you are now ready to 00:19:06 start building the front and the site area. You wouldn't be able to do effectively until now. It is necessary to first do the admin views and then only do the site views.
- Home
- Beta Testing
- Custom Code
- PHP Settings
- Demo Component
-
Tutorials
- Hello World JCB
- Intro JCB Guide
- JCB Installation Steps
- Planning Components
- Field Type Overview
- Basic Fields Creation
- Admin View Management
- Advanced Field Usage
- Admin Component Integration
- Component Setting Customization
- Scripting Components
- Component FTP Options
- Dynamic Get Method
- Site View DynamicGet
- Site View Templates
- Template Setup Guide
- Layout Configuration Steps
- Custom Admin Management
- Adding Site Views
- Custom Admin Integration
- MySQL Demo Tweaking
- Global JCB Settings
- Custom Time Field
- User Helper Integration
- Email Helper Usage
- Message Store Email
- List View Unescape
- Export Import Customization
- Overwrite Custom Fields
- List Field Filtering
- Automatic Code Import
- Manual Code Implementation
- Component Export Import
- Custom Admin Buttons
- Translation Management
- Site View Permissions
- Component SQL Updates
- Site Edit Configuration
- JCB Backup System
- Helper Structure Integration
- JCB v2.5 Upgrade
- Tab Setup Guide
- JCB v2.6 Release
- Extended HelloWorld
- Field Rule Validation
- Community Snippets Intro
- Snippet Forking Tutorial
- Pull Request Snippets
- Library Manager Area
- Excel-based Translation
- Dynamic Router Details
- Database Auto Updates
- Subform Quick Demo
- VDM Package Import
- Dynamic File Inclusion
- File Field Upload
- Drag-n-Drop Upload
- Quick HelloWorld JCB
- Non-database Fields
- Dashboard Customization
- Menu Prefix Toggle
- Community JCB Packages
- Collaborative JCB Workflow
- JCB Package Install
- JCB JAB18 Event
- Convenient New Fields
- Component Language Strings
- Library Functionality Anticipation
- Join Field Relations
- License Template Change
- Code Reusability
- Local Dev Environment
- Extended Field Types
- Joomla Custom Fields
- Custom Field Expansion
- Site View Listing
- Run Expansion Method
- Form Site View
- Field URL Update
- Additional Helper Methods
- Field Validation Rules
- New Placeholder Feature
- Component Config Params
- Per-field Default Values