NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Bruce

Pages: 1 ... 5 6 [7] 8 9
91
News And Views / Version 4.36 ships
« on: July 10, 2009, 12:34:48 AM »
Version 4.36 ( 9 July 2009)
Cosmetic template bug for ABC-In-Legacy support fixed.
Added option to Close Apps control template to set INI name.
Added detection for MSIE 8 as distinct from MSIE 7.
Fixed bug where invalid xhtml characters were included in creation of JavaScript browse object.
Fixed error with selection-by-radio browse.Set fields to clear alert_div even if auto-dict validation is off.

Version 4.35 (Gold) 22 June 2009
'Buttons' class option on CSS tab for browse and form deprecated
Fixed bug where CommentsClass on a form was overridden by global setting.
Added iphone as a recognized "mobile" agent.
Worked-around bug in IE7 and IE6 that does not set Referer: header when doing a window.open.
Fixed template bug on Other buttons where action set to "Use Button Name".

Version 4.34 (Gold) 16 June 2009

Fix for possible GPF in SSL close code.

92
Web Server - Share Knowledge / Levels of SSL
« on: June 12, 2009, 03:39:33 AM »
Background

SSL (Secure Sockets Layer) is the general term for the encrypted method for the web. However there are various "versions" of the protocol which all fall under this umbrella. Not surprisingly they're not binary compatible. Typically the browser supports "a lot of them", the server supports "a lot of them" and hopefully there's some overlap.

NetTalk servers (and clients) can support all of them - SSL v2, SSL v3, TLSv1, TLSv1.1 and TLS v1.2. As long as the client can do one of these a connection is possible. (SSLv2 and SSLv3 are disabled by default though - read on below if you need them.)

Within each of these options are a huge number of encryption schemes that can be used. However that's outside the scope of this discussion. (see reply below.)

Default SSLMethod

Up to version 5.05 NetTalk supported a client connecting using SSL2 by default. (SSLv2, SSLv3 and TLS1 were all supported.)
Up to version 8.29 NetTalk supported a client connecting using SSLv3 by default (SSLv3, TLSv1, v1.1 or v1.2 were all supported.)
From build 8.30 to 8.44 the default connection was TLSv1 (only)
From build 8.45 the default is TLS v1, TLSv1.1 or TLSv1.2

As you can see, the web keeps moving and so keeping up to date is important.

Setting the SSL Method

You are able to override the default setting, and dictate to NetTalk which level to use. This is done with a line of code in the WebServer.Open method, before the parent call. (see attached pic).

  Self.SSLMethod = NET:SSLMethodTLS

Your possible choices are
NET:SSLMethodSSLv23    ! Default (Version 5.30 and earlier)  - TLSv1, SSLv2, SSLv3
NET:SSLMethodSSLv2    
NET:SSLMethodSSLv3     ! Default from versions 5.31 and later
NET:SSLMethodTLSv1     ! Update: Default from versions 8.30 to 8.44
NET:SSLMethodTLSv1_1
NET:SSLMethodTLSv1_2
NET:SSLMethodTLS        ! Update: Default from versions 8.45 and later ! new in 8.45 allows all TLS versions


[attachment deleted by admin]

93
News And Views / Version 4.33 ships
« on: June 12, 2009, 12:42:43 AM »
Despite a flurry of incorrect builds on Monday, I finally got the real 4.33 uploaded to the site. This is minor maintainence release over 4.32.

*  Fixed bug when using a form embedded on a static page, and the form was submitted with invalid data multiple times.

* Added optional CLASS parameter to CreateSortHeader method.

* Added Capitalize method. This enforces CSS style text-transform capitalize. Note it does NOT LOWER any characters.

* Added template setting to specify port which an unsecure object should redirect to.

* Fixed bug with incorrect tab selected after form validation if hidden tabs exist.

cheers
Bruce

