WADocumentHandler


Seaside-RequestHandler

Comment:



Hierarchy:

ProtoObject
Object
WARequestHandler
WADocumentHandler

Summary:

instance variables:

document fileName mimeDocument mimeType

methods:

instance class
as yet unclassified as yet unclassified

Detail:

instance variables:

document
inferredType:
UndefinedObject
fileName
inferredType:
UndefinedObject
mimeDocument
inferredType:
UndefinedObject
mimeType
inferredType:
UndefinedObject

instance methods:

as yet unclassified
= other

	^ (other species = self species
		and: [other document = self document])
		and: [other mimeType = self mimeType]
document

	^ document
handleRequest: aRequest

	^ self response
hash

	^ self document hash bitXor: self mimeType hash
initializeWithDocument: anObject mimeType: mimeString fileName: fileString

	document _ anObject.
	mimeType _ mimeString.
	fileName _ fileString.
isActive

	^ true
mimeDocument

	^ mimeDocument ifNil: [mimeDocument _ document asMIMEDocument ]
mimeType

	^ mimeType
response

	| response |
	response _ WAResponse new.
	response contents: self mimeDocument contentStream text.
	response contentType: (mimeType ifNil: [self mimeDocument contentType]).
	response headerAt: 'Expires' put: 'Thu, 01 Jan 2095 12:00:00 GMT'.
	fileName ifNotNil: 
		[response headerAt: 'Content-Disposition' put: 'attachment; filename=' , fileName].
	^ response

class methods:

as yet unclassified
document: anObject mimeType: mimeString fileName: fileString

	^ self basicNew initializeWithDocument: anObject mimeType: mimeString fileName: fileString

^top


- made by Dandelion -