[Portal参考手册]Portlet描述文件

Portlet描述文件通过portlet.xml文件定义application portlet和conrete portlet。这一节将介绍portlet.xml的定义。

Portlet描述文件有下面的结构:

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app-collection>

<!--[if !vml]--><!--[endif]-->
<portlet-app-def> <!--[if !vml]--><!--[endif]-->

<portlet-app ...>

<!--[if !vml]--><!--[endif]-->
<concrete-portlet-app ...>

<!--[if !vml]--><!--[endif]-->
<concrete-portlet-app ...>
</portlet-app-def>
</portlet-app-collection>


<!--[if !vml]--><!--[endif]-->
portlet-app-collection定义portlet的集合

<!--[if !vml]--><!--[endif]-->
portlet-app-def定义了application porlet和多个conrete portlet

<!--[if !vml]--><!--[endif]-->
portlet-app提供了一个application portlet的定义

<!--[if !vml]--><!--[endif]-->
concrete-portlet-app提供了一个concrete portlet的定义




一个具体portlet定义了conrete portlet的属性。一个application portlet可以有多个conrete portlet。



<concrete-portlet-app id="org.myorganization.portlets.myportlet.1"> <!--[if !vml]--><!--[endif]-->

<context-param> <!--[if !vml]--><!--[endif]-->

<param-name>buzzle</param-name>

<param-value>yea</param-value>

</context-param>

<concrete-portlet> <!--[if !vml]--><!--[endif]-->

<portlet-name>Hello World 1</portlet-name> <!--[if !vml]--><!--[endif]-->

<default-locale>en</default-locale> <!--[if !vml]--><!--[endif]-->

<language locale="en_US"> <!--[if !vml]--><!--[endif]-->

<title>Hello World - Sample Portlet #1</title> <!--[if !vml]--><!--[endif]-->

<title-short>Hello World</title-short> <!--[if !vml]--><!--[endif]-->

<description>Here is a simple portlet</description> <!--[if !vml]--><!--[endif]-->

<keywords>portlet hello world</keywords> <!--[if !vml]--><!--[endif]-->

</language>

<language locale="zh_CN">

<title>您好#1</title>

<title-short>您好 </title-short>

<description>久违了</description>

<keywords>问候</keywords>

</language>

<allowed-access visibility="PRIVATE" role="ADMIN"/> <!--[if !vml]--><!--[endif]-->

<config-param> <!--[if !vml]--><!--[endif]-->

<param-name>a config parameter</param-name>

<param-value>a config value</param-value>

</config-param>

</concrete-portlet>

</concrete-portlet-app>



<!--[if !vml]--><!--[endif]-->
Id是conrete portlet的指示符,由application portlet Id加上一个整数组成。一般来说,由1开始递增

<!--[if !vml]--><!--[endif]-->
(可选)定义了portlet context信息,由PortletApplicationSettings 对象封装

<!--[if !vml]--><!--[endif]-->
concrete portlet,用作产生PortletSettings对象

<!--[if !vml]--><!--[endif]-->
(可选)conrete portlet的指示符

<!--[if !vml]--><!--[endif]-->
(可选) 缺省的locale

<!--[if !vml]--><!--[endif]-->
(可选) 其他的locale

<!--[if !vml]--><!--[endif]-->
(可选)title

<!--[if !vml]--><!--[endif]-->
(可选) 更简短的title,可以被用作WML设备上显示

<!--[if !vml]--><!--[endif]-->
(可选) 摘要

<!--[if !vml]--><!--[endif]-->
(可选) 关键字

<!--[if !vml]--><!--[endif]-->
(可选) 定义了用户浏览这个portlet的时候的可视化属性。Allowed 的值有两个 PRIVATE 和PUBLIC. Role属性哪个角色可以访问这个portlet。 可用的值是在PortletRole 对象中定义的值

<!--[if !vml]--><!--[endif]-->
附加的concrete portlet 设置,可以通过PortletSettings 对象取得
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值