YaST/Web/Development/TrainingKit
From openSUSE
Contents |
Developer Training Kit
This is the material that will help you to develop for YaST web, there are also additional development tips.
General knowledge for web service and web client
- Git for source control
- Ruby
- Ruby on Rails in general (for webservice and client)
- Getting started with Rails
- Ruby and RoR conventions
- Ruby On Rails Guides, edge version http://guides.rails.info/
- Ruby on rails specifics
- Rails 2.3 Engines (base for service and client plugins)
- http://www.slideshare.net/tsechingho/the-power-of-rails-23-engines-templates
- http://railscasts.com/episodes/149-rails-engines
- http://maulanaruby.wordpress.com/2009/02/04/getting-started-with-engines-development-in-rails-23/
- http://giantrobots.thoughtbot.com/2009/4/23/tips-for-writing-your-own-rails-engine
- Conference recordings
- Hoedown2008 http://rubyhoedown2008.confreaks.com/
- RubyConf 2008 http://rubyconf2008.confreaks.com/
- MountainView2009 http://mwrc2009.confreaks.com/
- Goruco2009 http://goruco2009.confreaks.com/
- Railsconf http://railsconf.blip.tv/]
- Scotland2009 http://www.rubyinside.com/scotland-on-rails-presentations-now-online-27-awesome-videos-1799.html
- Screencasts
- PeepCode Screencasts (paid) http://peepcode.com
- Railscasts.com http://railscasts.com/
- ASCIICasts http://asciicasts.com/
- Recommended Ruby and Rails learning sources with rating
Web client specific knowledge
Layout and Theming
This part describes ways how the layout of WebYaST like text, stylesheet, images, icons,... can be changed or added.
Changing existing images,icons and stylesheets
Images, icons, stylesheets are stored in the public directory of the YaST-Webclient. The public directory contains and additional subdirectory vendor which is used for overwriting,exchaninging images, stylesheets,.... for special vendors. Each file in the public directory can be exchanged by putting a file with the same path into the vendor.
For example changing the WebYaST logo which is stored in:
---public
|
+---images
|
+---webyast-logo.png
the corresponding file has be created in:
---public
|
+---images
| |
| +---webyast-logo.png
|
+---vendor
|
+---images
|
+---webyast-logo.png
Please take care that all links in the views have to be defined by the AssetTagHelper like image_tag, stylesheet_link_tag, javascript_include_tag, ...
e.g.
<%= link_to(image_tag("/images/webyast-logo.png", :alt =>"webyast" ),"/") %>
instead of
<a href="/"><img src="/images/webyast-logo.png" alt="webyast" /></a>
Add new images, icons, stylesheets,.... for Plugins
Icons, images,... are normally stored in the public directory of the webserver. In order to avoid flooding this directory each plugin can define his own public directory in:
vendor/plugins/<plugin-name>/public
The webserver has a look into this directory if the requested file is not in the official public directory. So only new files will be regarded in the vendor/plugins/<plugin-name>/public directory.
In order to exchange existing files use the mechanism described above.
Changing Text
WebYaST uses gettext in order to provide translations for each text in the UI. These translations are located in the po directory split in so called textdomains. While running a WebYaST module different textdomains will be loaded. e.g. the status module loads (logfile output):
Loading standard textdomain: yast_webclient Loading standard textdomain: yast_webclient_status
The concerning translations ( so called po-files) are located in
- po/<language>/yast_webclient.po
- vendor/plugins/status/po/<language>/yast_webclient_status.po
These po-files have to be translated into so called mo-files by the call rake makemo. The generated files are located in:
- locale/<language>/LC_MESSAGES/yast_webclient.po
- vendor/plugins/language/locale/<language>/LC_MESSAGES/yast_webclient_status.mo
This mechanism can also be used for changing text completely. Please regard when changing the text you have to provide translations by your own :-).
This is an example how to change the textdomain yast_webclient:
- Copy po/<language>/yast_webclient.po to public/vendor/text/po/<language>/yast_webclient.po
- Change the text in public/vendor/text/po/<language>/yast_webclient.po
- Call rake makemo in public/vendor/text. The text will be translated into mo-files.
After restarting the webserver following entries are generated in the logfile:
Loading textdomain yast_webclient from public/vendor/text/locale Loading standard textdomain yast_webclient_status
General Knowledge
- Ruby on rails specifics
- HTML specifics
Web service specific knowledge
Other
- Rails internals http://railsguts.com

