Re: Howto Image (picture) instance variable of the class
"Oswall Verny Arguedas C." <[email protected]> Wed, 9 Jun 2021 15:11:17 -0600
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <CABTWuHdSRhBhE=zSZ3GSCQFbV+2PSfDmsoC5UxSCNbu1VdZiNw@mail.gmail.com> |
--===============2646405672782287129== Content-Type: multipart/alternative; boundary="000000000000bd4fde05c45bb8b9" --000000000000bd4fde05c45bb8b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Karsten "" the biggest challenge in serving pictures via FileLibrary is how to map a URL <-> Picture. In HTTP all you have is a URL and you need to find a way to create this URL and then also to resolve your pictures based on a given URL. So if you use a FileLibrary or a similar RequestHandler, you need a way to find your Product object and then find its picture based on a given URL. If this is simple enough in your implementation, go for it. i.e. if your Products all have an ID and your are stored in a database there=E2=80= =99s no problem in resolving URLs like /pictures?product=3D1234&picture=3D1. "" This first part that you tell me I think is similar to what Esteban says. I have not implemented it. I am reviewing the documentation. "" An alternative is to register a URL during rendering (in that case Seaside takes care of creating and resolving the URLs): html image document: aProduct picture1 data The benefit is that you don=E2=80=99t need to think about creating a URL an= d resolving it. The downside is that your images have URLs with random keys in it and they=E2=80=99re only valid as long as your session is alive. "" Register url while rendering?. There is some documentation about it. Thanks El jue, 3 de jun. de 2021 a la(s) 23:53, Karsten Kusche ([email protected]) escribi=C3=B3: > Hi Oswall, > > the biggest challenge in serving pictures via FileLibrary is how to map a > URL <-> Picture. In HTTP all you have is a URL and you need to find a way > to create this URL and then also to resolve your pictures based on a give= n > URL. So if you use a FileLibrary or a similar RequestHandler, you need a > way to find your Product object and then find its picture based on a give= n > URL. If this is simple enough in your implementation, go for it. i.e. if > your Products all have an ID and your are stored in a database there=E2= =80=99s no > problem in resolving URLs like /pictures?product=3D1234&picture=3D1. > > An alternative is to register a URL during rendering (in that case Seasid= e > takes care of creating and resolving the URLs): > html image document: aProduct picture1 data > The benefit is that you don=E2=80=99t need to think about creating a URL = and > resolving it. The downside is that your images have URLs with random keys > in it and they=E2=80=99re only valid as long as your session is alive. > > Kind regards > Karsten > > =E2=80=94 > > Georg Heeg eK > > Wallstra=C3=9Fe 22 > 06366 K=C3=B6then > > Tel.: 03496/214328 > FAX: 03496/214712 > Amtsgericht Dortmund HRA 12812 > > > > Am 3. Juni 2021 um 20:52:10, Oswall Verny Arguedas C. ([email protected]= ) > schrieb: > > Greetings, > I have a query about saving instances of a class that are of type image > (picture). > For example. I have a Product class. This class must have two photographs > of that product. I have to save two instance variables of the Product > class, picture1, picture2. > These images must be uploaded from the Product form and displayed after > uploading. > In Seaside what would be the best procedure to do it. > I don't know if WAFileLibrary would be the best option. > Thanks in advance. > Oswall > _______________________________________________ > seaside mailing list > [email protected] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > --000000000000bd4fde05c45bb8b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi=C2=A0<span style=3D"font-family:Helvetica,Arial;fo= nt-size:13px">Karsten</span></div>""<div><span style=3D"font-fami= ly:Helvetica,Arial;font-size:13px">the biggest challenge in serving picture= s via FileLibrary is how to map a URL <-> Picture. In HTTP all you ha= ve is a URL and you need to find a way to create this URL and then also to = resolve your pictures based on a given URL. So if you use a FileLibrary or = a similar RequestHandler, you need a way to find your Product object and th= en find its picture based on a given URL. If this is simple enough in your = implementation, go for it. i.e. if your Products all have an ID and your ar= e stored in a database there=E2=80=99s no problem in resolving URLs like /p= ictures?product=3D1234&</span><span style=3D"font-family:Helvetica,Aria= l;font-size:13px">picture=3D1.</span><br></div><div>""<br clear= =3D"all"><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"= gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"lt= r"><div dir=3D"ltr"><div style=3D"color:rgb(0,0,0);font-family:Arial,Helvet= ica,sans-serif;font-size:13.63636302947998px">This first part that you tell= me I think is similar to what Esteban says.<br>I have not implemented it. = I am reviewing the documentation.<br></div></div></div></div></div></div></= div></div></div><br></div><div>""</div><div><div style=3D"font-fa= mily:Helvetica,Arial;font-size:13px">An alternative is to register a URL du= ring rendering (in that case Seaside takes care of creating and resolving t= he URLs):</div><div style=3D"font-family:Helvetica,Arial;font-size:13px"><s= pan style=3D"white-space:pre-wrap"></span>html image document: aProduct pic= ture1 data</div><div style=3D"font-family:Helvetica,Arial;font-size:13px">T= he benefit is that you don=E2=80=99t need to think about creating a URL and= resolving it. The downside is that your images have URLs with random keys = in it and they=E2=80=99re only valid as long as your session is alive.</div= ></div><div>""</div><div>Register url while rendering?.<br></div>= <div>There is some documentation about it.<br></div><div>Thanks</div></div>= <br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">El jue= , 3 de jun. de 2021 a la(s) 23:53, Karsten Kusche (<a href=3D"mailto:karste= [email protected]">[email protected]</a>) escribi=C3=B3:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex"> <div> <div style=3D"font-family:Helvetica,Arial;font-size:13px">Hi Oswall,</div> <div style=3D"font-family:Helvetica,Arial;font-size:13px"><br> </div> <div style=3D"font-family:Helvetica,Arial;font-size:13px">the biggest chall= enge in serving pictures via FileLibrary is how to map a URL <-> Pict= ure. In HTTP all you have is a URL and you need to find a way to create thi= s URL and then also to resolve your pictures based on a given URL. So if you use a FileLibrary or a similar RequestHand= ler, you need a way to find your Product object and then find its picture b= ased on a given URL. If this is simple enough in your implementation, go fo= r it. i.e. if your Products all have an ID and your are stored in a database there=E2=80=99s no problem in= resolving URLs like /pictures?product=3D1234&picture=3D1.</div> <div style=3D"font-family:Helvetica,Arial;font-size:13px"><br> </div> <div style=3D"font-family:Helvetica,Arial;font-size:13px">An alternative is= to register a URL during rendering (in that case Seaside takes care of cre= ating and resolving the URLs):</div> <div style=3D"font-family:Helvetica,Arial;font-size:13px"><span style=3D"wh= ite-space:pre-wrap"></span>html image document: aProduct picture1 data</div= > <div style=3D"font-family:Helvetica,Arial;font-size:13px">The benefit is th= at you don=E2=80=99t need to think about creating a URL and resolving it. T= he downside is that your images have URLs with random keys in it and they= =E2=80=99re only valid as long as your session is alive.</div> <div style=3D"font-family:Helvetica,Arial;font-size:13px"><br> </div> <div style=3D"font-family:Helvetica,Arial;font-size:13px">Kind regards</div= > <div style=3D"font-family:Helvetica,Arial;font-size:13px">Karsten</div> <div style=3D"font-family:Helvetica,Arial;font-size:13px"><br> </div> <div> <div>=E2=80=94=C2=A0</div> <div><br> <span style=3D"white-space:pre-wrap;font-family:-apple-system;font-size:14p= x">Georg Heeg eK</span></div> <div> <div style=3D"font-family:-apple-system;font-size:14px"> <pre style=3D"white-space:pre-wrap">Wallstra=C3=9Fe 22 06366 K=C3=B6then Tel.: 03496/214328 FAX: 03496/214712 Amtsgericht Dortmund HRA 12812</pre> <div><br> </div> </div> </div> </div> <br> <p>Am 3. Juni 2021 um 20:52:10, Oswall Verny Arguedas C. (<a href=3D"mailto= :[email protected]" target=3D"_blank">[email protected]</a>) schrieb:</p> <blockquote type=3D"cite"><span> <div> <div></div> <div> <div dir=3D"ltr"> <div> <div dir=3D"ltr"> <div dir=3D"ltr"> <div> <div dir=3D"ltr"> <div> <div dir=3D"ltr"> <div dir=3D"ltr"> <div style=3D"color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-= size:13.6364px"> Greetings,<br> I have a query about saving instances of a class that are of type image (pi= cture).<br> For example. I have a Product class. This class must have two photographs o= f that product. I have to save two instance variables of the Product class,= picture1, picture2.<br> These images must be uploaded from the Product form and displayed after upl= oading.<br> In Seaside what would be the best procedure to do it.<br> I don't know if WAFileLibrary would be the best option.<br> </div> <div style=3D"color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-= size:13.6364px"> Thanks in advance.<br> </div> <div style=3D"color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-= size:13.6364px"> Oswall</div> </div> </div> </div> </div> </div> </div> </div> </div> </div> _______________________________________________<br> seaside mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">sea= [email protected]</a><br> <a href=3D"http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seasi= de" target=3D"_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/lis= tinfo/seaside</a><br> </div> </div> </span></blockquote> </div> </blockquote></div> --000000000000bd4fde05c45bb8b9-- --===============2646405672782287129== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kc2Vhc2lkZSBt YWlsaW5nIGxpc3QKc2Vhc2lkZUBsaXN0cy5zcXVlYWtmb3VuZGF0aW9uLm9yZwpodHRwOi8vbGlz dHMuc3F1ZWFrZm91bmRhdGlvbi5vcmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3NlYXNpZGUK --===============2646405672782287129==--