您的位置:首页 > 其它

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

2008-03-12 13:27 417 查看
Portlet描述文件通过portlet.xml文件定义application portlet和conrete portlet。这一节将介绍portlet.xml的定义。

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

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

<portlet-app-collection> 1

<portlet-app-def> 2

<portlet-app ...> 3

<concrete-portlet-app ...> 4

<concrete-portlet-app ...>

</portlet-app-def>

</portlet-app-collection>

1

portlet-app-collection定义portlet的集合

2

portlet-app-def定义了application porlet和多个conrete portlet

3

portlet-app提供了一个application portlet的定义

4

concrete-portlet-app提供了一个concrete portlet的定义

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

<concrete-portlet-app id="org.myorganization.portlets.myportlet.1"> 1

<context-param> 2

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

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

</context-param>

<concrete-portlet> 3

<portlet-name>Hello World 1</portlet-name> 4

<default-locale>en</default-locale> 5

<language locale="en_US"> 6

<title>Hello World - Sample Portlet #1</title> 7

<title-short>Hello World</title-short> 8

<description>Here is a simple portlet</description> 9

<keywords>portlet hello world</keywords> 10

</language>

<language locale="zh_CN">

<title>您好#1</title>

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

<description>久违了</description>

<keywords>问候</keywords>

</language>

<allowed-access visibility="PRIVATE" role="ADMIN"/>

<config-param>

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

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

</config-param>

</concrete-portlet>

</concrete-portlet-app>

1

Id是conrete portlet的指示符,由application portlet Id加上一个整数组成。一般来说,由1开始递增

2

(可选)定义了portlet context信息,由PortletApplicationSettings 对象封装

3

concrete portlet,用作产生PortletSettings对象

4

(可选)conrete portlet的指示符

5

(可选) 缺省的locale

6

(可选) 其他的locale

7

(可选)title

8

(可选) 更简短的title,可以被用作WML设备上显示

9

(可选) 摘要

10

(可选) 关键字

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

附加的concrete portlet 设置,可以通过PortletSettings 对象取得
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: