下面是本人在使用WLP8.1內容治理模塊過程中的一些經驗總結.
與CMS有關的JSP TAG主要有:
<pz:contentSelector>
<es:forEachInArray>
<cm:getPRoperty>
<cm:getNode>
<cm:search>
CMS API 可通過:http://edocs.beasys.com/wlp/docs81/javadoc/overview-summary.Html 查到。
在采用WLP的CMS來治理站點的內容時,經常要處理包含圖片的HTML文件,因為HTML中的圖片一般都是超連接方法,不同于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>
顯示內容的方法一般有以下兩種:
直接顯示:直接把內容所對應的文件的內容顯示出來
間接顯示:通過點擊內容的標題等,以超連接的方式內容所對應的文件的內容顯示出來
下面分別說明相應的方法:
直接顯示HTML等內容
可采用下面的代碼,在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> 直接顯示圖片的內容<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>
新聞熱點
疑難解答