六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 125|回复: 0

Portlet布局框架 收藏

[复制链接]

升级  10%

66

主题

66

主题

66

主题

举人

Rank: 3Rank: 3

积分
230
 楼主| 发表于 2013-2-7 22:50:57 | 显示全部楼层 |阅读模式
Portlet<span style="">布局组件类似java中的awt/swing组件。原因有二:
<!---->1)     <!---->象awt/swing一样,提供了相近的增删组件的API
<!---->2)     <!----><span style="">基于Composite设计模式,用户可以自己开发组件。
 
Portlet<span style="">布局组件:
<span style="">一个portlet布局,在用户看来就是一个PortletPage。一个PortletPage包含多个portlet组件。通常portlet布局组件继承于PortletContainer类,有width,height,CSS属性等。
 
PortletContent
允许使用include属性包含外部内容。
PortletTableLayout
表格布局。
PortletRowLayout
行布局。
PortletColumnLayout
列布局。
PortletTabbedPane
Tab面板布局。
PortletTab
一个tab定义了一个标题和一个 portlet组件,当tab被选择的时候这个组件将被显示。
PortletFrame
<span style="">一个portlet frame 显示一个portlet。它包含标题边框和要显示的portlet的类名。如果transparent属性不被设为true, 标题栏不会被显示。required-role元素可以被指定为"GUEST", "USER", "ADMIN" 或 "SUPER"。
   
<span style="">设计一个布局:
    一个外部的web应用可以指定一种布局,通过年纪WEB-INF/layout.xml文件。布局描述文件定义了在一个double-tabbed 面板中的portlet的组织。下面时一个例子。
<portlet-tabbed-pane> <a name="tab.pane" /><!----><!----><img alt="1" width="12" height="12" /><!---->
    <portlet-tab>
        <title lang="en">Examples</title> <a name="tab.title" /><!----><!----><img alt="2" width="12" height="12" /><!---->
        <portlet-tabbed-pane style="sub-menu">  <a name="tab.pane2" /><!----><!----><img alt="3" width="12" height="12" /><!---->
            <portlet-tab>
                <title lang="en">Simple Examples</title>
                <table-layout>    <a name="table.layout" /><!----><!----><img alt="4" width="12" height="12" /><!---->
                    <row-layout>  <a name="row.layout" /><!----><!----><img alt="5" width="12" height="12" /><!---->
                        <column-layout width="50%> <a name="column.layout" /><!----><!----><img alt="6" width="12" height="12" /><!---->
                            <portlet-frame> <a name="frame" /><!----><!----><img alt="7" width="12" height="12" /><!---->
                                <portlet-class>org.myorg.portlets.examples.simpleone.1</portlet-class>
                            </portlet-frame>
                        </column-layout width="50%>
                        <column-layout width="50%>
                            <portlet-frame label="simpletwo"> <a name="label" /><!----><!----><img alt="8" width="12" height="12" /><!---->
                                <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>
 
<!----><!----><img alt="1" width="12" height="12" /><!---->
<span style="">每一个描述文件都必须以portlet-tabbed-pane   开始
<!----><!----><img alt="2" width="12" height="12" /><!---->
Tab<span style="">标题可以本地化。
<!----><!----><img alt="3" width="12" height="12" /><!---->
<span style="">不是必须的。
<!----><!----><img alt="4" width="12" height="12" /><!---->
Table<span style="">布局。
<!----><!----><img alt="5" width="12" height="12" /><!---->
Row<span style="">布局。
<!----><!----><img alt="6" width="12" height="12" /><!---->
Table<span style="">布局。
<!----><!----><img alt="7" width="12" height="12" /><!---->
portlet frame<span style="">。
<!----><!----><img alt="8" width="12" height="12" /><!---->
<span style="">指定一个标签。意味着它可以被连接。
 
了解更多的信息,可以查看layout-mapping.xml文件,它定义了portlet组件类和描述符之间的关系。
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表