On 24/02/2010 08:14, Raido Kuli wrote:

I am thinkin adapting the Gallery side of the plugin for
Wordpress plugin (dropdown widget id select).

I too am working on a plugin at the moment (for Drupal).

Since Elgg, Drupal and Wordpress are all PHP I wonder if we should work together to create some framework code here in the ASF that plugin developers can adapt for specific platforms.

The problem with developing plugins for GPL platforms (as all of these three are) is that we can't keep the code here in the ASF. This fractures our efforts. It seems to me that providing framework code would allow us to collaborate on the Wookie specific parts and thus avoid duplicating work on our respective platforms.

From what I know of plugin development (which is not a great deal right now) this would require us to provide classes that could be extended to implement environment specific stuff. Unfortunately my limited skills don't allow me to understand how to do this in PHP, but in Java we would have something like:

/**
 * A user represents a possible user of a widget.
 */
public class User() {
  /**
   * Get the login name for this user.
   */
  public String getLoginName() {
  }

  /**
   * Get the screen name for this user.
   */
  public String getScreenName() {
  }

  // etc.
}

/**
 * This service needs to be implemented on each platform. It provides
 * methods for interfacing with the host environment.
 */
public interface IWookiePluginService() {

  /**
   * Retrieve the details of the current user.
   */
  public User getCurrentUser();

  /**
   * Retrieve the details of a specific user, identified by their
   * login name.
   */
  public User getCurrentUser(String login);

  // etc.

}

/**
 * Provides a convenience class for working with widgets
 * via the Wookie REST api.
 */
public class WidgetAPI() {
  private WookiePluginService service = new JRollerWookiePluginService();

  /**
   * Instantiate or retrieve an instance of a Wookie widget for
   * the current user.
   */
  public Widget getWidget(String widgetId) {
    user = service.getUser();
    // do REST API call as necessary
  }
}

If we implement this code, a plugin author need only implement IWidgetService for their platform and develop the UI code for working with widgets.

So, whose up for teaching me some PHP via some shared work on a PHP framework (incidentally, I need a Java plugin too, so I'm willing to work on it in Java in parallel).

Ross

Reply via email to