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 ... 6 7 [8] 9
106
News And Views / 4.31 PR 18 available
« on: November 10, 2008, 08:12:41 AM »

107
News And Views / NetTalk 4.31 Candidate Release Available (PR17)
« on: October 17, 2008, 07:52:51 AM »
Hi All,

PR17 - which is a candidate release for 4.31 is now available at
http://www.capesoft.com/ftp/public/prerelease/index.htm

Cheers
Bruce

108
A while back there was a thread, possibly more than one, requesting that after inserting a record, to a SQL backend, the browse should highlight the most recently inserted record.

The reason it doesn't work is because if you are using a server-side auto-incrementing key, then immediately after the insert the auto-incrementing-key-field is unknown.

We solve this (in version 4.31 PR10 and later) by doing an immediate SET & PREVIOUS - which will work almost all the time except when 2 users add a record "at the same time" and by "at the same time" I mean within a few thousandths of a second of each other.

There is a file driver solution documented here
http://www.softvelocity.net/community/blogs/clarion_6_tipstricks/archive/2006/03/09/701.aspx
But it only applies to build 9051 and alter, and I'm not having much joy making it work in my current Clarion build (9058) with MsSql 2000.


Cheers
Bruce

110
Web Server - Share Knowledge / Changing the names of downloaded files
« on: July 11, 2008, 07:15:06 AM »
One question that has come up a couple times on this forum is how to change the name, prompted by the browser, when the user is saving a file to disk.

Take Example 40, as an example. This example shows you how to download a document, where the document name is passed as a parameter to a generic page. For example;

GET /ServeDocument?name=test.xls

In version 4.30 and earlier, the prompted name to save the file would be "ServeDocument". Most people would prefer for it to prompt as "test.xls".

Previously I've stated that it wasn't possible to do this, and I'm happy to say, I was wrong. It is possible. It's done by setting the content-disposition header field.

So with Version 4.31, PR6 or later, see example 40 (in the embed code in the ServeDocument procedure) for an example of how this is done.

Thanks to Robert De Jager who first showed me the technique.

Cheers
Bruce



111
Web Server - Share Knowledge / Starting Threads inside the Web Server
« on: July 11, 2008, 03:03:44 AM »
Hi All,

As you know, each incoming request spawns a new thread to handle the request.

However, you may not know, but this thread typically doesn't have a Window structure, has no ACCEPT loop, and simply runs from start to finish. This matters not, except in the case where you spawn your own thread from this thread.

If you wish to start a thread (to perform some task in the background) then typically you would call something like;

START(MyProc,25000)

Which normally would be sufficient. However because this thread has no ACCEPT loop, a slight variation to the START call is required. Your call to start the thread should look like this;

RESUME(START(MyProc,25000))

This allows the current thread to continue running, as well as giving some time to the newly started thread.

Cheers
Bruce

PS This tip applies on to Clarion 6 and later, RESUME is not in the language in Clarion 5.5.

112
Web Server - Share Knowledge / MS Sql HSTMT Connection Busy Errors
« on: May 07, 2008, 02:53:31 AM »
If you are using MsSql with your web server, and you have more than one user using the server, then you will likely run into the STMT Connection Busy error.

see here for a fuller explanation;
http://www.softvelocity.net/community/blogs/clarion_news/archive/2005/12/15/410.aspx

In our experience here we've found that turning MARS on does completely eliminate the error. We're using Ms SQL 2005, and Clarion 6.3.9058. You may have similar success with earlier builds of Clarion, we haven't back-checked to see exactly which build works the best.

The key issue though is "turning MARS on". Despite what the SV post above says, it does not appear to be automatic. In essence, the _first_ file opened in the database must have the driver setting
/MULTIPLEACTIVERESULTSETS=TRUE

If you are using FM3 then the first file that connects is none of the ones in your dictionary, but rather the FM3 connection file. In order to set the driver string for that, you'll need a recent build of FM3.

The new driver setting is on the AutoUp tab of the FM3 global extension. (see attached pic.)

Cheers
Bruce




[attachment deleted by admin]

113
News And Views / NetTalk Pre-Release version 4.31 available
« on: May 05, 2008, 07:42:59 AM »
The 4.31 pre-release is available here;

http://www.capesoft.com/ftp/public/prerelease/index.htm

The feature set for 4.31 is not complete yet, but major chunks have already been finished, and so for those urgently needing the new features this is a good build to start playing with.

** If you use this build please remember to update your Web folder **

