Recent

Author Topic: application permissions  (Read 20189 times)

mbohn

  • Full Member
  • ***
  • Posts: 120
Re: application permissions
« Reply #15 on: January 19, 2010, 05:19:40 pm »
[Option 1]
Upload via webform. (PHP) {you can ask for user id, pass and file in one step}
After upload process file and return as download. {PHP call to your program with correct args.}

[Option 2]
Upload via webform. (PHP)
After upload move file to special folder.
A separate crontab entry processes files in special folder via BASH script that then calls your program and emails the results. {look for packages uuenview and uudeview}

[Option 3]
ExtPASCAL.
You program has a direct web interface via fcgi.

I took a quick look at Webform and I don't think it is ideal.  My users will have about 100 input parameters and Webform seems more applicable to credit card and address info, maybe a dozen inputs.  I can forsee my users not wanting to enter all the 100 parameters in one sitting, partially out of fear of losing their work part way through, but mainly because it will be very tedious when starting a new case file from scratch.  So, I need some mechanism where a sample input case is presented, the user can edit that, save it whenever he pleases, and submit it when ready.

mbohn

  • Full Member
  • ***
  • Posts: 120
Re: application permissions
« Reply #16 on: January 24, 2010, 03:04:16 pm »
I've also ruled out ExtPascal/ExtJS due to its licensing arrangement.

Presently I'm looking into MAMP and it seems to offer everything I need.  Learning PHP doesn't look too difficult but that remains to be seen.

You may ask why OSX instead of Linux especially after all the struggle I had with getting Laz to work under Linux?  Here's a few reasons, but I'd appreciate any feedback + or - before I get too deeply into it:

1)  There are at least 3 companies offering Mac Mini colocation at very cost-effective rates. 

2)  I like the idea that I can prototype the entire system on my Mac, move it all over to a mini and ship that to a colocation center.

3)  Switching on Apache on my Mac was literally a 1-click affair.  Testing it required one more click.

4)  Getting Apache to recognize PHP took a bit more fiddling with the Apache .conf file but it was not too painful. 

5)  I recognize that 3) and 4) are one-time efforts but the point is that that is typical of working with OSX.  Everything is very-well thought out and just seems to work smoothly.  (I've yet to get my Linux install to print and it usually takes about 30 minutes before it decides to connect to my wireless router.  I just don't need to be fiddling with that kind of thing when I've got many other issues to deal with).

6)  I suppose if OSX died tomorrow, I can move it all to Linux without too much trouble.

Like I said, I'd appreciate any further feedback.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: application permissions
« Reply #17 on: January 24, 2010, 06:44:13 pm »
I've also ruled out ExtPascal/ExtJS due to its licensing arrangement.

Presently I'm looking into MAMP and it seems to offer everything I need.  Learning PHP doesn't look too difficult but that remains to be seen.

You may ask why OSX instead of Linux especially after all the struggle I had with getting Laz to work under Linux?  Here's a few reasons, but I'd appreciate any feedback + or - before I get too deeply into it:

1)  There are at least 3 companies offering Mac Mini colocation at very cost-effective rates. 

2)  I like the idea that I can prototype the entire system on my Mac, move it all over to a mini and ship that to a colocation center.

3)  Switching on Apache on my Mac was literally a 1-click affair.  Testing it required one more click.

4)  Getting Apache to recognize PHP took a bit more fiddling with the Apache .conf file but it was not too painful. 

5)  I recognize that 3) and 4) are one-time efforts but the point is that that is typical of working with OSX.  Everything is very-well thought out and just seems to work smoothly.  (I've yet to get my Linux install to print and it usually takes about 30 minutes before it decides to connect to my wireless router.  I just don't need to be fiddling with that kind of thing when I've got many other issues to deal with).

6)  I suppose if OSX died tomorrow, I can move it all to Linux without too much trouble.

Like I said, I'd appreciate any further feedback.

Yes, I agree that the Mac is really a great Web app development machine - so simple to get started.

I don't understand your issue with ExtJS - please be more specific.

I assume you've tested the PHP Toolkit:

http://web.fastermac.net/~MacPgmr/PhpTk/PhpTkStatus.html

This allows you to work with the open source VCL for PHP framework (qooxdoo JS controls).

However, now that I've switched to ExtPascal, PHP looks pretty stale by comparison. I like compiled code and I like being able to use huge chunks of debugged Pascal source in my Web apps (plus the Delphi/FPC RTL).

Thanks.

-Phil

mbohn

  • Full Member
  • ***
  • Posts: 120
Re: application permissions
« Reply #18 on: January 24, 2010, 07:25:53 pm »
Yes, I agree that the Mac is really a great Web app development machine - so simple to get started.
It seems like a great development platform in general, not just for web apps.

