<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everybody!<br>
<br>
I'm working on a project using Seaside for the first time, and for
various reasons it needs to output Content-Type: "text/plain"
documents. So having no idea, how Seaside's internals work I started
sticking in random 'self break' statements, until I found a place that
the Content-Type was set. What I did so far was:<br>
<br>
WAHtmlRoot<<contentType<br>
^ mimeType ifNil: ['text/html'] ifNotNil: [mimeType]<br>
<br>
<br>
WAHtmlRoot<<mimeType<br>
^ mimeType<br>
<br>
WAHtmlRoot<<mimeType: aString <br>
^ mimeType := aString<br>
<br>
This at least allows me to change what was previously a hardcoded
content type, but it wasn't enough to allow access from the viewer as I
couldn't find an obvious way to access the response object through the
html one so:<br>
<br>
WAHtmlDocument<<response<br>
^response<br>
<br>
WAHtmlDocument<<response: aResponse<br>
^response := aResponse<br>
<br>
WARender<<buildResponse<br>
| response document |<br>
self updateUrl: url.<br>
context actionUrl: url. <br>
response := self newResponse.<br>
response headerAt: 'Cache-Control' put: 'No-cache'.<br>
document := self session outputDocumentClass root: self
buildDocRoot.<br>
document stream: response stream.<br>
<b> document response: response.</b><br>
context document: document.<br>
root decorationChainDo: [:ea | ea renderWithContext: context].
<br>
self writeOnLoadOn: document.<br>
document close.<br>
^ response<br>
<br>
At this point I could now alter the response within my View class:<br>
<br>
TestView<<renderContentOn: html<br>
html context document response contentType: 'text/plain'.<br>
html text: 'Testing 1 2 3'<br>
<br>
Generates a page of type 'text/plain' but the page is just the
javascript load preamble:<br>
<br>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br>
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>><html
lang="en" xml:lang="en"
xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a>><head><title>Seaside</title><meta
content="text/html; charset=utf-8" http-equiv="Content-Type"
/><link type="text/css"
href="/seaside/files/WAStandardFiles/basics.css" rel="stylesheet"
/><link type="text/css"
href="/seaside/files/WAStandardFiles/kalseyTabs.css" rel="stylesheet"
/><link type="text/css"
href="/seaside/files/WAStandardFiles/sourceStyle.css" rel="stylesheet"
/><script type="text/javascript"
src="/seaside/files/WAStandardFiles/externalAnchors.js"></script><script
type="text/javascript"
src="/seaside/files/WAStandardFiles/misc.js"></script><script
type="text/javascript"
src="/seaside/files/WAStandardFiles/shortcuts.js"></script><link
type="text/css" href="/seaside/Test?_s=UbxOBKHRLUulbtSV"
rel="stylesheet" /></head><body
onkeydown="onKeyDown(event)" onload="onLoad()"><div
id="frameContent">testing 1 2
3</div><div>&nbsp;</div><p></p><div
id="toolbar"><a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;1">New
Session</a>&nbsp;<a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;2">Configure</a>&nbsp;<a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;3">Toggle
Halos</a>&nbsp;<a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;4">Spot
Profiler</a>&nbsp;<a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;5">Memory</a>&nbsp;<a
href="?_k=zekhIJre&amp;_s=VkiqJeuwtxwWVIAM&amp;6">Profiler</a>&nbsp;<a
href=<a class="moz-txt-link-rfc2396E" href="http://localhost:3900/seaside/Test?terminate=1&_s=VkiqJeuwtxwWVIAM&_k=zekhIJre">"http://localhost:3900/seaside/Test?terminate=1&amp;_s=VkiqJeuwtxwWVIAM&amp;_k=zekhIJre"</a>>Terminate</a>&nbsp;<a
title="Validate XHTML"
href=<a class="moz-txt-link-rfc2396E" href="http://validator.w3.org/check/referer">"http://validator.w3.org/check/referer"</a>>XHTML</a>&nbsp;<span
title="Render Time">0</span>/<span title="Callback
Time">0</span> ms</div><script
type="text/javascript">/*<![CDATA[*/function
onLoad(){}/*]]>*/</script></body></html><br>
<br>
So my question is how do I override this!<br>
<br>
I noticed that I can override the response stream in my View object,
but there's a continuation which gets called which will overwrite
whatever I put in the stream. Am I going about this totally the wrong
way?<br>
<br>
Dave<br>
</body>
</html>