Hi all,
I just have committed a new yast2-devtools skeleton for yast webservice plugins to
Yast SVN repository. This is the first version, there might be bugs or we can change
something later, but it should be usable as a good starting point.
This skeleton uses the Yast DBus service as a backend, you need yast2-core>=2.18.10
(SVN trunk version is recommended, I just have noticed that there is a small
unsubmitted fix).
Note: The Yast Web interface has two parts - the REST service (backend) and webclient
(uses the backend and renders HTML pages), this skeleton is for the backend part.
Later I'll create skeleton also for the webclient plugins.
Quick start
-----------
- install the latest yast2-devtools from SVN trunk (yast2-core is recommended)
- go to the webservice plugins directory in the checked out GIT repository
- call 'y2tool create-new-package rest-plugin <author> <email>',
e.g. 'y2tool create-new-package rest-plugin printers "Ladislav Slezak"
"lslezak@novell.com"'
- (re)start the webservice - the new plugin will be available after restart
- Test the new REST API:
http://localhost:8080/.xml will download list of all items,
http://localhost:8080//first.xml will download details of the item
with ID 'first' (there are some testing data in the generated code, so you can
immediately check whether the created skeleton works)
Adapting the skeleton to your Yast module
-----------------------------------------
- Prerequisite1: Your Yast module must have high level stateless API (e.g. YaPI::
modules), if it doesn't exist yet you have to add it.
(Well, you can start with stateful API first, but you should definitely add and use
the stateless API later, see
http://en.opensuse.org/YaST/DBus_Service/Description#How_to_export_YaST_func...
for details.)
- Prerequisite2: define .policy kit files for the needed functions in Prerequisite1
(see PolicyKit doc: http://hal.freedesktop.org/docs/PolicyKit/polkit-conf.html,
how to get the action ID for a specific Yast DBus service call:
http://en.opensuse.org/YaST/DBus_Service/Description#PolicyKit_Action_ID )
- Go through all generated files (the most important are in app/controllers and
app/models subdirectory) and adapt/fix the code marked by FIXME string.
Replace also the testing data with appropriate Yast calls.
Any feedback is welcomed!
--
Best Regards
Ladislav Slezák
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org
For additional commands, e-mail: yast-devel+help@opensuse.org