94
There seems to be some confusion about the difference between the NetWebSource procedure, and the normal Clarion source procedure type. The goal of this post is to remove that confusion.

Firstly, it should be noted, that a NetTalk serve is a normal Clarion procedure. As such you're perfectly able to create, and call, normal source procedures. If you want to use p_web method calls in the procedure then set the Prototype/Parameters of the source procedure to
(NetWebServerWorker p_web)

** You should use a Source procedure whenever you want to create reusable code, but code which does not explicitly send any HTML to the browser **

A NetWebSource procedure is exactly the same as a normal Clarion source procedure, except that it assumes that the result of this procedure is text to send to the browser. In other words, a NetWebSource is where you create re-usable code that will (usually) send something to the browser when it is called.

** You should use a NetWebSource _only_ when you plan to send stuff to the browser.

Cheers
Bruce

95
News And Views / Version 4.32 ships
« on: May 25, 2009, 02:43:12 AM »
Hi All,

I've released the official 4.32 build -which you can download from www.capesoft.com

My thanks to all those who have contributed during the (rather lengthy) 4.31 existence. Certainly there have been some major changes, and almost 40 builds of 4.31 since 4.30, so this is a major update. It would have been impossible to do this much work, and keep it as solid as it is, without the help of all those who've been prepared to download, and use, the builds along the way.

4.32 basically encapsulates the functionality for NetTalk 4 now - and so NetTalk 4 is also officially "gold". We'll maintain NetTalk 4, and post new builds as necessary, but new features will mostly be added to NetTalk 5.

I'll post about NetTalk 5 within a couple of weeks - there are some core changes that are required, but I'm keen to keep the upgrade from NetTalk 4 to NetTalk 5 as simple as possible. Ideally it should not be any harder than any of the NT4 updates. That said there is some radically new technology, and some cool features that will be coming out during the NT5 cycle. Some of it is already done - some will take a bit of time, but we'll speak more about that as time goes by.

For now I recommend the 4.32 build, and I strongly recommend that anyone using any build of 4.31 changes over to it as soon as is practical for you. If there are any regressions then those will be sorted out as the highest priority. (I don't think there are any, but time will tell.)

Cheers - and thanks again
Bruce

96
Web Server - Share Knowledge / Creating custom "All" files
« on: May 19, 2009, 10:33:55 PM »
If you haven't already done so make sure you read the thread on editing your own styles.

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=116.0

In this thread I'll assume you've created your own styles, or scripts. The goal of this thread is to show you how to make a custom all.js and all.css file to suit your particular app.

Background

NetTalk contains a bunch of client-side functionality which is written in JavaScript. These JS files are amalgamated together into All.Js (and All.Js.Gz) because "fewer files" is faster in the browser.

Many people however do not make use of all the possible client-side options. For example you may use the Chrome menu (Windows style menu) or the XP-Task Panel menu, but seldom both. Thus the shipping All.Js file is larger than it needs to be _for your site_.

In addition, if you add your custom.css files, and custom.js files to the WeBServer procedure, these are additional files that need to be fetched by the browser. Ideally this custom stuff should be included inside all.js and all.css.

Note

There's absolutely nothing wrong with using the files "out the box". There's also nothing wrong with adding extra styles, and script files. Your site will work perfectly. This topic discusses making this process slightly more efficient.

Editing shipping JS and CSS files is not recommended. Any edits you make will be overwritten with the next NetTalk build. However since the ALL files are constructed from the shipping JS and CSS files, all you need to do is remember to re-run your batch after each update of your web folder.

How it's done

1) Download Gzip.exe from the web (google for it) and put it into your application folder.

2) REMOVE any custom JS or CSS file names you've added to the WebServer procedure.

3) Create a batch file, I call mine GzipAll.Bat, in your application folder.
The Batch file I use looks like this;

