Re: Checking in

Carl Gundel <[email protected]> Wed, 26 Feb 2025 23:04:30 -0500
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAPYvR9fhGDzxqm2QYyQNw8ci+LnPbz7wirLAyDtOvR+LxhE7yg@mail.gmail.com>
--===============2472525138368058436==
Content-Type: multipart/alternative; boundary="00000000000039c46c062f17cb5d"

--00000000000039c46c062f17cb5d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hey, I finally got around to trying this.

  fileSystem :=3D WAExternalFileLibrary new.

  WADispatcher new register: fileSystem at: 'culture'.

  fileSystem preferenceAt: #directory put: 'c:\rbdev\public\'

As soon as I do this, the Seaside server is broken and I can't even launch
a browser on it.  I get this:
This site can=E2=80=99t be reached

*desktop-m4pvv3o* refused to connect.


So, maybe there is something else to do?


-Carl

On Sun, Feb 23, 2025 at 8:04=E2=80=AFPM Jupiter Jones <[email protected]=
om>
wrote:

> Hi Carl,
>
> From memory, you shouldn=E2=80=99t need to call updateRoot: on the librar=
ies - I
> believe that=E2=80=99s handled automatically.
>
> In any case, I just installed it to have a look and my educated guess was
> totally wrong :)
>
> From WAExternalFileLibraryTest-#setUp
>
> fileSystem :=3D WAExternalFileLibrary new.
> WADispatcher new register: fileSystem at: =E2=80=98culture'
>
> I guess you might be able to set the directory to serve files from the UI=
,
> or maybe in code with something like=E2=80=A6
>
> fileSystem preferenceAt: #directory put: =E2=80=98/path/to/files=E2=80=99
>
> If you have no luck, I should have time to give this a go tonight or
> tomorrow.
>
> On 24 Feb 2025, at 10:47=E2=80=AFam, Carl G <[email protected]> wrote:
>
> Well, thanks for your help but no luck.   The trouble is that the
> WAExternalFileLibrary seems to be broken?  I dunno.  It throws an excepti=
on
> in this method:
>
> SeasideRenderLoopContinuation>>updateRoot: anHtmlRoot
>
>     | charSet |
>
>     charSet :=3D self application contentType charSet.
>
>     charSet isNil ifFalse: [
>
>         anHtmlRoot meta charset: charSet ].
>
>     anHtmlRoot beHtml5.
>
>     anHtmlRoot title: 'Seaside'.
>
>     self application libraries
>
>         do: [ :each | each default updateRoot: anHtmlRoot ].
>
>     self session updateRoot: anHtmlRoot
>
> It DNUs when it tried to send #default to the library.  I wonder if I can
> make my own subclass of WAFileLibrary and extend it to serve files from a
> disk folder.
>
> It's just puzzling that there isn't a ready made way to do this.  After
> WAExternalFileLibrary does work in Seaside 2.8.
>
> I was hoping to find an answer in the Seaside book at
> http://book.seaside.st/book but the web page is hug or something.  It was
> working a few days ago.
>
> Whose bell do I ring to get that rebooted?
>
> -Carl
>
> On Sun, Feb 23, 2025 at 5:23=E2=80=AFPM <[email protected]> wrot=
e:
>
>> Hi Carl,
>>
>> Disclaimer: I=E2=80=99ve never used a WAExternalFileLibrary so the follo=
wing is
>> an educated guess, but hopefully gives you enough info.
>>
>> I typically configure these kind of things on creation of the applicatio=
n
>> with something like a #configureApplication: method on the class side of=
 my
