Ask Reuben
GitHub Repositories
Are there any samples / libraries available for download?
What are the GitHub repositories?
Where are the GitHub repositories?
What Is In the GitHub repositories?
When I wrote the article summarising resources available to Genero developers, I noticed that I had an article for most resources but not our GitHub repositories.
At previous WWDC, I have done some presentations, Tour de Github 2021, Tour de Github 2019, and also covered it as part of presentations on developer resources. The Tour de Github presentations focussed on some popular repositories.
I’ll assume most readers have a little bit of familiarity with GitHub. One thing you might not be aware of is that there is a Subversion bridge. This allows Genero Studio users to download and updateGitHub repositories from within Genero Studio simply by using Subversion (SVN) commands that are available with Genero Studio. Many years ago I made a video demonstrating this. So even though Genero Studio does not utilise Git, it can still check-out and check-in to GitHub.
It is important to note that these repositories are NOT intended to be finished products that you can incorporate into your Genero applications without modification. It is expected that you would adapt them to meet your coding standards, your own user interface standards, your own error handling conventions etc. I have deliberately bolded that sentence as I tend to find developers expect libraries, web components to be handed to them 100% complete, but then when you give them something they will ask a question, can the function names be in camel case to match our standard, can it say modify instead of update, can it be in a TRY/CATCH that raises any error to the calling program etc. Hence take it and modify to suit.
If you want to contact the author of the repository, or if you have spotted something wrong, or want to suggest an enhancement, use the Issues functionality within GitHub.
It is expected that most repositories will use the MIT License.
Repository contributors are asked to update a repository every time a new major release of Genero occurs. If you are not using the latest release of Genero, take that as a hint that any development you do should be done using the latest Genero release. If you do need to get a version of the code that is not using some new syntax so you can use it with an older Genero release, use the History button when viewing a file in Github to look at and download an older version of the file.
If you see a repository marked as DEPRECATED, the code is still there for you to look at but the developer is not actively updating the repository.
FourJsGenero
There are two public repositories FourJs contributes to, the main one is https://github.com/FourjsGenero which contains public code samples.
There is an attempted naming convention for use with these repositories. We try and use the following prefixes to indicate the purpose of the repository
- app – Application
- ex – Code Example
- fgl – Library for use with IMPORT FGL
- tool – Developer tool
- wc – Web Component
Originally applications were uploaded without a prefix, but the intent is to use app as a prefix for applications in the future. So repositories such as pool_doctors will one day be app_pool_doctors.
In each repository there should be a README that contains at least one screenshot if appropriate. There are two techniques that may have been used to add these screenshots.
- One is to file an issue with the screenshots and reference the screenshots in that issue from the README. This is the preferred technique. (An example is seen with this issue and this readme that references the images in that issue).
- Another technique is to include screenshots in the repository files and reference them from the README. This technique is not preferred as it increases the size of the download as these images are included when you download or checkout the repository.
If I was to plug some of my own repositories …
- fgl_zoom – A library using generic dialogs to implement zoom windows. Explained with more detail in this article.
- fgl_apache_poi – A library using the ApachePOI libraries to read/write Microsoft Excel, Word files. Gets mentioned in this article as well.
- fgl_lib – A library containing functions, operators that you think might be in Genero but are not (yet). This library has got smaller and smaller over time as more methods are formally added to the Genero product,
- fgl_auitree – A library to interrogate and manipulate the AUI Tree. This library has also got smaller and smaller over time as more methods are formally added to the Genero product.
The concept is that the repository should contain a .4pw and that a Genero developer can download and start using the repository in Genero Studio, it will contain a test or wrapper functions that show off the library, web component, examples etc. Historically it was asked that repositories contained form files as .per and not .4fd. The reason for that it is easy for a Genero Studio developer that uses Form Designer to Import Text Form and turn the .per into a .4fd. For a non Genero Studio developer, to take a .4fd and turn it into a .per is more difficult.
Cordova Plugins
There is a seperate repository at https://github.com/FourjsGenero-Cordova-Plugins for Cordova Plugins for use with Genero Mobile front-ends.
Cordova is a mobile application development framework that allows developers of hybrid web applications to interact with the mobile device without writing native code.
So for instance if you needed your Genero Mobile application to interact with a low energy bluetooth device, you would download the cordova-plugin-bluetoothle repository, do the necessary configuration, and interact with it via Cordova front-calls in your .4gl.
Other Repositories
You will find more code samples at most developers own repositories. These have been described as similar to builders houses and mechanics cars. That is lots of half started projects :-). There is some useful stuff in there but check with the individual developer first.
GitHub Language
One final point. GitHub uses linguist to determine languages used by a repository and to offer syntax highlighting. A change in the way they measured language notoriety meant that we recently qualified as a language in GitHub. So thank you alienriver49 for doing some of the groundwork here. We do have a task in the system to generate and provide these files ourselves.