type web\scripts\prototype.js   > web\scripts\all.js
type web\scripts\rico.js        >> web\scripts\all.js
type web\scripts\chrome.js      >> web\scripts\all.js
type web\scripts\netweb.js      >> web\scripts\all.js
type web\scripts\tabs.js        >> web\scripts\all.js
type web\scripts\tabsxp.js      >> web\scripts\all.js
type web\scripts\xptaskpanel.js >> web\scripts\all.js
type web\scripts\calendar2.js   >> web\scripts\all.js
type web\scripts\calendar6.js   >> web\scripts\all.js
type web\scripts\sorttable.js   >> web\scripts\all.js

gzip -9 -n -f -c web\scripts\prototype.js   > "web\scripts\prototype.js.gz"
gzip -9 -n -f -c web\scripts\rico.js        > "web\scripts\rico.js.gz"
gzip -9 -n -f -c web\scripts\chrome.js      > "web\scripts\chrome.js.gz"
gzip -9 -n -f -c web\scripts\netweb.js      > "web\scripts\netweb.js.gz"
gzip -9 -n -f -c web\scripts\tabs.js        > "web\scripts\tabs.js.gz"
gzip -9 -n -f -c web\scripts\tabsxp.js      > "web\scripts\tabsxp.js.gz"
gzip -9 -n -f -c web\scripts\xptaskpanel.js > "web\scripts\xptaskpanel.js.gz"
gzip -9 -n -f -c web\scripts\calendar2.js   > "web\scripts\calendar2.js.gz"
gzip -9 -n -f -c web\scripts\calendar6.js   > "web\scripts\calendar6.js.gz"
gzip -9 -n -f -c web\scripts\sorttable.js   > "web\scripts\sorttable.js.gz"
gzip -9 -n -f -c web\scripts\msie.js        > "web\scripts\msie.js.gz"
gzip -9 -n -f -c web\scripts\msie6.js       > "web\scripts\msie6.js.gz"
gzip -9 -n -f -c web\scripts\tiny_mce.js       > "web\scripts\tiny_mce.js.gz"
gzip -9 -n -f -c web\scripts\tiny_mce_popup.js > "web\scripts\tiny_mce_popup.js.gz"
gzip -9 -n -f -c web\scripts\all.js       > "web\scripts\all.js.gz"

type web\styles\accordion.css   >  web\styles\all.css
type web\styles\chromemenu.css  >> web\styles\all.css
type web\styles\netweb.css      >> web\styles\all.css
type web\styles\sorttable.css   >> web\styles\all.css
type web\styles\tabs.css        >> web\styles\all.css
type web\styles\xptabs.css      >> web\styles\all.css
type web\styles\xptaskpanel.css >> web\styles\all.css

gzip -9 -n -f -c web\styles\accordion.css   > "web\styles\accordion.css.gz"
gzip -9 -n -f -c web\styles\chromemenu.css  > "web\styles\chromemenu.css.gz"
gzip -9 -n -f -c web\styles\firefox.css     > "web\styles\firefox.css.gz"
gzip -9 -n -f -c web\styles\msie6.css       > "web\styles\msie6.css.gz"
gzip -9 -n -f -c web\styles\msie.css        > "web\styles\msie.css.gz"
gzip -9 -n -f -c web\styles\netweb.css      > "web\styles\netweb.css.gz"
gzip -9 -n -f -c web\styles\sorttable.css   > "web\styles\sorttable.css.gz"
gzip -9 -n -f -c web\styles\tabs.css        > "web\styles\tabs.css.gz"
gzip -9 -n -f -c web\styles\xptabs.css      > "web\styles\xptabs.css.gz"
gzip -9 -n -f -c web\styles\xptaskpanel.css > "web\styles\xptaskpanel.css.gz"
gzip -9 -n -f -c web\styles\all.css         > "web\styles\all.css.gz"
gzip -9 -n -f -c web\styles\error.css       > "web\styles\error.css.gz"

TIP : In a batch file > means "write as file", >> means "append to file".
TYPE lists the text inside the file, GZIP is the command to make the compressed file.

