IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Trolling for ideas...
Just thinking out loud, but I thought someone might give me some ideas how to approach a solution for a part time gig that I can't seem to make go away. :-)

What I've got is one of those web page applications that runs via user sessions. The data being viewed is similar to project management wherein users interact with the system to view and modify the state of their projects. The managers build a tree of projects that allow them to keep tabs on the state of various projects throughout the company. Not really supposed to be a complex project management system - that gets way too involved and becomes more work than it's worth - this one is very simple on purpose so that it might actually get used.

The application works fine. Problem is, though, that I have users that want to be able take the data offline and then upload changes back onto the main server after modifying it locally. Needless to say, a web application works exclusively with thin clients (i.e. browsers) and a web server. Means I basically need to write a parallel program that retrieves the data on attachment and saves off any changes. Synchronization can be a complex issue, in that you may have two users modifying the same data offline at the same time, which means you have to do merges and what not (or one may modify it and the other delete it).

Anyhow, I was wondering if anyone else had written any sort of web application where you had to support offline stuff? Kind of stuck trying to figure out the best way to do this. My inclination is to write a totally seperate program that has it's own user interface and only talks to the web server during the synchronization process. Probably be inclined to use Python and it's GUI libraries for the user interface. But I never like the idea of having duplicate code that achieves the same end. The web code doesn't appear to be reusable in this sort of framework - the clients in question don't have local webservers, so it's like two completely different programs with the same purpose.

The only other thought I had was using javascript in the browser to draw the pages on the client and have them read and write the data on the local drive. That is, still use the browser as the sole interface but have the webserver software embedded within the pages - instead of retrieving the info from the server the actions would be a function of javascript code embedded within the pages. But that seems to get complex as well.

Thanks.
New Only thing I can think of
is to create a transaction table, which the user changes get submitted to, and then set the transaction status code to inactive after the table is updated. Then you could have an employee review the transactions, which also by the way should log the user ID of the user who made them so you can track who is responsible for the changes, and then use the old transaction table to roll them back if needed. Or rather store the old record in a backup table before updating it on the main table. It takes more storage space to do this, but it can save your bacon when two employees update the same record and you need to roll back to an older version.

Client side VBScript/Javascript using ADO should work fine on an Access database or some file that is stored on the user's hard drive. That is what we used, but your milage may vary. Since we used ADO, the user had to have ADO installed on their system. Sometimes the techs missed an ADO install from time to time and it wonked out. But since I am free of that Microsoft Shop, I'd most likely use Java and JDBC or something.

"Before Christmas it is 'Ho ho ho', after Christmas it is 'Owe owe owe'" - Santa Norm
New Fat clients
Thanks for input.

It takes more storage space to do this, but it can save your bacon when two employees update the same record and you need to roll back to an older version.
For the most part, synchronization is more a theoretical problem, since most of the data entry for the nodes are the responsibility of a single person. I should probably mention, that the server software is also touching the data on a nightly basis, so the issue is not just two users stepping on each others toes, but also the system modifying the entries as well.

I don't think folding the entries on top of each other will be too bad. The app is designed to keep track of history, so that all entries are non-destructive. The only thing the synchronization really has to decide is what fields to merge within the records and which one comes out on as the latest entry when the same fields are changed.

Client side VBScript/Javascript using ADO should work fine on an Access database or some file that is stored on the user's hard drive.
Although I could try to push an MS only solution, I've been trying to avoid that scenario. Problem is that I don't really want to deal with the end users in any significant fashion. These users are not internal as the customers are from a number of different companies. My experience has been that once you start installing MS apps, you then have to take on significant customer support. The whole reason for writing a thin client in the first place was to keep my exposure to client problems to a minimum.

But since I am free of that Microsoft Shop, I'd most likely use Java and JDBC or something.
The main problem I have with Java is that I don't particularly like AWT or Swing. For importing and exporting the data, it would be a nice environment. But the problem I'm having is that I'm not sure how to build the user interface for the forms that I'm using in the web app.
New We did something like that
in Oracle when I had worked as a federal contractor. We had a C script get run every 15 minutes that did a table update and recorded the transactions, run by crontab. Any field that got changed had an entry in the transaction table, the other fields were blank or null, which means they didn't get updated. So it only updated the non-null fields. If there was a problem we had a backup table that the whole record got copied to, in case we needed to rollback the data.