>> root component...
>>
>> configureApplication: anApplication
>> anApplication preferenceAt: #sessionClass put: MySession.
>> anApplication configuration
>> addParent: MySystemConfiguration instance.
>> anApplication
>> addLibrary: WAExternalFileLibrary;
>> addLibrary: JQDevelopmentLibrary.
>> anApplication
>> preferenceAt: #directory put: =E2=80=98/path/to/serve/from=E2=80=99.
>>
>> Then call this method from the method that installs the web app=E2=80=A6
>>
>> register
>> self configureApplication: (WAAdmin register: self asApplicationAt:
>> =E2=80=98MyAppName')
>>
>> Cheers
>>
>>
>>
>> On 24 Feb 2025, at 8:56=E2=80=AFam, Carl G <[email protected]> wrote:
>>
>> I'm trying a few things trying to make my application serve static
>> files.  Run BASIC dynamically generates PNG files that are rendered into
>> the web page, but I cannot figure out how to make it work after hours of
>> head banging.  The old version of Seaside allows me to add
>> WAExternalFileLibrary in the configuration page.  But I cannot do this w=
ith
>> Seaside 3.5.1 on VW for some reason.  If I try to do the following, I ge=
t a
>> debugger when I launch the app.
>>
>>   (WADispatcher default handlers at: 'runbasicpersonal')
>>     addLibrary: WAExternalFileLibrary
>>
>> If I substitute WAFileLibrary it doesn't blow up, but it doesn't seem to
>> do anything either.  Putting a breakpoint in the handle: method for the
>> instance of WAFileLibrary does not stop.  It seems that the WAFileLibrar=
y
>> is not being used.  My guess is that it's only for serving 'files' that =
are
>> in-memory anyways but I tried it just to see if I could anything work.
>>
>> Any ideas?  What the simplest possible way to add external file serving
>> to my Seaside app?  I absolutely do not want my users to need Apache or
>> something else.  The current version doesn't require it.
>>
>> Thanks in advance.
>>
>> -Carl Gundel, author of Run BASIC
>> http://www.runbasic.com
>> _______________________________________________
>> seaside mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>>
>>
>> _______________________________________________
> seaside mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
>
>

--00000000000039c46c062f17cb5d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hey, I finally got around to trying this.=
<div><p><span style=3D"font-size:12px">=C2=A0 fileSystem</span><span style=
=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">:=3D</span>=
<span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">=
WAExternalFileLibrary</span><span style=3D"font-size:12px">=C2=A0</span><sp=
an style=3D"font-size:12px">new</span><span style=3D"font-size:12px">.</spa=
n></p><p><span style=3D"font-size:12px">=C2=A0 WADispatcher</span><span sty=
le=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">new</span=
><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px"=
>register:</span><span style=3D"font-size:12px">=C2=A0</span><span style=3D=
"font-size:12px">fileSystem</span><span style=3D"font-size:12px">=C2=A0</sp=
an><span style=3D"font-size:12px">at:</span><span style=3D"font-size:12px">=
=C2=A0</span><span style=3D"font-size:12px">&#39;</span><span style=3D"font=
-size:12px">culture</span><span style=3D"font-size:12px">&#39;</span><span =
style=3D"font-size:12px">.</span></p><p><span style=3D"font-size:12px">=C2=
=A0 fileSystem</span><span style=3D"font-size:12px">=C2=A0</span><span styl=
e=3D"font-size:12px">preferenceAt:</span><span style=3D"font-size:12px">=C2=
=A0</span><span style=3D"font-size:12px">#directory</span><span style=3D"fo=
nt-size:12px">=C2=A0</span><span style=3D"font-size:12px">put:</span><span =
style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">&#39;<=
/span><span style=3D"font-size:12px">c:\rb</span><span style=3D"font-size:1=
2px">dev\public\</span><span style=3D"font-size:12px">&#39;</span></p><p>As=
 soon as I do this, the Seaside server is broken and I can&#39;t even launc=
h a browser on it.=C2=A0 I get this:</p><h1 style=3D"font-size:1.6em;font-w=
eight:normal;line-height:1.25em;margin-bottom:16px;margin-top:0px;font-fami=
ly:&quot;Segoe UI&quot;,Tahoma,sans-serif">This site can=E2=80=99t be reach=
ed</h1><p></p><p style=3D"display:inline;color:rgb(95,99,104);font-family:&=
quot;Segoe UI&quot;,Tahoma,sans-serif;font-size:15px"><strong>desktop-m4pvv=
3o</strong>=C2=A0refused to connect.</p></div><div><p style=3D"display:inli=
ne;color:rgb(95,99,104);font-family:&quot;Segoe UI&quot;,Tahoma,sans-serif;=
font-size:15px"><br></p></div><div><p style=3D"display:inline;color:rgb(95,=
99,104);font-family:&quot;Segoe UI&quot;,Tahoma,sans-serif;font-size:15px">=
So, maybe there is something else to do?</p></div><div><p style=3D"display:=
inline;color:rgb(95,99,104);font-family:&quot;Segoe UI&quot;,Tahoma,sans-se=
rif;font-size:15px"><br></p></div><div><p style=3D"display:inline;color:rgb=
(95,99,104);font-family:&quot;Segoe UI&quot;,Tahoma,sans-serif;font-size:15=
px">-Carl</p></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl=
ass=3D"gmail_attr">On Sun, Feb 23, 2025 at 8:04=E2=80=AFPM Jupiter Jones &l=
t;<a href=3D"mailto:[email protected]" target=3D"_blank">jupiter.jones=
@mail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div>Hi Carl,<div><br></div><div>From memory, you shouldn=E2=80=
=99t need to call updateRoot: on the libraries - I believe that=E2=80=99s h=
andled automatically.=C2=A0</div><div><br></div><div>In any case, I just in=
stalled it to have a look and my educated guess was totally wrong :)</div><=
div><br></div><div>From=C2=A0WAExternalFileLibraryTest-#setUp</div><div><br=
></div><div><div>fileSystem :=3D WAExternalFileLibrary new.</div><div>WADis=
patcher new register: fileSystem at: =E2=80=98culture&#39;</div><div><br></=
div><div>I guess you might be able to set the directory to serve files from=
 the UI, or maybe in code with something like=E2=80=A6</div><div><br></div>=
