My favorites | Sign in
Logo
                
Search
for
Updated Aug 02, 2009 by arunoda....@gmail.com
ExAppReqComm  
Establish ExApp Requesting Communication

ExApp Requesting Communication

The Requesting party of the communication is now ExApp. And all the actual functionality reside on Joomla. What we've do is configure the API and use (call methods) as necessary. As described in early wikies there are two class to this and there purpose is described below.

  1. Joomla - Allows ExApp to call back-end functions of Joomla such as managing users.
  2. JConnect - Allows and helps to do Authentication and Single Sign On (SSO)

Let's Begin

before we go any further we assume that the folder structure is looks like this. and you've successfully configured the ExApp API.

before you call any methods in the class's you've to include the API like this

include_once('jconnect_api/api.php');

then you can get the references for each Joomla and JConnect like this...

 $joomla=JCFactory::getJoomla();
 $jconnect=JCFactoty::getJConnect();

Work with Joomla

Reference to Joomla allows you to invoke /request back-end methods of Joomla!. Currently it support only for User Management only.

methods

more..

then you can call these methods inside your code as necessary.

eg:-

  function deleteUserHook($username){
    $joomla=JCFactory::getJoomla();
    $joomla->deleteUser($username);
  }

elgg's use of the this can be viewed here.

Work with JConnect

Reference to JConnect will help you to do Authentication and Single Sign On based on Joomla with extending JCAuth class.

JCAuth has two methods

  • login($status,$data)
  • logout()

extended class:JCMyAppAuth
file: /modules/my_mod/auth.php

you'can implement application logic when particular action occurred in those methods and add them to API (setting.php).

  //in /modules/my_mod/jconnect_api/setting.php
  include_once('./auth.php');
  JCFactory::register('auth',new JCMyAppAuth());

implementation of this class in elgg can be found here..

Now what you've do it get the reference of JConnect and call the methods in the correct places in your application.

methods

  • JConnect::login();
  • JConnect::logout();

elgg's use of logout
elgg's use of login

Now you've successfully established the ExApp Requesting Communication


Sign in to add a comment
Hosted by Google Code