|
[
Permalink
| « Hide
]
Martin Dougiamas added a comment - 24/Jan/08 03:18 PM
All of these subtasks need specifications and discussion before development
We have I implemented some functions as first prototype.
Howevere we need write access to the CVS, we lost it since the migration from sourceforge. Users : granludo pigui tusefomal davcastro thanks! L. All developers need to go here to reapply now: http://moodle.org/cvs
I've "accepted" request from developer "pigui" granting CVS access to "/contrib/plugins/mod/wiki" as requested.
Note that, in the request, "pigui" asked about extra-access to know where to store their WS-related code.... Martin? Ciao Pigui, any progress on this? I can't see any and it's getting urgent.
Sorry for the delay... we are commiting the code today.
Hi,
we have developped for two years web services for Moodle 1.8.2, under PHP5. These web services have been developped during a project name Bricoles and the PhD Thesis in Computer Science and Learning Sciences of Pierre-André Caron. See http://noce.univ-lille1.fr/projets/bricoles/
ModX and GenDep are available at : http://noce.univ-lille1.fr/projets/ModX/index.php We have presented our project at french-speaking Moodlemoot 2007 and we will present the evolution of our work at french-speaking Moodlemoot 2008. We are currently studying how to articulate our web services with those described in this issue. WSDL description of web services for Moodle 1.8.2 developped by NOCE research team in Bircoles project.
Done... we have commited our work. We will try to work directy over the cvs when all of us can access it without problems.
There's a layer of php functions implementing the functionality, there's also a SOAP layer that implements calls to these php functions and finally there's a pyton client that connects to the soap ws. Next week we will post more detailed documentation. Ludo Some documentation about what's going on http://blogs.dfwikilabs.org/moodle_ws/2008/04/14/a-proposal-of-interoperability-architecture-for-moodle/
At the French MoodleMoot 2008, Frederic Hoogstoel, author of a SOAP WS with operations mostly aimed at creating "personnalized" courses from a learning profile determined outside Moodle (ie create/modify categories and courses, adding sections, forums, wikis...to courses and enroling/unenroling) , and me, current maintainer of the OK Web service implementation, that is more focused on "getting informations out of Moodle" (users, courses, activities, roles, grades...) have agreed to merge our two implementations that are really complementary.
Most of the operations he is currently supporting are not in mine and conversely. We are really waiting for Ludo's implementation of " STANDARD list of CORE web service function" to start reducing our lower layer (server.class.php) that currently speaks (most of the time) to Moodle core API and in some rare cases do direct SQL calls ( such as when retrieving last activities in a course). In the meantime we will focus on "merging" our high layer implementations that will finally propose about 80 operations, why names and parameters as per current OK WS 1.5.10 revision ( see wspp directory in CVS contrib/patches/ws ) More to come in future weeks. If you can read french, our two communications at the Freench MM2K8 are here http://moodlemoot2008.vet-nantes.fr/moodle/course/view.php?id=34 http://moodlemoot2008.vet-nantes.fr/moodle/course/view.php?id=56 Cheers. Hi all,
I would need more information about your work on Web Services for Moodle 2.0. I went to have a look to the contrib folder in patches/dfws.
It's apparently not the last version of your work, can I get an access to the last version? For information, I'm still a recent Moodler, and not an expert in web services yet. Have you a way to communicate easily? You can contact me on skype, my skype account is jerome.mouneyrac@skype.com Last point, I can not access to the two French discussions. I created a "jerome" account on the French Moodlemoot website but I'm not allowed to access to these conversations. Thanks a lot for your help. Hello,
I finally succeeded to get dwfs running against a test Moodle 1.9 ... First the webservice directory MUST be at the "root" of the Moodle installation, nowhere else ... The excellent point about this implementation is that the WSDL required by SOAP client in generated "on the fly" by collecting all datatypes and functions declarations from the files present in directories apis/* and mod/* , but they use the outdated nusoap library. A possible issue will be performance since the WSDL will be recomputed at each call. Currently I got some answers from :
It is still unclear to me why there is two entry points (connect.php and inout.php ) and how the security is implemented , i.e how a single call to connect is required before jumping to inout.php and how inout.php reject unconnetd operations... but I am still searching By quickly peeking in apis directory, I noticed that all functions that address creating or deleting Moodle entities (course, user...) do not check for roles... and call directly the delete_course() or delete_user() APi functions. As far as the specifications are concerned it is true that the functions do not have yet the proposed names I think Ludo's team should concentrated on writing the code in apis/ and mods/ directory, with the help of Moodle core developers, that are the most competent people on that matter, using the inout/direct/* scripts to test them out and let others take care of the real clients. Currently, people that already have implemented WS for Moodle ( Frederic and me for SOAP and Linux Box Corporation for XML-RPC) and eager to replace their "low level layer" that talks directly to Moodle API or do SQL calls by a set of well established functions located in Ludo's apis/ and mod/ directories My 2 cents... Cheers I forgot to say that there are some interesting docs at http://blogs.dfwikilabs.org/moodle_ws/
Some entries are in spanish, but Google translator has been my friend as always One more step to do :
Python client navega.py do work as expected if you add the table mdl_api_session to Moodle database. CREATE TABLE mdl_api_session ( So I start to understand how security is implemented. Operation mdl_config_login located in connect.php add a record to mdl_api_session table and that record is fetched back by inout.php and deleted by a call to mdl_config_logout operation. In a prod version, database updates should be done by standard Moodle manipulations . A+ Thanks a lot for all these information Patrick
Hello,
I played harder on current dfws implementation and start to have some good results with it ... Attached a modified version of cvs:/moodle.org/contrib/patches/dfws/webservice.
I would suggest that the sessionid be added as the first parameter to all calls -since there is currently TWO entry points (connect.php and inout.php) the service names MUST be different
Some modificatiions to CVS current release (date APril 18th).
correct some typos in first version attached.
Can an user with admin privileges remove the previous version. Thkx In this subtask http://tracker.moodle.org/browse/MDL-13127
we should have a consistent way of passing parameters. Shall we debate it there? I don't get it. Can you post an example when passing parameters is not consistent?
The technical specification (http://docs.moodle.org/en/Development:Web_services Sorry,
I did not explain myself - language issues Absolutely they should be consistent.
I like the idea of passing an array of "field" -> value like: array ( Where they are processed in order. Does that make sense to all? delete user with idnumber 434343 Obviously this could delete a lot of users at once: array ( Perhaps we should allow wildcards too: array ( Hmm... acording to this who do we delete 3 users with id 4,5,6 ... the position of the associative array "id" s is taken...
So how do we doi it? separating id's by commas? My idea is that we should implement ONE function to do all the heavylift ( delet the user and the role asocciations and so on ) ... this function shuld be invoqued by 4 functions like delete_users_by_id delete_users_by_username ...
So it may be easy for the user developer and from the maintenance point because just one function >In any order, and any number or items, where they are logically joined with AND in the function. Does that make sense to all?
So if you mean delete user whose idnumber is 434343 AND email=fred@xxx AND id=3 ??? :In that case is it too much demanding on the external SIS that will likely not know anything about Moodle internal ids and does not want to know about them. And if you mean user whose idnumber is 434343 OR email=fred@xxx OR id=3 , it does not make sense to me either since, when writing processes to sync Moodle with my SIS it is very unlikely that I shall scan my database twice, once for idnumber and one for email. If in my place idNumber are the "primary key", I shall use it anywhere, if it is the email, I shall uses is instead, but never both... I think Ludo's question is more : -Shall we have ONE public operation delete_users (array of some info, corresponding field name in Moodle ) that could be called as :
res = delete_users_byid (array(1,2,3') and make delete_users private to avoid devastating calls such as delete_users (array(1),'confirmed') or delete_users(array('patrick'),'firstname')... unless you feel that it should be allowed Also the question of wildcards should be addressed (permitted or not) such as delete_users (array('CS%','idnumber) .... To me it should not be permitted to delete_users for safety reasons ; it that case we should request a true identifying id (unique in database) ; Cheers. Yep, fair enough Patrick, though I prefer the field name to be first (same as get_records etc)
delete_users ('id', array(1,2,3) ) I'm not keen on one function per field ... that would get unmanageable rather quickly! As everybody agreed, I updated the specs for delete_users() : http://docs.moodle.org/en/Development:Web_services#delete_users
I added some Patrick's comment into a TBD paragraph. For any change to do in the specs let me know. Thanks everybody. hi all,
why not consider a solution based on SCA (http://www.osoa.org/display/PHP/SCA+with+PHP 1 y ago, when i started implementing a prototipal impl of a gateway between moodle and a student information system i thought it was the way; now i think it can be the way for moodle too. what do you think about it? mbertazz Hi Matteo,
the proposed architecture consists of 3 layers. The first one consists in "putting the house in order". Meaning that we need a stable and consisten API to access to the Moodle core, that can be used for non moodle-core iniciates and that can resists changes (because we can change its implementation as the core evolves). Then we have proposed an architecture that allows to build diferent ws connectors. Because we don't one one aproach we want it all So in this framework we can the implement thinks like the current oktech ws, something based on osa, or what my team did in the campus project (http://campus.org Take a look at http://blogs.dfwikilabs.org/moodle_ws/2008/04/14/a-proposal-of-interoperability-architecture-for-moodle/ L. Hi Mateo,
I quickly peeked at SCA site and indeed found some nice features such as automatic generation of a WSDL from a set of well commented php classes and functions, something Ludo is currently doing using the "old" nusoap library for his sample SOAP server, and me by hand So SCA could indeed be used to write the high level ws connectors Ludo is talking about. They claims to support a fair amount of protocols such as : binding.ebaysoap Binding Documentation However I also noticed on their download page : "SCA is in its early stages while SDO has achieved a stable state. " , and that nothing has been released since august 2007... Cheers. Hi patrick, we used nusoap for a proof of concept development cause the guy who was coding it knew the APi.
I'm more into REST rigth now, IMO SOAP is not the way. But as I said I don't want any ws protocol... "I want them all". I added some comments to user and course functions.
I would like to discuss about get_user and get_course. It's important to define what are User and Course objects. I'm completely agree with Jordi.
First of all we have to define what are the user & course objects or instead of this define an array structure to start. From a philosophical point of view, idl like this API to be COMPLETELLY INDEPENDENT FROM WHAT'S INSIDE THE MOODLE CORE. It needs to be independent from the implementation, if we return the user object or the course object and some darn day this changes in moodle 2.1 then... to the hell with the stability of the api. That's why we need to work with something like asociative arrays like MD suggested, and lock it. we can adapt implementations of the functions to each evolution of the core. but what the users whant is something fixed that does not change.
Please, pigui, put here a link to the working phpdoc that we where working yesterday and lets talk about it. L. I uploaded the phpdoc here.
Hello All,
Would it make sense to add a "reset_courses" function to the list of standard core functions? One of the requirements in our moodle implementation is to reset all courses by category at the end of a term. Since we have over 500 courses, resetting these manually would have been an administrative challenge. We use the Ok Tech WS to control enrolments and retrieve grades into our SIS and have modified some of their functions to work with collections of courses under a category. We added a simple reset_courses() web method and since it it was a good solution for our requirements, I thought it might be a candidate to add to the list of standard webservices core functions... Hello Ken,
Could you disclose yours modifications to OK Tech Implementation ? They could benefit to others while waiting for the official Moodle 2.0 API layer. Especially the grade part that has not been tested in production to my knowledge. Thks. Hi Patrick,
I posted the modifications to the Web Services forum here: http://moodle.org/mod/forum/discuss.php?d=102511 Hope this will be of some benefit... Hi, we here at the Moodle Partner company in Switzerland ( liip.ch ) would like to implement some web services for the quiz module. See
http://docs.moodle.org/en/Development:Quiz_web_services What is the status of web services for Moodle 2.0 currently? I've seen http://cvs.moodle.org/contrib/patches/ws/ We'd like to contribute what we do, but we're not sure how best to proceed now though. Assuming we develop these services using XML-RPC, where would these fit in in the CVS repository? A little background: http://creaviva.lernfrage.ch/froodle/creaviva/100001-anonym-de-new-go Back then, we had to modify the quiz handling and the question fields a bit (e.g. adding overall feedback). We'd like to update to using Moodle 1.9 / 2.0 and later, and get away from having to make core hacks to Moodle. The customer has agreed to opensource the updated IMS-QTI2-rendering flash client (which we will also contribute to the Moodle community, assuming that there's some way to get the necessary information from Moodle without having to make core hacks). We'd like to be able to get the necessary quiz information using a standard interface, that will not greatly change for each new version of Moodle. So, we're proposing to develop these: http://docs.moodle.org/en/Development:Quiz_web_services We would appreciate some feedback. We have a project scheduled to start soon, and would very much like to be able to develop something that the greater Moodle community can profit from. Best regards, @Brian Pleaase contact me at granludo@gmail.com so we can talk about this possible collaboration.
Hi,
I started writing some documentation on Moodle docs: About the web service module: http://docs.moodle.org/en/Development:Web_services About the Moodle API: http://docs.moodle.org/en/Development:Moodle_API It's still work in progress and you're welcome to participate. Thanks Cool Jerome. We like this kind of structure. I'm creating a subtask to reimplement all of the functions above defined using this structure. I'm reopening all functions again .
Hi,
I committed on HEAD an alpha version of web service with Rest implementation. I used Ludo Team's work as a base. You'll find:
The /webservice/rest folder also contains a lib.php file that check the web service description in order to call the core function. Some explanation about the process can be find here: http://docs.moodle.org/en/Development:Do_we_need_named_parameters#Web_Services_.2F_Moodle_API If you like to run it, go to: http://your_moodle/webservice/rest/testclient/ All feedback are welcome. We are adding functionalities suggestions in the API discussion page.
http://docs.moodle.org/en/Development_talk:Moodle_API_Function_List#Course Hi, I am going to add a kill switch for this feature - I do not think this should be enabled by default especially until we get some security implemented.
Please add if (empty($CFG->enablewebservices)) { die;die;die;} into each new script, thanks @petr OK, I agree. Will do.
Hi, here is a update about last days web service implementation:
Many stuff still need to be implemented before to reach a "stable" API:
At this moment Petr will be working on access control and some core functions, Ludo team's soon on module forum web services, and I on SOAP, the full test and others stuff. I'll organize a talk between all of us. Hello Jerome,
I noticed that since few days, updates to /webservice directory and /lib/moodlewsapi.php and all I have to use my cvs account on cvs.moodle.org to retrieve your work on web services and thus I have to do it manually every morning to keep the pace ... Surprisingly these updates are nevertheless available by anonymous http access on http://cvs.moodle.org Is this intentional ? I am glad to learn that a wsdl generator is in progress, since in my SOAP implementation I have a wsdl2php.php script that generates php client classes "a la" java or python. Cheers. Patrick, all mirrors should be a complete copy of the main repository. I've been told there were some problems on some european servers last week. There could also be some delay for the copy (in hours).
It should work but if it happens again, I'll alert our new sys admin. Brian King: I'm sending an email to you, sorry for this late answer. Will any of these fix the pull/push of quiz grades into the gradebook for 1.9.2? Please refer to http://tracker.moodle.org/browse/MDL-18032
Thomas please do not post unrelated questions in other bugs. Tim already told you that your problem is not a moodle bug.
Groups are nearly finished, we are going to start with course functions.
Hi all,
I wrote a document about the current web service implementation: http://docs.moodle.org/en/Development_talk:Web_services#Design_state_at_the_16_Feb_2009 I explain some interrogation I've got about the design, the use of zend component... I invite you to read it and express your opinion For people who didn't read the previous link, here is situation:
Web Service API design: I think it's good, we should keep the description array as it's easy to understand by developers. The only thing still needed to be defined is: how to we define an array/object parameter? It could be good to support it if we want to support multiple operations at the same time: delete_users(id1, id2, id3,...)). REST protocol: I don't know yet how RESTful protocol support multiple operations. Moreover for implementing a real RESTful server we would need to improve the description array (web service API need to know if the web service function is GET/POST/PUT/DELETE). SOAP protocol: I like the zend_soap server (and zend WSDL generator) in HEAD. With an accurate documentation generator, it should be easy to create a client. XMLRPC protocol: same as SOAP AMF: I need to have a better look, for later. As usual any comments are welcome, I'm most that listening for advices on the REST protocol and also the support of array in the description (web service API design) Thanks I talked with Martin and we should be able to get rid of the description array and have all the same information into the phpdoc. I'll come back soon to you with a solution for all the mentioned points (web service description + RESTful server). Sorry for the noise
I've seen the documentation.php file. I'm wondering how this file is integrated in the Moodle language system.
Hi Ralf, I think we need a webservices.php file in the lang folder. I'll add lang support to the documentation.php.
Hi I committed the new web services API design. It now use only the phpdoc. We generate the description array from these phpdoc now.
Here it how we need to write the phpdoc:
':' colon character indicates that the left word is considered as a non associative array However when we generate the description array, the non associative arrays are translated by associative arrays with all key starting by 'multiple:'. For example the description array for the above phpdoc would be: I'll update the Moodledocs with more information. Web service task list
------------------------------------------
-------------------------------------------
------------------------------------------
Hi Jerome,
Soap is not working.... there are some problems with the token. The token must be a lower int value or a string. Pigui. Thanks Jordi, I fixed the mock token. (I'm using Ubuntu 64 ;o)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||