Skip to content

Commit

Permalink
Merge pull request #1155 from jecisc/New-control-panel-in-spec2
Browse files Browse the repository at this point in the history
New-control-panel-in-spec2
  • Loading branch information
Johan Brichau authored Jul 12, 2020
2 parents 5b0f781 + 4f0dbd4 commit fb9f5a8
Show file tree
Hide file tree
Showing 85 changed files with 598 additions and 4 deletions.
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: (GRPlatform current pharoVersionsFrom: 8)
do: [ spec
package: 'Seaside-Tools-Core' with: [ spec includes: #('Seaside-Pharo-Tools-Spec2') ];
package: 'Seaside-Pharo-Tools-Spec2' with: [ spec requires: #('Seaside-Tools-Core') ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*BaselineOfSeaside3
pharoVersionsFrom: aVersion
^ (aVersion to: SystemVersion current major)
collect: [ :v | ('pharo' , v asString , '.x') asSymbol ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "GRPharoPlatform"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*BaselineOfSeaside3
pharoVersionsFrom: aVersion
"Return a list of pharo version from the major version as parameter to the major version of the image"

^ #()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "GRPlatform"
}
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
basicName: 'Add adaptor';
basicDescription: '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
basicName: 'Clear configuration caches';
basicDescription: '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
basicName: 'Clear sessions';
basicDescription: '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
basicName: 'Inspect';
basicDescription: '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
basicName: 'Open';
basicDescription: '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
Loading

0 comments on commit fb9f5a8

Please sign in to comment.