Rewrite module installation wizard and settings pages according to changes suggested by Zohar in #891128: Server Integration Settings with Kaltura CE and #884724: KalturaCE installation fatal error "undefined method Exception::Message()" - allow custom CE server URL in setup.

Update forms to use FAPI correctly.

Permit update of access settings in Kaltura settings screen.

Comments

xurizaemon’s picture

  1. Rather than combining the install wizard, we redirect from admin/settings/kaltura to admin/settings/kaltura/install if the Kaltura Partner ID variable is not found.
  2. The first screen prompts for SaaS (ie, Kaltura.com) or CE (use your own URL). If CE is selected, we expose a field to enter the CE server URL.
    http://drupal.org/files/1026246-installer-p1-saas.png
    http://drupal.org/files/1026246-installer-p1-ce.png
  3. Users are prompted to register with the Kaltura server by providing their site details. A button lets users skip to (4) if they already have a Partner ID with the Kaltura server. If CE is detected, this stage does not prompt for Kaltura T&C acceptance.
    This screen is only exposed if SaaS is selected (see note on 3 below).
    http://drupal.org/files/1026246-installer-p2-register-details.png
    Successful registration will redirect the user to admin/settings/kaltura (the next screen is not displayed).
  4. Users are prompted for Kaltura Partner credentials.
    This screen is only displayed if the user chooses to use an existing partner ID on the previous page, or is using CE.
    http://drupal.org/files/1026246-installer-p3-login-details.png
  5. On successful completion of either the Register Partner or Partner Login screens, the user is redirected to the settings screen where they can customise their Drupal Kaltura integrations settings.
    On the settings screen it's now possible to update the partner info details. Details are validated against the Kaltura server before saving.

Notes:
(3) In testing, I found that both the supplied Kaltura AMI and my local Kaltura install failed to accept partner registration. The module can be configured to enable this behaviour by altering the define KALTURACE_ACCEPTS_REGISTRATION in includes/kaltura.admin.inc - if that is set to TRUE, then CE installs will attempt remote registration as well.

There is a lot more pre-submit validation in place to prevent errors happening, and I believe all exceptions etc are correctly handled and have tested this with bad partner credentials, bad server URLs, etc etc.

There is a branch on Github for this work. The patch attached is substantial (17K, 4K lines, rewrites almost all of includes/kaltura.admin.inc). Unless you have a specific reason to test using a patch, I suggest using the download from Github:

(edit: corrected branch name and URL in github links above)

xurizaemon’s picture

Status: Needs work » Needs review

Related issues:
#884724: KalturaCE installation fatal error "undefined method Exception::Message()" - allow custom CE server URL in setup
#891128: Server Integration Settings with Kaltura CE

Kaltura team, please note also #1025018: Installation registrations always set 'NO' for partner's "adultContent" field on Kaltura.com, irrespective of selected option. If you can tell me what the correct value to submit for this property is, I'll update so that the correct data is stored on the Kaltura server.

Would also appreciate your thoughts on the CE partner registration I was having. (Just point me to a CE server which works for remote reg and I'll be able to test that process for CE installs too.)

Zohar.Babin’s picture

The installation process should follow the guidelines for creating CMS extensions to Kaltura:
http://www.kaltura.org/guidelines-kaltura-cms-extensions-development

Essentially, there should not be a different approach to Kaltura.com, CE or On Prem - the process is the same since the servers share the same core and same set of core APIs.

The following approach was found to be best:
After enabling the module, a screen is shown prompting the user for the URL of his Kaltura server, holding www.kaltura.com as default.
Then the module should verify the URL is correct and the Kaltura server is accessible using the ping API: $client->system->ping();

After that stage, a selection is presented: either an existing partner credentials or new partner account creation.

If existing partner credentials chosen, the user should enter his partner Id, email and password used for login to his Kaltura account.
Now the module should get the partner session keys (user and admin KS) using the getSecrets API:
$client->partner->getSecrets($partnerId, $adminEmail, $cmsPassword);
Keep these session keys, pairing with Kaltura server done.

If user selected registration of new partner, module should follow the same registration flow as described in http://www.kaltura.org/guidelines-kaltura-cms-extensions-development .
Essentially, creating a new KalturaPartner object, and using the register API:
$results = $client->partner->register($partner, $cmsPassword);

RE:AdultContent should be a boolean value.

xurizaemon’s picture

Title: Installation issues: FAPI rewrite of installer and settings pages » Installation issues: FAPI rewrite of installer
Status: Needs review » Fixed

Fixed in 6.x-2.0-beta2.

Status: Fixed » Closed (fixed)
Issue tags: -installation, -kaltura, -registration, -pairing with kaltura server

Automatically closed -- issue fixed for 2 weeks with no activity.

xurizaemon’s picture

Assigned: xurizaemon » Unassigned
Issue summary: View changes