Liferay Portal CE 6.2 Portlet 配置(Configuration) 开发

Portlet配置(Configuration)开发

应用场景:比如左侧菜单树,每个一级会有一个节点图标,我们通过配置,可以随时更新图标。所以图票取自文档库。

 

Portlet.xml配置

leftmenuv2

leftmenuv2

com.yixin.LeftMenuv2.LeftMenuV2

view-template

/html/leftmenuv2/view.jsp

config-template

/html/leftmenuv2/configuration.jsp

 

Liferay-portlet.xml配置文件

leftmenuv2

/icon.png

leftmenuv2

com.liferay.portal.kernel.portlet.DefaultConfigurationAction

 

 

Configuration.jsp

注: lable是中文名字,配置一下国际化。

Input name要以preferences--开头

<%@include file="/html/init.jsp" %>

<%

StringimageURLFromDocumentlibrary =portletPreferences.getValue("imageURLFromDocumentlibrary",String.valueOf("imageURLFromDocumentlibrary"));        

%>

 

 

" method="post"name="fm">

" type="hidden"value="<%= Constants.UPDATE %>" />

 

label="imageURLFromDocumentlibrary"type="text" value="<%= imageURLFromDocumentlibrary%>" />

 

 

 

 

View.jsp中读取

<%

StringimageURLFromDocumentlibrary =portletPreferences.getValue("imageURLFromDocumentlibrary",String.valueOf("imageURLFromDocumentlibrary"));        

%>

你可能感兴趣的:(liferay,portal)