コード例 #1
0
  public String getDDMFormHTML() throws PortalException {
    DDLRecordSet recordSet = getRecordSet();

    if (recordSet == null) {
      return StringPool.BLANK;
    }

    DDMStructure ddmStructure = recordSet.getDDMStructure();
    boolean requireCaptcha = isCaptchaRequired(recordSet);

    DDMForm ddmForm = getDDMForm(ddmStructure, requireCaptcha);

    DDMFormLayout ddmFormLayout = getDDMFormLayout(ddmStructure, requireCaptcha);

    DDMFormRenderingContext ddmFormRenderingContext = createDDMFormRenderingContext(ddmForm);

    boolean showSubmitButton = isShowSubmitButton();

    ddmFormRenderingContext.setShowSubmitButton(showSubmitButton);

    String submitLabel = getSubmitLabel(recordSet);

    ddmFormRenderingContext.setSubmitLabel(submitLabel);

    return _ddmFormRenderer.render(ddmForm, ddmFormLayout, ddmFormRenderingContext);
  }
コード例 #2
0
  protected DDMFormRenderingContext createDDMFormRenderingContext(DDMForm ddmForm) {

    String languageId = ParamUtil.getString(_renderRequest, "languageId");

    DDMFormRenderingContext ddmFormRenderingContext = new DDMFormRenderingContext();

    ddmFormRenderingContext.setDDMFormValues(_ddmFormValuesFactory.create(_renderRequest, ddmForm));
    ddmFormRenderingContext.setHttpServletRequest(PortalUtil.getHttpServletRequest(_renderRequest));
    ddmFormRenderingContext.setHttpServletResponse(
        PortalUtil.getHttpServletResponse(_renderResponse));
    ddmFormRenderingContext.setLocale(LocaleUtil.fromLanguageId(languageId));
    ddmFormRenderingContext.setPortletNamespace(_renderResponse.getNamespace());

    return ddmFormRenderingContext;
  }