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.
1
Your Views and Comments / Re: Suggestions for Nettalk 6
« on: October 08, 2011, 08:00:05 PM »packet = clip(packet) & '<li>' & LOG:Description & ' recorded at ' & Format(LOG:Time, @T1)
How about returning such a formatted string from the function?
Hi Wolfgang,
That wouldn't be such a problem, but then we have the additional overhead of opening the same file(s) in the other procedure to build the string.
However, my main objective is the 'wrap' the output in a loop. In this case, there could be one, twenty, two hundred lines that I need to generate, and returned such a large block of text could be problematic, especially when you are up against maximum packet size (16K) that NT can send to the client at any one time.
Cheers,
Devan
2
Your Views and Comments / Re: Suggestions for Nettalk 6
« on: October 07, 2011, 04:36:33 AM »Good suggestion, but you can actually do this already.
Create a procedure, based on netwebsource, which generates the html you want.
Then you can "embed" this in your xhtml as
<!-- Net:functionname -->
Cheers
Bruce
That is fantastic Bruce! I had completely forgotten that you could call other procedures using these tags. Now, for my next question - can you call ROUTINEs using similar tags?
Reason being, in most of my NetWebPages, I have sections for a header, perhaps a sidebar or menu, then the content, then the footer. In a lot of cases, the content bit requires a repeated element, such as a list of log entries from a database. Because all the files I need are already open in the Procedure, it would be handy if I could use <!-- Net:r:MyRoutine --> and then within the code:
MyRoutine ROUTINE
Set(MyFile, 0)
Loop
Next(MyFile)
If Error() Then Breal.
packet = clip(packet) & '<li>' & LOG:Description & ' recorded at ' & Format(LOG:Time, @T1)
End
Do SendPacket
Keeps everything for that page contained within the one Procedure instead of scattering across many...??
3
Web Server - Ask For Help / Re: Auto directing after user login - How?
« on: October 02, 2011, 04:33:57 PM »
Hi Ubaidullah,
Wow - It's THAT simple!!
Never realised that this was the default behaviour - I've been filling in that field in ALL my NetTalk apps to redirect to the main portal page. Now I know.
Thanks very much for the immensely useful tip!
Cheers,
Devan
Wow - It's THAT simple!!
Never realised that this was the default behaviour - I've been filling in that field in ALL my NetTalk apps to redirect to the main portal page. Now I know.
Thanks very much for the immensely useful tip!
Cheers,
Devan
4
Web Server - Ask For Help / Auto directing after user login - How?
« on: October 01, 2011, 10:37:49 PM »
Hi all,
We have a project developed in NetTalk 5 which is a fairly basic user project messaging portal that requires a login to use.
Part of the functionality is that when a message is sent to a user on the portal, an email is sent to the recipient with a link back to the specific project in the portal e.g.: http://www.myportal.com/projects?projectID=12345
Now, these pages are set to only display if logged in, and I love the way that NetTalk automatically takes the user to the login screen if they are not already logged in so they can do so.
However, once they log in, they are taken to the main portal dashboard, and not to the link that they were trying to head to.
What is the neatest way to capture the original page reference, so that once the login procedure is completed, it can redirect the user to the project page that they wanted to do to? (and conversely if they are doing a normal login then just go to the dashboard?)
Thanks,
Devan
We have a project developed in NetTalk 5 which is a fairly basic user project messaging portal that requires a login to use.
Part of the functionality is that when a message is sent to a user on the portal, an email is sent to the recipient with a link back to the specific project in the portal e.g.: http://www.myportal.com/projects?projectID=12345
Now, these pages are set to only display if logged in, and I love the way that NetTalk automatically takes the user to the login screen if they are not already logged in so they can do so.
However, once they log in, they are taken to the main portal dashboard, and not to the link that they were trying to head to.
What is the neatest way to capture the original page reference, so that once the login procedure is completed, it can redirect the user to the project page that they wanted to do to? (and conversely if they are doing a normal login then just go to the dashboard?)
Thanks,
Devan
5
Web Server - Ask For Help / Re: How to get at photos on server in different folder?
« on: October 01, 2011, 10:31:02 PM »
Guys,
Probably the best way to do this (if you are using Win Vista/Win 7/Win 2003/Win 2008 as the NetTalk server) is to use symbolic links.
We use it on one of our NetTalk projects to link to mass storage on another drive and it work very well.
Basically, if your NetTalk app is in C:\Apps\MyApp and your photos are stored on G:\Data\Photos\WebPhotos and you want the web user to be able to view these photos under the /photos folder on the web server, then you can run the following command:
You can still create/delete files and folder in G:\Data\Photos\WebPhotos and any changes will be reflected in C:\Apps\MyApp\web\photos - after all, it is just a virtual link to the other folder.
Hope this helps,
Cheers,
Devan
Probably the best way to do this (if you are using Win Vista/Win 7/Win 2003/Win 2008 as the NetTalk server) is to use symbolic links.
We use it on one of our NetTalk projects to link to mass storage on another drive and it work very well.
Basically, if your NetTalk app is in C:\Apps\MyApp and your photos are stored on G:\Data\Photos\WebPhotos and you want the web user to be able to view these photos under the /photos folder on the web server, then you can run the following command:
Code: [Select]
mklink /d C:\Apps\MyApp\web\photos G:\Data\Photos\WebPhotos
You can still create/delete files and folder in G:\Data\Photos\WebPhotos and any changes will be reflected in C:\Apps\MyApp\web\photos - after all, it is just a virtual link to the other folder.
Hope this helps,
Cheers,
Devan
6
Your Views and Comments / Re: Suggestions for Nettalk 6
« on: September 18, 2011, 08:43:05 PM »
My suggestion for NT6 would be some sort of way that we can embed run time evaluations in XHTML snippets.
At present, we have to calculate the expression, and load it into the value or session queue, e.g.
LOC:MyString = 'John is ' & (Today() - STU:DateOfBirth)/365 & ' years old'
p_web.SetValue('MyExpression', LOC:MyString)
and then in the XHTML, do:
<!-- Net:v:MyExpression -->
to 'embed' this variable within the HTML sent to the web browser. Wouldn't it be handy if we could do something like:
<!-- Net:x:['John is ' & (Today() - STU:DateOfBirth)/365 & ' years old'] -->
and get NetTalk to EVALUATE() then expression at run time?
At present, we have to calculate the expression, and load it into the value or session queue, e.g.
LOC:MyString = 'John is ' & (Today() - STU:DateOfBirth)/365 & ' years old'
p_web.SetValue('MyExpression', LOC:MyString)
and then in the XHTML, do:
<!-- Net:v:MyExpression -->
to 'embed' this variable within the HTML sent to the web browser. Wouldn't it be handy if we could do something like:
<!-- Net:x:['John is ' & (Today() - STU:DateOfBirth)/365 & ' years old'] -->
and get NetTalk to EVALUATE() then expression at run time?
7
Web Server - Ask For Help / Re: Problem with DUPLICATE() in WebForm
« on: September 12, 2011, 04:11:28 PM »
Thanks Bruce & Thys,
Yeah - this one has got me stumped. Thys - I have scoured the database. There are no blank ID's there at all. The problem NEVER comes up when adding a new record - only when CHANGING an existing one...and always only on certain records.
The problem doesn't 'move around'. It is the same 4 or 5 records in a set of 20 that constantly refuse to save.
In any case, I did a forced EXIT out of the CheckForDuplicates routine, and things still seem to work well, so I will keep my fingers crossed and go live... !
Cheers,
Devan
Yeah - this one has got me stumped. Thys - I have scoured the database. There are no blank ID's there at all. The problem NEVER comes up when adding a new record - only when CHANGING an existing one...and always only on certain records.
The problem doesn't 'move around'. It is the same 4 or 5 records in a set of 20 that constantly refuse to save.
In any case, I did a forced EXIT out of the CheckForDuplicates routine, and things still seem to work well, so I will keep my fingers crossed and go live... !
Cheers,
Devan
8
Web Server - Ask For Help / Problem with DUPLICATE() in WebForm
« on: September 12, 2011, 03:08:37 AM »
I've just come across a strange problem that I hope someone here can help with. I am not sure if it is a NetTalk WebServer problem, or an ODBC driver problem, or a MySQL problem?
In short: We have a NetTalk web app that talks to a back end MySQL database via ODBC. Standard template NetWebBrowse -> NetWebForms. Within the database, we are using VARCHAR(64) fields as the unique ID, and I am generating a GUID using the IceTips tools to prime these ID fields when a new record is added.
All seems to be going OK, and when I check the MySQL database, the GUID's are being saved nicely, along with all the other data.
But when testing, I find that when I edit some of the records, and click the 'Save' button, I am getting a 'Duplicate Key Found PRIMARY --> CLI:ID' which is happening in the CheckForDuplicate routine.
PRIMARY is the name of the key, which only has CLI:ID as the only unique, primary key field in it.
Wierd in that it only happens on SOME records, not all. Is this a bug in the ODBC driver, (I am using v3.51) or with MySQL?
Because I am generating long GUIDs manually, I don't think we will ever have the occurance of a duplicate value in the database, so to circumvent this, I have just put an EXIT at the top of that routine however I am nervous that this might break something else?!? Did I do the right thing?
Thanks!
Devan
In short: We have a NetTalk web app that talks to a back end MySQL database via ODBC. Standard template NetWebBrowse -> NetWebForms. Within the database, we are using VARCHAR(64) fields as the unique ID, and I am generating a GUID using the IceTips tools to prime these ID fields when a new record is added.
All seems to be going OK, and when I check the MySQL database, the GUID's are being saved nicely, along with all the other data.
But when testing, I find that when I edit some of the records, and click the 'Save' button, I am getting a 'Duplicate Key Found PRIMARY --> CLI:ID' which is happening in the CheckForDuplicate routine.
PRIMARY is the name of the key, which only has CLI:ID as the only unique, primary key field in it.
Wierd in that it only happens on SOME records, not all. Is this a bug in the ODBC driver, (I am using v3.51) or with MySQL?
Because I am generating long GUIDs manually, I don't think we will ever have the occurance of a duplicate value in the database, so to circumvent this, I have just put an EXIT at the top of that routine however I am nervous that this might break something else?!? Did I do the right thing?
Thanks!
Devan
9
Web Server - Ask For Help / WebServer IP Address
« on: September 12, 2009, 07:00:06 PM »
We are looking for a way to give our users the choice of IP Addresses to bind their NetTalk web server to (e.g. they may only want to serve on their local IP address range instead of the public IP).
I was hoping to give them an admin screen with the list of available IP's in a drop down - this would hopefully reduce our support load in the end as we wouldn't have to step our users through how to find out the list of available IP addresses on their server.
Is there in internal NetTalk function which would give us a list of valid IP addresses on the machine it is running on, or do we have to resort to the Windows API for this information?
Thanks,
Devan
I was hoping to give them an admin screen with the list of available IP's in a drop down - this would hopefully reduce our support load in the end as we wouldn't have to step our users through how to find out the list of available IP addresses on their server.
Is there in internal NetTalk function which would give us a list of valid IP addresses on the machine it is running on, or do we have to resort to the Windows API for this information?
Thanks,
Devan
10
Web Server - Ask For Help / Re: Running NetSimple in a Source module (Not a Window)
« on: December 16, 2008, 11:08:12 PM »
Thanks for the clarification Bruce!
I am looking to create this application as a WebServer, and using SelfService to make it into a background service. My process will be running on a timer, or may in fact get invoked by a web client request. Will this cause an issue with Vista security etc. if the service keeps 'popping up' an invisible window from time to time? Will it also cause the currently running application on the user's PC to lose focus?
I haven't 'gone all the way' and tested this under XP or Vista, in case someone else here has already done it and can advise me??
Thanks,
Devan
I am looking to create this application as a WebServer, and using SelfService to make it into a background service. My process will be running on a timer, or may in fact get invoked by a web client request. Will this cause an issue with Vista security etc. if the service keeps 'popping up' an invisible window from time to time? Will it also cause the currently running application on the user's PC to lose focus?
I haven't 'gone all the way' and tested this under XP or Vista, in case someone else here has already done it and can advise me??
Thanks,
Devan
11
Web Server - Ask For Help / Running NetSimple in a Source module (Not a Window)
« on: December 16, 2008, 02:05:44 AM »
Hello all,
I am looking at creating a small procedure which uses NetSimple to send some packets of data up to a server, then listen for some incoming packets.
I would like to create this procedure as a 'Source' procedure instead of a 'Window' or 'Progress' which contains the structure for a window.
I am guessing that this cannot be done, as NetTalk listens and processes all it's events on the window's ACCEPT loop?
Cheers,
Devan
I am looking at creating a small procedure which uses NetSimple to send some packets of data up to a server, then listen for some incoming packets.
I would like to create this procedure as a 'Source' procedure instead of a 'Window' or 'Progress' which contains the structure for a window.
I am guessing that this cannot be done, as NetTalk listens and processes all it's events on the window's ACCEPT loop?
Cheers,
Devan
12
Web Server - Ask For Help / Re: NetSimpleClient - checking for connection closed
« on: December 11, 2008, 08:40:55 PM »
Hi flashpot - thanks for the reply.
PageReceived() works beautifully in NetWebClient, however I am using NetSimpleClient, which is a lot more Spartan that the WebClient.
AFAIK - NetSimpleClient fires the Process() method each time a packet of data comes in, which is fine, however, I have no idea when the last packet is received, unless the connection eventually times out. If there was some way to work out which packet finishes the stream then it would all be fine and dandy. I thought that putting the cleanup code in ConnectionClosed() method would work, but it looks like the Amazon server uses persistent connections and keeps it open until I close it - which is difficult to do if I am not sure when to close it in the first place!!
This is regardless of whether I include the "Connection: close" header line when sending my request.
It looks like I will have to parse the returned header to find out the "Content-Length" property and check that against the data downloaded to see if I have got it all. What makes this harder is that Amazon returns some requests as "chunked" data which means I have to wait until it sends me a zero size chunk command, which can be in the middle of the second last packet....aaaargh!
Making this even harder is that there is no way to separate the returned header from the data in NetSimpleClient. I will have to manually parse the first packet to split the header out and identify each line.
I wonder how hard it would be to hack the code and try to inherit some of the NetWebClient methods into my NetSimpleClient object?!?!?!?!
Cheers,
Devan
PageReceived() works beautifully in NetWebClient, however I am using NetSimpleClient, which is a lot more Spartan that the WebClient.
AFAIK - NetSimpleClient fires the Process() method each time a packet of data comes in, which is fine, however, I have no idea when the last packet is received, unless the connection eventually times out. If there was some way to work out which packet finishes the stream then it would all be fine and dandy. I thought that putting the cleanup code in ConnectionClosed() method would work, but it looks like the Amazon server uses persistent connections and keeps it open until I close it - which is difficult to do if I am not sure when to close it in the first place!!
This is regardless of whether I include the "Connection: close" header line when sending my request.
It looks like I will have to parse the returned header to find out the "Content-Length" property and check that against the data downloaded to see if I have got it all. What makes this harder is that Amazon returns some requests as "chunked" data which means I have to wait until it sends me a zero size chunk command, which can be in the middle of the second last packet....aaaargh!
Making this even harder is that there is no way to separate the returned header from the data in NetSimpleClient. I will have to manually parse the first packet to split the header out and identify each line.
I wonder how hard it would be to hack the code and try to inherit some of the NetWebClient methods into my NetSimpleClient object?!?!?!?!
Cheers,
Devan
13
Web Server - Ask For Help / NetSimpleClient - checking for connection closed
« on: December 11, 2008, 04:29:19 AM »
Hi all,
I am playing with the NetSimpleClient object to send GET and POST requests to Amazon.
The problem is, I cannot see any way to check if the server has finished sending me data back. Is there a property somewhere that will tell me the server has done the job and is finished?
Data coming back can range from 100 bytes up to 10 megabytes (I am sending queries to Amazon S3).
I have tried putting code in the ConnectionClosed() point, but this never seems to be called?!?!
Thanks,
Devan
I am playing with the NetSimpleClient object to send GET and POST requests to Amazon.
The problem is, I cannot see any way to check if the server has finished sending me data back. Is there a property somewhere that will tell me the server has done the job and is finished?
Data coming back can range from 100 bytes up to 10 megabytes (I am sending queries to Amazon S3).
I have tried putting code in the ConnectionClosed() point, but this never seems to be called?!?!
Thanks,
Devan
14
Web Server - Ask For Help / Re: PDF Not formatting correctly
« on: December 10, 2008, 04:51:47 AM »
Hi Neil,
From experience, it has something to do with the default printer that the client has installed on their system. Sounds silly I know, but I usually find that if I get the client to install a generic laser printer driver, such as an HP Laserjet 4 and set it as the default printer, it usually works OK (oh - dont forget to set the paper size to suit your region as well).
I believe it has something to do with the PDF renderer on the client's side taking some of the page settings from the default printer driver.
Give it a shot - I think it is worth a try. It has been some years since we had this issue, but I believe this solved it for us.
Cheers,
Devan
From experience, it has something to do with the default printer that the client has installed on their system. Sounds silly I know, but I usually find that if I get the client to install a generic laser printer driver, such as an HP Laserjet 4 and set it as the default printer, it usually works OK (oh - dont forget to set the paper size to suit your region as well).
I believe it has something to do with the PDF renderer on the client's side taking some of the page settings from the default printer driver.
Give it a shot - I think it is worth a try. It has been some years since we had this issue, but I believe this solved it for us.
Cheers,
Devan
15
Web Server - Ask For Help / Re: WebClient: POSTing large files
« on: December 02, 2008, 12:40:51 AM »
Hi Bruce,
Now I am confused - the document says to build the PostString as thus:
PostString = '--' & Clip(mimeBoundary) & '<13,10>' |
& 'Content-Disposition: form-data; name="SessionID"<13,10>' |
& '<13,10>' |
& Clip(sessionID) & '<13,10>' |
& '--' & Clip(mimeBoundary) & '<13,10>' |
& 'Content-Disposition: form-data; name="thisFormData"<13,10>' |
& '<13,10>' |
& Clip(PostForm) |
& '--' & Clip(mimeBoundary) & '<13,10>'
And I am assuming that the variable PostForm above is the binary contents of the file we are trying to upload. I am not sure how to handle it if the file is 1MB in size - wont the PostString variable max out at 16K or whatever and truncate the rest of the file data?
Thanks,
Devan
Now I am confused - the document says to build the PostString as thus:
PostString = '--' & Clip(mimeBoundary) & '<13,10>' |
& 'Content-Disposition: form-data; name="SessionID"<13,10>' |
& '<13,10>' |
& Clip(sessionID) & '<13,10>' |
& '--' & Clip(mimeBoundary) & '<13,10>' |
& 'Content-Disposition: form-data; name="thisFormData"<13,10>' |
& '<13,10>' |
& Clip(PostForm) |
& '--' & Clip(mimeBoundary) & '<13,10>'
And I am assuming that the variable PostForm above is the binary contents of the file we are trying to upload. I am not sure how to handle it if the file is 1MB in size - wont the PostString variable max out at 16K or whatever and truncate the rest of the file data?
Thanks,
Devan