<div><span style=3D"color:rgb(0,0,0)">fileSystem=C2=A0</span>preferenceAt: =
#directory put: =E2=80=98/path/to/files=E2=80=99</div><div><br></div><div>I=
f you have no luck, I should have time to give this a go tonight or tomorro=
w.</div><div><br><blockquote type=3D"cite"><div>On 24 Feb 2025, at 10:47=E2=
=80=AFam, Carl G &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:</div><br><div><div dir=3D"ltr">Well=
, thanks for your help but no luck.=C2=A0 =C2=A0The trouble is that the WAE=
xternalFileLibrary seems to be broken?=C2=A0 I dunno.=C2=A0 It throws an ex=
ception in this method:<br><br><p><span style=3D"font-size:12px">SeasideRen=
derLoopContinuation&gt;&gt;updateRoot:=C2=A0</span><span style=3D"font-size=
:12px">anHtmlRoot</span></p><p><span style=3D"font-size:12px">=C2=A0=C2=A0=
=C2=A0=C2=A0</span><span style=3D"font-size:12px">|</span><span style=3D"fo=
nt-size:12px">=C2=A0</span><span style=3D"font-size:12px">charSet</span><sp=
an style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">|</=
span></p><p><span style=3D"font-size:12px">=C2=A0=C2=A0=C2=A0=C2=A0</span><=
span style=3D"font-size:12px">charSet</span><span style=3D"font-size:12px">=
=C2=A0</span><span style=3D"font-size:12px">:=3D</span><span style=3D"font-=
size:12px">=C2=A0</span><span style=3D"font-size:12px">self</span><span sty=
le=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">applicati=
on</span><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-si=
ze:12px">contentType</span><span style=3D"font-size:12px">=C2=A0</span><spa=
n style=3D"font-size:12px">charSet</span><span style=3D"font-size:12px">.</=
span></p><p><span style=3D"font-size:12px">=C2=A0=C2=A0=C2=A0=C2=A0</span><=
span style=3D"font-size:12px">charSet</span><span style=3D"font-size:12px">=
=C2=A0</span><span style=3D"font-size:12px">isNil</span><span style=3D"font=
-size:12px">=C2=A0</span><span style=3D"font-size:12px">ifFalse:</span><spa=
n style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">[</s=
pan></p><p><span style=3D"font-size:12px">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0</span><span style=3D"font-size:12px">anHtmlRoot</span><span=
 style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">meta<=
