JavavaJ——無盡的死循環(huán)

          這是一場沒有結(jié)束的投入和一個無盡的漩渦甚至一個不知邊界的子宇宙。
          數(shù)據(jù)加載中……
          開場白以及收集來的liferay_portal資料

          目前正從事軟件實施工作,但是自認對于開發(fā)的熱情還沒有消減多少,因此記下一些開始的話,提醒自己不要失去那份已然老去的追求。
          以下:liferay_portal中的portlet配置文件相關(guān)資料:

          portlet.xml

          portlet定義描述文件,它描述portlet的類型,支持Mode, preferenes和role等,遵循JSR168標(biāo)準(zhǔn)實現(xiàn),以便于移植(需要針對性的做一些小改過)。

          下面是一個簡單的定義:

           〈portlet〉
            〈portlet-name〉2〈/portlet-name〉
            〈display-name〉My Account〈/display-name〉
            〈!-- portlet的實現(xiàn)類 --〉
            〈portlet-class〉com.liferay.portlet.StrutsPortlet〈/portlet-class〉
            〈init-param〉
             〈name〉view-action〈/name〉
             〈value〉/my_account/view〈/value〉
            〈/init-param〉
            〈expiration-cache〉0〈/expiration-cache〉
            〈supports〉
             〈mime-type〉text/html〈/mime-type〉
            〈/supports〉
            〈resource-bundle〉com.liferay.portlet.StrutsResourceBundle〈/resource-bundle〉
           〈/portlet〉

          其中各項的含義為:

          portlet-name 描述此Portlet的規(guī)定名稱,這個名稱必須是唯一不重復(fù)的。
          display-name 記錄此Portlet在Portal中的顯示名稱,在將Portlet加入到Portal中時如果看到了這個名字,那么就可以找到現(xiàn)在編寫的這個Portlet組件,此名稱不必是唯一的。
          portlet-class 描述與此Portlet對應(yīng)的Java類的完整路徑。
          init-param 通過name/value對的形式指定此Portlet初始化時的參數(shù)。
          expiration-cache 定義Portlet輸出緩存的超時時間,以秒為單位,超出這里指定的時間后就認為Portlet的輸出已經(jīng)超時了,如果這里是-1則說明輸出永遠不超時。
          supports 包括所支持的MIME格式,同時定義對一種特定的MIME格式,此Portlet所支持的模式,所有的Portlet都必須支持View模式。


          在JSR168標(biāo)準(zhǔn)中,定義了view/edit/help三種模式,
          liferay對其進行了擴展,增加了config/about/preview/print等模式。


          liferay-portlet.xml

          liferay的portlet定義描述文件,是liferay對portlet.xml的擴展描述,允許我們對portlet的呈現(xiàn)、功能和行為進行更深入的定制。
          它與com.liferay.portal.model.Portlet類對應(yīng),

          下面是一個較為詳細的liferay-portlet定義:
           〈portlet〉
            〈portlet-name〉19〈/portlet-name〉
                          〈!-- struts路徑 --〉
            〈struts-path〉message_boards〈/struts-path〉
                          〈!-- 配置路徑 --〉
            〈configuration-path〉/message_boards/edit_configuration〈/configuration-path〉
                          〈!-- lucene索引類 --〉
            〈indexer-class〉com.liferay.portlet.messageboards.util.Indexer〈/indexer-class〉
                          〈!-- url處理類 --〉
            〈portlet-url-class〉com.liferay.portlet.messageboards.MBFriendlyPortletURL〈/portlet-url-class〉
                          〈!-- 友好url插件類 --〉
            〈friendly-url-plugin-class〉com.liferay.portlet.messageboards.MBFriendlyURLPortletPlugin〈/friendly-url-plugin-class〉              
            〈preferences-unique-per-layout〉false〈/preferences-unique-per-layout〉
            〈use-default-template〉false〈/use-default-template〉
            〈restore-current-view〉false〈/restore-current-view〉
            〈private-request-attributes〉false〈/private-request-attributes〉
           〈/portlet〉

           

          liferay-display.xml

          portlet的類別定義文件,下面是一個簡單的例子:

           〈category name="category.admin"〉
            〈portlet id="9" /〉
            〈portlet id="40" /〉
            〈portlet id="79" /〉
            〈portlet id="80" /〉
           〈/category〉

          要注意的是,在portlet.xml/liferay-portlet.xml/liferay-display.xml三個文件中的portlet-name, portlet-id必須是一致的。


          PS:當(dāng)我接觸到如liferay般甚至比之更復(fù)雜的應(yīng)用技術(shù)之時,我便明白,當(dāng)年那種依靠AWT和Swing寫出一個僅供娛樂的小程序的時代已經(jīng)一去不復(fù)返了……

          PS2:以上與liferay有關(guān)的資料來自網(wǎng)絡(luò),其中一部分來自CSDN博客中dream_zh的專欄,還有一部分來源忘記了,若有侵權(quán),敬請告知。

          posted on 2011-07-19 14:24 苗觀 閱讀(157) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 大足县| 敦化市| 旌德县| 万盛区| 盈江县| 黄山市| 扎囊县| 克拉玛依市| 高碑店市| 永泰县| 沐川县| 荆门市| 松潘县| 灵山县| 合川市| 桐城市| 赤峰市| 同心县| 江达县| 江陵县| 鄂尔多斯市| 武义县| 陵川县| 丹巴县| 诏安县| 花莲市| 梅州市| SHOW| 柘荣县| 江北区| 新宾| 武川县| 揭西县| 云龙县| 阿尔山市| 闽清县| 焦作市| 扬州市| 汝城县| 夏邑县| 宿州市|