Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New control panel for Pharo8+ using Spec2 #1214

Merged
merged 12 commits into from
Jul 31, 2020
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ matrix:
allow_failures:
- smalltalk: Squeak-trunk
- smalltalk: Squeak-5.1
- smalltalk: Pharo64-9.0

include:
- smalltalk: Pharo64-9.0
env: BUILD_NAME=Pharo64-9.0
- smalltalk: Pharo64-8.0
env: BUILD_NAME=Pharo64-8.0
- smalltalk: Pharo64-7.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,16 @@ baselinepharo: spec
package: 'Seaside-Pharo-Flow' with: [ spec requires: #('Seaside-Flow' 'Seaside-Pharo-Continuation') ];
package: 'Seaside-Tests-Pharo-Continuation' with: [ spec requires: #('Seaside-Pharo-Continuation') ];
package: 'Seaside-Tests-Core' with: [ spec includes: #('Seaside-Tests-Pharo-Core') ];
package: 'Seaside-Tests-Pharo-Core' with: [ spec requires: #('Seaside-Pharo-Core' 'Seaside-Tests-Core') ].
package: 'Seaside-Tests-Pharo-Core' with: [ spec requires: #('Seaside-Pharo-Core' 'Seaside-Tests-Core') ] ].

"Spec based tools"
spec
spec
for: #(#'pharo4.x' #'pharo5.x' #'pharo6.x' #'pharo7.x')
do: [ spec
package: 'Seaside-Tools-Core' with: [ spec includes: #('Seaside-Pharo-Tools-Spec') ];
package: 'Seaside-Pharo-Tools-Spec' with: [ spec requires: #('Seaside-Tools-Core') ] ]
package: 'Seaside-Pharo-Tools-Spec' with: [ spec requires: #('Seaside-Tools-Core') ] ].

spec
for: #(#'pharo8.x' #'pharo9.x')
do: [ spec
package: 'Seaside-Tools-Core' with: [ spec includes: #('Seaside-Pharo-Tools-Spec2') ];
package: 'Seaside-Pharo-Tools-Spec2' with: [ spec requires: #('Seaside-Tools-Core') ] ]
5 changes: 5 additions & 0 deletions repository/Seaside-Pharo-Tools-Spec2.package/.filetree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*Seaside-Pharo-Tools-Spec2
seasidePharoToolsSpec2
^ self new
name: 'Seaside-Pharo-Tools-Spec2';
description: 'Spec based server adapter browser for Pharo';
addDependency: 'Seaside-Tools-Core';
url: #seasideUrl;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "GRPackage"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am an action to register a new adaptor in Seaside.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
adaptorClasses
^ (WAServerAdaptor allSubclasses reject: #isAbstract) sorted: #name ascending
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asSpecCommand
^ super asSpecCommand
iconName: #add;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
hooks
execute
| allAdaptors |
allAdaptors := self adaptorClasses.
(UIManager default
chooseFrom: (allAdaptors collect: #name)
values: allAdaptors
lines: #()
title: 'Add Seaside Adaptor' translated)
ifNotNil: [ :class |
(UIManager default request: 'Enter a port number' initialAnswer: class basicNew defaultPort greaseString)
ifNotNil: [ :port |
(port isEmpty or: [ port isAllDigits not ])
ifFalse: [ class port: port greaseInteger.
context updateAdaptorsTable ] ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
initialize
super initialize.
self
name: 'Add adaptor';
description: 'Allows one to create a new adaptor.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:06",
"super" : "WAControlPanelCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAAddAdaptorCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am an action to clear the caches of seaside configurations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asSpecCommand
^ super asSpecCommand
iconName: #remove;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hooks
execute
WAAdmin clearConfigurationCaches
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
initialize
super initialize.
self
name: 'Clear configuration caches';
description: 'Cleat all the caches of the configuration.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:07",
"super" : "WAControlPanelCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAClearConfigurationCachesCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am an action to clear seaside sessions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asSpecCommand
^ super asSpecCommand
iconName: #remove;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hooks
execute
WAAdmin clearSessions
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
initialize
super initialize.
self
name: 'Clear sessions';
description: 'Clear all the sessions.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:07",
"super" : "WAControlPanelCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAClearSessionsCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Description
--------------------

I am an abstract class to manage commands of the controle panel of Seaside.

My context is a WAPharoControlPanel.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isAbstract
^ self = WAControlPanelCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
adaptor
^ self context selectedAdaptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hooks
hasAdaptor
^ self adaptor isNotNil
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:06",
"super" : "CmCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAControlPanelCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am an action to inspect the currently selected adaptor.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asSpecCommand
^ super asSpecCommand
iconName: #smallInspectIt;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hooks
execute
self adaptor ifNotNil: #inspect
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
initialize
super initialize.
self
name: 'Inspect';
description: 'Inspect the currently selected adaptor.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:07",
"super" : "WAControlPanelCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAInspectAdaptorCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am an action to open a web browser on the localhost defined by the adaptor depending on its port.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asSpecCommand
^ super asSpecCommand
iconName: #window;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hooks
execute
self adaptor
ifNotNil: [ :adaptor |
adaptor isRunning ifFalse: [ ^ self ].
WebBrowser openOn: 'http://localhost:' , adaptor port asString ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
initialize
super initialize.
self
name: 'Open';
description: 'Opoen localhost on the port of the adaptor.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 8/26/2019 12:08",
"super" : "WAControlPanelCommand",
"category" : "Seaside-Pharo-Tools-Spec2",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAOpenBrowserCommand",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Description
--------------------

I am a controle panel for seaside. I will present to the user the list of adaptors registered in Seaside and let the user do some actions such as:
- Adding a new adaptor
- Removing an adaptor
- Starting an adaptor
- Removing an adaptor
...

Examples
--------------------

self class open

Internal Representation and Key Implementation Points.
--------------------

Instance Variables
actionBar: <aToolbarPresenter> A toolbar containing actions to execute on the selected adaptor
adaptors: <aTablePresenter> A table providing informations about the registered adaptors
infos: <aTextPresenter> A text giving informations to the user about the selected adaptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
icons
adaptorRunningIconContents
^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwY
AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUI
IFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuj
a9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMB
APh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCd
mCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgw
ABRmS8Q5ANgtADBJV2ZIALC3AMDOEA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