4) Edit the above batch file to add extra files, or remove files. Most of the names above are reasonably self explanatory. You MUST include the Prototype, Rico and NetWeb files. However the other JS and CSS files you use depends on your application.

Note

After a NetTalk update you are accustomed to refresh your app's web folder with the updated NetTalk web folder.
If you follow the above process you must also remember to re-run your Gzipall.Bat file. If you fail to do this your custom scripts, and styles will not be served since they won't be inside the shipping All.Css and All.Js files.

97
Web Server - Share Knowledge / Using XP-TaskPanel in Frames
« on: May 18, 2009, 10:31:46 PM »
Applies to NetTalk 4.32 and later.

The XP Task Panel, when used in a frame, does not scale particularly well (by default). This note discusses the best settings to use so that the menu scales the best across all browsers.

See the attached pic for the recommended style settings.

Other settings which you can use to affect the menu height;
a) Height setting on the CSS Class tab (of the menu extension).
b) "Wrap menu in table" & "Css Class" on the Menu tab (menu extension.)

Be aware that IE and FF behave differently with regard to table, div, body and html heights. So if you experiment with the styles etc then make sure you test in both browsers.

The Accounts example (Example 31) and the FrameWithTaskPanel example (example 27) have both been updated and are examples of the correct usage.

Cheers
Bruce


[attachment deleted by admin]

98
Web Server - Share Knowledge / Translating Web Pages
« on: May 13, 2009, 07:15:51 AM »
This applies to NetTalk version 4.32 and later.

There is a method in the WebHandler class called Translate.
By embedding code in this method you can translate much of the text generated onto your web pages.

There is no translation mechanism built into NetTalk itself, rather it offers the embed point, in the web handler, so you can "plug in" your favorite translation tool.

There is also a property,
self.translateOff
which can be set in the code to "turn off" translations.
Thus if you embed code in the Translate method you should test this property. If it is greater than zero, then bypass your translation code.

Note - do not test this property = 1 as it may contain a value > 1.

You may set the property in your code, if you wish to suppress translations. Set the property by incrementing it, and decrementing it. Using this approach, rather than explicitly setting it to 1, or 0, will allow for nested code to turn translations off.

Cheers
Bruce

99
This information applies to version 4.32 and later.

Preamble

If you generate a file "on demand", such as a Report (PDF), Graphic image, Excel file, or whatever, and it takes a "long time" to generate, then the browser can time out. A mechanism is needed to tell the browser to "wait a bit longer".

HTML pages

The solution for HTML pages is easy - just send a space character at regular intervals using the ParseHTML method.

Binary Pages

the solution for binary files is more complex as characters cannot be added to the "front" of the file. Typically the whole file has to be generated before any of it can be sent, and equally, whatever is sent must not end up being part of the file being sent.

Solution

The solution is the .NoOp method. This method should be called _before_ sending the resultant file & header. In other words it can be called 1 or more time _before_ sending a binary file (with header in the normal way) back to the browser.

It can be called multiple times. Internally it will only send a packet every 15 seconds, so you do not need to do any time calculations yourself.

Support for this method has been added to the ABC Report template, the call to .NoOp is added to the TakeRecord method. In Legacy reports it is added to the start of the GetNextRecord routine.

If you are hand-coding a report, or using another report template (CPCS etc) then feel free to add the call;
if not p_web &= Null then p_web.NoOp().
as the report loops through the file.

Really really big files

If your files are really large, or take a really long time to generate, then you may want to re-think the strategy somewhat. It is almost certainly better to let the user request the file online, but then deliver the file to them via email. This is safer (reduces the chance of the user closing the browser window by mistake) and allows the user to have a record of the file (and not have to re-generate it all the time.)

Cheers
Bruce

100
News And Views / Version 4.31 update
« on: April 23, 2009, 10:50:09 PM »
I'm making an official release of version 4.32 early next week.

