Customizing GWC-JS applications / Customization framework |
You modify features and styles of a Genero Web Client for JavaScript (GWC-JS) front-end within a customization project.
In the custom_project_dir, you add your custom JavaScript, HTML, and CSS sources. These sources are compiled into a new front-end for distribution.
Directory | Description | Usage examples |
---|---|---|
resources | Project resources, to include images in an img subdirectory. | See Add an image to the application title |
js | The project's JavaScript and widget template HTML files. | |
locales | The project's translation texts for localization. | See Add localized texts |
sass | Cascading Style Sheet files for instructing the browser how to display specific widgets. You can change colors, font, layout, and how text is positioned, etc. | See Widget scss file |
theme.scss.json | Change the default GWC-JS color and theme settings for your windows, widgets, messages, buttons, tables, etc. |
Create your customization projects in the project_dir/customization directory. To create a new customization project, create a copy of the customization template directory (project_dir/customization/template) and rename your copy. When you copy the template, you copy the directory structures needed for a customization project. This copy becomes your new custom_project_dir, and you can start adding your customized files.
You can have many customization projects. Each must have a unique custom_project_dir name.
A customization project must be compiled to be usable. See Compile a customization project. To have an application use a customization project, see Apply customization to an application.
Customization initially consists of working with the GWC-JS client to identify which component in the interface to customize. Each element of the UI is a widget/component.
For the widgets you want to customize, create MyxxxWidget.tpl.html and MyxxxWidget.js files in your customization project's js directory. These contain the minimal HTML and JavaScript code needed to inherit and extend the parent widgets.
Create your Myxxx.scss file in your customization project sass directory. Import your .scss in the customization.scss file.
Follow the recommended naming convention to define new widgets with the same name in the format "MyxxxWidget", where "xxx" is the parent widget name. For example; MyHeaderBarWidget.js, MyHeaderBarWidget.tpl.html, and MyHeaderBarWidget.scss.
The How Do I … ? section provides examples that illustrate how to extend widget classes.
As you add or update your project files, run the grunt command to compile your project.
Open an application to test the customization. See Apply customization to an application.