Some Notes about WebFlow
- WebFlowEditor is the applet which is downloaded to the user side.
- WebEditor is reponsible for sendinf Module Lifecycle requests to the
Session Manager.
- webflow.frontend.WFtree package is responsible for module tree
representation on the screen.
- In modules.txt each entry denotes the name of the module class,
address of the server on which this module run and its visual
appereance. Current design requires that module developer should
provide the visual representation class(extended from WebNode) with
the module implementation.
- Whenever user picks a module and drops in the Graphical editor,
it will invoke a method (initializeModule()) on WebEditor which
talks back to SM and starts the module on MM.
- Whenever user connects an output of a module with the input of
another, it will go through the connection manager and verifies
that this connection can be done.
- Connection Manager(CM) defines the appropriate ports and exchanges
their handles so that each one know where to read/write.
- Module Manager (MM) is responsible for lifecycle of each module.
- Session Manager keeps the information about current users on the
server. SM gives a client id to each user sequentially. All the requests
from client keeps this clientID info so that SM can recignize who started
the certain operation. For each received request, SM starts the appropriate
WFSession object to handle the requests. webflow.backend.WFSession package
contains module lifecycle operations and each of them provides the Action
interface.
- Current version runs on top of GEF. It uses GEF as a Graphical Editor
package therefore uci and symantec packages can be used diractly. We have
tested with JDK 1.0.2 version.
- Recently, refresh button is added to the module tree so that you can
reread the modules.txt file from scratch.
- webflow.util contains Action and several objects related to List and
Queue.
- webflow.util.Workers contains Worker pool objects.
Module Development with GUI
- If the module you are developing needs a user input, then you need to
define an applet for this GUI. This definition should be included in the
initialize() method of Module and put it 'html' attribute of MetaModule
object so that when this module is created by MM this information being
sent to the user side and it can execute the necessary stuff there.
- On the front end, when you realize that module has a GUI, you use the
viewerID of this module and ask SM this viewer object it will return
you the necessary html page to fire the applet in the bottom frame of
the netscape window.
- Why did we do that?
Because it is not possible through java to display an HTML page
without going through JavaScript. I did not know the current stuation.
- We can get rid of the viewerID approach by defining an Echo Servlet
on the server side.
- Since all the GUI's directed to the bottom frame, each GUI should sit
in the frame object so that it can pop up a different window. If your
application needs a seperate netscape window(such as you need to use
VRML browser) then while you are defining the module in initialize()
you need ti provide window name information. This information and
the id of the module will be used to open all the stuff in a seperate
netscape window. Window name is concatented with the module Id to get
the unique window id for each invokation of the same module.
- How does GUI of the module communicates with the module on the server?
ServerSocket. When you are defining a module also you open a
server Socket and give this address as an applet parameter to the
GUI. Whenever GUI pops up, it tries to make connection with this
given server socket and then it can send the necessary inputs through
serialization. On the server side, the best approach is to define
an object which runs it seperate thread and knows the handle of the
module object. So that you can seperate the module's body from the
GUI control. You have to becareful here especially you are dealing
with some control parameters of the module. You have to use
'synchronize' write to the attributes of the module.
Give sampling value example for time based sampling filter.
How can I check that CM and MM is working?
- If CM is working, you can access it like invoking a servlet and it
will return you the machine and port number on which this servlet accepting
the connections. It is same for the Module Manager.
How can I see the running modules on MM?
- If MM is working, you can get the list of modules managed by MM by
sending servlet address of the MM+"?cmd=running_modules".
This will give you a list of modules managed by MM.
How does a module with GUI started under WebFlow?
- showViewer(viewerURL, WinName) of WebFlowEditor
This method lets us access to the session servlet and receives the
HTML page from the session servlet and put it given WindowName
if there is a window name otherwise it will put this HTML page
into bottom frame(might be Viewer?).
- Who invokes showViewer()?
newViewer() of WebEditor. In this methow, front-end builds
viewerURL by concatenating
SMURL+"?cmd=get_viewer&viewerID="+key+"&clientID="clientID.
Note that we know the viewerID from MetaModule and clientID from the
first connection.
- Who invokes newViewer()?
postPlacement() of WebNode.
In this method front-end does the followings:
- Initialize the module. (invoke initializeModule() of WebEditor)
- Receives the reply and from this reply wecan decide whethet
the module has GUI. If it has, front-end looks at its
window name and viewerID. Then front-end invokes the newViewer()
with the viewerID and window name(it sends null if it is not
provided).
Who provides the SMURL to the WebEditor?
- If you look at the first demo page in upper frame there is an
applet tag for webFlowEditor applet. The front-edn takes this
parameter and starts WebEditor with this parameter so that WebEditor
object knows whom it is going to talk.
How does WebEditor know moduleListURL?
In the InitializeSocket() of WebEditor.
- sends start_session message to SM throgh URL.
- SM returns
hostName
portNumber
moduleListURL (This info is provided to SM as an initial servlet
parameter)
clientID
-
How does WebEditor send messages to the SM?
requestFromServer() of WebEditor.
- Opens a URL connection with SM and reads the status and portNumber
information. If the operation do not need further information, it
wont get portNumber. Otherwise it will get portNumber to read the
additional information such as SMreply/MMreply/CMreply.
- If the current request needs further info, it will open the necessary
I/O streams through portnumber and receives the reply.
connect(), runModules(), destroy(), destroyModule(), endSession() of
WebEditor uses this.
How Connection works?
WebArc is the class.
- connect() of WebArc applies the necessary checks and then invokes the
connect() of WebEditor with necessary information.
How can we define the Visual Representation of a Module ?
WebNode1, WebNode2, WebNode3, WebNodeImgF, WebNodeImgV,..etc all extended
from WebNode so that all can use postPlacement() of WebNode.
- initialize() : defines moduleTreeItem and ports (WebPort objects)
- makePerspective() : defines visual representation.
Improvements
- Documents and WebFlow pages. It is not clear how you end up with
webflow 0.0.3 or webflow 0.0.4.
- Documentation should be reviewed ( except the Set Up-Download
explanations). Module Development help sucks. It does not have at
least walks through the developer on one real module.
- Dimple's improvement did not tested(Tom said something). This might
change the Module Development information page. This should be done very
quickly and should be tested. This improvement provides
- cancellation of port definition done by users
- requires user to write its own data in case he/she uses
an object which is not serializable.
- validity checks on the front-end ( connect output->input, type
checks)
- try GEF V0.5 with JDK 1.1 version
- Visual Representation of each module can be generalized.
Problem: we do not know without initializing the module how many
ports does it have? (MetaModule wont work)
- A general solution for GUI of Module.
- A Vector of Inputs and Outputs. And run the module whenever its input
changes.
- Combining modules.txt with hierarchical representation.
- Client support. Password. ACL definition for the modules.
- Mesh of WebFlow Servers.