The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings Développement de WIMS
Summary Activity Forums Tracker Tasks Docs Surveys News SCM Files Listes Sympa

Forum: developers

Monitor Forum | Start New Thread Start New Thread
RE: adm/raw job listclasses [ Reply ]
By: Marina Cazzola on 2011-07-26 13:36
[forum:13387]
Dear Oliver,

I tested your modification and I started using json as you suggested.

I think everything is working fine, except for a small error in the output (is a comma missing?). Here is the diff of my suggested modification

$ diff json json-orig
358c358
< !shortout ,"message":"Lists classes associated to specified rclass in your server",\
---
> !shortout "message":"Lists classes associated to specified rclass in your server",\

If it is ok with you I can commit the change.

Marina

RE: adm/raw job listclasses [ Reply ]
By: Olivier Bado on 2011-07-11 09:03
[forum:13377]
Hello Marina
I just committed a bugfix in svn revision 4365.
Can you check if it works ?
ps : i preconise the use of new "json" format instead of the old "wims" format for interconnexions with other platforms.

have a nice day,

adm/raw job listclasses [ Reply ]
By: Marina Cazzola on 2011-07-03 06:01
[forum:13371]
Dear all,

I am looking at the job listclasses in the module adm/row

1) as it is now it does not behave as it should. Documentation says

job=listclasses list all the classes with connection between the rclass and /.

Optionally, the query parameter 'option' contains the name of fields related to classes asked :
module=adm/raw&ident=&passwd=....&code=abcde&job=listclasses&option=description,supervisor&rclass=

in other words the request shoud give a ident and a rclass, and the job listclasses shoud return the list of classes with class_connection=ident/rclass

At the moment the function is written in two steps. At the first step it looks for classes in the .index file, but it does not check if rclass is given (thus it returns the list of all the classes connected to ident/whatever). And I think this is not right.

At the second step it check the parameter option (calling the job getclass). This part also is not working as expected. From the doc above I would understand that if no option is given, then no option should be shown (it should return just the list of classes). What happens now is that if no rclass is given, it lists the class, but give back no options (no matter what the option paramters says); if rclass is given and no option is given, it returns the complete configuration of the class (while I would understand "no option"="I do not want any configuration settings", docs says option is optional!). In other words it works as documented only if rclass is given and some option is given.

2) I need a job returning the list of classes connected to a given ident, possibly with other paramters included by default, as "description" and "institution". I could either modify listclasses as needed or write a new job. My idea would be to keep using the job listclasses, possibly using a keyword like rclass=all to say I want the list of all classes with ident/whatever. In this case I would like also to change the function so that it returns "description" and "institution" without calling the getclass function, just looking at the .index file (possibly using a option not to break the previous behavior).

Before doing anything I would like to know if as far as you know anybody is actually using this function and if my suggested modification would break somebody else setup. And/or if you have any objection.

Olivier, for the "option" problem, it seems to me that it is the function getclass that if no option is given it just sets a default list (and of course this is the way that function should work). What I think it should be done is to modify the type/wims (or type/whatever) file so that if no option is given it just does not call getclass, but I do not seem to be able to write the proper condition. Could you please have a look at it?

So long

Marina