SimpleForm portlet can now be submitted
With the latest checkin to CVS, a portlet now responds properly to a form submit. That is the processAction is called followed by a call to doView.
PortletUnit is a jUnit Java Unit Testing Framework for testing JSR-168 portlets. It is built on ServletUnit and Pluto. It provides a mock portlet container as ServletUnit provides a mock servlet container.
<fragment name="welcome" type="page">
<navigation>
<title>PHC Welcome Portlet</title>
<description>Welcome to PHC</description>
</navigation>
<fragment name="row3" type="row">
<fragment name="col3" type="column">
<fragment name="p4" type="portlet">
<property name="portlet" value="5.1"/>
</fragment>
</fragment>
</fragment>
</fragment>
welcome=org.apache.pluto.portalImpl.aggregation.PageFragment@1f10a67
welcome_row3=org.apache.pluto.portalImpl.aggregation.RowFragment@1e2161d
welcome_row3_col3=org.apache.pluto.portalImpl.aggregation.ColumnFragment@1f2af1c
welcome_row3_col3_p4=org.apache.pluto.portalImpl.aggregation.PortletFragment@1a3e41f
dump fragments.get("welcome");
fragments.get("welcome"); = {
org.apache.pluto.portalImpl.aggregation.AbstractFragmentContainer.children: instance of java.util.ArrayList(id=1449)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.BASE_ROOT: "/WEB-INF/aggregation/"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.id: "welcome"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.config: instance of com.meterware.servletunit.ServletUnitServletConfig(id=1452)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.parent: instance of org.apache.pluto.portalImpl.aggregation.RootFragment(id=1453)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.fragDesc: instance of org.apache.pluto.portalImpl.om.page.impl.FragmentImpl(id=1454)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.initParameters: instance of org.apache.pluto.portalImpl.util.Parameters(id=1455)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.navigation: instance of org.apache.pluto.portalImpl.aggregation.navigation.Navigation(id=1456)
}
main[1] dump fragments.get("welcome_row3");
fragments.get("welcome_row3"); = {
org.apache.pluto.portalImpl.aggregation.AbstractFragmentContainer.children: instance of java.util.ArrayList(id=1459)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.BASE_ROOT: "/WEB-INF/aggregation/"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.id: "welcome_row3"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.config: instance of com.meterware.servletunit.ServletUnitServletConfig(id=1452)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.parent: instance of org.apache.pluto.portalImpl.aggregation.PageFragment(id=1446)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.fragDesc: instance of org.apache.pluto.portalImpl.om.page.impl.FragmentImpl(id=1461)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.initParameters: instance of org.apache.pluto.portalImpl.util.Parameters(id=1462)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.navigation: instance of org.apache.pluto.portalImpl.aggregation.navigation.Navigation(id=1456)
}
main[1] dump fragments.get("welcome_row3_col3");
fragments.get("welcome_row3_col3"); = {
org.apache.pluto.portalImpl.aggregation.AbstractFragmentContainer.children: instance of java.util.ArrayList(id=1465)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.BASE_ROOT: "/WEB-INF/aggregation/"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.id: "welcome_row3_col3"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.config: instance of com.meterware.servletunit.ServletUnitServletConfig(id=1452)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.parent: instance of org.apache.pluto.portalImpl.aggregation.RowFragment(id=1458)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.fragDesc: instance of org.apache.pluto.portalImpl.om.page.impl.FragmentImpl(id=1467)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.initParameters: instance of org.apache.pluto.portalImpl.util.Parameters(id=1468)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.navigation: instance of org.apache.pluto.portalImpl.aggregation.navigation.Navigation(id=1456)
}
main[1] dump fragments.get("welcome_row3_col3_p4");
fragments.get("welcome_row3_col3_p4"); = {
portletWindow: instance of org.apache.pluto.portalImpl.om.window.impl.PortletWindowImpl(id=1471)
log: instance of org.apache.pluto.portalImpl.services.log.LoggerImpl(id=1472)
PORTLET_ERROR_MSG: "Error occurred in portlet!"
class$org$apache$pluto$portalImpl$aggregation$PortletFragment$PortletWindowStateInfo: null
class$org$apache$pluto$portalImpl$aggregation$PortletFragment$PortletModeInfo: null
org.apache.pluto.portalImpl.aggregation.AbstractFragment.BASE_ROOT: "/WEB-INF/aggregation/"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.id: "welcome_row3_col3_p4"
org.apache.pluto.portalImpl.aggregation.AbstractFragment.config: instance of com.meterware.servletunit.ServletUnitServletConfig(id=1452)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.parent: instance of org.apache.pluto.portalImpl.aggregation.ColumnFragment(id=1464)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.fragDesc: instance of org.apache.pluto.portalImpl.om.page.impl.FragmentImpl(id=1475)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.initParameters: instance of org.apache.pluto.portalImpl.util.Parameters(id=1476)
org.apache.pluto.portalImpl.aggregation.AbstractFragment.navigation: instance of org.apache.pluto.portalImpl.aggregation.navigation.Navigation(id=1456)
}
main[1] print fragments.get("welcome_row3_col3_p4").initParameters.iEntries
fragments.get("welcome_row3_col3_p4").initParameters.iEntries = "[portlet = 5.1]"
main[1]
org.apache.pluto.portalImpl.aggregation.Fragment
for the portlet to live in. The fragment needs to be added to org.apache.pluto.portalImpl.services.pageregistry.PageRegistry.addFragment()
which is a static method.javax.servlet.UnavailableException: Initialization of one or more services failed.
You enable logging with PortletRunner.setLogging( System.out );
This will show the stack trace of the problem, usually a ClassNotFound type problem.