下面是本人在使用WLP8.1內(nèi)容治理模塊過(guò)程中的一些經(jīng)驗(yàn)總結(jié).
與CMS有關(guān)的JSP TAG主要有:
<pz:contentSelector>
<es:forEachInArray>
<cm:getPRoperty>
<cm:getNode>
<cm:search>
CMS API 可通過(guò):http://edocs.beasys.com/wlp/docs81/javadoc/overview-summary.Html 查到。
在采用WLP的CMS來(lái)治理站點(diǎn)的內(nèi)容時(shí),經(jīng)常要處理包含圖片的HTML文件,因?yàn)镠TML中的圖片一般都是超連接方法,不同于Word等文件是直接包含。為了使HTML文件以加載到WLP的CMS Repository中,仍然可以正確顯示。可采用以下兩種方法。
<table cellSpacing="0" cellPadding="10" border="0"> <tbody> <tr> <td><a ><img src="/essWeb/images/logo_bea.gif" border="0" width="95" height="57"></a></td> </tr> <tr> <td><a ><img src="/essWeb/images/logo_fls.gif" border="0" width="95" height="83"></a></td> </tr> </tbody> </table>
顯示內(nèi)容的方法一般有以下兩種:
直接顯示:直接把內(nèi)容所對(duì)應(yīng)的文件的內(nèi)容顯示出來(lái)
間接顯示:通過(guò)點(diǎn)擊內(nèi)容的標(biāo)題等,以超連接的方式內(nèi)容所對(duì)應(yīng)的文件的內(nèi)容顯示出來(lái)
下面分別說(shuō)明相應(yīng)的方法:
直接顯示HTML等內(nèi)容
可采用下面的代碼,在SP3中正常,在SP4中THROW EXCEPTION:Error getting bytes from property: file caused by: : java.lang.NullPointerException
<body> <pz:contentSelector rule="my" id="nodes"/> <% if ( nodes == null nodes.length == 0 ) { %> No content found <% } else { %> <utility:forEachInArray array="<%=nodes%>" id="node" type="com.bea.content.Node"> <cm:getProperty id="node" name="file" failOnError="true" /> </utility:forEachInArray> <% } %></body> 直接顯示圖片的內(nèi)容<body> <pz:contentSelector rule="Untitled" id="nodes"/> <% if ( nodes == null nodes.length == 0 ) { %> No content found <% } else { %> <utility:forEachInArray array="<%=nodes%>" id="node" type="com.bea.content.Node"> <% String simg = "<img src= ' " + "/sampleportal/ShowBinary" + node.getPath() + "'>"; out.println(simg); %> </utility:forEachInArray> <% } %> </body>新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注