use of org.jasig.portlet.cms.mvc.form.ContentForm in project SimpleContentPortlet by Jasig.
the class ConfigureContentController method getForm.
/**
* Get the form object for the portlet configuration. If this portlet has
* already been configured with content, the current HTML will be
* pre-populated into the form object. If this is a new portlet, the
* initial content will be an empty string.
*
* @param request PortletRequest
* @return form object for the portlet configuration
*/
@ModelAttribute("form")
public ContentForm getForm(PortletRequest request) {
// TODO: Get the locale specified in the drop-down list
String content = this.contentDao.getContent(request, null);
ContentForm form = new ContentForm();
form.setContent(content);
return form;
}
use of org.jasig.portlet.cms.mvc.form.ContentForm in project SimpleContentPortlet by Jasig.
the class ConfigureContentControllerTest method testUpdateConfigurationWithoutCleaning.
@Test
public void testUpdateConfigurationWithoutCleaning() throws PortletModeException {
when(preferences.getValue("cleanContent", "true")).thenReturn("false");
ContentForm form = new ContentForm();
form.setContent(content);
controller.updateConfiguration(request, response, form);
verify(contentDao).saveContent(request, content, null);
}
use of org.jasig.portlet.cms.mvc.form.ContentForm in project SimpleContentPortlet by Jasig.
the class ConfigureContentControllerTest method testUpdateConfiguration.
@Test
public void testUpdateConfiguration() throws ReadOnlyException, PortletModeException {
ContentForm form = new ContentForm();
form.setContent(content);
controller.updateConfiguration(request, response, form);
verify(contentDao).saveContent(request, cleanContent, null);
verify(response).setPortletMode(PortletMode.VIEW);
}
Aggregations