public PortletArchive createFacesPortlet(String name, String title, String viewModeViewId, String editModeViewId, String helpModeViewId) {
viewModeViewId = checkForLeadingSlash(viewModeViewId);
editModeViewId = checkForLeadingSlash(editModeViewId);
helpModeViewId = checkForLeadingSlash(helpModeViewId);
PortletDescriptor desc = getOrCreatePortletDescriptor()
.createPortlet()
.portletName(name)
.portletClass(GENERIC_FACES_PORTLET_CLASS)
.createInitParam()
.name(DEFAULT_VIEW_ID_PARAM_NAME)
.value(viewModeViewId)
.up()
.createInitParam()
.name(DEFAULT_EDIT_ID_PARAM_NAME)
.value(editModeViewId)
.up()
.createInitParam()
.name(DEFAULT_HELP_ID_PARAM_NAME)
.value(helpModeViewId)
.up()
.createSupports()
.mimeType("text/html")
.portletMode(PortletMode.VIEW.toString())
.portletMode(PortletMode.EDIT.toString())
.portletMode(PortletMode.HELP.toString())
.up()
.getOrCreatePortletInfo()
.title(title)
.up()
.up();
this.setPortletXML(new StringAsset(desc.exportAsString()));
return covarientReturn();
}