WADispatcherEditor


Seaside-Components-Tools

Comment:



Hierarchy:

ProtoObject
Object
WAPresenter
WAComponent
WADispatcherEditor

Summary:

instance variables:

dispatcher path type

methods:

instance class
*SeasideTesting *SeasideTesting-override accessing actions as yet unclassified initialization rendering as yet unclassified

Detail:

instance variables:

dispatcher
path
type

instance methods:

*SeasideTesting
test: rootClass
 
	self
		call: (SCTestRunner forCase: rootClass suite)

*SeasideTesting-override
renderRowForEntryPoint: anEntryPoint named: aString on: html
 
	| rootClass |
	html
		tableRowWith: [html anchorWithUrl: anEntryPoint basePath do: aString]
		with: [html
				anchorWithAction: [self configure: anEntryPoint]
				text: 'configure'.
			html space;
				anchorWithAction: [self remove: anEntryPoint]
				text: 'remove'.
			(anEntryPoint isKindOf: WAApplication)
				ifTrue: [
			rootClass _ anEntryPoint preferenceAt: #rootComponent.
			(rootClass notNil
					and: [rootClass hasTestSuite])
				ifTrue: [html space;
						anchorWithAction: [self test: rootClass]
						text: 'test']]]

accessing
dispatcher: aDispatcher

	dispatcher _ aDispatcher

actions
addEntryPoint

	| entryPoint |
	path isEmpty ifTrue: [^ self inform: 'You must enter a path.'].
	entryPoint _ type new.
	dispatcher registerEntryPoint: entryPoint at: path.
	self configure: entryPoint
clearCaches

	WARegistry clearAllHandlers.
	Smalltalk garbageCollect
configure: anEntryPoint

	anEntryPoint configurationComponent ifNotNilDo: [:c | self call: c]
remove: anEntryPoint

	dispatcher removeEntryPoint: anEntryPoint
verifyPassword: pass forUser: user

	^ user = 'fooz' and: [pass = 'bar']

as yet unclassified
entryPointClasses

	^ WAEntryPoint concreteSubclasses

initialization
initialize

	dispatcher _ WADispatcher default.
	type _ WAApplication.
	path _ ''.

rendering
renderContentOn: html

	html heading: 'Squeak Enterprise Aubergines Server'.
	
	html bold: dispatcher basePath.
	html form: [
		html table: [
			dispatcher entryPoints keysSortedSafely do:
				[:name |
				self
					renderRowForEntryPoint: (dispatcher entryPoints at: name)
					named: name
					on: html].
		]
	].
	html paragraph.
	
	html bold: 'add entry point: '.
	html form: [
		html table: [
			html tableRowWithLabel: 'Path:' column: [html textInputWithValue: '' callback: [:n | path _ n]].
			html tableRowWithLabel: 'Type:' column:
				[html selectFromList: self entryPointClasses selected: type callback: [:c | type _ c] labels: [:ea | ea description].
				html space.
				html submitButtonWithAction: [self addEntryPoint] text: 'Add']
		]
	].

	html anchorWithAction: [self call: (WAConfigurationBrowser new pool: WASystemConfigurationPool default)] text: 'Edit Configurations'.

	html preformatted: SeasidePlatformSupport vmStatisticsReportString.
	html anchorWithAction: [self clearCaches] text: 'Clear Caches'.
	

class methods:

as yet unclassified
canBeRoot
 
	^ true
initialize

	self registerAsAuthenticatedApplication: 'config'

^top


- made by Dandelion -