Discarded the old sample_module

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@814 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Denis Zgonjanin 2008-12-24 18:08:08 +00:00
parent 383ad888c1
commit be064b7a18
9 changed files with 19 additions and 245 deletions

View File

@ -1,3 +1,22 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2008 by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.chat
{
import org.bigbluebutton.common.IBigBlueButtonModule;

View File

@ -48,7 +48,6 @@ package org.bigbluebutton.modules.chat
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupCommand);

View File

@ -1,49 +0,0 @@
package org.bigbluebutton.modules.sample_module
{
import org.bigbluebutton.modules.sample_module.controller.StartupSampleCommand;
import org.puremvc.as3.multicore.patterns.facade.Facade;
/**
* This is the facade for the Module
* @author Denis
*
*/
public class SampleFacade extends Facade
{
public static const NAME:String = "SampleFacade";
public static const STARTUP:String = "StartupSampleModule";
//Notification Constants
public static const TEST:String = "Test";
public function SampleFacade()
{
super(NAME);
}
/**
*
* @return - the Unique! instance of this Singleton facade.
*
*/
public static function getInstance():SampleFacade{
if (instanceMap[NAME] == null) instanceMap[NAME] = new SampleFacade;
return instanceMap[NAME] as SampleFacade;
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupSampleCommand);
}
/**
* Sends out a command to start the rest of the module (mediators, proxies)
* @param app
*
*/
public function startup(app:SampleModule):void{
sendNotification(STARTUP, app);
}
}
}

View File

@ -1,46 +0,0 @@
package org.bigbluebutton.modules.sample_module
{
import flexlib.mdi.containers.MDIWindow;
import org.bigbluebutton.common.BigBlueButtonModule;
import org.bigbluebutton.common.messaging.IRouterAware;
import org.bigbluebutton.common.messaging.Router;
import org.bigbluebutton.main.view.components.MainApplicationShell;
import org.bigbluebutton.modules.sample_module.view.SampleWindow;
/**
* This is a Sample Module. It is very minimalistic. You can copy it and use it as a start point for your own BBB module
* @author Denis
*
*/
public class SampleModule extends BigBlueButtonModule
{
public static const NAME:String = "SampleModule";
private var window:SampleWindow;
private var facade:SampleFacade;
public function SampleModule()
{
super(NAME);
this.window = new SampleWindow();
this.facade = SampleFacade.getInstance();
this.preferedX = 400;
this.preferedY = 200;
this.startTime = BigBlueButtonModule.START_ON_LOGIN;
}
override public function acceptRouter(router:Router, shell:MainApplicationShell):void{
super.acceptRouter(router, shell);
facade.startup(this);
}
override public function getMDIComponent():MDIWindow{
return this.window;
}
override public function logout():void{
facade.removeCore(SampleFacade.NAME);
}
}
}

View File

@ -1,49 +0,0 @@
package org.bigbluebutton.modules.sample_module
{
import mx.controls.Alert;
import org.bigbluebutton.common.ModuleMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
/**
* This is a Module Mediator. It communicates between this module and the rest of BigBlueButton.
* @author Denis
*
*/
public class SampleModuleMediator extends ModuleMediator
{
public static const FROM_SAMPLE_MODULE:String = "From Sample Module";
public static const TO_SAMPLE_MODULE:String = "To Sample Module";
public function SampleModuleMediator(viewComponent:SampleModule)
{
super(viewComponent, TO_SAMPLE_MODULE, FROM_SAMPLE_MODULE);
}
/**
* You list the notifications your mediator is interested in here. If one of the listed events occurs, this class will get
* notified of it
* @return
*
*/
override public function listNotificationInterests():Array{
return [
SampleFacade.TEST
];
}
/**
* This is the method where the event gets handled.
* @param notification
*
*/
override public function handleNotification(notification:INotification):void{
switch(notification.getName()){
case SampleFacade.TEST:
Alert.show(notification.getBody() as String);
break;
}
}
}
}

View File

@ -1,28 +0,0 @@
package org.bigbluebutton.modules.sample_module.controller
{
import org.bigbluebutton.modules.sample_module.SampleModule;
import org.bigbluebutton.modules.sample_module.SampleModuleMediator;
import org.bigbluebutton.modules.sample_module.model.SampleProxy;
import org.bigbluebutton.modules.sample_module.view.SampleWindow;
import org.bigbluebutton.modules.sample_module.view.SampleWindowMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
/**
* This command is exected when the Module starts-up. The command creates a SampleModuleMediator and registers it
* with the Facade of this module.
* @author Denis
*
*/
public class StartupSampleCommand extends SimpleCommand
{
override public function execute(notification:INotification):void{
var note:SampleModule = notification.getBody() as SampleModule;
facade.registerMediator(new SampleModuleMediator(note));
facade.registerMediator(new SampleWindowMediator(note.getMDIComponent() as SampleWindow));
facade.registerProxy(new SampleProxy("Hello World"));
}
}
}

View File

@ -1,35 +0,0 @@
package org.bigbluebutton.modules.sample_module.model
{
import org.bigbluebutton.modules.sample_module.SampleFacade;
import org.puremvc.as3.multicore.interfaces.IProxy;
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
/**
* The job of the proxy class is to communicate with web services and manipulate data objects. This proxy is a very simple one,
* just to show you roughly how it functions.
* @author Denis
*
*/
public class SampleProxy extends Proxy implements IProxy
{
public static const NAME:String = "SampleProxy";
public function SampleProxy(data:String)
{
super(NAME, data);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
override public function getData():Object{
return data as String;
}
public function test():void{
sendNotification(SampleFacade.TEST, getData());
}
}
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MDIWindow xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" title="Sample Module">
<mx:Button id="btnTest" label="Test" click="dispatchEvent(new Event(SampleWindowMediator.TEST));" />
</MDIWindow>

View File

@ -1,33 +0,0 @@
package org.bigbluebutton.modules.sample_module.view
{
import flash.events.Event;
import org.bigbluebutton.modules.sample_module.model.SampleProxy;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
public class SampleWindowMediator extends Mediator implements IMediator
{
public static const NAME:String = "SampleWindowMediator";
public static const TEST:String = "Test Event";
public function SampleWindowMediator(viewComponent:SampleWindow)
{
super(NAME, viewComponent);
viewComponent.addEventListener(TEST, test);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
private function get proxy():SampleProxy{
return facade.retrieveProxy(SampleProxy.NAME) as SampleProxy;
}
public function test(e:Event):void{
proxy.test();
}
}
}