Page 1 of 1

CxpHttpServer

Posted: Wed Apr 15, 2015 12:16 pm
by Zdeno Bielik
Hi Roger,

in last few days I worry with correct showing and writing our national characters
and translating some CXP code to CxpHttpServer(CHS).

1.
due to some problems with refreshing content of html page, I added clause NO-CACHE to index.html and in all created html file
- this workaround works in most cases, but sometimes when I click on „lelf-arrow“ pushbutton for showing previous page,
old/cached content is displayed
- try run example test04 and click on pb 6 or 666 and then on left arrow for navigatig back
- you will see that time was not changed
- when you click on pb a-7b, page/time is refreshed
- in this example I also try move/redirect/call to other method/function/page and also show some pb’s style and hover clause
- hmmm, I think there is also any parameter for SessionManager for enable/disable this behavior, is to possible add it into CHS if it will solve this?

2.
I added support for DbfCdx, because that format I use in windows desktop app and automatical start of CHS when it was started
- please, can you add this in your code too, I did not have to always do this – many thanks
- just note: FoxCdx must be set to default – recommendation from Alaska’s guys

3.
please, can you add exact procname, line number and passed parameters into error.log when any error occurs?
- try e.g. enable line 524 and re-run program – as you can see if there is more MemoWrit() I have no idea, where and what problem occurs

= Donnay Software Web Server Error ==========
Date: 20150415, Time: 20:12:04
App: c:\exp20\Samples\Web20\CxpHttpServer.EXE, Thread: 4
ERROR BASE/3
Parameter has a wrong data type: memoWrit
Called from WEBHANDLER:ONERROR(79)
Called from WEBHANDLER:EXECUTE(170)
Called from CUSTOMWEBHANDLER:EXECUTE(157)
Called from WEBHANDLERPROCESSOR:RUN(260)
Called from ABSTRACTHOSTADAPTOR:RUN(204)
Called from WEBJOB:EXECUTEWEBREQUEST(562)
Called from WEBJOB:EXECUTEHTTP(505)
Called from WEBJOB:EXECUTE(461)


4.
biggest problem I have with our national characters...
if data in database are filled with desktop app, indexing with your CHS and with desktop app works OK (not ok with CXP) – I use OEM CodePage 852 / Central-Europe / Latin-2
- note: some national chars are bad displayed
- just see test07 and image test-cdx-07.png
- but when I open in web-browser file test-8859-2.html – example 8b, it is showed OK! So with CHS it is possible do, with CXP not!
- also example test8a – if that same file are first readed into memory and then saved in html, result is wrong...
- also when I direct write any our characters into html file – e.g. examples test01, 02, 03 – it is not good...
- I think problem is how to write these chars in cxp/chs, because if it is written in any external html editor(like test-8859-2.html), it is ok


5. I added my replacement for your SendMail function
- MyMailerTestMsg works with MarshallSoft LIB
- if someone else are interested...


Zdeno

Re: CxpHttpServer

Posted: Thu Apr 16, 2015 10:58 am
by Zdeno Bielik
Roger,

ok, I figured it! „nearly“...

Attached is updated test code.
When you run example test06b or test07b, it finally correctly shows our chars,
but only when I direct call created/saved html file test06b.html or test07b.html.
When cHtml content is displayed in webbrowser as return value of method/function,
our chars are „tranformed“ to any „&#nnn;“ codes... just see source or images.

Why? How is it possible turn this off?

TIA & Regards
Zdeno

Re: CxpHttpServer

Posted: Thu Apr 16, 2015 11:34 am
by rdonnay
I don't know why it is doing that.

I have a program in which I create dynamic HTML and it displays correctly.
I will have to see if I get the same result.

Re: CxpHttpServer

Posted: Mon Apr 20, 2015 6:22 am
by rdonnay
These are my results for Test06b.html

#1 Test06b.html sent directly from CxpHttpServer

cPath:c:\exp20\Samples\Web20\
Alias():TEST

00000005 Adamekova Aneta aa@drt.sw
00000025 Ádamekova Aneta aa@drt.sw
00000006 Bielik Andrej ba@abc.ks
00000026 Bielik Andrej ba@abc.ks
00000004 Bielik Tomas bt@aaa.net
00000024 Bielik Tomáš bt@aaa.net
00000001 Bielik Zoltan bz@bbb.sk
00000021 Bielik Zoltan bz@bbb.sk
00000002 Cacko Peter cacko@xyz-test.sk
00000022 Čacko Peter cacko@xyz-test.sk
00000003 Dezider Roman dez@aaa.com
00000023 Dezider Roman dez@aaa.com
00000007 Laco Martin lm1@a.a
00000027 Laco Martin lm1@a.a
00000010 lsctzyaieuaon ls1@x.x
00000030 ľščťžýáíéúäôň ls2@y.y
00000008 Mino Jeremias mj@b.b
00000028 Miňo Jeremiáš mj@b.b
00000009 Zvala Lukas zl@c.c
00000029 Zvala Lukáľ zl@c.c

