View Full Version : xml datasource not updated in SOLO mode
romain.eude
02-27-2006, 06:05 AM
Hi,
I am experimenting with Laszlo and especially with SOLO data-driven apps.
I am testing a simple app with the phonebook.xml dataset. I am compiling the swf in SOLO mode so that it can be used outside the appServer, as a simple flash app. I notice that after the compilation, the swf does not need the xml to run. I also noticed that if I update the dataset in memory, the XML file is not updated.
[This is all probably obvious but as a newbie, I have to ask].
1- is there a way to have an XML file being dynamically updated by a SOLO app ?
2- My use case is as follows: a/ I build a form in a SOLO app. b/ the user enters data c/his data is saved into a local XML file. d/ the user can then give me the XML file for processing.
>>> Can this be done with a solo app in some way ?
3- what are the mechanisms available for a solo app to save the dataset values locally on the client ?
Thanks in advance for any light on these ideas.
Romain.
jcmaxx
02-27-2006, 07:21 PM
Laszlo creates a compiled flash movie. Due to security concerns, Flash no longer has the ability to write to the local drives.
If your app does not have to be browser based, there are a number of 3rd party flash projectors available which can convert a Laszlo created flash file into a stand-alone executable. Most of these projectors also have the ability to read and write local files. Screenweaver (http://screenweaver.org) is free and open source but I don't remember if the current version can write to local files. I use MDM Zinc (http://www.multidmedia.com/software/zinc/) It is arguably the best of the projectors and definitely can read and write local files but is also pretty pricey.
I have seen other methods mentioned on these forums so try doing a search or maybe someone else will chime in.
Good luck.
romain.eude
02-28-2006, 01:33 AM
Thanks a lot for this clarification.
After searching through the forums, I sort of got this response.
Obviously it is a bit annoying as my app needs to work offline (hence SOLO Mode) then to send the collected data to a server... so Lazslo may not be the proper answer to this use case.
Thanks,
Romain.
Do you have PHP installed on your remote server?
romain.eude
02-28-2006, 02:45 AM
my original idea was to generate a swf with Lazslo, then to give to my user for running it on his laptop [without network connection], and then to "somehow" transfer what he has saved on his lazslo forms back to the network....
from the prior posting, it seems the issues is not what to put on the server [I can do PHP, no prob] but how to save the data in disconnected mode...
Romain.
jcmaxx
02-28-2006, 03:30 PM
Take a look at one of the projectors mentioned previously. If you're on a strict budget, Screenweaver will probably work. I just looked at the web site (which can be confusing) but it looks like it will read and write local files.
You would create your application using Laszlo (SOLO mode). Get everything except writing to the local file working then add the functionality for saving the data. Laszlo has a serialize() method (I think on the dataset object) which will generate a string which could then be saved to the local file using one of the projector's methods.
The last step would be to use Screenweaver (or whatever projector you choose) to turn your Flash file into a stand-alone executable which can read and write to the local drives and still has complete access to the web. Maybe your app could automatically email the file to you?
This all sounds much more complicated than it really is. The projectors generally just add additional objects and methods which can be accessed just like any other Flash or Laszlo object. Using Zinc, loading a string from a file looks something like:
sData = mdm.FileSystem.loadFile(sFile);
The only difference being you can't debug them until after converting the SWH file to an executable.
In most of my projects, being web enabled is a must but using a browser is generally not an option. Laszlo combined with a projector is the perfect solution. Very rapid development and a stand-alone executable with web access and rich features. Zinc even includes the Flash 8 runtime so the end user is not required to have it installed.
Take a look at the Laszlo/Projector option and I think you may find it will serve your needs.
romain.eude
03-01-2006, 02:38 AM
this is along the lines I am investigating at the moment. I look quite a bit in Screenweaver. It seems it can do most of what I need. However, the reason why I wanted a flash based solution was to be able to run it on Pocket Pc. But Screenweaver does not support PocketPC. I found the "Screenweaver Core", which lead me to thinking it could work on PocketPc via .net... but this doesn't exist yet.
Zinc, on the other hand does that as well, and has a cmd line interface but their licensing does not work for my application. I want the end-user to be able to make the projector, using the swf produced by Lazlo...
Romain.
cjordan
04-23-2006, 07:20 PM
Why is writing an application in one language and then having to wrap it in another the "perfect" solution?
I realize I'm a bit late to chime in on this topic, but why not just fix Laszlo so that we can do reads and writes to the file system? Personally speaking, I just want the ability to write to a database, but writing an XML file would be great too.
If this means getting rid of Flash because its junk, then let's ditch it. If it means that the applications that get written with Laszlo only have this ability if they're compiled in a certain way, then let's get that going.
Does this frustrate anybody else? Do I have this all wrong?
bfagan
04-23-2006, 09:09 PM
cjordan,
You do have this all wrong. OpenLaszlo generates web apps in both Flash and DHTML.
One of the basic precepts of web application security is that web apps have absolutely no ability to read/write from the local filesystem. You also can't execute something outside the browser sandbox layer. Whenever you hear of a virus or worm propogating on the Internet, it's usually a flaw in the implementation of this layer.
Flash is not junk because it doesn't do what you want it to.
Laszlo doesn't need to be fixed. You just need a better understanding of what web application security is.
cjordan
04-24-2006, 03:55 PM
I do understand web security. We just don't seem to be talking about the same kinds of applications. I'm saying that there are honest reasons to want access to the local file system or a local data source.
If there weren't such restrictions and limitations on cookies, I'd use them to store the users updates in an xml format (in fact, I might just try that anyway). The user would just have to know that they can't delete their cookies before syncing up. It seems cludgy, but...
And on the subject of security, if there's nothing wrong with a cookie, then there's nothing wrong with what I'm asking for. I just want to be able to store some data on the client's machine while they're offline and then sync up later on.
Maybe the cookie analogy is what I ought to be talking more about. I don't really want more than that.
I think what most folks in my position are looking for is a way in which to write (essentially) fat clients. Applications that can be easily downloaded (or packaged in a box and sold at the store for all I care) and can access any data source (local or remote). But most important, in my opinion anyway, is the speed of development. That's where most of these languages that create web applications excel (I think), is in the speed of development.
Java would seem to be the answer, but its too cumbersome for smaller jobs, and speed of development is too slow (least ways, that's what I think).
I have other thoughts on this subject under a post called "disconnected client questions".
skidmark
05-25-2006, 07:58 PM
Your so righ this matter,
example having a flash contact list app
get the data and save local to xml,
add and delete as needed local, through a browser mode
and then connect to the web and sync with the mysql db online...
I've been looking and testing with cookies and they sortof work... but thats another rabbit hole of issues.
I'm looking for the same solution....
why can't I get access to a local file...
I've used the zinc for a bit then dropped it for just making the brower file into a .hta file and that was cheaper with javascript access but again sync the data on a remoter server was a issue...
docweb
06-02-2006, 03:01 AM
I have the same use case and perhaps a suggestion for a solution.
As described in the security whitepaper
http://www.adobe.com/devnet/flashplayer/articles/fp8_security-related_apis.pdf
you are able to sign a swf as a trusted file.
"Added in Flash Player 8. Indicates the type of security sandbox in which the calling SWF file is operating. System.security.sandboxType has one of the following values:
remote: This SWF file is from an Internet URL and will operate under domain-based sandbox rules.
localWithFile: This SWF file is a local file, but it has not been trusted by the user and was not published with a networking designation. This SWF file may read from local data sources, but may not communicate with the Internet.
System.security. sandboxType
localWithNetwork: This SWF file is a local file and has not been trusted by the user. It was published with a networking designation. This SWF may communicate with the Internet, but may not read from local data sources.
localTrusted: This SWF file is a local file and has been trusted by the user, using either the Settings Manager or a FlashPlayerTrust configuration file. This SWF file may both read from local data sources and communicate with the Internet.
"
I expected signing a swf as trusted, let me using the local dataset as everybody would like to: Easily load and save local data.
I recognized that this works for Flash 8 and above. So it might be a possibility for a future Openlaszlo feature?
This is what I have just found in researching persistent client side databases .. i.e. retaining persistent data whilst offline ..
Browser Based Data-Base Server (http://www.webcom.it/blog/articles/category/ajax)
See ..
Apache Derby
Sun Java DB the Sun-supported version of Apache Derby. They also have a demo online of running it inside a web browser
JavaScript Database a sort of technology demo (or a “quick hack”, as the author puts it) using AMASS and TrimPath
AMASS AJAX MAssive Storage System uses a hidden flash applet to allow JavaScript AJAX applications to store an arbitrary amount of sophisticated information on the client side
dojo.storage is a direct evolution of AMASS, and looks like it is production-ready and very actively worked on
TrimQuery is an SQL engine written in Javascript
I'm starting to experiment with these.
eboer
06-08-2006, 02:18 AM
In response to the previous macromedia url in this thread, this is a snippet from
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001613.html#244861
--start snippet--
In the #Security directory on your hard disk, you can create a FlashPlayerTrust directory where you can store unique configuration files. Inside these files, you can specify directories or applications to trust on your hard disk. This directory does not require administrative access, so users without administrative permissions can set permissions for SWF files and test applications.
If you do not specify a directory, your content might not function as intended. Configuration files inside a FlashPlayerTrust directory contain directory paths. The file can contain a list of several directories, and you can append new paths to the file. Flash Player expects one path per line in configuration files. Any line that begins with a # punctuator (with no leading space before it) is treated as a comment.
To create a configuration file to trust a directory:
Locate the #Security folder on your hard disk.
Create a folder called FlashPlayerTrust inside the #Security folder.
Create a new file in the FlashPlayerTrust directory using a text editor, and save it as myTrustFiles.cfg.
You can use any unique name for your configuration file.
Locate the directory where you test Flash applications.
Type or paste each directory path (any directory path on your hard disk) on a new line in the file. You can paste multiple directory paths on separate lines. When you finish, your file looks similar to the following example:C:\Documents and Settings\<yourname>\My Documents\files\
C:\Documents and Settings\<yourname>\My Documents\testapps\
Save your changes to myTrustFiles.cfg.
Test a document that accesses local and network files from the directory you added to the file.
Flash applications saved in this directory can now access local files and the network.
There can be numerous directory paths saved in each configuration file, and numerous *.cfg files saved in the FlashPlayerTrust directory.
If you create applications that install on an end user's hard disk, you might need to create a configuration file in FlashPlayerTrust to specify a trusted directory for your application. You can create configuration files inside the FlashPlayerTrust directory that specify the location of the trusted application. See the pervious procedure for information on this directory and creating configuration files.
NOTE
An installer is run by a user with administrative permission on a computer.
You should develop a unique naming scheme to avoid conflicts with other applications that might install files in this directory. For example, you might want to use your unique company and software name in the filename to avoid conflicts.
--end of snippet--
xcdesz
06-29-2006, 06:44 AM
Correct me if I'm wrong - Im not experienced in Laszlo or Flash right now. But, Im assuming that you can call another URL from within the application?
If so, all you need is to have a JSP engine, such as Tomcat runnning on your server. You would call the JSP and pass the updated information in as parameters. The JSP could then use Java to write to the file. There are plenty of libraries in Java, and Tag Libraries in JSP that would make this easier.
Im sure someone has written this before. Any java programmer should be able to write this.
eboer
07-11-2006, 05:40 AM
As any programmer will tell you, the less dependencies you have (such as a Tomcat server) the more solid your application will be in term of survival, maintenance etc. There a just to much server architectures at the moment you cannot expect organisations to support them
all in terms of maintenance cost.
MichaelNino
07-25-2007, 06:36 PM
jcmaxx,
We would like to use Zinc. I have complied the Component Sampler found on OL's site but when I try <button onclick="mdm.Dialogs.prompt('Zinc Rocks!')">Zinc Rocks!</button> (runing the swf7 inside the Zinc projector) I receive the error in the OL debugger "ERROR: med-flash.lzx:130: call to undefined method 'prompt' ".
Could you provide a simple example. If we can get this to work, we are ready... we have an application that needs to be written immediately.
TIA Mike :-)
Take a look at one of the projectors mentioned previously. If you're on a strict budget, Screenweaver will probably work. I just looked at the web site (which can be confusing) but it looks like it will read and write local files.
You would create your application using Laszlo (SOLO mode). Get everything except writing to the local file working then add the functionality for saving the data. Laszlo has a serialize() method (I think on the dataset object) which will generate a string which could then be saved to the local file using one of the projector's methods.
The last step would be to use Screenweaver (or whatever projector you choose) to turn your Flash file into a stand-alone executable which can read and write to the local drives and still has complete access to the web. Maybe your app could automatically email the file to you?
This all sounds much more complicated than it really is. The projectors generally just add additional objects and methods which can be accessed just like any other Flash or Laszlo object. Using Zinc, loading a string from a file looks something like:
sData = mdm.FileSystem.loadFile(sFile);
The only difference being you can't debug them until after converting the SWH file to an executable.
In most of my projects, being web enabled is a must but using a browser is generally not an option. Laszlo combined with a projector is the perfect solution. Very rapid development and a stand-alone executable with web access and rich features. Zinc even includes the Flash 8 runtime so the end user is not required to have it installed.
Take a look at the Laszlo/Projector option and I think you may find it will serve your needs.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.