首页 > 代码库 > 用Oracle ADF Essentials 开发Web 应用
用Oracle ADF Essentials 开发Web 应用
Kevin QQ:527358657
Oracle ADF QQ 群:216731341
第一章ADF Essentials 应用开发环境的安装和设置........................................................7
准备...........................................................................................................................................7
安装MySQL ............................................................................................................................8
MySQL 的安装..............................................................................................................10
MySQL 的设置...............................................................................................................11
修改MySQL 选项..........................................................................................................14
验证MySQL 能正常运行..............................................................................................14
修改Sakila 数据库.........................................................................................................15
安装JDK 和GlassFish...................................................................................................16
安装JDK 7 .............................................................................................................16
安装GlassFish........................................................................................................18
GlassFish 的安装....................................................................................................18
设置域.....................................................................................................................19
验证安装是否成功.................................................................................................21
在GlassFish 中安装MySQL 连接器...................................................................22
在GlassFish 中增加数据源...................................................................................22
安装ADF Essentials.......................................................................................................24
获得ADF Essentials...............................................................................................24
在GlassFish 中安装ADF 共享库........................................................................25
设置GlassFish JVM 参数.....................................................................................25
验证安装是否成功.................................................................................................27
安装JDeveloper .............................................................................................................27
选择Jdeveloper 还是Eclipse? ...............................................................................28
Jdeveloper 的版本..................................................................................................28
Jdeveloper 的安装..................................................................................................28
在JDeveloper 中安装MySQL 连接器................................................................28
安装GlassFish 服务器扩展..................................................................................28
连接到GlassFish 服务器......................................................................................28
创建简单的ADF Essentials 应用.................................................................................28
创建应用.................................................................................................................29
数据库.....................................................................................................................29
业务服务.................................................................................................................29
模型层.....................................................................................................................29
控制层.....................................................................................................................29
视图层.....................................................................................................................29
准备部署.................................................................................................................29
数据源.............................................................................................................29
AM 设置.........................................................................................................29
修改部署平台.................................................................................................29
运行ADF Essentials 应用.....................................................................................30
如何运行得更快?.........................................................................................................30
在WebLogic 中设置MySQL ...............................................................................30
在WebLogic 中增加数据源..................................................................................30
重新运行ADF Essentials 应用..............................................................................30
小结.........................................................................................................................................30
第2 章:创建业务服务(Business Service)..............................................................................30
选择业务服务.................................................................................................................31
ADF BC ..........................................................................................................................32
开始示例应用.................................................................................................................33
ADF BC 工作原理.........................................................................................................34
创建自己的基础类.........................................................................................................35
创建框架扩展类.............................................................................................................35
使用框架扩展类.............................................................................................................37
示例应用创建EO ..........................................................................................................38
准备创建.........................................................................................................................38
运行向导.........................................................................................................................39
Examining the result .......................................................................................................40
设置标签.........................................................................................................................40
自动生成的值.................................................................................................................41
清除数据类型.................................................................................................................41
清除关联.........................................................................................................................42
删除多余的关联.............................................................................................................43
修正错误的关联.............................................................................................................44
移除EO 中无效的引用.................................................................................................45
创建VO..........................................................................................................................46
The storyboard ................................................................................................................46
创建客户VO..................................................................................................................47
创建rental VO................................................................................................................50
创建视图连接.................................................................................................................52
AM..................................................................................................................................52
测试BC ..........................................................................................................................54
小结.................................................................................................................................55
第3章: 创建任务流(Task Flows)和页面(Pages)..............................................................55
创建任务流.....................................................................................................................56
绑定任务流和未绑定任务流.........................................................................................56
页面和页面片断.............................................................................................................57
任务流模版.....................................................................................................................58
示例应用.........................................................................................................................59
创建租借DVD 任务流..................................................................................................59
创建归还DVD 任务流.................................................................................................60
内存范围.........................................................................................................................65
任务流中的其他组件.....................................................................................................65
创建页面.........................................................................................................................66
使用模板.........................................................................................................................66
Facet 定义......................................................................................................................67
页面片段模板.................................................................................................................67
页面模板.........................................................................................................................69
示例应用.........................................................................................................................72
创建客户搜索页面.........................................................................................................73
创建归还DVD 页面.....................................................................................................75
另一个选择–ADF 查询面板......................................................................................75
创建出租DVD 页面......................................................................................................76
创建主页面.....................................................................................................................76
运行页面.........................................................................................................................78
使用数据绑定.................................................................................................................78
在页面上展示客户信息.................................................................................................78
在页面上显示客户租借信息.........................................................................................81
增加导航.........................................................................................................................83
小结.................................................................................................................................83
第4章增加业务逻辑.................................................................................................................83
在BC 中增加业务逻辑.................................................................................................84
EO 中的逻辑..................................................................................................................84
Overriding accessors .......................................................................................................84
使用数据库触发器.........................................................................................................85
重写doDML() ................................................................................................................86
数据验证.........................................................................................................................87
声明式验证.....................................................................................................................88
正则表达式验证.............................................................................................................89
Groovy 脚本..................................................................................................................90
方法验证.........................................................................................................................91
VO 中的业务逻辑..........................................................................................................91
重写访问器(accessor) ...............................................................................................91
改变视图条件.................................................................................................................92
AM 中的业务逻辑.........................................................................................................93
在用户接口中增加业务逻辑.........................................................................................94
为按钮增加bean 方法...................................................................................................94
向任务流增加bean ........................................................................................................95
在bean 中访问UI 组件.................................................................................................96
访问绑定层.....................................................................................................................97
使用属性值.....................................................................................................................97
使用操作.........................................................................................................................98
使用整个数据集.............................................................................................................98
显示消息.........................................................................................................................98
示例应用.........................................................................................................................99
注册出租.........................................................................................................................99
创建一个bean ..............................................................................................................100
映照域...........................................................................................................................100
建立绑定.......................................................................................................................101
编写代码.......................................................................................................................103
记录归还.......................................................................................................................104
增加列和按钮...............................................................................................................104
创建bean ......................................................................................................................105
映照表...........................................................................................................................105
创建VO 方法...............................................................................................................105
发布方法.......................................................................................................................106
建立绑定.......................................................................................................................107
编写bean 代码.............................................................................................................107
标记当天归还的项.......................................................................................................108
创建临时属性...............................................................................................................108
绑定新属性...................................................................................................................108
对属性返回值编程.......................................................................................................109
使用属性值...................................................................................................................110
讨论............................................................................................................................... 111
小结............................................................................................................................... 111
第5 章创建企业应用................................................................................................................. 111
划分模块...............................................................................................................................112
工作空间和项目...........................................................................................................112
工作空间的层次...........................................................................................................112
目录结构.......................................................................................................................113
使用版本控制.......................................................................................................................114
使用ADF 库........................................................................................................................115
创建ADF 库.................................................................................................................115
发布ADF 库.................................................................................................................116
使用ADF 库.................................................................................................................116
示例应用...............................................................................................................................117
创建主应用工作空间...................................................................................................117
创建工作空间.......................................................................................................117
加入源代码控制...................................................................................................118
创建ADF 库目录................................................................................................120
创建CommonCode 工作空间.....................................................................................120
创建工作空间.......................................................................................................120
重建框架扩展类...................................................................................................121
检查JDeveloper preferences ................................................................................121
加入源代码版本控制...........................................................................................122
创建ADF 库.........................................................................................................122
发布ADF 库.........................................................................................................123
创建CommonUI 工作空间.........................................................................................123
创建工作空间.......................................................................................................123
创建模板...............................................................................................................124
增加ADF 库.........................................................................................................125
加入源代码版本控制系统...................................................................................126
创建和发布ADF 库.............................................................................................126
创建CommonModel 工作空间...................................................................................126
创建工作空间.......................................................................................................126
增加ADF 库.........................................................................................................127
创建EO...............................................................................................................127
加入源代码版本控制和创建ADF 库.................................................................128
创建RentDvd 子系统工作空间.................................................................................128
创建工作空间.......................................................................................................128
增加ADF 库.........................................................................................................128
创建VO................................................................................................................129
创建AM...............................................................................................................130
创建任务流和页面片断.......................................................................................130
增加绑定...............................................................................................................131
增加业务逻辑.......................................................................................................131
其他.......................................................................................................................131
创建ReturnDvd 子系统工作空间...............................................................................132
创建工作空间.......................................................................................................132
增加ADF 库.......................................................................................................132
创建Customer VO ..............................................................................................132
创建Rental VO....................................................................................................132
创建视图连接.......................................................................................................133
创建AM...............................................................................................................134
创建任务流...........................................................................................................135
创建Customer 搜索页面片断...........................................................................135
创建Rentals 页面片断.......................................................................................136
记录归还...............................................................................................................136
其他.......................................................................................................................136
完成主应用工作空间...................................................................................................136
增加ADF 库.......................................................................................................137
创建主页面...........................................................................................................137
小结.......................................................................................................................................137
第6 章ADF 应用的调试............................................................................................................137
ADF logging .........................................................................................................................137
创建logger ...................................................................................................................138
增加log 语句................................................................................................................138
业务logging .................................................................................................................139
JDeveloper shortcuts .....................................................................................................140
读取log ........................................................................................................................141
GlassFish 环境下的Logging ...............................................................................................142
控制域logging .............................................................................................................143
控制单个logger ...........................................................................................................143
JDeveloper 中的调试...........................................................................................................144
调试代码.......................................................................................................................144
了解ADF 生命周期.....................................................................................................145
调试任务流...........................................................................................................146
调试ADF 库.........................................................................................................................147
创建源代码目录...........................................................................................................147
创建源代码JAR 文件..................................................................................................148
在主应用中包含源代码...............................................................................................148
在ADF 库中设置断点.................................................................................................149
调试ADF 源代码........................................................................................................150
小结.......................................................................................................................................151
第7 章保护ADF Essentials 应用.............................................................................................151
Apache Shiro 基础...............................................................................................................151
获取软件...............................................................................................................................151
在应用中安装包...................................................................................................................152
为Shiro 设置应用........................................................................................................153
Shiro 进阶.....................................................................................................................154
用户数据库...................................................................................................................155
基于Form 的授权........................................................................................................156
登录页面.......................................................................................................................156
登录bean .....................................................................................................................157
Login 方法....................................................................................................................157
用户过滤器...................................................................................................................158
Shiro 配置....................................................................................................................159
访问用户.......................................................................................................................160
实现授权.......................................................................................................................160
Can I see some ID, please? ...........................................................................................160
Are you a member, Sir?.................................................................................................161
使组件不可用...............................................................................................................162
移除组件.......................................................................................................................163
保护任务流...................................................................................................................163
小结.......................................................................................................................................164
第8 章构建和部署.....................................................................................................................164
创建build 脚本....................................................................................................................164
创建脚本.......................................................................................................................165
部署单个应用...............................................................................................................167
构建主应用...................................................................................................................167
起始点...................................................................................................................167
构建应用EAR 文件............................................................................................167
构建所有子系统...................................................................................................168
复制所有ADF 库................................................................................................169
Putting it all together.............................................................................................170
自动部署到GlassFish..........................................................................................................170
用命令行部署...............................................................................................................171
使用Ant 部署..............................................................................................................171
在构建中集成其他功能.......................................................................................................172
Preparing to go live ...............................................................................................................172
清除代码.......................................................................................................................172
数据库连接...........................................................................................................172
部署平台...............................................................................................................173
Print 语句..............................................................................................................174
ADF 应用的调优.........................................................................................................174
小结.......................................................................................................................................174
Oracle ADF QQ 群:216731341
第一章ADF Essentials 应用开发环境的安装和设置........................................................7
准备...........................................................................................................................................7
安装MySQL ............................................................................................................................8
MySQL 的安装..............................................................................................................10
MySQL 的设置...............................................................................................................11
修改MySQL 选项..........................................................................................................14
验证MySQL 能正常运行..............................................................................................14
修改Sakila 数据库.........................................................................................................15
安装JDK 和GlassFish...................................................................................................16
安装JDK 7 .............................................................................................................16
安装GlassFish........................................................................................................18
GlassFish 的安装....................................................................................................18
设置域.....................................................................................................................19
验证安装是否成功.................................................................................................21
在GlassFish 中安装MySQL 连接器...................................................................22
在GlassFish 中增加数据源...................................................................................22
安装ADF Essentials.......................................................................................................24
获得ADF Essentials...............................................................................................24
在GlassFish 中安装ADF 共享库........................................................................25
设置GlassFish JVM 参数.....................................................................................25
验证安装是否成功.................................................................................................27
安装JDeveloper .............................................................................................................27
选择Jdeveloper 还是Eclipse? ...............................................................................28
Jdeveloper 的版本..................................................................................................28
Jdeveloper 的安装..................................................................................................28
在JDeveloper 中安装MySQL 连接器................................................................28
安装GlassFish 服务器扩展..................................................................................28
连接到GlassFish 服务器......................................................................................28
创建简单的ADF Essentials 应用.................................................................................28
创建应用.................................................................................................................29
数据库.....................................................................................................................29
业务服务.................................................................................................................29
模型层.....................................................................................................................29
控制层.....................................................................................................................29
视图层.....................................................................................................................29
准备部署.................................................................................................................29
数据源.............................................................................................................29
AM 设置.........................................................................................................29
修改部署平台.................................................................................................29
运行ADF Essentials 应用.....................................................................................30
如何运行得更快?.........................................................................................................30
在WebLogic 中设置MySQL ...............................................................................30
在WebLogic 中增加数据源..................................................................................30
重新运行ADF Essentials 应用..............................................................................30
小结.........................................................................................................................................30
第2 章:创建业务服务(Business Service)..............................................................................30
选择业务服务.................................................................................................................31
ADF BC ..........................................................................................................................32
开始示例应用.................................................................................................................33
ADF BC 工作原理.........................................................................................................34
创建自己的基础类.........................................................................................................35
创建框架扩展类.............................................................................................................35
使用框架扩展类.............................................................................................................37
示例应用创建EO ..........................................................................................................38
准备创建.........................................................................................................................38
运行向导.........................................................................................................................39
Examining the result .......................................................................................................40
设置标签.........................................................................................................................40
自动生成的值.................................................................................................................41
清除数据类型.................................................................................................................41
清除关联.........................................................................................................................42
删除多余的关联.............................................................................................................43
修正错误的关联.............................................................................................................44
移除EO 中无效的引用.................................................................................................45
创建VO..........................................................................................................................46
The storyboard ................................................................................................................46
创建客户VO..................................................................................................................47
创建rental VO................................................................................................................50
创建视图连接.................................................................................................................52
AM..................................................................................................................................52
测试BC ..........................................................................................................................54
小结.................................................................................................................................55
第3章: 创建任务流(Task Flows)和页面(Pages)..............................................................55
创建任务流.....................................................................................................................56
绑定任务流和未绑定任务流.........................................................................................56
页面和页面片断.............................................................................................................57
任务流模版.....................................................................................................................58
示例应用.........................................................................................................................59
创建租借DVD 任务流..................................................................................................59
创建归还DVD 任务流.................................................................................................60
内存范围.........................................................................................................................65
任务流中的其他组件.....................................................................................................65
创建页面.........................................................................................................................66
使用模板.........................................................................................................................66
Facet 定义......................................................................................................................67
页面片段模板.................................................................................................................67
页面模板.........................................................................................................................69
示例应用.........................................................................................................................72
创建客户搜索页面.........................................................................................................73
创建归还DVD 页面.....................................................................................................75
另一个选择–ADF 查询面板......................................................................................75
创建出租DVD 页面......................................................................................................76
创建主页面.....................................................................................................................76
运行页面.........................................................................................................................78
使用数据绑定.................................................................................................................78
在页面上展示客户信息.................................................................................................78
在页面上显示客户租借信息.........................................................................................81
增加导航.........................................................................................................................83
小结.................................................................................................................................83
第4章增加业务逻辑.................................................................................................................83
在BC 中增加业务逻辑.................................................................................................84
EO 中的逻辑..................................................................................................................84
Overriding accessors .......................................................................................................84
使用数据库触发器.........................................................................................................85
重写doDML() ................................................................................................................86
数据验证.........................................................................................................................87
声明式验证.....................................................................................................................88
正则表达式验证.............................................................................................................89
Groovy 脚本..................................................................................................................90
方法验证.........................................................................................................................91
VO 中的业务逻辑..........................................................................................................91
重写访问器(accessor) ...............................................................................................91
改变视图条件.................................................................................................................92
AM 中的业务逻辑.........................................................................................................93
在用户接口中增加业务逻辑.........................................................................................94
为按钮增加bean 方法...................................................................................................94
向任务流增加bean ........................................................................................................95
在bean 中访问UI 组件.................................................................................................96
访问绑定层.....................................................................................................................97
使用属性值.....................................................................................................................97
使用操作.........................................................................................................................98
使用整个数据集.............................................................................................................98
显示消息.........................................................................................................................98
示例应用.........................................................................................................................99
注册出租.........................................................................................................................99
创建一个bean ..............................................................................................................100
映照域...........................................................................................................................100
建立绑定.......................................................................................................................101
编写代码.......................................................................................................................103
记录归还.......................................................................................................................104
增加列和按钮...............................................................................................................104
创建bean ......................................................................................................................105
映照表...........................................................................................................................105
创建VO 方法...............................................................................................................105
发布方法.......................................................................................................................106
建立绑定.......................................................................................................................107
编写bean 代码.............................................................................................................107
标记当天归还的项.......................................................................................................108
创建临时属性...............................................................................................................108
绑定新属性...................................................................................................................108
对属性返回值编程.......................................................................................................109
使用属性值...................................................................................................................110
讨论............................................................................................................................... 111
小结............................................................................................................................... 111
第5 章创建企业应用................................................................................................................. 111
划分模块...............................................................................................................................112
工作空间和项目...........................................................................................................112
工作空间的层次...........................................................................................................112
目录结构.......................................................................................................................113
使用版本控制.......................................................................................................................114
使用ADF 库........................................................................................................................115
创建ADF 库.................................................................................................................115
发布ADF 库.................................................................................................................116
使用ADF 库.................................................................................................................116
示例应用...............................................................................................................................117
创建主应用工作空间...................................................................................................117
创建工作空间.......................................................................................................117
加入源代码控制...................................................................................................118
创建ADF 库目录................................................................................................120
创建CommonCode 工作空间.....................................................................................120
创建工作空间.......................................................................................................120
重建框架扩展类...................................................................................................121
检查JDeveloper preferences ................................................................................121
加入源代码版本控制...........................................................................................122
创建ADF 库.........................................................................................................122
发布ADF 库.........................................................................................................123
创建CommonUI 工作空间.........................................................................................123
创建工作空间.......................................................................................................123
创建模板...............................................................................................................124
增加ADF 库.........................................................................................................125
加入源代码版本控制系统...................................................................................126
创建和发布ADF 库.............................................................................................126
创建CommonModel 工作空间...................................................................................126
创建工作空间.......................................................................................................126
增加ADF 库.........................................................................................................127
创建EO...............................................................................................................127
加入源代码版本控制和创建ADF 库.................................................................128
创建RentDvd 子系统工作空间.................................................................................128
创建工作空间.......................................................................................................128
增加ADF 库.........................................................................................................128
创建VO................................................................................................................129
创建AM...............................................................................................................130
创建任务流和页面片断.......................................................................................130
增加绑定...............................................................................................................131
增加业务逻辑.......................................................................................................131
其他.......................................................................................................................131
创建ReturnDvd 子系统工作空间...............................................................................132
创建工作空间.......................................................................................................132
增加ADF 库.......................................................................................................132
创建Customer VO ..............................................................................................132
创建Rental VO....................................................................................................132
创建视图连接.......................................................................................................133
创建AM...............................................................................................................134
创建任务流...........................................................................................................135
创建Customer 搜索页面片断...........................................................................135
创建Rentals 页面片断.......................................................................................136
记录归还...............................................................................................................136
其他.......................................................................................................................136
完成主应用工作空间...................................................................................................136
增加ADF 库.......................................................................................................137
创建主页面...........................................................................................................137
小结.......................................................................................................................................137
第6 章ADF 应用的调试............................................................................................................137
ADF logging .........................................................................................................................137
创建logger ...................................................................................................................138
增加log 语句................................................................................................................138
业务logging .................................................................................................................139
JDeveloper shortcuts .....................................................................................................140
读取log ........................................................................................................................141
GlassFish 环境下的Logging ...............................................................................................142
控制域logging .............................................................................................................143
控制单个logger ...........................................................................................................143
JDeveloper 中的调试...........................................................................................................144
调试代码.......................................................................................................................144
了解ADF 生命周期.....................................................................................................145
调试任务流...........................................................................................................146
调试ADF 库.........................................................................................................................147
创建源代码目录...........................................................................................................147
创建源代码JAR 文件..................................................................................................148
在主应用中包含源代码...............................................................................................148
在ADF 库中设置断点.................................................................................................149
调试ADF 源代码........................................................................................................150
小结.......................................................................................................................................151
第7 章保护ADF Essentials 应用.............................................................................................151
Apache Shiro 基础...............................................................................................................151
获取软件...............................................................................................................................151
在应用中安装包...................................................................................................................152
为Shiro 设置应用........................................................................................................153
Shiro 进阶.....................................................................................................................154
用户数据库...................................................................................................................155
基于Form 的授权........................................................................................................156
登录页面.......................................................................................................................156
登录bean .....................................................................................................................157
Login 方法....................................................................................................................157
用户过滤器...................................................................................................................158
Shiro 配置....................................................................................................................159
访问用户.......................................................................................................................160
实现授权.......................................................................................................................160
Can I see some ID, please? ...........................................................................................160
Are you a member, Sir?.................................................................................................161
使组件不可用...............................................................................................................162
移除组件.......................................................................................................................163
保护任务流...................................................................................................................163
小结.......................................................................................................................................164
第8 章构建和部署.....................................................................................................................164
创建build 脚本....................................................................................................................164
创建脚本.......................................................................................................................165
部署单个应用...............................................................................................................167
构建主应用...................................................................................................................167
起始点...................................................................................................................167
构建应用EAR 文件............................................................................................167
构建所有子系统...................................................................................................168
复制所有ADF 库................................................................................................169
Putting it all together.............................................................................................170
自动部署到GlassFish..........................................................................................................170
用命令行部署...............................................................................................................171
使用Ant 部署..............................................................................................................171
在构建中集成其他功能.......................................................................................................172
Preparing to go live ...............................................................................................................172
清除代码.......................................................................................................................172
数据库连接...........................................................................................................172
部署平台...............................................................................................................173
Print 语句..............................................................................................................174
ADF 应用的调优.........................................................................................................174
小结.......................................................................................................................................174
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。