Flex环境配置

来源:互联网 发布:明天,妈妈不在 知乎 编辑:程序博客网 时间:2024/05/21 17:06
[翻译]配置FluorineFX环境
2008-02-18 17:13

本文由唐勇翻译自FluorineFX官方文档(http://www.fluorinefx.com/docs/fluorine/index.html),转载请保留

ASP.NET2.0 application directory layout
ASP.NET2.0目录布局

To simplify the process of creating Fluorine enabled ASP.NET application the Fluorine Wizard enables you to create a new project customized and configured to work with the gateway.
使用Fluorine向导可以简化创建Fluorine Asp.NET应用的过程和配置网关。

There are 2 project templates used to create a complete FluorineFx-enabled solution and it is recommended to create your projects in the order given in this page (as the WebSite project will automagically add a reference to the service library project)
有2个项目模板,用来建立一个完整的FluorineFx功能的解决方案,并建议建议按此页指定的顺序创建项目(作为网站项目将自动添加服务库项目参考)

FluorineFx Visual Studio Wizard for Visual Studio 2005
In Visual Studio 2005 select the File/New/Project... option and create a blank solution:
Visual Studio 2005中的FluorineFx Visual Studio向导
在Visual Studio 2005下拉菜单中选择File/New/Project...来创建一个空白的解决方案。


In Visual Studio 2005 select the File/Add/New Project... option:
在Visual Studio 2005下拉菜单中选择File/Add/New Project...操作。


In the installed templates pane, select the FluorineFx ServiceLibrary project Template
在弹出对话框中,选择FluorineFx ServiceLibrary project模版。


The wizard creates the Service Library (this is just a class library with the FluorineFx assembly reference). Service libraries are used for 2 reasons: your application can work in Medium Trust environment and for architectural separation.
向导会创建服务类库(这只是一个类库和FluorineFx集合参考) 。使用服务类库原因有二:你的应用可以使用的信任的环境,并建筑分离。

The workspace should look like this:
工作环境看起来类似这样


Select the File/Add/Web Site... option:
选择File/Add/Web Site...选项。


In the installed templates pane, select the FluorineFx ASP.NET WebSite Template
在弹出对话框中,选择FluorineFx ASP.NET WebSite模版


The Solution Explorer should provide you with the following project structure:
该解决方案应该向你提供下列项目的结构:


In the Web Site References property page you can manage references to assemblies (if required)
在网站上的参考属性页中,您可以管理参照集合(如果需要)

Debugging with Visual Studio 2005
在Visual Studio 2005调试


Use the Visual Studio .NET debugger to observe the run-time behavior of your program and service classes.
使用Visual Studio .NET的调试器,以观察运行时的行为你的项目和服务类别。

If this is the first time you are running the application set the startup project and the start page
如果这是您第一次运行的应用,设定启动项目和起始页


Setting the start page (this tutorial uses the wizard generated Console.aspx page that will redirect to the Service Browser page).
Later you can change this to point to the page that loads your client application
设置起始页(此教程使用向导生成console.aspx页面将重定向到服务的浏览器页)。
以后,你可以改变这一点,在页面加载你的客户端应用。


Set your breakpoints and start debugging
设置断点并开始调试。


Visual Studio launches the default browser, starts your application, the start page is loaded in the browser.
Set parameter values and hit the "Call" button
Visual Studio开始默认浏览,开始你的应用,起始页被加载到浏览器。
设置参数值并点击“call”按纽。


Visual Studio breakpoint is hit.
Visual Studio断点被触发。


Debug & Continue running your application.
调试并继续运行程序。


Client receives the results
客户端都会收到结果

Flex Setup
Flex设置


Create a new Flex Project
创建一个新的Flex项目


Set project location and project name
设置项目位置和项目名称。


We are using the specified directory structure in the Folder box, where the Flex project is stored in the "Flex" subfolder of the .NET Web Site project

This directory structure is not mandatory but if you change it then you will have to update the rest of the settings accordingly.
我们用指定的目录结构中的文件夹框中,如Flex项目是放在.NET的网站项目的子文件夹"Flex"中。

这个目录结构是不是强制性的,但如果你改变它,然后你将有更新其它的设置。

Set Output Folder URL
设置输出位置的URL


Output folder URL is used to specify the server location of the compiled application files. It is optional but you should set a valid URL if you plan to debug from Flex Builder.
输出文件夹URL是用来指明服务器的位置来编译应用程序的。它是可选的,但你应指定出一个有效的URL ,如果您打算使用Flex Builder来调式程序。

If Output folder URL is set then you must run your .NET web application prior to launch the Flex application from Flex Builder (as the compiled swf file is served via the web server).
如果输出文件夹的URL被设定,你必须运行你的.NET Web应用之前,使用Flex Builder来编译Flex应用,(当编译SWF文件的时候便是通过web服务提供支持) 。


In our sample setup the Visual Web Developer Web Server is running on port 2980 (check the Web Site properties for the port number). The context root is "WebSite1" (the web application root). The "Flex/bin" path is where our Flex application is compiled by default.
在我们的例子设置Visual Web Developer的Web服务器运行端口为2980 (检查网站的属性端口号) 。上下文根目录是" website1 " ( Web应用根文件夹) 。 "Flex/bin"路径是我们默认的Flex应用的路径。


In this sample setup the complete URL to our Flex application becomes "http://localhost:2980/WebSite1/Flex/bin/MyFlexApp.html" (this is the URL you will see when running the application from Flex Builder).
在这个例子里设置完整的URL,我们的Flex应用变成" http://localhost:2980/website1/flex/bin/myflexapp.html " (这是一个网址,当使用Flex Builder运行应用你会看到)。

Flex Compiler settings
Flex编译器设置


Set the service configuration file: -service "Path to your asp.net application folder/WEB-INF/flex/services-config.xml"

Set the context root: -context-root "/your asp.net application root(name)"
设置服务配置文件:服务"Path to your asp.net application folder/WEB-INF/flex/services-config.xml"

原创粉丝点击