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 ... 4 5 [6] 7 8 9
76
News And Views / Forums need testing
« on: May 15, 2010, 08:45:42 PM »
Hi

I'm in the process of building some forum software written in NetTalk. I have a demo running now at http://forums.capesoft.com. [update - I had the link wrong earlier.]

I'd appreciate it if you'd take a couple minutes to swing past, add an entry - it can be complete nonsense - and perhaps a reply or two. I'll almost certainly blow all the postings away sometime next week when we release it "for real".

At this stage I'm interested in any suggestions (obviously it's very early days, and I've not released a bunch of features it can already do) - but in the general way it works, or looks, I'm very keen on getting some feedback. The approach to adding  user is a bit different, and the way posts are displayed, and the way you can browse through posts is very different to normal web forums, so I'm particularly interested in those aspects right now.

We'll be releasing the source to this program, probably at some extra cost though. I'd like to get some idea whether this is something worth spending time on from a wider point of view, or only for our purposes, and this is the easiest way to do that - as well as show some return on the work done.

Cheers
Bruce

77
In some cases the user clicks on a link to get a "page", but in reality that page is generated on the fly, served to the user, then possibly deleted.

The most common instance of this is with a report, and in the case of a report it's all done for you by the report extension template. However it's equally straightforward to generate any file in this way. It might be a PDF, or any other kind of file.

1. Create a new NetWebPage procedure. This will be the URL that the user uses to ask for this document.

2. Set the "Page Type" of the procedure to "FILE"

3. Set the FileName of the procedure to some local variable, (which you need to declare) - for example
loc:filename

4. In the "Before Header" embed point add your code to generate the file*. Note that you should set the loc:filename variable here to contain the name of the file you are generating.
 
5. (optional). The page will attempt to determine the correct Content-type header based on the extension of the file you create. So if you create a file with a pdf extension it'll set the content type as if it's a pdf file. You can override this property if you need to in the "Processed Code" embed, priority 1200.

6. In the same place as 5, set the Content-Disposition of the file you are sending, if you do not want (or not expect) the browser to be able to display the file. For example, the following line tells the browser to display the "save as" screen, and supplies the default file name.

  p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&clip(loc:fileName)&'"'

7. (optional). If you want to delete the file after it has been sent, then add code to the Processed Code embed, priority 9500.

Example 50 (File Download) is a good example to study if you want to do this sort of thing.

* In step 4 you add the code to generate the file. If this process is slow (ie takes more than 30 seconds) then you need to keep the browser "interested" while you are taking your time to generate. The way to do this is to add calls to

  p_web.NoOp()

during the generation process. You can (and should) call this method inside loops etc. Don't worry about over-doing it, the method itself is smart enough  to cope with that.

cheers
Bruce



[attachment deleted by admin]

78
Web Server - Share Knowledge / Character Sets
« on: May 06, 2010, 08:00:41 AM »
NetTalk Version 5, PR16 or later applies.

update - PR20 adds support for Spanish

Introduction

Many countries use more than the basic ASCII Roman character set. Handling data with extended character sets can be tricky. There are two basic ways your data may be stored. Please read this section and then decide which way needs to be handled in your situation.

Web HTML Charset

Set the HTML Charset on the Advanced tab of the WebServer procedure settings. The following information ONLY applies if you have the HTML Charset set to 'utf-8'.
Regardless of the way your data is stored, I recommend setting the charset to utf-8.

Utf-8 is an encoding scheme for encoding unicode characters. The reasons for choosing utf-8 is outside the scope of this article.

Data Stored as utf-8

If your app is exclusively a web app, and data will be entered via a browser, and displayed via a browser, then the data can be stored in the database in utf-8 format. If you are using a SQL engine it's also possible that other (non Clarion) apps, that support utf-8, will be happy with this approach.

This is the default approach for NetTalk, if the charset is set to utf-8.

Data Stored as a "code page"

