What database entries to assign a user to a group.

10 views
Skip to first unread message

Graham Conway

unread,
May 18, 2016, 4:21:50 PM5/18/16
to OpenOLAT, Paul Senn
HI there again.

We are hoping to assign users to a group using a custom transaction from within our rest api.

Just wondering what database entries would need to be made to do this, assuming a group already exists and has an id of X.
and we create a new user with a user_id of Y.

Thanks,


Graham Conway

Florian Gnaegi

unread,
May 19, 2016, 4:32:51 AM5/19/16
to open...@googlegroups.com, Paul Senn
Hi Graham

When manipulating the OpenOLAT database you MUST use the OpenOLAT business layer. NEVER directly manipulate the fields using SQL! You will end up with a big mess as OpenOLAT does have it’s own caches and own way of creating the identifiers. Don’t do it. 

You can enable the OpenOLAT REST API in the admin area. There is also a link to a somewhat outdated documentation the API. To learn how to use the API it is best to look at the OpenOLAT/src/test/java/org/olat/restapi/* classes. 

Cheers
Florian

--
--
Sie erhalten diese Nachricht, weil Sie Mitglied sind von Google
Groups-Gruppe "OpenOLAT".
Für das Erstellen von Beiträgen in dieser Gruppe senden Sie eine E-Mail
an open...@googlegroups.com
Um sich von dieser Gruppe abzumelden, senden Sie eine E-Mail an
openolat+u...@googlegroups.com
Weitere Optionen finden Sie in dieser Gruppe unter
http://groups.google.com/group/openolat?hl=de
-------------------------------------------------------------------------------------------------------------------
OpenOLAT - infinite learning - http://www.openolat.org

---
You received this message because you are subscribed to the Google Groups "OpenOLAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openolat+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------
professional services for the e-learning system OpenOLAT
hosting - operating - support - development - mobile - consulting
--------------------------------------------------------------------
frentix  GmbH
Florian Gnägi, Geschäftsführer
Hardturmstrasse 76
CH-8005 Zürich, Switzerland


Find me on skype  twitter xing linkedin 
--------------------------------------------------------------------

Graham Conway

unread,
May 19, 2016, 3:38:49 PM5/19/16
to OpenOLAT, paul...@gmail.com
Hi Florian.

Thanks again for a quick response. In addition to the Rest API, is there some sort of business layer java object method(s) we can call to assign a user to a group, and / or enroll them in a course?

Thanks,

Grhaam

Florian Gnaegi

unread,
May 19, 2016, 5:04:08 PM5/19/16
to open...@googlegroups.com, paul...@gmail.com
Sure, just look at the source code. For most things you need to use the *Manger classes to manipulate objects. You can look at BusinessGroupMembersController to learn how to use the code. 

Cheers
Florian
Reply all
Reply to author
Forward
0 new messages