jetspeed开发实战
2005-09-23 12:18
330 查看
这里假设monsys为web服务的名称,其路径在webapps/下面
1,jetspeed的图片处理图片默认放在monsys/images下面,
调用方法:$clink.setURI("images/test.jpg")
2,javascript处理 javascript默认放在monsys/javascript下
调用方法:$clink.setURI("javascript/test.css")
3,portlets的位置位于monsys/WEB-INF/templates/vm/portlets/html下面
4,页面总体布局控制看JetspeedResources.properties
bottomnav.enable=true
bottomnav.vm=bottom.vm
leftnav.enable=true
leftnav.vm=left.vm
leftnav.width=10%
topnav.enable=true
topnav.vm=top.vm
topnav.logo.file=images/jetspeed-logo-1.5.gif
topnav.logo.url=
topnav.user_login.enable=true
topnav.user_creation.enable=true
topnav.my_pages.enable=true
5,portlets源代码分析: portlet主要实现三个方法:
<1>,buildMaximizedContext最大化
<2>,buildConfigureContext显示信息
<3>,buildNormalContext正常情况,也就是所看到的正常显示时所要显示的信息
<4>,调用时,在添加模块时添加新参数action=portlets.GraphDailyAction
package org.apache.jetspeed.modules.actions.portlets;
import .............(N个,略)
public class GraphDailyAction extends VelocityPortletAction {
/**
* Subclasses should override this method if they wish to
* build specific content when maximized. Default behavior is
* to do the same as normal content.
*/
protected void buildMaximizedContext(VelocityPortlet portlet, Context context, RunData rundata) {
buildNormalContext(portlet, context, rundata);
String text = (String) context.get("text");
if (text == null) {
text = "Top Record of baccarat game";
}
context.put("text", text + " (Maximized !)");
}
/**
* Subclasses should override this method if they wish to
* provide their own customization behavior.
* Default is to use Portal base customizer action
*/
protected void buildConfigureContext(VelocityPortlet portlet, Context context, RunData rundata) {
buildNormalContext(portlet, context, rundata);
setTemplate(rundata, "hello-customize");
}
/**
* 这是主要部份
* Subclasses must override this method to provide default behavior
* for the portlet action
*/
protected void buildNormalContext(VelocityPortlet portlet, Context context, RunData rundata) {
String mode = portlet.getPortletConfig().getInitParameter("mode"); //读取添加模块时从配置文件传来的参数
String searchdate = rundata.getParameters().getString("searchdate"); //取得从页面提交得到的参数
context.put("mode", mode);
context.put("searchdate", searchdate) //输出页面要显示的信息,支持输出数组,对像,及容器等形式的数据
}
}
<5>写好源代码,并编译,参考里的:
1,<3>所建的参数action,其值为portlets.GraphDailyAction,则系统会去执行这个类
1,jetspeed的图片处理图片默认放在monsys/images下面,
调用方法:$clink.setURI("images/test.jpg")
2,javascript处理 javascript默认放在monsys/javascript下
调用方法:$clink.setURI("javascript/test.css")
3,portlets的位置位于monsys/WEB-INF/templates/vm/portlets/html下面
4,页面总体布局控制看JetspeedResources.properties
bottomnav.enable=true
bottomnav.vm=bottom.vm
leftnav.enable=true
leftnav.vm=left.vm
leftnav.width=10%
topnav.enable=true
topnav.vm=top.vm
topnav.logo.file=images/jetspeed-logo-1.5.gif
topnav.logo.url=
topnav.user_login.enable=true
topnav.user_creation.enable=true
topnav.my_pages.enable=true
5,portlets源代码分析: portlet主要实现三个方法:
<1>,buildMaximizedContext最大化
<2>,buildConfigureContext显示信息
<3>,buildNormalContext正常情况,也就是所看到的正常显示时所要显示的信息
<4>,调用时,在添加模块时添加新参数action=portlets.GraphDailyAction
package org.apache.jetspeed.modules.actions.portlets;
import .............(N个,略)
public class GraphDailyAction extends VelocityPortletAction {
/**
* Subclasses should override this method if they wish to
* build specific content when maximized. Default behavior is
* to do the same as normal content.
*/
protected void buildMaximizedContext(VelocityPortlet portlet, Context context, RunData rundata) {
buildNormalContext(portlet, context, rundata);
String text = (String) context.get("text");
if (text == null) {
text = "Top Record of baccarat game";
}
context.put("text", text + " (Maximized !)");
}
/**
* Subclasses should override this method if they wish to
* provide their own customization behavior.
* Default is to use Portal base customizer action
*/
protected void buildConfigureContext(VelocityPortlet portlet, Context context, RunData rundata) {
buildNormalContext(portlet, context, rundata);
setTemplate(rundata, "hello-customize");
}
/**
* 这是主要部份
* Subclasses must override this method to provide default behavior
* for the portlet action
*/
protected void buildNormalContext(VelocityPortlet portlet, Context context, RunData rundata) {
String mode = portlet.getPortletConfig().getInitParameter("mode"); //读取添加模块时从配置文件传来的参数
String searchdate = rundata.getParameters().getString("searchdate"); //取得从页面提交得到的参数
context.put("mode", mode);
context.put("searchdate", searchdate) //输出页面要显示的信息,支持输出数组,对像,及容器等形式的数据
}
}
<5>写好源代码,并编译,参考里的:
1,<3>所建的参数action,其值为portlets.GraphDailyAction,则系统会去执行这个类
相关文章推荐
- jetspeed开发实战
- 博客园新书《构筑敏捷的开发团队—VS2010实战兵法》已经出版
- 魔乐科技MLDN_android开发实战经典_李兴华_视频下载汇总
- Web前端开发工程师实战培训教程
- Knockoutjs实战开发:属性监控(Observables)和依赖跟踪(Dependency tracking )
- Bluemix云平台实战日志:Java开发Wason应用
- POI实战-java开发excel详解之附录
- 微信小程序高级实战开发培训视频
- 安卓项目开发实战(1)续--首页顶部菜单用actionbar实现
- POI实战-java开发excel详解之简单写出
- MongoDB实战开发 【零基础学习,附完整Asp.net示例】
- Eclipse+CXF框架开发Web服务实战
- iPhone与iPad开发实战——精通iOS开发(更新完毕)
- 实战 J2EE 开发购物网站 开发环境篇
- WCF开发实战系列一:创建第一个WCF服务
- Spring 3.x 企业开发实战Chapter7 Part1
- WCF开发实战系列五:创建WCF客户端程序
- 《.NET 2.0模式开发实战》Foundations of Object-Oriented Programming Using .NET 2.0 Patterns
- JSON开发笔记(三)—— JSON Schema实战(中)
- ado.net视频教程-实战开发CRM企业客户管理系统