The primary feature additions with this build are;
a) Better looking browses.
b) Edit-In-Place on browses.
c) a "Copy" button for the browse (ie Insert / Copy / Change / Delete)
d) An animated graphic displays when Ajax browse updates are pending.
e) 4 new examples covering ActiveX, Timers, Static Pages and record Tagging.

The complete version history is as follows;

Add: New example: WScriptActiveX (45)
Add: New example: Timers (46)
Add: New example: Pages (47)
Add: New example: Tagging (48)
Add: MouseOver feature in Browses. The row under the mouse is visually highlighted (as distinct from visual highlighting used for selections)
Add: Support for multi-lined browse records.
Add: Edit-In-Place on browse columns added. [still todo : Lookup button functionality]
Add: 'Other' buttons in browses can now trigger server-side code.
Add: Support for browse headers to span multiple columns.
Add: Support for browse data to span multiple columns.
Add: Removed extra browse column 1.
Add: Small animated "busy" graphic when browse is doing an Ajax update.
Add: Copy button and SmallCopy button to browses. Does an "Insert" but using the highlighted record to prime the fields.
Add: SmallOtherButton property and template settings.
Add: ABC Class support to NetWebBrowse, NEtWebForm and NetWebSource procedure types.
Add: Optionally allow xHtml in Browse headings and sub-headings.
Add: SyncSql property. If set VIEW access to the database is synchronized. This may help with HTMST BUSY errors in MsSql. [Better to use Ms2005, clarion 9058, and MARS]
Add: Page title on browse and form defaults to header if blank. *** This may cause compile errors when upgrading. Please see note here.
Add: Allow xHtml setting for Form "Display" fields.
Add: Option to suppress children if browse called as a lookup.
Add: Ability to set the browse table width in pixels.

Change: NoWrap attribute added to browse and form styles. This prevents text from wrapping. Feel  free to override in your own styles.
Change: Improved CSS for Browse table - including Image background for header bar.
Change: Optionally allow a read-only lookup field on a form to display the "description" instead of  the "Code".
Change: Properties ImageW and ImageH in NetWebButtonGroup changed to ImageWidth and ImageHeight respectively to avoid conflict with Pro-Scan.
Change: Embed points in NetWebBrowse better organised.
Change: Improved template support for Checkbox values.
Change: Deprecated "not in view" template option on browse.
Change: Re-arranged template settings for buttons on a form to make it neater.

Fix: Style applied to comment in form, even if comment is Spanned.
Fix: Dynamic Form Fields, with formatted pictures, improved.
Fix: _jsok method can now be called safely multiple times on the same string.
Fix: Special characters in Form Field Type "Display" handled correctly.
Fix: When using SQL backends, the form often "forgot" where to return to in the browse.
Fix: ReadOnly on Text fields (when HTML) now works.
Fix: Work-around for frame borders not visible in IE.
Fix: After specific lookup sequence, old checkbox field values might be restored.
Fix: Contains and BeginsWith Locators were broken.
Internal: Parameters for CreateSortHeader method changed.
Internal: Parameter to CreateTextArea method added.
Internal: Parameter to _jsok method added.

Cheers
Bruce

114
Hi All,

I have an internal build of NetTalk 4.31 which we are using on our NetTalk apps.
There are a number of substantive changes to the engine in this build, so I'm looking for 5 or 6 people who would be prepared to run this version on their apps to check for any regressions.

If you are currently releasing a NetTalk program, or about to release one, then this test is expressly not for you. The risk of regressions in this build is quite high - so I'm really interested more in folk who would not be materially affected by a regression that might be in for a day or two until a fix can be made.

If you're interested please drop me an email at
bruce at capesoft . com

Cheers
Bruce

115
Web Server - Ask For Help / Simple consulting job available in Jobs forum.
« on: November 28, 2007, 11:55:36 PM »
Title says it all.
Bruce

116
Looking To Hire / NetTalk Consulting
« on: November 28, 2007, 11:53:49 PM »
Hi All,

I got the following request today.

<< We run a Clarion billing application (developed by another company), and want to make some data from the underlying tables available online. Can you refer us to a company or consultant that knows / uses NetTalk, and so can efficiently help us get this running. Many thanks.

Sounds  simple enough so those who want to work for cash please email him at
scott
at
alarmbills
dot
c o m

Cheers
Bruce

117
News And Views / NetTalk Version 4.30 pre-release 1 available
« on: October 29, 2007, 06:58:09 AM »
Hi All,