If your data has been captured by a Clarion program, or will be displayed by a clarion program (INCLUDING a Clarion Report) then the data must be converted to a specific code page for storage, and converted back to utf-8 when being displayed in a web page. This makes the data limited to one specific code-page - however in most cases that is ok, since your Clarion app was limited in that way anyway.

Support for each language has to be added on a case-by-case basis. So far support has been added for;
Polish (PR16), Spanish (PR20)

If you use an extended characters that aren't in the list of languages above, then please contact me. I may need some minor information from you, but it should be straight-forward to add support for other languages.

At this stage you will need to set a setting, in embed code, in the web server procedure. (ie it isn't yet a template option.) In the web server procedure, in the "Override Default Server Settings" "NetTalk Object After s_web assigned" embed point, add a line of code something like this;

s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsPolish
or
s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsSpanish

As more languages are added, more equates will be available as well. It's also possible that regions will be introduced which span multiple countries that share characters.


79
I had a discussion a few months back with someone regarding the problem of using non-ascii characters in both a Windows program and Web program. The Windows program is Charset based (and the characters are stored in the data file in this way) but the Web is utf-8 based and characters entered here don't appear correctly in the TPS file.

I seem to remember it was around either Latvian or Hungarian character sets.

I remember the answer at the time was less than completely satisfactory. I've recently added some support which makes the above layout possible, however there is some coding I need to add on a language-by-language basis. (I've only done Polish so far). So if you are using foreign characters, and mixing them between windows and the web, please let me know.

Cheers
Bruce

80
Web Server - Share Knowledge / Lookups
« on: April 28, 2010, 02:03:05 AM »
I've done a document on Lookups in NetTalk 5. It's something of a work-in-progress, but serves to highlight two new features in recent NetTalk builds (PR12 and PR13).

Comments welcome, please let me know if anything is unclear.


[attachment deleted by admin]

81
News And Views / NetTalk Webserver Workshop 2010
« on: April 21, 2010, 01:52:16 AM »
Hi folks,

I'm thinking of running a NetTalk WebServer workshop sometime this year, probably around September or October.

At the moment I don't really have any locks on where, when, how long, how much etc - hence this note.

I _think_ it would be best done as 2 days, where day 1 is for beginners, or those just starting out, and day 2 is more for those who want a little more in-depth knowledge. People could then sign up for just day 1, just day 2, or both days. I _think_ this would be a good way to go, but obviously it depends completely on what you want.

So - if you are interested in attending a workshop send me an email (details below).

Tell me where you are so I get some idea of what locations would work. Obviously I can't be everywhere, but I'll try and do the best I can for the most people I can.

If you are interested in hosting an event in your town or city also let me know. This is one way to up the chances of you getting an event locally. Hosting is reasonably little work - it usually boils down to finding a suitable venue and acting as the local liaison with them.

Cost-wise the goal will be to make it as low cost as possible. Obviously there are costs involved, and we'd need to at least break even, but this isn't aimed at being a massively profitable exercise, the goal is rather to touch base with those that are building web servers, and those that think they could be writing better programs.

So, if you have any comments please email me at bruce dot johnson at you know where. For easy allocation of the emails please put NetTalk 2010 into the subject line.

Thanks again.

Cheers
Bruce

82
NetTalk 5, PR12 and later applies.

NetTalk makes extensive use of jQuery - this thread is one of a series of threads on information that may be useful in understanding how jQuery and the NetTalk code fit together.

The goal of this article is to explain the use of the jQuery method, and the loc:options variable.

The jQuery Method

When adding a jQuery item to a page, a common script syntax is often used to initialize the object. The script usually looks something like this;

Code: [Select]
<script type="text/javascript">
$(function() {
$("#div_id").some_action(some_options);
});
</script>

rather than repeatedly create this text a simple method has been created to do the heavy lifting.

Code: [Select]
p_web.jQuery(id,action,options,<more>)
This method returns a string so is usually used like this;

