`
jone33
  • 浏览: 27004 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

初篇学习potomac-framework

    博客分类:
  • OSGI
阅读更多

  注:本文只作本人记录,不作为技术分享。

        

 

      固定链接: http://www.nethref.com/?p=281

 

      官方网址:http://www.potomacframework.org/

      下载地址:http://www.potomacframework.org/downloads/

      论坛讨论:http://forum.potomacframework.org/

      API文档:http://www.potomacframework.org/1.0beta/asdoc

      学习文档:http://www.potomacframework.org/documentation/

 

 

      potomac-framework源于目前多种技术的设计思想,类似于OSGI和Eclipse RCP技术,适合做企业级Flex模块块的开发,但目前最新版是Beta 0.8版,只建议学习研究,不做实际项目应用。

 

      第一、Flex的potomac-framework中一个模块化的框架,参考OSGI的原理,而其构建成用户的UI界面,则是由”parts(组件)“拼装而成。这点相信有Eclipse的使用经验的朋友都明白。

      第二、potomac-framework是一种通用的商用应用Flex程序框架,拥有框架的依赖注入及支持反射和可扩展机制。

 

      第三、总体来说,potomac的设计思想是很优秀的,是值得推荐理由。但目前其拥的多种机制都还不成熟。如果企业或团体需要应用,则需要自己实现他的扩展机制。

 

   如何搭建potomac的开发环境,在官网上已有详细的文档体现。具体页面为:http://www.potomacframework.org/documentation/getting-started/,但我还是把内容再贴出来吧。

 

    1、做好环境搭建准备

          安装Java SDK

          下载 Potomac  立即下载 

          安装好Flash Builder4或Eclipse

          安装Potomac基于Eclipse的插件,老版本Eclise放在Plugins中而新版本的放在Dropins,插件在下载好的PhotoMac包中有为”com.elementriver.potomac.sdk_1.0.0_vXXXXXX.jar

 

    2、然后配制PhotoMac的开发平台

         在Window下的Perferences中,指定Potomac解压位置中的targetPlatform目录。

        不清楚可参考:http://www.potomacframework.org/documentation/modularity/about-the-target-platform/

 

 

接下来就是创建应用了,这里我就不多说了,英语不难,大家都看的懂。把这例子跑起来后再细读官方文档和API吧。

 

 

Create a Bundle
Potomac projects are composed of bundles (i.e. Potomac modules). Bundles are hosted within Flex Library Projects.

Create a new Flex Library Project.

Once the library project is created, you need to add the Potomac Bundle Nature to it.

Right-click on the project and select the new “Add Potomac Bundle Nature”.

When that is complete, you should notice that Potomac created a new file named “bundle.xml” in the project’s root folder.



Configure the Bundle
Now you’ll need to perform some standard configuration to the bundle. Open the bundle.xml file.

In the Bundle XML Editor, add the two Potomac bundles, potomac_core and potomac_ui, to the dependencies list. Click save.





Add a Sample Component
You’ll need to add at least on UI component to see anything on screen. Here’s a simple one you can cut-n-paste in called MyComponent.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
	<mx:Metadata>
		[Page(id="hellopage",title="Hello World")]
		[Part(id="hellopart",page="hellopage",
		      folder="default",title="Hello World")]		
	</mx:Metadata>
	<mx:Label x="10" y="10" text="Hello World"/>
</mx:Canvas>




Create an Application
A Potomac application is a normal Flex Project with the Potomac Application Nature. Create a Flex Project, then right-click on the project and select “Add Potomac Application Nature”.





Configure the Application
Open the newly created appManifest.xml. This file is used to configure your Potomac application.

Add potomac_ui, potomac_ui_templates_dark, and your newly created bundle to the manifest’s bundle list.

Set potomac_ui and potomac_ui_templates_dark to load as RSLs.

Now select the potomac_dark template (it became available after we included the potomac_ui_templates_dark bundle). Click save.

Lastly, you’ll need one Potomac stub to the application’s main mxml file. Simply add an instance of the PotomacInitializer like:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute" xmlns:derived="potomac.derived.*">
	<derived:PotomacInitializer/>
</mx:Application>




Run the Application
Now you’re ready to run the application



Importing the Sample Project

Potomac comes with a (hopefully) easy to follow sample project.

The sample project includes two bundles and one application.

To import the sample app into FlexBuilder, click on File – Import…

Select General – Existing Projects Into Workspace.

Select the “exampleApp” folder that was extracted from the potomac zip file for the root directory.

Check the “Copy projects into workspace” option.

Click Finish.

Once the projects import and rebuild, you should be able to run the sample appication.

 

 

          源文固定链接: http://www.nethref.com/?p=281

 

 

 

1
1
分享到:
评论

相关推荐

    cgross-Potomac-

    标题中的"cgross-Potomac-"似乎是一个项目或软件的标识符,它可能代表了某个特定的开发分支或者版本。在IT行业中,这样的命名通常用于版本控制系统,如Git,来标识不同的提交或分支。"Potomac"可能是项目的名字,也...

    flex osgi实现-potomac 实现页面与页面间数据传递和页面间各部分的数据传递

    Flex OSGi实现,以Potomac框架为例,是一种在富互联网应用程序(RIA)中集成模块化和动态性的方式。OSGi(Open Service Gateway ...通过学习和应用Potomac,开发者可以构建出更加动态、模块化的富互联网应用。

    potomac_0.8.1115.zip

    标题"Potomac_0.8.1115.zip"指向的是一个特定版本的Potomac软件包,版本号为0.8.1115。...开发者需要阅读README.txt获取详细信息,然后可以使用提供的SDK和示例来学习和开发与Potomac兼容的应用程序。

    CPU-Z 1.47,CPU 查看工具

    CPU-Z Readme file ------------------ Version 1.47 August 2008 ...CPU-Z is a freeware and can be freely distributed. ...The configuration file must be named cpuz.ini and be present at the same directory ...

    cpuz 1.0 完美版

    CPU-Z 自读文件 ------------------ Version 1.56 版本号 1.56 October 2010 2010年10月 ...The configuration file must be named cpuz.ini and be present at the same directory level as cpuz.exe....

    iPhone and iPad Apps for Absolute Beginners.pdf

    - **索引编制**:Potomac Indexing, LLC - **艺术家**:April Milne - **封面设计师**:Anna Ishchenko ### 分销与销售 本书由Springer-Verlag New York, Inc.在全球范围内分销至图书贸易市场。对于学术、企业或...

    SharePoint 2010 User's Guide Learning Microsoft's usiness Collaboration Platform

    - **索引编制者**:Potomac Indexing, LLC - **艺术家**:April Milne - **封面设计师**:Anna Ishchenko #### 七、全球发行与销售 本书在全球范围内由Springer-Verlag New York, Inc.发行,公司地址位于233 ...

    美国地图(英文版)

    - **河流**:波多马克河(Potomac River),是美国东海岸的重要河流之一。 - **海峡**:白令海峡(Bering Strait),连接北冰洋和太平洋的重要水道。 4. **城市与地区**: - **美国主要城市**:华盛顿特区...

    应用蛋白芯片技术检测幽门螺杆菌分型及对其根除率影响研究.pdf

    在研究方法上,本研究利用了西安联尔科和Potomac Bio-Tech公司生产的蛋白芯片检测系统,通过检测Hp的细胞毒素相关蛋白(CagA)、空泡毒素相关蛋白(VacA)以及尿素酶(Ure)等标志物来确定细菌的血清学分型。...

Global site tag (gtag.js) - Google Analytics