SDK Development Community Git Repository (sdkpackage)
This blog is targeted to everyone who wants to clone the repository with the community components.
we use normal repository at GitHub, you need a user on GitHub.com to be able to clone this repository.
After cloning the repository, you can import all projects which are in the repository. WE have following folder structure:
- .git - standard git folder
- features - the folder for feature definition (one for 1.3, one with data sources for 1.4)
- script - main generation script (below more details)
- src - sources for the bundles.
there are currently 6 packages, with following content:
- basics - all components with manual content filling (no data binding)
- databound - components which are bound to data
- datasource - the package with data sources, this one is compatible with 1.4 only
- prototypes - something what is not (yet) for productive usage
- shared - this package is for shared scripts, and other shared obejcts
- utils - non-ui components
Every package has following structure:
When you take a look on "res" folder, you will see many components, one subfolder per component, e.g.
For demonstration purposes I have created the "DummyControl" folder, actually I should call this just "Dummy" to have the name in sync..
The basic concept is, all components are self contained - this means all editing is placed in the specific component folder. The structure of this folder is as given below. The component folder is located always in "res" folder, e.g.:
We do not set any specific naming conventions, just make this "similar" to other components.
in the component folder, there are 2 subfolders, and the JS file and image file.
For content of those files, look at the uploaded Dummy in the templates
- in aps fodler place all files related to "Advanced Property Sheet"
- in def folder place the definition files, meaning
- custom.html (NEW for documentation, see example)!
- then in the main folder place the JS files you require to run the folder
HTML Help Generation (NEW, Jan 2015)
Since January 2015, we have also a way to generate help, see SDK Development Community Git Repository (list & documentation)
If you want to place some specific "non-generated" part, add it into "custom.html" file in "def" folder, this will be 1:1 included as HTML in the index file.
Script (for generation) - script/build.cmd
As the SDK infrastructure requires only one contribution.xml and contribution.ztl per package, we just generate it.
This means, when you have created a new component, you need to "register" it in the build.cmd
folder <package of the component>/script/build.cmd
, you need to add 2 lines, like here for the "Dummy" control.
one line for inclusion into "contribution.xml"
and one for inclusion into "contribution.ztl"
Then you should execute the script build.cmd, and the main contribution files will be updated.
This procedure allows easy editing in own folder to avoid collisions.
You can use the Dummy package, I will upload the content into repository as template, see here:
this control was created in the "basis" package, you need to assure you have replaced all parts also in the packaging when using as template in databound, e.g. org.scn.community.basics.Dummy must be changed to org.scn.community.databound.Dummy.
Special Folders - /OS
to allow reuse, we have the "os" folder to place there all other open source components, keep the license there and assure also some link which helps to know where is this coming from.
- the component contribution.xml and contribution.ztl files MUST start and end with EMPTY LINE, this is for better concatenation
- when changed something in contribution files, do not forget to re-run the build.cmd script...
- assure your setting is "autocrlf"="true" (other case everyone will be collisioning on linebreaks). LInk to HELP.
- The config place in eclipse:
Effective Work Rules (New, Jan 2015)
The repository is cut this way, that the components are independent of each other.. The only dependencies are through the generated contribution files, therefore the first "learning-by-doing" rule is:
- revert to HEAD all contribution files which are generated (those are the files in root folders of the packages) and then sync from repository...
- then easily generate the files again with the scripts
Second part which can cause collisions, in case you add new components into the cmd files - are the script/build.cmd files itself. Also here, you can either revert them to the HEAD and reedit again or you have to resolve the conflicts.
I hope this describes the basics..
Reading that you should be able to
- import the repository
- add new component
- include the component into the package
- start Design Studio in debug mode with your component
For those who have 20 minutes to look at the video (setting up repository and creating Dummy component)