web.xml file:
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>AssetsPortfolio</display-name>
<context-param>
<param-name>contextPath</param-name>
<param-value>cdotest</param-value>
<description>The context root to which this web application is deployed. Used by the Portal JSR 168 implementation.</description>
</context-param>
<context-param>
<param-name>filter_session</param-name>
<param-value>false</param-value>
</context-param>
<!-- END THIS VIGNETTE PACKAGING TOOL ADDITION. -->
<!-- ADDED BY VIGNETTE PORTLET PACKAGING TOOL. DO NOT EDIT -->
<!--<filter>
<filter-name>PortletApplicationSecurityFilter</filter-name>
<filter-class>com.vignette.portal.portlet.jsrcontainer.PortletApplicationSecurityFilter</filter-class>
</filter> -->
<!-- END THIS VIGNETTE PACKAGING TOOL ADDITION. -->
<!-- ADDED BY VIGNETTE PORTLET PACKAGING TOOL. DO NOT EDIT -->
<!--<filter-mapping>
<filter-name>PortletApplicationSecurityFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>-->
<!-- END THIS VIGNETTE PACKAGING TOOL ADDITION. -->
<!-- ADDED BY VIGNETTE PORTLET PACKAGING TOOL. DO NOT EDIT -->
<listener>
<listener-class>com.vignette.portal.portlet.jsrcontainer.PortletApplicationServletContextListener</listener-class>
</listener>
<!--Cdo deal search starts here -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--Cdo deal search ends here -->
<!-- END THIS VIGNETTE PACKAGING TOOL ADDITION. -->
<!-- ADDED BY VIGNETTE PORTLET PACKAGING TOOL. DO NOT EDIT -->
<servlet>
<servlet-name>PortletCommandServlet</servlet-name>
<display-name>Portlet Command Servlet</display-name>
<description>Utilized by Portal to invoke JSR 168 portlets</description>
<servlet-class>com.vignette.portal.portlet.jsrcontainer.PortletCommandServlet</servlet-class>
</servlet>
<!-- <servlet>
<servlet-name>BOReportServlet</servlet-name>
<display-name>BOReportServlet</display-name>
<servlet-class>com.standardandpoors.framework.BOReportServlet</servlet-class>
<init-param>
<param-name>filter_session</param-name>
<param-value>false</param-value>
</init-param>
</servlet>-->
<servlet-mapping>
<servlet-name>PortletCommandServlet</servlet-name>
<url-pattern>/portletCommand/*</url-pattern>
</servlet-mapping>
<!--<servlet-mapping>
<servlet-name>BOReportServlet</servlet-name>
<url-pattern>/BOReportServlet</url-pattern>
</servlet-mapping>-->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
</web-app>
portlet.xml file:
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>Manage My Assets Portfolio Portlet</description>
<portlet-name>AssetsPortlet</portlet-name>
<display-name>AssetsPortlet</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
</supports>
<portlet-info>
<title>AssetsPortlet</title>
<short-title>AssetsPortlet</short-title>
<keywords>Spring</keywords>
</portlet-info>
</portlet>
<user-attribute>
<description>User Given Name</description>
<name>user.name.given</name>
</user-attribute>
<user-attribute>
<description>User Last Name</description>
<name>user.name.family</name>
</user-attribute>
<user-attribute>
<description>User UserName</description>
<name>logon</name>
</user-attribute>
<user-attribute>
<description>User GroupName</description>
<name>user.name.group</name>
</user-attribute>
<user-attribute>
<description>User eMail</description>
<name>user.business-info.online.email</name>
</user-attribute>
<user-attribute>
<description>User Language</description>
<name>user.preferred.language</name>
</user-attribute>
</portlet-app>
controller file:
PHP Code:
public class AssetsPortfolioController extends BaseFormController {
private static SPLogger oSPLogger = SPLogger
.getLogger(AssetsPortfolioController.class);
public void onSubmitAction(ActionRequest actionRequest,
ActionResponse actionResponse, Object command, BindException error) {
}
public ModelAndView onSubmitRender(RenderRequest aRenderRequest,
RenderResponse aRenderResponse, Object aCommand,
BindException aError) {
try {
} catch (Exception e) {
oSPLogger.error(e.getStackTrace());
}
return new ModelAndView("CreateAssetportfolio", "", "");
}
public void copyToBean(AssetsPortfolioForm aAssetsPortfolioForm,
AssetsPortfolio aAssetsPortfolio) {
try {
BeanUtils.copyProperties(aAssetsPortfolio, aAssetsPortfolioForm);
} catch (IllegalAccessException e) {
oSPLogger.error(e.getMessage());
} catch (InvocationTargetException e) {
oSPLogger.error(e.getMessage());
}
}
}
Base form controller extends SimpleFormController.