#2 Test06b.html sent by MemoRead('Test06b.html')

cPath:c:\exp20\Samples\Web20\
Alias():TEST

00000005 Adamekova Aneta aa@drt.sw
00000025 Ádamekova Aneta aa@drt.sw
00000006 Bielik Andrej ba@abc.ks
00000026 Bielik Andrej ba@abc.ks
00000004 Bielik Tomas bt@aaa.net
00000024 Bielik Tomáš bt@aaa.net
00000001 Bielik Zoltan bz@bbb.sk
00000021 Bielik Zoltan bz@bbb.sk
00000002 Cacko Peter cacko@xyz-test.sk
00000022 Èacko Peter cacko@xyz-test.sk
00000003 Dezider Roman dez@aaa.com
00000023 Dezider Roman dez@aaa.com
00000007 Laco Martin lm1@a.a
00000027 Laco Martin lm1@a.a
00000010 lsctzyaieuaon ls1@x.x
00000030 ¾šèťžýáíéúäôò ls2@y.y
00000008 Mino Jeremias mj@b.b
00000028 Miòo Jeremiáš mj@b.b
00000009 Zvala Lukas zl@c.c
00000029 Zvala Luká¾ zl@c.c

Which of these is correct? #1 or #2

When I bring your test06b.html into Multiedit, it shows characters as in #2.

I know very little about how to deal with these issues as I usually work in the English language.

Re: CxpHttpServer

Posted: Mon Apr 20, 2015 9:48 am
by Zdeno Bielik
Which of these is correct? #1 or #2
#1 is OK

When I bring your test06b.html into Multiedit, it shows characters as in #2.
When I open created/generated html file from cHtml in any program or web-browser or in direct in CxpHttpServer,
it is OK, just see also attached images test06b-04---OK.png and test-nc-06b-02---OK.png,
it shows correct that file in ConText, in Windows Notepad and Total Commander Viewer...


BUT it is BAD / WRONG displayed in CxpHttpServer, when it is returned back to web-browser window as Return value cHtml

METHOD MyTest01:Text06b()
...
RETURN cHtml


see attached image test-nc-06b-01---WRONG.png

and as you can see in this image on the right side, some our chars are „for some reason“
before displaying in web-browser window changed in source code to „&#nnn;“ codes...
A -> „Á“
C -> „È“
etc...

so, problem is NOT in generated cHtml (see previous sections), but may be in their automatic internal conversion… or some bad settings


I know very little about how to deal with these issues as I usually work in the English language.
Please, I kindly ask you, can you ask Steffan, how is is possible TURN-OFF „transforming“ chars or if it bug in Xbase++? Or mine?


Many thanks
Zdeno

Re: CxpHttpServer

Posted: Mon Apr 20, 2015 9:51 am
by Zdeno Bielik
next images

Re: CxpHttpServer

Posted: Thu Apr 23, 2015 10:38 am
by Zdeno Bielik
Hi,

if someone is interesting, I made this „workaround“ for now:

before end of METHOD MyTest01:Text06b() I added this code
and now in web-browser are displayed our nationals chars OK...


...
MemoWrit('test06b.html',cHtml) && ok, first save actual cHtml

wtf cHtml

*

* and then create NEW temp html, which just shows created/saved html file
* so, not direct original cHtml is sended back to browser, but this short "help/temp" version

cHtml := '<html>' + CRLF
cHtml += '<head>' + CRLF
cHtml += '<meta content="text/html; charset=windows-1250" http-equiv="content-type">' + CRLF
cHtml += '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">' + CRLF
cHtml += '</head>' + CRLF

cHtml += '<body>' + CRLF


cHtml += '<script language="javascript" type="text/javascript">' + CRLF
cHtml += ' window.location.href=' + "'" + '/test06b.html' + "' ;" + CRLF
cHtml += '</script>' + CRLF



cHtml += '</body>' + CRLF
cHtml += '</html>' + CRLF

* MemoWrit('test06bNew.html',cHtml) && just for "test/control"

wtf cHtml

*

RETURN cHtml

*