PR35 is basically the 4.31 PR 34 release with some very minor stuff added.
Please download this build if you are using 4.31 and let me know if there are any regressions that need attention before I release it as 4.32.

(I'll call the official release 4.32 to avoid confusion).

minor tweaks in this build; (most of which I've mentioned in other threads on this forum.)

a) css class option added to browses so you can limit the height of the browse.
b) translation improvements
c) "Save", "Cancel" and "Logout" buttons added as button type to form buttons.
d) default global css class setting for form comments
e) setting on Form advanced tab to set "default behavior" of the form.
f) Option for setting Prompts class on form.
g) more embed points added

Cheers
Bruce



101
News And Views / bruce is away
« on: April 05, 2009, 11:02:39 PM »
I'm on leave this week starting april 6.
So help each other till I get back.
And play nicely children while I'm away....

Cheers
Bruce

102
Marc Lebhertz reports the following information:

The database I am using is a SQL Anywhere database (but this must be the
same with Oracle or SQL server). The default parameter in SQL Anywhere is to disconnect a client after 240 minutes of inactivity.

So, say after a night, when I try to connect to the webserver, first screen
appears (login screen), but on the "do OpenFiles" before controlling user
password, the webserver closes, without gpf and without any message.

To work around, I have simply modified the default parameter so the
disconnect from the database server never occurs : and the webserver now
works fine since last Monday.

Cheers
Bruce


103
Web Server - Share Knowledge / Debugging
« on: January 29, 2009, 12:42:24 AM »
I've noticed in recent examples sent to me that there are a bunch of people out there use a variety of techniques for debugging.

A common approach (perhaps because it works so well) is to use debugView.

I thought I should mention, The web server, and web handler classes have a built-in method for debugview support. To write a debug statement to debugview use the _trace method. eg
p_web._trace('hello debugview, bruce was here')

If you don't have debugview yet, you can download it for free from www.sysinternals.com (which is now owned by microsoft.)

Cheers
Bruce

104
Web Server - Ask For Help / Volunteers Needed to run Test
« on: January 27, 2009, 12:29:08 AM »
Hi Guys,

This is a different kind of request for help.

Graham Smith is interested in knowing how well the NetTalk Simple Server (which is the layer on which the web server is built) performs under load.

To this end he has set up a server at a large ISP with plenty of bandwidth. He has also written a small client app which will open connections to this server, and at very specific times will make requests on the server.

This effectively tests 2 things;

a) The number of "open connections" supported by the server. As you know web connections are only open for a brief instant - but it's still important to know if there are any limits on this front.

b) the performance issue, if any, when large numbers of clients make a request "at the same time".

Graham has graciously agreed to make the results of his tests available to the whole NetTalk community (good or bad). From our side we're interested to know the result, and if necessary to set the benchmark against which we can measure improvements.

Graham's page for this test is here
http://www.gsasoftware.co.za/index.php?option=com_content&view=article&id=8&Itemid=10

So what do we need you for?
Well to make the test valid we need as many people to run the test client as possible. The official test will run from  Feb 1 to Feb 14, but if you can please download and run the client, on as many computers as you have, as soon as possible that would be great.

Graham has gone to great lengths to minimize the bandwidth consumed by the test (for each client) and also to make absolutely sure that no identifying information is passed to the server. He has released the source code to the client for inspection so feel free to compile that and run that if you prefer.

Thanks again.

Cheers
Bruce


105
News And Views / Version 4.31 PR 19 uploaded
« on: November 19, 2008, 08:14:49 AM »
This update has fairly few programming tweaks - just a little bit around the new locator's stuff. The WebServer Template Documentation though has been completely updated - at least for the Browse and Form templates (and some of the other ones as well). This is worth reading, especially for long time NTWS users who may have missed some of those settings I've sneaked in over the years.

Cheers
Bruce

Pages: 1 ... 5 6 [7] 8 9