NetTalk Central

Author Topic: Adding FM3 to my app  (Read 8111 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Adding FM3 to my app
« on: January 13, 2012, 02:30:35 PM »
As I am developing multiple login user capability I need to add FM3 to my app so that when  the user logs in, presumably the web app will update the files automatically in each user data folder.

I created a RTFM procedure and populated it etc. However when I run the app and manually call the  RTFM procedure it tells me the page cannot be found. I have not created a NetWeb page but a normal window and populated the FM3 controls onto that.

So how do you add FM3 to an app and get it to run?

Thanks

John

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Adding FM3 to my app
« Reply #1 on: January 13, 2012, 03:51:44 PM »
Hey John,

Explain what exactly what you are trying to do please?  What do you mean by, "multiple login user capability?"

Are you meaning the ability to have multiple user accounts to access one web app?

If so, you don't need FM3 for that.  You need FM3 for your structure changes but not this.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Adding FM3 to my app
« Reply #2 on: January 13, 2012, 08:42:00 PM »
You can add fm3 to an app to update the files but you can't do the RTFM current remotely.

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #3 on: January 14, 2012, 12:38:51 AM »
Hmm now I'm confused. I'll start over ...

Many users will access the one web app using a login id. That means that each user has their own data file. So my folder structure is .....

web app files ......
      web folder
      data folder
               user1 folder
               user2 folder
               user3 folder

So when I provide an update to the FILES I need FM3 to run to update those just as with a traditional Clarion app.

The problem is that I cannot run RTFM (as a separate app) in every single user folder.

HTH

John


bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Adding FM3 to my app
« Reply #4 on: January 14, 2012, 08:54:15 PM »
I'm not sue why you think you need the rtfm procedure at all. Fm3 will convert the files when it opens them.

Cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #5 on: January 15, 2012, 01:27:14 AM »
Sorry Bruce - that's my point. When I added FM3 I could not compile my app.

Will try again today and post any problems.

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #6 on: January 15, 2012, 02:22:10 AM »
OK got it working but 2 problems, one minor one major.

See attached - for some reason it does not like the MessageBoxLogFile. I took the file out of the dct and it worked but would be nice to know what the problem is.

Now for the major one ...

This is a MULTI login application. So if I have 1000 users all with their own data folders FM3 does not work as per the docs. Setting the upg path in the FM3 init embed triggers when the server app starts.

So I ended up putting the setupg path in the WebHandler Process link embed where I set my data paths. i.e.

ds_SetUPGPath('Data\' & clip(p_web.gsv('Login_ID')))
Glo:DataPathContact  = 'Data\' & clip(p_web.gsv('Login_ID')) & '\Contact.tps'
etc.

As all my user data folders are in sub folders of \Data'

First of all, is this correct (as it seems sensible to do it there) and secondly is there any impact on speed as every time the application makes a request to the server app FM3 will run all be it instantaneously.

I am wondering if the Options setting on FM3 "Open upg once" may help here. Also hioding the yellow window would probably be a good idea which i just noticed in the template settings.

Thanks

John

[attachment deleted by admin]

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #7 on: January 15, 2012, 02:55:56 AM »
Ok this has turned into a nightmare now and my app will not run properly. Here is why ...

Again a multi login scenario. Say I have 2 users UserA and User B. My folder structure is as follows:

Application Folder
         Data
                  User A Data
                  User B Data
 
In the web handler I set the data path using:

ds_SetUPGPath('Data\' & clip(p_web.gsv('Login_ID')))

I run my app and an upg.tps file is put into the Data folder. That is because at that time no user has logged in so it creates a duplicate set of files.

Now the user logs in and FM3 runs again and creates an upg.tps file in the User A Data folder. Great that's what I want.

BUT what is now happening is that every time a screen is accessed FM3 is telling me there is a file version not been updated. I am not absolutely sure why that is but I suspecting that the fact that FM3 is running multiple times is the cause.

So really I am pretty confused now. I wonder if there is a way to get the upg path set when the user longs in and only then? Or if I can make that upg path declaration conditional?

Thanks

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Adding FM3 to my app
« Reply #8 on: January 15, 2012, 09:00:38 PM »
Hi John,

you're taking something absurdly simple, and making it complicated.

I recommend you start again. Remove fm3 from your app completely - delete the upg.tps files, remove your embed code.

Then
a) add the Fm3 global extension.
b) do not do anything else.

Specifically do not add the Runtime File Manager procedure. You cannot use that via a web interface.

(Aside: The reason you got the error with the MessageBoxLogfile, which is in the RuntimeFileManager screen, is because you have the RTFM screen set to use all the files in the dict, but you are not generating all the files in your dict in this application.)

You do not need (nor I think want) multiple upg files. A single upg file will suffice.

In the longer run you will want to create a separate exe, which runs through all the data sets, opening all the files therein. This will allow you to upgrade all the files after an upgrade, without waiting for the user to access a file. Much better from a performance point of view to do the upgrade when the user isn't waiting. But that's down the road and not something you need to worry about now.

Cheers
Bruce


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #9 on: January 16, 2012, 07:33:12 AM »
OH!! I thought you HAD to have RTFM for FM3 to work.

Anyway - I am going to frame this post (or your last one) - you said delete the upg.tps file <g> - you must never never never do that according to the docs. <g>

I am still astounded it's as simple as that. I had better read up again exactly what RTFM does!

Thanks

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #10 on: January 16, 2012, 07:39:34 AM »
Oh sorry Bruce - I need to set the upg.tps location do I? Or does it default to the exe path?

You see I did not realise FM3 was clever enough to have the data files in one folder but the upg.tps file in another. That is what has been confusing me I think.

Thanks

John

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Adding FM3 to my app
« Reply #11 on: January 16, 2012, 11:25:31 AM »
No, they don't need to be in the same location.

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Adding FM3 to my app
« Reply #12 on: January 16, 2012, 03:04:31 PM »
John,

Check out ProPath from www.lansrad.com

You can designate the UPG file location and the location of the data tables.

Completely compatible with NetTalk. 

Don

"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #13 on: January 16, 2012, 03:14:52 PM »
I do have ProPath but trying to minimise the 3rd party templates for this app.

Bruce now has explained that the upg file does NOT have to be in the same path. Still can't get it to upgrade the files but I will test more in the morning. I think I might have a handle on it now.

Thanks

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Adding FM3 to my app
« Reply #14 on: January 16, 2012, 04:30:04 PM »
Don - what I do not understand at all is this ....

I have FM3 in my app (2 actually). I do NOT set the upg file location and leave it in the working folder.

On my development machine everything works perfectly. The file is upgraded (yellow flash).

So I now send that app to the server, I have NO upg files on the server but when I run the app I get error 47. The upg file is created but why the error 47 on the server and not on the development machine.

Yes, the data set on the server is different but that is what FM3 is for.

John