Flex 独立应用程序,没有数据库

发布于 2024-09-07 10:39:53 字数 257 浏览 2 评论 0原文

我正在尝试开发一个可供我的队友在本地使用的应用程序。它是一种具有报告生成功能的问题跟踪应用程序。我计划在 Flex 上进行。在我的公司环境中,我确实有很多限制,例如无法安装 AIR、没有数据库等。

因此我计划在 Flex 应用程序上进行开发,并将其放在共享驱动器中。现在主要问题是如何存储数据。我有一个想法,比如使用 Excel 文件作为数据库。我想要关于此选项的意见,并且,如果有人尝试从 Flex 应用程序读取和写入 excel 文件,我也想要建议。

谢谢,阿努普

I am trying to develop an application which can be used locally by my team mates. its a sort of issue tracking application with report generation. am planning to do it on flex. in my company environment, i do have a lots of restrictions like, can't install AIR, no database, etc.

so am planning to develop on flex app, and put it in a shared drive. now the main problem is how can i store data. i have an idea like using excel files as database. I want opinion about this option, as well as, if anyone has tried reading and writing excel files from Flex application I want the suggestions also.

Thanks, Anoop

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水水月牙 2024-09-14 10:39:53

Flex 提供了 RemoteObject、WebService 和 HTTPService 标签来访问远程数据和服务。 AIR 通过一些用于本地文件访问(文件)和 SQL Lite 数据库的 API 对此进行了一些扩展。

如果没有 AIR API,您将无法写入本地文件;我怀疑你能写出它们。您可以尝试使用带有“file://”URL 的 HTTPService。我预计会有跨域问题。

您可以设置 Flex 应用程序来访问远程服务器吗?如果是这样,您可以让服务器处理 Excel 文件的创建和编辑。但是,如果你能做到这一点,为什么不使用真正的数据库呢?

您可以查看其他工具来从 Flex 创建桌面应用程序。我相信 Janus 是一种选择( http://www.janus-flash.com/ )。您还可以使用 Flash Pro 并发布为可执行文件;但是要使其支持 Flex 代码会很困难,但也是可能的。锌是另一种选择(http://www.multidmedia.com/)。

如果不允许使用 AIR,我不确定为什么会出现这些其他选项。我不禁想知道,您是否最好探索 MS Access 解决方案,而不是尝试将客户端/服务器技术转变为桌面技术。

Flex provides the RemoteObject, WebService, and HTTPService tags for accessing remote data and services. AIR Expands that a bit with some APIs for local file access (File) and SQL Lite database.

Without AIR APIs you won't be able to write local files; and I doubt you can write them. You could try to use HTTPService with a "file://" URL. I would expect cross domain issues.

Can you set up the Flex app to access a remote server? If so, you can have the server deal with creating and editing the excel files. but, if you could do that why not use a real database?

You can look at other tools to create desktop applications from Flex. I believe Janus is one option ( http://www.janus-flash.com/ ). You could also use Flash Pro and publish to an executable; but it would be difficult, but possible, to make that support Flex code. Zinc is another option ( http://www.multidmedia.com/ ).

If AIR isn't allowed, I'm not sure why these other options would be, though. I can't help but wonder if you're better off exploring an MS Access solution instead of trying to turn client/server technologies into desktop technologies.

2024-09-14 10:39:53

您可以使用 FileReference< 读取/写入本地文件/a> 类。我使用 FileReference 类打开和保存图像,而不使用服务器端代码。

这是一个例子:

    package 
{
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.net.FileReferenceList;

    public class Main extends Sprite 
    {

        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);        

            //load a file when the application starts
            var fileRef:FileReference = new FileReference();
            var fileRefList:FileReferenceList;
            fileRefList = new FileReferenceList();
            fileRef.addEventListener(Event.SELECT, function(evt:Event):void {
                    fileRef.load();                     
            });


            fileRef.addEventListener(Event.COMPLETE, function(evt:Event):void
                {       
                    //do something with the loaded data here
                    trace(fileRef.data);        
                    onSave();
                });

            var arr:Array = [];

            arr.push(new FileFilter("Data file", "*.dat"));

            //prompt the user for the file to load 
            fileRef.browse(arr);
        }

        private function onSave():void
        {
            var fileRef:FileReference = new FileReference();
            fileRef.save("this is my data to save");
        }
    }

}

You can read/write to local files using the FileReference class. I've used the FileReference class for opening and saving images without using serverside code.

Here is an example:

    package 
{
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.net.FileReferenceList;

    public class Main extends Sprite 
    {

        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);        

            //load a file when the application starts
            var fileRef:FileReference = new FileReference();
            var fileRefList:FileReferenceList;
            fileRefList = new FileReferenceList();
            fileRef.addEventListener(Event.SELECT, function(evt:Event):void {
                    fileRef.load();                     
            });


            fileRef.addEventListener(Event.COMPLETE, function(evt:Event):void
                {       
                    //do something with the loaded data here
                    trace(fileRef.data);        
                    onSave();
                });

            var arr:Array = [];

            arr.push(new FileFilter("Data file", "*.dat"));

            //prompt the user for the file to load 
            fileRef.browse(arr);
        }

        private function onSave():void
        {
            var fileRef:FileReference = new FileReference();
            fileRef.save("this is my data to save");
        }
    }

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文