Preparing Moodle 20

From Joomdle
Revision as of 08:42, 11 November 2010 by Antonio (Talk | contribs) (Networking Settings)

Jump to: navigation, search

This document applies to Joomdle Release 2.0.0

Note: This document applies to the preparation of Joomdle with Moodle 2.0+ If you are installing Joomdle for Moodle 1.9+ please refer to this document Preparing Moodle 1.9+ for Joomdle

Moodle 2 Prerequisites

If you are installing Moodle for the first time, it will check for the existence of the PHP extension XML-RPC.  Please ensure it is installed.

xmlrpc_check.jpg

For further information on PHP XML-RPC libraries refer to PHP XML-RPC Prerequisites


.

Networking Settings

Ensure that Moodle's Networking Settings are on as in the picture below.

Networking settings m20.jpg



.

Activate Moodle's Network Authentication

Insert picture here


.

Setting up Moodle Web services

Moodle 2.0 introduces a new Web Services approach to integration with external applications like Joomdle. As such, beginning with Moodle 2.0, to integrate Joomdle with Moodle, you will need to complete the following steps to configure Moodle's Web services.


To make it easier Moodle 2, has created a Step-by-step table that you can following for configuring Moodle's Web Services. This can be found here


Site Administration->Plugins->Web services->Overview.


Wsoverview.png



.

Enable web services

Enable Web Services. The status should change to Yes

Enablews.png



.

Enable protocols: XMLRPC

Joomdle leverages XMLRPC to connect with Moodle. Therefore, select 2. Enable Protocols from the table and enable XMLRPC. You will need to ensure that your webhost has the PHP XMLRPC libraries loaded and enabled. Refer to PHP Prerequisites for more information.


Enablexmlrpc.png


.

Create a specific user

Moodle's Web Services requires a "user" to connect with Joomdle.


To configure Moodle's Web Services, we need to define a specific "user" which will be given the appropriate access to "enter" / connect with Moodle. Ideally, this "user" should be used only for connecting Joomla to Moodle. It should not be used as a typical Joomla front end or Joomla backend user. Also, it should not be your Joomla or Moodle system admin user. For example, we created a user called joomdle connector.


.

Check user capability

Check user permissions

For Joomdle to connect to Moodle using Web services, a specific user must be created in Moodle, as defined above. Once defined this user must be given the appropriate access to the Web services protocol being used, XML-RPC. This is done by defining a role, assigning the user to that role and then granting that role access to the Web services. In this section, we show you how to:

  • Check the permissions of existing users
  • Create a new role
  • Assign a specific user, eg. Joomdle Connector, to a given role


From the table click on 4. Check user capability. Select the user who you have created to be the Web services user and press the Show this user's permissions button.


Checkpermissions.png

Scroll down until you see XML-RPC and ensure this is set to yes. The background colour will have changed as well. In this case the background colour is light blue/green indicating it is set to yes in comparison to pink for no.

If it is not set to Yes you will need to do one or more of the following:

  • Create a new role
  • Assign the user to the specific role

Checkuserpermission.png


.

Define a new role, to manage access to Joomdle Web services

To define a new role, go to Site Administration->Users->Permissions->Define roles, and click the 'Add a new role' button. Then enter a unique name, short name and description. These should be something that you will recognise relating to Joomdle services.

Newrole.png

Then, check 'System' as Context types where this role may be assigned.

Scroll down looking through the Capability table and Allow (check):

  • Use XML-RPC protocol
  • View discussions

Capabilities.png


.

Assign the user to the new role

After you have created the new role, you will need to add your Joomdle Web services user (eg. joomdle connector) to this role.

Go to Users->Permissions->Assign System roles, and select the new role.


Assignrole.png


.

Add a new service

Next we must add a new "service" for Joomdle. This "service" will allow you to define what Joomdle can do inside Moodle. For example pulling course details information from Moodle or creating a new user in Moodle. This task is split into two tasks:

  • Create a new service
  • Defining what functions this new service can perform (See the next section)

This is done in Site Administration->Plugins->Web services->External services

Newservice.png

Add functions to service

Normally, this would be the first time you are setting up Joomdle on this webserver. Therefore, it is assumed the Joomdle for Moodle has not been installed and you will not be able to perform this task at this time. Instead, this activity will be completed as part of the Installing Joomdle in Moodle 2.0 task.


If Joomdle has already been installed, you can perform this task now. The details of this task can be found here Add Functions to Service


.

Add user as authorized user for the service

Now that we have created a new service and added the appropriate functions (All Joomdle functions), we need to authorise / grant the Joomdle Web services 'user' to the newly created service. This is done in:

Site Administration->Plugins->Web services->External services

Click on Authorized users for the new service and add the Joomdle Web services user we created before.

Adduser.png


.

Create token

The final step is to create a token which will be entered in Joomdle configuration page in the Joomdle Joomla component. Without this token, even if everything is configured in Moodle, Joomla and Joomdle correctly, Joomdle will not be able to connect with Moodle.

In the Moodle Administration menu:

Site Administration->Plugins->Web services->Manage tokens, click on Add.

Addtoken.png


Select the user and the service we created, and Save.

Tokens.png


You will get a new token, to enter in Joomdle's component configuration in Joomla. Refer to this page for entering the token in Joomdle.