Quote
I don't understand your issue with ExtJS - please be more specific.
Unless I misunderstand the ExtJS licensing it seems that if you are developing a commercial app, you need to pay a license fee to use the ExtJS software.  I'm trying to keep my end-user fees as low as possible and licensing ExtJS for $379 (w/o support) makes that more difficult. (Translation:  I don't expect to have hundreds of users to amortize the license fee.)

Quote
I assume you've tested the PHP Toolkit:

http://web.fastermac.net/~MacPgmr/PhpTk/PhpTkStatus.html
I did look at it but believe I can take the more straightforward path by using PHP directly.  Although my app started as a Win GUI with a few forms, the forms I'll need for web users will be pretty straightforward so trying to salvage my Win GUI forms will not save me much.  I think my efforts will be in the database portion.

Thanks for your insight.

mbohn

  • Full Member
  • ***
  • Posts: 120
Re: application permissions
« Reply #19 on: May 13, 2010, 04:17:23 pm »
Thought I'd update this post since I have made some pretty good progress on this project.

Quick review: I wanted to deploy an application on the web where  users submit a data-input file, the application crunches numbers and then makes a data-output file available to the user.

I decided that since I'd eventually be implementing a forum to provide technical support, I'd go ahead with that now and take advantage of the forum's user-management facilities and connection to MySQL.  I'm using SMF, same as the Lazarus forum.

So, I have a web site:  www.dynostep.com which is mainly to serve documentation for potential users and a link to the forum  where access to the application is provided.  The application is a numerical simulation of an internal-combustion engine written as an fpc console app using OSX 10.6.  The server also runs on OSX.  If you are a motorhead as well as a Lazarus fan you might be interested in checking it out. :)   

Once a user has read the documentation and understands how to prepare the data input file, he/she registers on the forum.  Since they are now in the forum database I can easily make sure they are registered before they try to upload the data input file.  That upload is done by a simple HTML page via a post method coupled to a PHP script.  The script takes the uploaded file, cleans up the file name, and puts the file in a permanent location.

The PHP script then logs info on the user, their data input filename, and date/time to a table I added to the forum database.  It also prepares another text file containing information needed by the application.  The PHP script then calls my application.

Once the application has run with the user's input data it saves  the data to an output file, updates the database table to indicate the name of the output file, what version of the application was used, and whether the run was successful.

I'd like the application at this point to notify the user that the run was complete and provide a link to the output file, but haven't yet figured out how to do that so I do it manually based on info in the database table.  I may do it via a forum PM.

That's it.  Maybe this will help someone in the future with a similar project.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: application permissions
« Reply #20 on: May 13, 2010, 04:29:26 pm »
I'd like the application at this point to notify the user that the run was complete and provide a link to the output file, but haven't yet figured out how to do that so I do it manually based on info in the database table.  I may do it via a forum PM.

Online, the way this is typically done is by launching the server app using a form on a web page that runs a Javascript command every N seconds via a timer. Basically, the script in the client's browser calls a PHP script (or a console program) on your server that checks for a file that is written when the server application quits. When that file is found on the hard drive, the PHP script returns a web page with the relevant info and a link to the output, otherwise it returns, for example, an empty string.

Offline, you can run a cron job on the server to do the same thing and send an email message to the user when the job is done.

(@mbohn : are you a one of the trescom fans, by any chance?)
« Last Edit: May 13, 2010, 05:09:45 pm by Troodon »
Lazarus/FPC on Linux

mbohn

  • Full Member
  • ***
  • Posts: 120
Re: application permissions
« Reply #21 on: May 13, 2010, 08:22:20 pm »

Online, the way this is typically done is by launching the server app using a form on a web page that runs a Javascript command every N seconds via a timer. Basically, the script in the client's browser calls a PHP script (or a console program) on your server that checks for a file that is written when the server application quits. When that file is found on the hard drive, the PHP script returns a web page with the relevant info and a link to the output, otherwise it returns, for example, an empty string.

Offline, you can run a cron job on the server to do the same thing and send an email message to the user when the job is done.
I can see how the online method would work for something that runs quickly but my app takes about a minute to run.  I don't want to ask my users to wait that long.

I've been trying to get Indy to work so I can do essentially your offline method.  No luck so far.  What other way can I send mail?

Quote
(@mbohn : are you a one of the trescom fans, by any chance?)
Trescom the game?  No.
« Last Edit: May 13, 2010, 08:35:50 pm by mbohn »

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: application permissions
« Reply #22 on: May 14, 2010, 02:31:10 pm »
I've been trying to get Indy to work so I can do essentially your offline method.  No luck so far.  What other way can I send mail?

On Linux, you can send email using Perl, PHP, or a local mail server such as sendmail; I assume the same should work on Mac OS X. In any case, you need to configure these tools to use an external SMTP mail transfer server (e.g., the one provided by your ISP).

Quote
Trescom the game?  No.
Trespasser, the game; trescom.org, the fan site :)
« Last Edit: May 14, 2010, 02:33:00 pm by Troodon »
Lazarus/FPC on Linux

 

TinyPortal © 2005-2018