Code: [Select]
packet = p_web.jQueuy('some_div_id','some_action',loc:options)
do Sendpacket

The loc:options variable

Whenever the template generates a call to the jQuery method, it also has an embed point right before the call. This embed point allows you to edit the loc:options variable, which is then used in the call to the jQuery method. By examining the options available (ie by reading the jQuery documentation), you can thus override, or add to, the options being generated by the template.

In this way you have access to all the functionality of any jQuery component which is being used, even if there isn't a specific template option to match every option provided by the jQuery component.

Related methods

A number of the methods in the classes call the jQuery method internally.

CreateDateInput:
The p_Options parameter is passed on to the jQuery call internally. Some items (dateFormat, minDate, maxDate) are added to the options, IF they are not included in the p_Options parameter.

CreateButton:
The p_Options parameter is passed on to the jQuery call internally. Some of the options (text, icons, disabled) are deduced based on the values of other parameters.









83
News And Views / NetTalk ClarionLive Webinar this week
« on: March 03, 2010, 07:41:30 AM »
Hi All,

I'm doing a webinar on www.clarionlive.com this week (Friday, around 5pm GMT) on the WebClient class. Specifically I'll be looking at some features added to the class in NetTalk 5, and using the class to consume web pages, and web services. The webinar is open to all, so if you're interested in this sign up at ClarionLive.

Cheers
Bruce

84
News And Views / Clarion 7.1
« on: December 23, 2009, 05:49:32 AM »
I've uploaded new Clarion 7.1 builds of NetTalk 3, NetTalk 4 and NetTalk 5 to the CapeSoft web site, so if you're using Clarion 7.1 then please use one of these builds.

Cheers
Bruce

85
Web Server - Share Knowledge / Customising the Date Lookup widget
« on: December 08, 2009, 12:19:06 AM »
As you may know by now, NetTalk 5 uses jQuery. And jQuery has a very powerful Date Picker widget, which is now the date picker in NetTalk 5.

Some of the options in the DatePicker are supported directly by the template (the date limits for example) but most options have to be set in embed code. The goal of this post is to show how and where to put this embed code.


jQuery options documentation

http://jqueryui.com/demos/datepicker/#options
I'm not going to duplicate that documentation here, so feel free to go there and have a look at some of the options.

Setting options globally

The SitesQ has a new property, DateOptions. So this can be set either in the WebServer procedure, or (better) in the WebHandler procedure, in the ProcessLink method (before the parent call).

For example; (in web handler)
  self.site.dateoptions = 'numberOfMonths: 3'

Translations

One big use for setting options is non-english sites. for example;
Code: [Select]
Self.site.DateOptions = 'monthNames: [''Januarix'', ''Februarix'', ''Marchix'', ''Aprilix'', ''Mayix'', ''Juneix'', ''Julyix'', ''Augustix'', ''Septembix'', ''Octobix'', ''Novembix'', ''Decembix''], monthNamesShort: [''Jax'', ''Fix'', ''Max'', ''Apx'', ''Mix'', ''Jux'', ''Jix'', ''Aix'', ''Six'', ''Oix'', ''Nix'', ''Dix'']'
There's also options there for day names, first day of the week, and so on.

Date Picture

You can set the Date Picture for your site on the Web Server procedure, (General Tab) and also for each field individually as before. The one big difference is that it supports a lot more date pictures than NT4. As far as I know all date pictures supported by clarion (up to @D16) are supported.

Setting options locally

You can also set options specifically for each date lookup. This is useful if you want one (or more) date pickers to behave differently to the global default.

To do this, right-click on the procedure in question, and search for
.CreateDateInput
There's an embed point right before that call where you can set a variable called loc:options
you can either add to the global options as in...
Code: [Select]
loc:options = clip(p_web.site.DateOptions) & ',numberOfMonths: 3'or override it completely as in...
Code: [Select]
loc:options = 'numberOfMonths: 3'

