Skip to content

Commit 19c97e3

Browse files
committed
adding draft of websockets and starting of gemstone
1 parent 85ffe86 commit 19c97e3

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
!!Getting Started in Gemstone/S
2+
@cha:gettingstarted-gemstone
3+
4+
In this chapter we show you how to develop a simple Seaside application in GemStone/S. There are two different ways to install and run a GemStone/S server: the GLASS Virtual Appliance (GLASS is an acronym for GemStone, Linux, Apache, Seaside, and Smalltalk) \-- a pre-built environment for running GemStone/S in VMware, and the GemStone/S Web Edition \-- a native version of GemStone/S for Linux or Mac OS X Leopard. Further information is available at *http://seaside.gemstone.com/*.
5+
6+
The identical development process is used for both the GLASS Virtual Appliance and the native GemStone/S Web Edition. Both are available from *http://seaside.gemstone.com/downloads.html*. For most developers we recommend using the appliance, since this avoids the intricacies of system administration tasks. All GemStone/S editions which run Seaside are fully 64-bit enabled, and require 64-bit hardware, a 64-bit operating system, and at least 1GB RAM. The GLASS Virtual Appliance will run on a 32-bit Windows OS as long as the underlying hardware supports running a VWware 64-bit guest operating system.
7+
8+
9+
%+The Seaside development environment.>file://figures/seasideApplicationDesk.png|width=100|label=fig:seasideDesk
10+
11+
!!! Using the GLASS Virtual Appliance
12+
13+
The GLASS Virtual appliance is a pre-built, ready-to-run, 64-bit VMware virtual appliance configured to start GemStone, Seaside, Apache, and Firefox when it is booted. It is a complete Seaside development environment, including:
14+
15+
- Seaside 2.8 running in a GemStone/S 2.2.5 64-bit multi-user Smalltalk virtual machine, application server and object database.
16+
- A Squeak 3.9 VM and Squeak image configured as a development environment for the GemStone/S server running on the appliance.
17+
- An Apache 2 web server configured to display Seaside applications running in GemStone/S.
18+
- A Firefox web browser set to display the GemStone/S system status on its home page (although you can reach that same page from any browser on your network.)
19+
- A toolbar menu to start, stop, or restart GLASS or Apache, start Squeak, and run GemStone/S backups.
20+
- A toolbar icon which starts a terminal session on the appliance.
21+
- The latest stable release of Xubuntu Linux \-- Version 7.10.
22+
23+
You start the GLASS Virtual Appliance from your VMware console, just as you would any other VMware virtual appliance. The first time it may take several minutes before the system is fully operational since it must boot Linux, start the GemStone/S server, three GemStone virtual machines, Apache, and Firefox. It's ready once you see the status page shown in *@ref:status-page*.
24+
25+
+GLASS Virtual Appliance status page.>file://figures/gemstone-status-page.png|width=100|label=fig:status-page+
26+
%+status-page|width=60%+
27+
28+
We recommend when you are ready to stop work, you suspend the appliance rather than shut it down. This will make the next startup much faster. You'll be able to start up just where you left off.
29+
30+
The status of your GemStone/S system is refreshed every 10 seconds. All the GemStone processes listed in the right sidebar should have a green OK status as shown in *@ref:status-panel*. If not, use the ``GLASS Appliance\'' menu shown in *@ref:glass-menu* to start, stop, or restart GLASS or its individual components.
31+
32+
+GLASS Virtual Appliance status.>file://figures/gemstone-status-panel.png|width=100|label=ref:status-panel+
33+
%+status-panel|width=30%+
34+
35+
You should now be able to explore the Seaside components installed in the GLASS Virtual appliance by clicking on the "GLASS: Seaside" bookmark you can see in *@ref:seaside-dispatcher*. You can also view that web page from another computer on your network by using the "eth0:" IP address listed under "Network Information".
36+
37+
%+GLASS Virtual Appliance Seaside page.>file://figures/gemstone-seaside-dispatcher.png|width=100|label=fig:seasideDesk
38+
39+
40+
Should you need to edit a file or perform other command line operations on the appliance, you can open a terminal session by clicking on the terminal icon in the toolbar. If you prefer, you can ==ssh== to the appliance by using the IP address mentioned above and the username/password glass/glass. To copy files to/from the appliance use the ==scp== command. Here's an example of using ==scp== to copy a seaside log file from the appliance to your current directory.
41+
42+
[[[
43+
scp [email protected]:/opt/gemstone/log/seaside.log .
44+
]]]
45+
46+
+GLASS Virtual Appliance menu.>file://figures/gemstone-glass-menu.png|width=100|label=ref:glass-menu+
47+
%+glass-menu|width=20%+
48+
49+
!!! A first Seaside Component
50+
51+
!!! Defining a Component
52+
53+
!!! Defining Some Methods
54+
55+
!!! Rendering a Counter
56+
57+
!!! Registering the application
58+
59+
!!! Adding Behavior
60+
61+
!!! Keeping Up with the Latest Features
62+

Chapters/18-WebSockets/websockets.pillar

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ ZnWebSocketDelegate subclass: #TLCytoscapeWebSocketDelegate,
119119

120120

121121

122+
[[[
122123
TLCytoscapeWebSocketDelegate class >> registerVisualization: aTLVisualization underId: aDivId withCallBack: aCallBack callbackUrl: callbackUrl [
123124
self ensureServerIsRunning.
124125
self singleton delegate
@@ -127,6 +128,22 @@ TLCytoscapeWebSocketDelegate class >> registerVisualization: aTLVisualization un
127128
withCallBack: aCallBack
128129
callbackUrl: callbackUrl
129130
]
131+
]]]
130132

133+
[[[
134+
initialize [
135+
super initialize.
136+
self visualizationByIdDictionary: Dictionary new.
137+
self websocketByVisu: Dictionary new.
138+
self
139+
handler: [ :webSocket |
140+
[
141+
[ webSocket runWith: [ :message | self onMessageReceived: message webSocket: webSocket ] ]
142+
on: ConnectionClosed
143+
do: [ self freeResourcesFor: webSocket ] ]
144+
on: PrimitiveFailed
145+
do: [ self class restart ] ]
146+
]
147+
]]]
131148

132149

book.pillar

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ Finally, you will see a discussion of ``Slime\'', which despite its name is an e
5454
%${inputFile:Chapters/15-REST/rest.pillar}$
5555
%${inputFile:Chapters/16-Deploy/deploy.pillar}$
5656

57-
${inputFile:Chapters/17-JQuery/jquery.pillar}$
57+
%${inputFile:Chapters/17-JQuery/jquery.pillar}$
58+
5859

5960
!! Wish list of new chapter
6061

0 commit comments

Comments
 (0)