[Portal参考手册]Portlet布局框架

Portlet布局组件类似java中的awt/swing组件。原因有二:

<!--[if !supportLists]-->1) <!--[endif]-->象awt/swing一样,提供了相近的增删组件的API

<!--[if !supportLists]-->2) <!--[endif]-->基于Composite设计模式,用户可以自己开发组件。



Portlet布局组件:

一个portlet布局,在用户看来就是一个PortletPage。一个PortletPage包含多个portlet组件。通常portlet布局组件继承于PortletContainer类,有width,height,CSS属性等。



PortletContent

允许使用include属性包含外部内容。

PortletTableLayout

表格布局。

PortletRowLayout

行布局。

PortletColumnLayout

列布局。

PortletTabbedPane

Tab面板布局。

PortletTab

一个tab定义了一个标题和一个 portlet组件,当tab被选择的时候这个组件将被显示。

PortletFrame

一个portlet frame 显示一个portlet。它包含标题边框和要显示的portlet的类名。如果transparent属性不被设为true, 标题栏不会被显示。required-role元素可以被指定为"GUEST", "USER", "ADMIN" 或 "SUPER"。



设计一个布局:

一个外部的web应用可以指定一种布局,通过年纪WEB-INF/layout.xml文件。布局描述文件定义了在一个double-tabbed 面板中的portlet的组织。下面时一个例子。

<portlet-tabbed-pane> <!--[if !vml]--><!--[endif]-->

<portlet-tab>

<title lang="en">Examples</title> <!--[if !vml]--><!--[endif]-->

<portlet-tabbed-pane style="sub-menu"> <!--[if !vml]--><!--[endif]-->

<portlet-tab>

<title lang="en">Simple Examples</title>

<table-layout> <!--[if !vml]--><!--[endif]-->

<row-layout> <!--[if !vml]--><!--[endif]-->

<column-layout width="50%> <!--[if !vml]--><!--[endif]-->

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

<portlet-class>org.myorg.portlets.examples.simpleone.1</portlet-class>

</portlet-frame>

</column-layout width="50%>

<column-layout width="50%>

<portlet-frame label="simpletwo"> <!--[if !vml]--><!--[endif]-->

<portlet-class>org.myorg.portlets.examples.simpletwo.1</portlet-class>

</portlet-frame>

</column-layout>

</row-layout>

</table-layout>

</portlet-tab>

<portlet-tab>

<title lang="en">Demos</title>

<table-layout>

<row-layout>

<column-layout>

<portlet-frame>

<name>DemoPortlet</name>

<portlet-class>com.kuaff.spirit.portlets.examples.DemoPortlet.1</portlet-class>

</portlet-frame>

</column-layout>

</row-layout>

</table-layout>

</portlet-tab>

</portlet-tabbed-pane>

</portlet-tab>

</portlet-tabbed-pane>



<!--[if !vml]--><!--[endif]-->
每一个描述文件都必须以portlet-tabbed-pane 开始

<!--[if !vml]--><!--[endif]-->
Tab标题可以本地化。

<!--[if !vml]--><!--[endif]-->
不是必须的。

<!--[if !vml]--><!--[endif]-->
Table布局。

<!--[if !vml]--><!--[endif]-->
Row布局。

<!--[if !vml]--><!--[endif]-->
Table布局。

<!--[if !vml]--><!--[endif]-->
portlet frame。

<!--[if !vml]--><!--[endif]-->
指定一个标签。意味着它可以被连接。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值