A pre-release build of NetTalk 4.30 has been uploaded here
http://www.capesoft.com/ftp/public/prerelease/index.htm

(Note this is NOT the regular NetTalk downloads page which still contains version 4.29 - Use the link above to get to the 4.30 files.)

The goal of this release is for regression testing before the official 4.30 release.
If you see any regressions, or show-stoppers, please let me know.

Cheers
Bruce

118
FTP - Share Knowledge / Deciphering Custom FTP Directory Listings
« on: September 20, 2007, 12:09:22 AM »
Preamble:

When using FTP a common command is to get a directory listing. Unfortunately the FTP spec does not specify the format of this listing. In theory each serer can return it in a different way, in practice there are a handful of common formats.

However every now and then you may interact with a server that has a completely obscure format. These are typically custom FTP servers used in specific companies and may be running on an obscure operating system. And in this situation you will need to add code to your program to correctly decipher the directory listing.

To do this is a 2 step process. Firstly you need to come up with a technique that identifies the format, and secondly you need to add code that deciphers the format into the internal nettalk fields.

Step 1

To identify the format, add code to the _FigureOutDirFormat method, which is a method of the NetFTPClientData class. You can add code to methods in your procedure, by clicking on the procedure in the application tree, and then searching for the method name.

After the parent call do a test to see if the test was successful, and if it wasn't then you can add additional code of your own to detect the format. For example

PARENT._FigureOutDirFormat(p_Data)
If self._DirFormatSet = 1 and self._DirListingFormat = 0
  ! do your check here, and set self._DirListingFormat to some number > 200 and < 250.
End


In the _FigureOutDirFormat method your goal is to determine the format, and give it a number (between 200 and 250). This format number is stored in the property _DirListingFormat. Reading the code in the NetSimp.Clw file, for the _FigureOutDirFormat method can be helpful in showing you how you might try and detect your format.

In this example I'll assume you do detect your format, and you assign this format to number 201. We'll use this number in step 2.

Step 2

Now that you know the format, you need to use this knowledge to populate the ControlConnection.DirListingQ Queue property.
The format of the Queue looks like this

Name                            string(FILE:MAXFILENAME)
Shortname                       string(13) ! Never used - just here because of the DirListing structure
Date                            long
Time                            long
Size                            long
Attrib                          byte
NoOfLinks                       long
Owner                           string(50)
GroupOwnership                  string(50)
AccessPermissions               string(50)


You won't necessarily have all the information in your listing, and hence you won't necessarily be able to fill in all the fields. Apart from the Name though the fields are optional.

Find the _FillDirListingQ_FormatCustom method in your procedure by right-clicking on your ftp procedure in your application tree, and choosing Source. Then search for _FillDirListingQ_FormatCustom. Again, after the parent call, add the code to dechiper the listing.

For example

  ReturnValue = PARENT._FillDirListingQ_FormatCustom(p_Line)
  If self._DirListingFormat = 201 ! The number we set in step 1
    ! decipher the string into the queue here. For example if the name is
    ! always in the string from position 1 to position 20
    self.ControlConnection.DirListingQ.Name =
    ! or, if the line contains dir in the first column then the file is a directory name
    if sub(p_line,1,4) = 'dir '
      self.ControlConnection.DirListingQ.Attrib = ff_:DIRECTORY
    end
  End
 

You will find the code that deciphers the known formats in the methods
_FillDirListingQ_Format01 etc. Having a look at these can be helpful in seeing what approaches you can take to filling the queue fields.

Cheers
Bruce

119
News And Views / NetTalk 4.29 Released
« on: September 07, 2007, 05:28:37 AM »
NetTalk 4.29 has been released.
This looks like a pretty good build, so grab it and let me know.
http://www.capesoft.com/accessories/downloads.htm#nettalk

Cheers
Bruce

Release Notes:
---------------------
NOTE: Pictures now apply to Display fields. If you have used long display fields, you may need to set the picture to '' to suppress it clipping the string.

    * Add: Support for GlobalErrors class (for those who use the Procedure name from there)
    * Add: new example 39 - integrating with CapeSoft MessageBox
    * Add: new example 40 - demonstrates serving static files from BLOB's. Also demonstrates serving static files from folders other than the web folder.
    * Add: read-only option to Drop controls.
    * Add: property for "required" comment, p_web.Site.requiredText.
    * Add: Support for Insight Graphs in Legacy web servers added.
    * Add: Support for "Send new value to server" added to "Display" Form fields (Buttons, Images and Hyperlinks) even if the form field also has a URL.
    * Add: Auto-Complete option added to String and Date Form fields. Auto-Complete is automatically disabled if the field is dynamic, or is a password. Auto-Complete is optional to the end user, who can turn it off in his browser.
    * Add: Report procedures can be called as functionname.pdf as well as just functionname.
    * Add: Dictionary validation (on the whole record) has been added to the ValidateRecord routine.
    * Add: Before doing an Insert, or Update, Non-Autonumbering Keys are checked to see if a Duplicate will be triggered.Change: Ability to set CSS class for Display fields on form (without having to fill in Display Text).
    * Change: Client-Side tab simplified a bit. Move "refresh: Prompt   Value  Server" into "Reset" list. Once done the options to specifically reset itself disappear.
    * Change: When the browse is called as a lookup, it's a lot smarter about what record it jumps to.
    * Change: All form elements (prompts, values, comments) are wrapped in a DIV which seems to solve some of the layout issues. In the past only dynamic form elements were enclosed in a DIV.
    * Change: Forms (containing a browse) can now be used as a Lookup URL. This allows for complex filtering on lookup browses. However note that none of the form fields on this lookup page should be a STRING with LOOKUP of it's own. In other words a lookup inside a lookup is not allowed.
    * Change: Hand-code HTML tabs changed to XHtml, since that's what it needs.
    * Added parameter to .RenameFile method, makes moving incoming files easier.
    * Fix: Browse Delete button could get invalid "Action" in some cases.
    * Fix: Add D06 and D02 to supported date pics (in addition to D2 and D6)
    * Fix: If a form field spans the prompt/value/comment columns then the prompt is top-aligned, not bottom-alligned.
    * Fix: Text fields can now be used dynamically (ie Send new value to server).
    * Fix: Before Div and After Div html embed points
    * Fix: Setting the Comments Class blank on a form could cause a compile error.
    * Fix: Headings, and Sub-headings can have special chars (eg <)
    * Fix: Translation added to Sub-heading on Browse.
    * Fix: If Allow Unfilled is on, then disabling of Next & Last buttons failed at end of file.
    * Fix: Disabling of buttons under IE just hid the graphic.
    * Fix: Blank, unfilled, lines did not take conditional columns into account.
    * Regression: fix use of %nFieldFile
    * Regression: automatically format Display fields if picture set in dictionary.
    * Regression: a few examples needed a "touch" to compile correctly.


120
There are many techniques that malicious programs use to try and get your web server to do something it's not supposed to do. NetTalk on the other hand employs several techniques to try and prevent both known, and unknown attacks.

One of these techniques is the ValidateFileName method which is part of the WebHandler class (NetWebServerWorker). Inside this method is code that expressly prevents the server from serving (or indeed running) Exe, Com and Pif files.

This can result in 2 problems however.

Firstly, if you change the name of your web folder to something including these extensions, then all files in that folder will be suppressed. For example, if you named your folder
www.capesoft.com
then the ".com part will trigger this method and any files in that folder will be suppressed.

Secondly you may want to serve EXE files directly from your site. (Be aware that some users will be unable to download EXE files directly because of restrictions on their end). If the file has a .EXE extension (or indeed even just .EXE in the name) then the file will not be served.

An obvious solution to the first problem is simply to rename your folder. However a more generic solution to both problems is to modify the behavior in the ValidateFileName method.

You can do this by going to your WebHandler procedure, right click on the procedure name, and choose "Source". Then do a search for ValidateFileName.

The code currently inside that method (inside the class) looks like this;
  if clip(p_FileName) = ''
    return (-1) ! blank file name
  elsif instring('..', p_FileName, 1, 1)
    return (-2)  ! prevents hacking
  elsif instring('.exe', lower(p_FileName), 1, 1) ! may possibly mean .exe files can not be served? probably a good thing.
    return (-2)  ! prevents hacking
  elsif instring('.com', lower(p_FileName), 1, 1)
    return (-2)  ! prevents hacking
  elsif instring('.pif', lower(p_FileName), 1, 1)
    return (-2)  ! prevents hacking
  end
  return (0)

Using this code as a starting point, write your own code in the WebHandler, before the call to Parent.ValidateFileName.  If you do a RETURN before the parent call, then the code in the main class will not run at all.

By editing the code above you can tweak this security behavior to suit your needs.

Cheers
Bruce

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