Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 22, 2019 5:20 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 3:28 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Can I use a website to host data for my desktop application? In a nutshell, on Sat. 25 computers will be running the same program all across campus. It has to be a desktop application (not an option). One Professor will be putting text into a Text Area, and I'd like it to show on the computers. I'm thinking a Database file and a timer to check to see if the Prof has updated the Text Area, but the question then becomes can I connect to the online database file every 5 minutes and check for an update in the record? It would simply be 3 Columns 1 record with RTF information for the text area and 'editing rights' in the other 2 columns. OR can I have a text file that can be read every 5 minutes by the timer. I'd much prefer the RBSQLite method, so only the Professor will be allow to change it, but I'll do with what I have to. :-)

Not a clue how to connect to an online file via the net. If it has to be downloaded to check for an update that's ok too, but again no clue how to do that.

TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 4:27 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
I don't think that a web app is the right tool here. You could do something like a simple desktop app with an HTMLViewer that connects to a webapp, but that seems kludgy to me :)

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 4:33 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Jym wrote:
Can I use a website to host data for my desktop application? In a nutshell, on Sat. 25 computers will be running the same program all across campus. It has to be a desktop application (not an option). One Professor will be putting text into a Text Area, and I'd like it to show on the computers. I'm thinking a Database file and a timer to check to see if the Prof has updated the Text Area, but the question then becomes can I connect to the online database file every 5 minutes and check for an update in the record? It would simply be 3 Columns 1 record with RTF information for the text area and 'editing rights' in the other 2 columns. OR can I have a text file that can be read every 5 minutes by the timer. I'd much prefer the RBSQLite method, so only the Professor will be allow to change it, but I'll do with what I have to. :-)

Not a clue how to connect to an online file via the net. If it has to be downloaded to check for an update that's ok too, but again no clue how to do that.

TIA


One option
Professors app is set as a "server" and has a ServerSocket that every other client can connect to
Then when the prof types you could send it key stroke by keystroke to the other computers

Second
Client computers simply connect to a web site that has a page that is updated by the professors app
Clients repeatedly poll to get the update reasonably soon (and cache the time they got the file so they only update when it has changed)
And they dont have to go to a web page - it could be a file accessed via http

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 5:06 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Option 1 sounds ok, option 2 doesn't sound like a desktop app.

However I don't know that I'll have time to figure it out.

With the OpenDialog if I put

http://tedrogersschoolofmanagement.ca/crap/crap.txt

into the field, I get the right file, there's no way to do that with GetFolderItem or something?


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 5:49 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Use an HTTPSocket and Get the file.

dim http as new HTTPSocket
http.Get("http://tedrogersschoolofmanagement.ca/crap/crap.txt", 10)


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Tue Oct 23, 2012 8:04 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Use a PostgreSQL database - included with most hosting packages - and utilize the notification system. The master saves the content to the database then posts a notification that it has done so. When the slaves receive the notification, they can fetch the updated content. No need for polling.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Wed Oct 24, 2012 1:03 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
timhare wrote:
Use an HTTPSocket and Get the file.

dim http as new HTTPSocket
http.Get("http://tedrogersschoolofmanagement.ca/crap/crap.txt", 10)



When I use this code I get error 'not compatible' - but without the , 10 it's fine. I can also use
Dim s As String = http.Get("http://tedrogersschoolofmanagement.ca/crap/crap.txt", 10)

Which gets me the contents of crap.txt. If I'm using an RBSQLite db file, do I then rebuild it from s or is there a way to get the file downloaded?

TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Wed Oct 24, 2012 1:15 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Thom McGrath wrote:
Use a PostgreSQL database - included with most hosting packages - and utilize the notification system. The master saves the content to the database then posts a notification that it has done so. When the slaves receive the notification, they can fetch the updated content. No need for polling.



Institutes don't move quickly enough. Probably take 2 months to get it installed. I do have mySQL installed on the site but in order to use it because of the security it has to be done through a web app. I'm guessing an HTML viewer would be able to poll the database, but I don't think I have the time to learn it.

Essentially for this weekend, the text area might get updated 3 times, I have 1500 students will be writing the same exam in 25 classrooms and if I find a typo on the exam I won't be able to make it to each classroom as they are spread across the entire campus.

It has to be a desktop app because it uses Kernel32 on each machine to control sleep states, screen savers and also the projectors.


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Wed Oct 24, 2012 3:44 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Jym wrote:
timhare wrote:
Use an HTTPSocket and Get the file.

dim http as new HTTPSocket
http.Get("http://tedrogersschoolofmanagement.ca/crap/crap.txt", 10)



When I use this code I get error 'not compatible' - but without the , 10 it's fine. I can also use
Dim s As String = http.Get("http://tedrogersschoolofmanagement.ca/crap/crap.txt", 10)

Which gets me the contents of crap.txt. If I'm using an RBSQLite db file, do I then rebuild it from s or is there a way to get the file downloaded?

TIA

Yeah, sorry for the "forum code" - notoriously incomplete.

Your variable, s, contains the file. You just have to write it to disk, then open it as a database.

dim f as folderitem = GetFolderItem("thedb.rsd")
dim t as textoutputstream = textoutputstream.Open(f)
t.write(s)
t.close
dim db as new REALSQLdatabase
db.DatabaseFile = f
call db.open

(Again, all forum code off the top of my head. Untested.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Wed Oct 24, 2012 5:38 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
timhare wrote:
(Again, all forum code off the top of my head. Untested.)


Code I can deal with once I'm kicked in the right direction :-)

Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Don't know if this is a Web Question.
PostPosted: Wed Oct 24, 2012 7:19 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Uggh I don't think this is going to work as I'm only allowed to log in from one computer in the whole school to upload a file, so it looks like it's going to need to be an HTML viewer and a web Text Area.

So is this the right start?

Remove the Text Area from the project and replace it with an HTML viewer

Start a new WebProject and cover the whole thing with a Web Text Area Lock top bottom left and right

Code the Web Text Area like I would with a desktop App
-Right click web area, get a password screen, click update button and Update the database with the text that's in the Web Text Area
- Give it a timer that will check every 5 minutes for an updated entry
- if it's updated change the text in the Web Text Area

I need to be able to correct a typo in whatever classroom I happen to be in when a student points it out, so that's why I'm putting in a password before the update so others can't update the Text.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group