/span><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:=
12px">charset:</span><span style=3D"font-size:12px">=C2=A0</span><span styl=
e=3D"font-size:12px">charSet</span><span style=3D"font-size:12px">=C2=A0</s=
pan><span style=3D"font-size:12px">]</span><span style=3D"font-size:12px">.=
</span></p><p><span style=3D"font-size:12px">=C2=A0=C2=A0=C2=A0=C2=A0</span=
><span style=3D"font-size:12px">anHtmlRoot</span><span style=3D"font-size:1=
2px">=C2=A0</span><span style=3D"font-size:12px">beHtml5</span><span style=
=3D"font-size:12px">.</span></p><p><span style=3D"font-size:12px">=C2=A0=C2=
=A0=C2=A0=C2=A0</span><span style=3D"font-size:12px">anHtmlRoot</span><span=
 style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">title=
:</span><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-siz=
e:12px">&#39;</span><span style=3D"font-size:12px">Seaside</span><span styl=
e=3D"font-size:12px">&#39;</span><span style=3D"font-size:12px">.</span></p=
><p><span style=3D"font-size:12px">=C2=A0=C2=A0=C2=A0=C2=A0</span><span sty=
le=3D"font-size:12px">self</span><span style=3D"font-size:12px">=C2=A0</spa=
n><span style=3D"font-size:12px">application</span><span style=3D"font-size=
:12px">=C2=A0</span><span style=3D"font-size:12px">libraries</span><span st=
yle=3D"font-size:12px">=C2=A0</span></p><p><span style=3D"font-size:12px">=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"font-=
size:12px">do:</span><span style=3D"font-size:12px">=C2=A0</span><span styl=
e=3D"font-size:12px">[</span><span style=3D"font-size:12px">=C2=A0</span><s=
pan style=3D"font-size:12px">:</span><span style=3D"font-size:12px">each</s=
pan><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12=
px">|</span><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font=
-size:12px">each</span><span style=3D"font-size:12px">=C2=A0</span><span st=
yle=3D"font-size:12px">default</span><span style=3D"font-size:12px">=C2=A0<=
/span><span style=3D"font-size:12px">updateRoot:</span><span style=3D"font-=
size:12px">=C2=A0</span><span style=3D"font-size:12px">anHtmlRoot</span><sp=
an style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:12px">]</=
span><span style=3D"font-size:12px">.</span></p><p><span style=3D"font-size=
:12px">=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"font-size:12px">self</=
span><span style=3D"font-size:12px">=C2=A0</span><span style=3D"font-size:1=
2px">session</span><span style=3D"font-size:12px">=C2=A0</span><span style=
=3D"font-size:12px">updateRoot:</span><span style=3D"font-size:12px">=C2=A0=
</span><span style=3D"font-size:12px">anHtmlRoot</span></p><p><span style=
=3D"font-size:12px">It DNUs when it tried to send #default to the library.=
=C2=A0 I wonder if I can make my own subclass of WAFileLibrary and extend i=
t to serve files from a disk folder.</span></p><p>It&#39;s just puzzling th=
at there isn&#39;t a ready made way to do this.=C2=A0 After WAExternalFileL=
ibrary does work in Seaside 2.8.</p><p>I was hoping to find an answer in th=
e Seaside book at=C2=A0<a href=3D"http://book.seaside.st/book" target=3D"_b=
lank">http://book.seaside.st/book</a>=C2=A0but the web page is hug or somet=
hing.=C2=A0 It was working a few days ago.</p><p>Whose bell do I ring to ge=
t that rebooted?</p><p>-Carl</p></div><br><div class=3D"gmail_quote"><div d=
ir=3D"ltr" class=3D"gmail_attr">On Sun, Feb 23, 2025 at 5:23=E2=80=AFPM &lt=
;<a href=3D"mailto:[email protected]" target=3D"_blank">terra.aust=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex"><div>Hi Carl,<div><br></div><div>Disclaimer: I=E2=80=99ve n=
ever used a=C2=A0WAExternalFileLibrary so the following is an educated gues=
s, but hopefully gives you enough info.<br><div><br></div><div>I typically =
configure these kind of things on creation of the application with somethin=
g like a #configureApplication: method on the class side of my root compone=
nt...</div><div><br></div><div><div>configureApplication: anApplication</di=
v><div><span style=3D"white-space-collapse: preserve;">	</span>anApplicatio=
n preferenceAt: #sessionClass put: MySession.</div><div><span style=3D"whit=
e-space-collapse: preserve;">	</span>anApplication configuration</div><div>=
<span style=3D"white-space-collapse: preserve;">		</span>addParent: MySyste=
mConfiguration instance.</div><div><span style=3D"white-space-collapse: pre=
serve;">	</span>anApplication</div><div><span style=3D"white-space-collapse=
: preserve;">		</span>addLibrary: WAExternalFileLibrary;</div><div><span st=
yle=3D"white-space-collapse: preserve;">		</span>addLibrary: JQDevelopmentL=
ibrary.</div><div><span style=3D"white-space-collapse: preserve;">	</span>a=
nApplication</div><div><span style=3D"white-space-collapse: preserve;">		</=
span>preferenceAt: #directory put: =E2=80=98/path/to/serve/from=E2=80=99.</=
div><div><br></div><div>Then call this method from the method that installs=
 the web app=E2=80=A6</div><div><br></div><div><div>register</div><div><spa=
n style=3D"white-space-collapse: preserve;">	</span>self configureApplicati=
on: (WAAdmin register: self asApplicationAt: =E2=80=98MyAppName&#39;)</div>=
</div><div><br></div><div>Cheers</div></div></div><div><br></div><div><br><=
/div><div><br><blockquote type=3D"cite"><div>On 24 Feb 2025, at 8:56=E2=80=
=AFam, Carl G &lt;<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>&gt; wrote:</div><br><div><div dir=3D"ltr">I&#39;m=
 trying a few things trying to make my application serve static files.=C2=
=A0 Run BASIC dynamically generates PNG files that are rendered into the we=
b page, but I cannot figure out how to make=C2=A0it work after hours of hea=
d banging.=C2=A0 The old version of Seaside allows me to add WAExternalFile=
Library in the configuration page.=C2=A0 But I cannot do this with Seaside =
3.5.1 on VW for some reason.=C2=A0 If I try to do the following, I get a de=
bugger when I launch the app.<div><br></div><div>=C2=A0 (WADispatcher defau=
lt handlers at: &#39;runbasicpersonal&#39;)=C2=A0<br>=C2=A0 =C2=A0 addLibra=
ry: WAExternalFileLibrary<br><br></div><div>If I substitute WAFileLibrary i=
t doesn&#39;t blow up, but it doesn&#39;t seem to do=C2=A0anything either.=
=C2=A0 Putting a breakpoint in the handle: method for the instance of WAFil=
eLibrary does not stop.=C2=A0 It seems that the WAFileLibrary is not being =
used.=C2=A0 My guess is that it&#39;s only for serving &#39;files&#39; that=
 are in-memory anyways but I tried it just to see if I could anything work.=
</div><div><br></div><div>Any ideas?=C2=A0 What the simplest possible way t=
o add external file serving to my Seaside app?=C2=A0 I absolutely do not wa=
nt my users to need Apache or something else.=C2=A0 The current version doe=
sn&#39;t require it.</div><div><br></div><div>Thanks in advance.</div><div>=
<br></div><div>-Carl Gundel, author of Run BASIC</div><div><a href=3D"http:=
//www.runbasic.com/" target=3D"_blank">http://www.runbasic.com</a></div></d=
iv>_______________________________________________<br>seaside mailing list =
--=C2=A0<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a><br>To unsubscribe send an email=
 to=C2=A0<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a><br></div></blockqu=
ote><br></div></div></blockquote></div>____________________________________=
___________<br>seaside mailing list --=C2=A0<a href=3D"mailto:seaside@lists=
.squeakfoundation.org" target=3D"_blank">[email protected]=
</a><br>To unsubscribe send an email to=C2=A0<a href=3D"mailto:seaside-leav=
[email protected]" target=3D"_blank">[email protected]=
oundation.org</a><div class=3D"gmail-yj6qo"></div><div class=3D"gmail-adL">=
<br></div></div></blockquote></div><div class=3D"gmail-adL"><br></div></div=
></div></blockquote></div></div>

--00000000000039c46c062f17cb5d--

--===============2472525138368058436==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
seaside mailing list -- [email protected]
To unsubscribe send an email to [email protected]

--===============2472525138368058436==--