86
Web Server - Share Knowledge / Useful jQuery URL's
« on: December 03, 2009, 09:34:39 PM »
NetTalk 5 is now using the jQuery framework as the primary client-side JavaScript framework.

While you do not need to know any jQuery to use NetTalk, one of the reasons for choosing it is because it is so powerful, and extendable.

The goal of this thread is to act as a repository for links that may be useful if you are starting out on the jQuery road, and want to learn more.

Good starting points

http://jquery.com/ - The jQuery Home page.
http://plugins.jquery.com/ -- Starting page for the list of jQuery plugins.

Documentation for components integrated into NetTalk

http://jqueryui.com/demos/datepicker/ -- documentation for the DatePicker control (which NetTalk uses for date fields).
http://jqueryui.com/demos/accordion/ -- documentation for the Accordion control, used for the accordion tabs and menus.
http://jqueryui.com/demos/tabs/ -- documentation for the Tabs control, used for the "Tabs" tab style.

Books

I found the following books helpful
http://www.packtpub.com/learning-jquery-1.3/book/mid/1802090m1d2r -- Learning jQuery 1.3
http://www.packtpub.com/jquery-reference-guide-Open-Source/book -- jQuery Reference Guide

External sites of interest

Mark Riffey found these:
http://jquerystyle.com/ -- A gallery showing sites built with jQuery

http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-video-series/ -- jQuery for Absolute Beginners Video Series.





87
News And Views / Version 4.38
« on: November 11, 2009, 04:50:20 AM »
A maintainance build, 4.38, has been uploaded to our usual downloads page.

http://www.capesoft.com/accessories/downloads.htm#nettalk

Cheers
Bruce

88
News And Views / NetTalk Version 5 Release Announcement
« on: September 29, 2009, 09:54:12 PM »
Hi All,

Well it's official. We'll be releasing the first public edition of NetTalk 5 at the OzDevcon in Eden this year. I'll do a "special bonus session" at end of day Monday (October 12th) and after that NetTalk 5 will be available to the public.

During the session I'll focus on the changes to the web server, and the new stuff that's been added - some of which you already know about, and some of which is less well known.

For those attending the Devcon I'll be available during the week to assist with upgrading apps from NetTalk 4 - so those bringing laptops should definitely come prepared.

I hope to record the session and post it online sometime in the week that follows.

Cheers
Bruce

89
News And Views / Version 4.37
« on: August 25, 2009, 10:40:43 PM »
This is a maintainence release for Version 4.
Available from http://www.capesoft.com/accessories/downloads.htm

# Fixed other-button error that affects IE users.
# Fixed problem with form fields, containing + and % chars, on a form with a file upload field.
# Fixed Multi-Proj support for Clarion 7 (library names.)
# Fixed bug where there was a space char in unique key components, and children existed.
# Added support to NetWebSource so if there's a timer, and the procedure is a child, then it'll update correctly.
# Added no-cache header stuff to generated error page.
# Added template extension for PDF-Tools report version 4.
# Enabled template options to set classes for buttons in a browse.
# Added optional Class parameter to CreateImage method
# Fixed bug where connection was closed before sending browse click response.
# Fixed support for spanning header columns with server-side sorting
# Added width and span parameters to CreateSortHeader method

Cheers
Bruce

90
Web Server - Share Knowledge / Clarion Builds (9058 etc.)
« on: August 03, 2009, 10:42:56 PM »
One user, who has been having a problem with GPF's in a SSL based site (after a random, but large, number of page views) has reported that the error went away when upgrading Clarion from 9056 to 9058. The test involved running 12 to 15 clients against a single server, with a page on a 2 second timer. In other words generating about 5 to 10 page views per second. The same test reported no problems under either build for a non-secure version of the site.

The database was TPS.

One data-point does not a trend make, but I thought I'd mention it here because it clearly shows some importance to the 9058 build. If you are having a problem then 9058 might be a good build to use. (9058 is also the preferred build for MsSql users
for SQL related issues.)

Cheers
Bruce


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