We also did this in Access, and had a database on floppy that the clerks handed to whomever would update the table and it worked the same way. The main database was on a networked drive. As long as they didn't update too many records it worked. We later moved the database from the floppy to another network location to avoid floppies with bad sectors and other issues.

On a job interview when I was asked what software we used to handle this, I told them that we wrote it ourselves and it worked fine. The interviewer didn't believe me. We were on a tight budget and they didn't want to spend the thousands to tens of thousands of dollars to buy a software package to do this for us.

"Before Christmas it is 'Ho ho ho', after Christmas it is 'Owe owe owe'" - Santa Norm
New Is it a simple data structure?
If it is sufficiently simple then you can do this with 2 pages. The first takes whatever and exports it as CSV. (This can be read in Excel.) The second one has a textfield which you cut-and-paste into from Excel and upload back (that comes back as tab-delimited).

Cheers,
Ben
New A tree of sorts
Nothing particularly difficult about the data structure, but it is a hierarchical tree that has 6 distinct node types that are somewhat cyclic. Although I'm using a relational database to hold the data, it's kind of a pain to manage. A nice OO model would actually be better suited to a solution, but I didn't have that advantage on picking the server platform.

That said, I think maybe what you are suggesting might be the route I take. The offline stuff doesn't necessarily have to carry the hierarchy over to the user interface. The reason for taking it offline have more to do with data entry than it does with analysis. I could collapse the tree into a flat structure that would allow the data entry to take place offline, but keep the tree intact on the web server.

Have to give it some thought though on what features I want to shuck on the offline version.
New We do pretty much the same thing
The application I work on does pretty much the same thing right now.

We actually build an .xls file on the server, and then put a link so they can download the file.

To upload the file we have a macro in the spreadsheet that picks up the data fields we need back, formats them nicely and copies them to the clipboard. Then the user can past them into a text box on the server.

Jay
New OUCH!!!!
New Done that too, in PL/SQL. Only, IIUC it was...
...*actually* a CSV-format file -- but by giving it the .XLS file-name extension, you get Windows/Explorer/Internet Explorer to have Excel open it by default, and then you let that figure out the actual format of the file.

Can't be sure, though; it *could* be that we used some special export-to-Excel package that built a real actual Excel file... I dunno, it was a while ago, and I only copied-and-modified a colleague's code.

Oh, and we only built the file if they really tried to download it. The URL pointed to a PL/SQL procedure that, when they clicked the URL / invoked the procedure, built a file for them.

IIRC.
   Christian R. Conrad
The Man Who Knows Fucking Everything
New Install a web server?
How hard would it be to get a web server running on user machines? Get a cut-down Apache, have it listen on some unlikely port on the system, then use your normal server-side code. The only concern then becomes merging/locking, but there is no duplicate code there...
New Roll your own server?
There are some really stripped down http servers written in Java that might be able to do the trick. Don't know if I want to install much that has a significant footprint. Then again, I don't enjoy the prospect of supporting my own web server either. Will have to look into how big a chore it is to get a minimal webserver that can handle form generation and submissions.
New Not hard, but it has some issues
mainly management usually doesn't like users running a server. We tried this out at the federal contracting job I had, and someone sqwuaked about my workstation having a web server running on it. So I took it off. But I was testing the workload and the transaction database on it.

Plus with Windows 9X/ME security is so laxed that the user can modify the files on the web server. Imagine a script getting loaded in Frontpage and getting messed up.

Or imagine you put Apache on the user's workstation and somehow they install PWS, or Oracle with the Web Services and it over-rides your Apache server? Or what if they uninstall it? Or what if they install some software that clobbers the files used for your web server?

Just some issues to think about.

"Before Christmas it is 'Ho ho ho', after Christmas it is 'Owe owe owe'" - Santa Norm
     Trolling for ideas... - (ChrisR) - (11)
         Only thing I can think of - (nking) - (2)
             Fat clients - (ChrisR)
             We did something like that - (nking)
         Is it a simple data structure? - (ben_tilly) - (4)
             A tree of sorts - (ChrisR)
             We do pretty much the same thing - (JayMehaffey) - (2)
                 OUCH!!!! -NT - (Arkadiy)
                 Done that too, in PL/SQL. Only, IIUC it was... - (CRConrad)
         Install a web server? - (Arkadiy) - (2)
             Roll your own server? - (ChrisR)
             Not hard, but it has some issues - (nking)

The simplest explanation is that I'm an idiot!
188 ms