<?xml version='1.0' encoding="iso-8859-1" ?>
<qbean class="org.jpos.q2.ui.UI" name="UI" logger="Q2"
look-and-feel="com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"
provider="org.jpos.bsh.BSHUI">
<ui width="800" height="600" full-screen="false" undecorated="false" close="true">
<caption>jPOS</caption>
<menubar id="MAIN">
<menu id="Actions" accesskey="f">
<menuitem id="Echo-Test" accesskey="E" action="bsh" command="cfg/echotest.bsh" />
<menuitem id="Sign-on" accesskey="O" action="bsh" command="cfg/signon.bsh" />
<menuitem id="Sign-off" accesskey="F" action="bsh" command="cfg/signoff.bsh" />
<menuseparator />
<menuitem id="Quit" accesskey="Q" action="exit" />
</menu>
</menubar>
<components>
<border-layout>
<center>
<vsplit divider="110">
<top>
<grid rows="1" columns="1">
<cell>
<iso-meter refresh="250" idref="channel.channel">Remote Host</iso-meter>
</cell>
</grid>
</top>
<bottom>
<log-listener scrollable="true"
logger="Q2" font="fixed-normal-12" max-events="1000" max-lines="50" />
</bottom>
</vsplit>
</center>
<south>
<label font="helvetica-bold-8">jPOS</label>
</south>
</border-layout>
</components>
</ui>
<object class="org.jpos.ui.action.Exit" id="exit" />
<object class="org.jpos.bsh.BSHAction" id="bsh" />
</qbean>
Then cfg/echotest.bsh looks like this:
import org.jpos.iso.*;
import org.jpos.space.*;
Space sp = SpaceFactory.getSpace("jdbm:stan");
long stan = SpaceUtil.nextLong (sp, "stan");
ISOMsg m = new ISOMsg();
m.set (0, "0800");
m.set (7, ISODate.getDateTime(new Date()));
m.set (11, ISOUtil.zeropad (Long.toString(stan % 1000000), 6));
m.set (70, "301");
sp.out ("send", m);
You can add more cells and monitor channels as well as servers.
>
> I know that clicking on the Isometer screen gives info close to that
> of (2) above in the form
> 1200 -->
> <-- 1210,
> However,this info may not be easily understood by a normal user. Thats
> why I was thinking of building such a control GUI around it.
>
You can certainly create your own component, you can use ours as a sample starting point.
--Alejandro
org.jpos.ui.BSHUI is there in modules/jpos/src/org/jpos/bsh/BSHUI.java
>
> And with my couriousity i have a few questions:
> - is there a way to make the log listener area (bottom area) to
> running in auto-scroll when the message comes?
>
Ha! Yeah.. I want that too, I guess you could have a look at
modules/jpos/src/org/jpos/ui/factory/LogListenerFactory.java and give it
a shot. It has been some time since my last Swing based project so I
don't know exactly how to deal with the slider in realtime, but I'm sure
it's doable.
>
> - I have dblogger which save the status of messages into database. Can
> I add a new cell to show the database's record? maybe in JSP or
> something..
>
You can create a custom UI factory and integrate your own components
into the UI (any JFrame). There's a very interesting one, the
HtmlFactory that lets you put a mini browser inside the jPOS UI.
--Alejandro
>
> I also realise that if I modify the isometer and remove some portions
> like;
> provider="org.jpos.bsh.BSHUI">
> and
> <object class="org.jpos.bsh.BSHAction" id="bsh" />
>
> I am able to launch the isometer with jpos-1.5.0.jar and can even
> access the Actions menu - Only the Quit functions works fine.
>
Exactly, that makes sense, because BSHUI is not available and you can't
run the BSH scripts.
>
> Whats the secret in the action files above being .bsh files? Is it
> possible to have them defined in a different format?
>
> At first I thought echotest.bsh was a java file, but then i realised
> there was no class definition.
>
It's a BeanShell script (see http://www.beanshell.org)
>
> So how does JPOS running on a windows env interprete and run/execute
> these files once i click on the respective action menu.
>
BeanShell
>
> In the definition of echotest.bsh, i dont' see any reference to the
> server ip or port, how is it possible
> that it can send an echo test?
>
It uses the already defined channel and send the message through the
jPOS Space, our coordination infrastructure.
The site has been absent for about a week now, I imagine though it will
be back shortly.
I will ask on their mailing list.
--
Mark
Perhaps I should have asked before...
... what are you trying to get from the site?
--
Mark
> Let me ask, whats the difference between running Dave's "bsh.bat" and
> running
> "java bsh.Interpreter" at the cmd prompt
Not much, the bsh.bat mainly sets up the classpath before making the
same call to bsh.Interpretor.
--
Mark
> But why is it that windows doesn't recognize it?
>
> C:\Projects\jposee>bin\bsh.bat
> 'C:\Program' is not recognized as an internal or external command,
> operable program or batch file.
>
There really is a space following C:\Program in the command generated.
If you can't see it, then there is not much more I can do for you?
You are trying to run a command called 'Program' on the root of your c
drive; it probably does not exist.
Put quotes around the command it will work.
--
Mark