Developing Portlets

本文档详细介绍了如何设置Portlet,包括所需的各种实体及其关联方式。从Portlet类别到Portal页面的具体配置,再到屏幕设置的实现代码都有详尽说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This document explains the way to setup a portlet.

Entities Involved

  • PortletCategory – Used to define category for portlets.
  • PortalPortlet – All the information about a portlet is stored here.
  • PortletPortletCategory – This associates the portlets with the logical categories.
  • PortalPage – A portal page. Every Portal Page has a owner associated to it (userLoginId). To move a portlet from one Portal Page to another can be done
    • If the logged in user is the owner of the portal page or
    • If the portal page is a system page. (userLoginId="NA")
  • PortalPageColumn – The number of the columns can be defined for a portal page.
  • PortalPagePortlet – The portlets that belong to a portal page.
  • PortalPageAndUserLogin – (View entity PortalPage + UserLoginSecurityGroup) - The portal pages that are accessible to a user if he belongs to certain security group.
  • PortletAttribute – This defines all the attributes of a portlet. For example, to display a portlet, it needs a roleTypeId (attrName) = PLACING_CUSTOMER (attrName).

How To Setup

Here I am taking an example from OOTB implementation to show how do we setup a portlet.
The reference file here is PartyPortletData.xml Data preparation needs to be done as shown bellow this is all done for viewprofile page in partymgr:

Following is the first portlet with its all the associations and details:
复制代码
<PortletCategory portletCategoryId="PROFILE" description="Profiles"/>
<PortalPortlet portalPortletId="party"
    portletName="Party Info"
    screenName="Party"
    screenLocation="component://party/widget/partymgr/ProfileScreens.xml"
    description="General information about a person or party group"
    screenshot="/images/portlets/party.png"/>
<PortletPortletCategory portalPortletId="party" portletCategoryId="PROFILE"/>
<PortalPage portalPageId="PartyProfile" sequenceNum="0" portalPageName="Party Profile Portal Page" description="Party profile page using flexible Portal technology" ownerUserLoginId="_NA_"/>
<PortalPageColumn portalPageId="PartyProfile" columnSeqId="00001" columnWidthPercentage="50"/>
<PortalPageColumn portalPageId="PartyProfile" columnSeqId="00002"/><!-- no width in pixels or percent, use the rest of the space available -->
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
复制代码

Screen Setup

(OFBiz Trunk)
Now following code works in the screen to have portlets in action:
Trace the screen "viewprofile" from /party/widget/partymgr/PartyScreens.xml. We need to set portalPageId in parameters and include generic screen PortalPageScreen from component://common/widget/CommonScreens.xml
Which is as follows(Reference commit in OFBiz trunk rev. 900156):

复制代码
<screen name="PortalPageScreen">
    <section>
        <actions>
            <entity-one entity-name="PortalPage" value-field="portalPage"/>
            <get-related value-field="portalPage" relation-name="PortalPageColumn" list="portalPageColumns"/>
            <entity-and entity-name="PortalPagePortletView" list="portalPagePortlets">
                <field-map field-name="portalPageId" from-field="portalPage.portalPageId"/>
            </entity-and>            
        </actions>
        <widgets>
            <platform-specific>
                <html><html-template location="component://common/webcommon/portal/showPortalPage.ftl"/></html>
            </platform-specific>
        </widgets>
    </section>
</screen>
复制代码

 

Using FreeRTOS and libopencm3 instead of the Arduino software environment, this book will help you develop multi-tasking applications that go beyond Arduino norms. In addition to the usual peripherals found in the typical Arduino device, the STM32 device includes a USB controller, RTC (Real Time Clock), DMA (Direct Memory Access controller), CAN bus and more. Each chapter contains clear explanations of the STM32 hardware capabilities to help get you started with the device, including GPIO and several other ST Microelectronics peripherals like USB and CAN bus controller. You’ll learn how to download and set up the libopencm3 + FreeRTOS development environment, using GCC. With everything set up, you’ll leverage FreeRTOS to create tasks, queues, and mutexes. You’ll also learn to work with the I2C bus to add GPIO using the PCF8574 chip. And how to create PWM output for RC control using hardware timers. You'll be introduced to new concepts that are necessary to master the STM32, such as how to extend code with GCC overlays using an external Winbond ?W25Q32 flash chip. Your knowledge is tested at the end of each chapter with exercises. Upon completing this book, you’ll be ready to work with any of the devices in the STM32 family. Beginning STM32 provides the professional, student, or hobbyist a way to learn about ARM without costing an arm! What You'll Learn Initialize and use the libopencm3 drivers and handle interrupts Use DMA to drive a SPI based OLED displaying an analog meter Read PWM from an RC control using hardware timers Who This Book Is For Experienced embedded engineers, students, hobbyists and makers wishing to explore the ARM architecture, going beyond Arduino limits.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值