SCSeasideResponse


SeasideTesting-Core

Comment:



Hierarchy:

ProtoObject
Object
SCXMLElementWrapper
SCSeasideResponse

Summary:

instance variables:

httpResponse

methods:

instance class
HTTP info initialize parts instance creation

Detail:

instance variables:

httpResponse
inferredType:
UndefinedObject

instance methods:

HTTP info
cookies

	^httpResponse cookies
status

	^httpResponse status

initialize
initializeFromResponse: anHttpResponse
 
	| doc |
	anHttpResponse contents reset.
	httpResponse _ anHttpResponse.
	doc _ XMLDOMParser parseDocumentFrom: anHttpResponse contents.
	self
		initializeFromXMLElement: (doc elementAt: #html)

parts
anchorWithId: aString
 
	^self
		anchorWithId: aString
		ifNone: []
anchorWithId: aString ifNone: aBlock
 
	| res |
	res _ self elementWithId: aString ifNone: [].
	^res ifNil: aBlock ifNotNil: [SCSeasideAnchor fromXMLElement: res]
anchorWithLabel: aString
 
	^ self anchors detect: [:anchor | anchor label = aString] ifNone: []
anchorWithLabel: aString ifNone: aBlock

	^ self anchors
		detect: [:anchor | anchor label = aString]
		ifNone: aBlock
anchors

	| result |
	result := OrderedCollection new.
	self 
		allElementsWithTag: #a
		in: xmlElement
		addTo: result.
	result := result select: [:each | each attributes includesKey: #href].
	^result collect: [:each | SCSeasideAnchor fromXMLElement: each]
anchorsWithLabel: aString
 
	^ self anchors
		select: [:anchor | anchor label = aString]
bodyElement

	^ xmlElement
		elementAt: #body
formWithId: aString
 
	^ self formWithId: aString ifNone: []
formWithId: aString ifNone: aBlock
 
	| res |
	res _ self
				elementWithId: aString
				ifNone: [].
	^ res
		ifNil: aBlock
		ifNotNil: [SCSeasideForm fromXMLElement: res]
forms

	| result |
	result := OrderedCollection new.
	self 
		allElementsWithTag: #form
		in: xmlElement
		addTo: result.
	^result collect: [:each | SCSeasideForm fromXMLElement: each]
fullStringContents

	^httpResponse contents contents
stringTaggedWithId: anId

	^(self elementWithId: anId) contents first string

class methods:

instance creation
fromResponse: aResponse
 
	^ self new initializeFromResponse: aResponse

^top


- made by Dandelion -