The tutorial explains the overall structure of the various components of the demo, and how to compile and start them. The last part goes through how to assemble the services into an assembly and ways to launch this assembly.
pal-ovb
script starts the OVB from the
"out-of-the-box" package, i.e. with classpath directed to the
/palcom/lib
directory containing the latest export of
pre-compiled code. pal-dev-ovb
script
starts the OVB from the latest compile of
/palcom/developer
source code. Unless you have made local
changes to the OVB source code, the developer-OVB should be identical
to the out-of-the-box OVB. Notice that before executing the
pal-dev-ovb
script you must have compiled the developer
source code with either pal-dev-build -J
or from inside
Eclipse (see /doc/setup/Eclipse-build.txt)
OverViewBrowserDevice.java
under the
pal-visualization/test
project. pal-launcher
pal-dev-launcher
. As with pal-dev-ovb
this requires that you have first compiled the developer source code,
either with pal-dev-build -J
or from inside
Eclipse. ApplicationLauncherGUI.java
from the pal-applicationlauncher
project.ist.palcom.services.simulated-geotagger
, that is
checked in under
palcom/developer/application-layer/services/simulated-geotagger
.
The corresponding Eclipse project is simulated-geotagger
In the simulated-geotagger
there is a Main
class that upon launch calls all the necessary services automatically,
and in the start
subpackage to the
simulated-geotagger
there are classes,
"MyXXX"
, that allows for individual launch of the
different services, as it is done in the try-it demo.
If you compiled the developer
tree as described above,
you have automatically also compiled the geotagger into the palcom
developer applications jar file. If not, run pal-dev-build
-J
, or from Eclipse, open the dev-lib
project and
run the Ant script by right-clicking on build.xml
, and
choosing Run As->Ant Build.
With the launcher you can now browse to the jar file containing the
geotagger. The "out-of-the-box" jar is
palcom/lib/jars/palcom-applications.jar
. If you compiled
the complete source tree with either pal-dev-build -J
or
from Eclipse, the developer jar file can be found at
palcom/developer/dev-lib/jars/generated/palcom-applications.jar
.
You should now be able to start all services, as in the demo on the try it page.
Notice, that all services and simulated devices can also be launched
from Eclipse (i.e. without the launcher application) if that is more
convenient for you. Services can of course also be launched completely
manually, for instance:
java -cp palcom-applications.jar ist.palcom.simulated.geotagger.start.MyLaptop
.ass
file). There are two ways of creating an assembly file:
Starting the developer's browser can be done in multiple ways:
pal-developer
script
can be run to launch the out-of-the-box stand-alone version
of the browser.Assuming you have started the stand alone version you will see the three panes open: "Browser view", "NavigatorView", and "XML view". (The full Eclipse-based version has more views, but the essential functionality in order to compose assemblies are contained in these three. See the Developer's Companion for details on the browser.)
In the "Browser view" you should see the top branch ("Universe") og the tree of discovered services and devices. First step is to create an empty assembly description and drag the geotagger devices onto the description:
Right-click on the "Navigator view" and select New Project. Select the "new project" wizard and click "next". Name your project and press "Finish".
Right-click once again on the "Navigator view" to create a new file: Select "New->other" and select the "new file" wizard. Select your project as the container of the new file and name the assembly file. The PalCom convention is to finish the name with the ".ass" extension, e.g. "mygeotagger.ass".
Make sure the 4 devices (Camera, GPS, Laptop, and Server) is running on your computer (or on another computer on the same LAN). The 4 devices should appear in the "Browser View" pane. You can now drag the devices one-by-one to the assembly editor pane dropping them in the "Devices" folder in the assembly description tree.
Next, the services in need of connections to the assembly must be dragged from the browser view pane to the assembly editor pane. In the geotagger example this concerns all services except the ResourceManager and the AssemblyManager on the Laptop (both of these work independently on the assembly). Expand the devices in the "Browser view" and drag the services one by one to the "services" node in the assembly tree.
Now comes the logic part, or the "assembly programming/scripting". Here the needed connections and logic to run the geotagger example will be explained, to get more detail about assembly logic, please refer to the PalCom deliverable 43.
It is possible to set up connections directly between services, but in the geotagger example all services communicate via the assembly. To declare these connections all services must again be dragged to the editor, this time in the "connections" node.
Since the assembly acts as the central logical unit variables that must be shared between the services can be held in the assembly. In the geotagger example the only value that needs to be exchanged between the services is the last GPS coordinate. Variables are declared by selecting the "Variables" node and doing "Add variable declaration" from the context menu (i.e. right-clicking on the Variables node). Declare a new variable called something like "latestCoordinate" with type text/plain.
Next we must make sure communication is set up. The "latestCoordinate" (or what you named the variable) must be updated from the GPS device. Therefore we drag the out-going "coordcommand" from the "Position" service on the "My GPS" device to the Eventhandler node. (The command is found be expanding the "PRDServiceFMDescription" under the Position service in the Browser view.) A clause called "when coordcommand from Position" is added to the assembly tree. We can add a assignment to this clause by right-clicking on it and selecting "Add assignment". In the assignment dialogue select the "latestCoordinate" and assign to it the "text/plain wgs84".
Likewise, we need to set up the other functionalities in the assembly, i.e. the exchange of photos from the camera, to the stuffer service on the laptop and on to the photo database of the server.
After doing this you should now have the following clauses in the event handler list:
Assignment statements are added to an Eventhandler clause by selecting it and doing "Add assignment" from the context menu. Choose target and source variables from the dialogs.
SendMessage statements are added by dragging a CommandInfo node from the Browser view to the EventHandler clause. If the command has parameters, dialogs appear allowing you to select parameter values. Alternatively,select an EventHandler clause and do "add Send Message" from the context menu.
Invoke statements are the counterpart to SendMessage statements, on the assembly’s own synthesized service, and are added a similar way; by dragging a CommandInfo from the ServiceDescription in the Assembly editor to the EventHandlerClause. Alternatively,select an EventHandler clause and do "add Invoke" from the context menu. -->
When the assembly is up and running in the Developer's Bowser, you can save the current XML description. (Does "SaveAs" work?) (What does "release" mean?)
ist.palcom.services.googleearth.simulated-geotagger
, that is
checked in under
palcom/developer/application-layer/services/simulated-geotagger
.
The corresponding Eclipse project is simulated-geotagger
.
You should now be able to make the final steps that are similar to those described in the demo.