Class MacroFormRenderer

  • All Implemented Interfaces:
    FormStringRenderer

    public final class MacroFormRenderer
    extends java.lang.Object
    implements FormStringRenderer
    Widget Library - Form Renderer implementation based on Freemarker macros
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • MacroFormRenderer

        public MacroFormRenderer​(java.lang.String macroLibraryPath,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws freemarker.template.TemplateException,
                                 java.io.IOException
        Throws:
        freemarker.template.TemplateException
        java.io.IOException
      • MacroFormRenderer

        @Deprecated
        public MacroFormRenderer​(java.lang.String macroLibraryPath,
                                 java.lang.Appendable writer,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws freemarker.template.TemplateException,
                                 java.io.IOException
        Deprecated.
        Throws:
        freemarker.template.TemplateException
        java.io.IOException
    • Method Detail

      • getRenderPagination

        public boolean getRenderPagination()
      • setRenderPagination

        public void setRenderPagination​(boolean renderPagination)
      • renderLabel

        public void renderLabel​(java.lang.Appendable writer,
                                java.util.Map<java.lang.String,​java.lang.Object> context,
                                ModelScreenWidget.Label label)
      • renderMenuField

        public void renderMenuField​(java.lang.Appendable writer,
                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                    ModelFormField.MenuField menuField)
                             throws java.io.IOException
        Specified by:
        renderMenuField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderTextField

        public void renderTextField​(java.lang.Appendable writer,
                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                    ModelFormField.TextField textField)
                             throws java.io.IOException
        Specified by:
        renderTextField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderCheckField

        public void renderCheckField​(java.lang.Appendable writer,
                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                     ModelFormField.CheckField checkField)
                              throws java.io.IOException
        Specified by:
        renderCheckField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderRadioField

        public void renderRadioField​(java.lang.Appendable writer,
                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                     ModelFormField.RadioField radioField)
                              throws java.io.IOException
        Specified by:
        renderRadioField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderSubmitField

        public void renderSubmitField​(java.lang.Appendable writer,
                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                      ModelFormField.SubmitField submitField)
                               throws java.io.IOException
        Specified by:
        renderSubmitField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderResetField

        public void renderResetField​(java.lang.Appendable writer,
                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                     ModelFormField.ResetField resetField)
                              throws java.io.IOException
        Specified by:
        renderResetField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderHiddenField

        public void renderHiddenField​(java.lang.Appendable writer,
                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                      ModelFormField.HiddenField hiddenField)
                               throws java.io.IOException
        Specified by:
        renderHiddenField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderHiddenField

        public void renderHiddenField​(java.lang.Appendable writer,
                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                      ModelFormField modelFormField,
                                      java.lang.String value)
                               throws java.io.IOException
        Specified by:
        renderHiddenField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFieldTitle

        public void renderFieldTitle​(java.lang.Appendable writer,
                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                     ModelFormField modelFormField)
                              throws java.io.IOException
        Specified by:
        renderFieldTitle in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderSingleFormFieldTitle

        public void renderSingleFormFieldTitle​(java.lang.Appendable writer,
                                               java.util.Map<java.lang.String,​java.lang.Object> context,
                                               ModelFormField modelFormField)
                                        throws java.io.IOException
        Specified by:
        renderSingleFormFieldTitle in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormOpen

        public void renderFormOpen​(java.lang.Appendable writer,
                                   java.util.Map<java.lang.String,​java.lang.Object> context,
                                   ModelForm modelForm)
                            throws java.io.IOException
        Specified by:
        renderFormOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormClose

        public void renderFormClose​(java.lang.Appendable writer,
                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                    ModelForm modelForm)
                             throws java.io.IOException
        Specified by:
        renderFormClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderMultiFormClose

        public void renderMultiFormClose​(java.lang.Appendable writer,
                                         java.util.Map<java.lang.String,​java.lang.Object> context,
                                         ModelForm modelForm)
                                  throws java.io.IOException
        Specified by:
        renderMultiFormClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatListWrapperOpen

        public void renderFormatListWrapperOpen​(java.lang.Appendable writer,
                                                java.util.Map<java.lang.String,​java.lang.Object> context,
                                                ModelForm modelForm)
                                         throws java.io.IOException
        Specified by:
        renderFormatListWrapperOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderEmptyFormDataMessage

        public void renderEmptyFormDataMessage​(java.lang.Appendable writer,
                                               java.util.Map<java.lang.String,​java.lang.Object> context,
                                               ModelForm modelForm)
                                        throws java.io.IOException
        Specified by:
        renderEmptyFormDataMessage in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatListWrapperClose

        public void renderFormatListWrapperClose​(java.lang.Appendable writer,
                                                 java.util.Map<java.lang.String,​java.lang.Object> context,
                                                 ModelForm modelForm)
                                          throws java.io.IOException
        Specified by:
        renderFormatListWrapperClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderOpen

        public void renderFormatHeaderOpen​(java.lang.Appendable writer,
                                           java.util.Map<java.lang.String,​java.lang.Object> context,
                                           ModelForm modelForm)
                                    throws java.io.IOException
        Specified by:
        renderFormatHeaderOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderClose

        public void renderFormatHeaderClose​(java.lang.Appendable writer,
                                            java.util.Map<java.lang.String,​java.lang.Object> context,
                                            ModelForm modelForm)
                                     throws java.io.IOException
        Specified by:
        renderFormatHeaderClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowOpen

        public void renderFormatHeaderRowOpen​(java.lang.Appendable writer,
                                              java.util.Map<java.lang.String,​java.lang.Object> context,
                                              ModelForm modelForm)
                                       throws java.io.IOException
        Specified by:
        renderFormatHeaderRowOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowClose

        public void renderFormatHeaderRowClose​(java.lang.Appendable writer,
                                               java.util.Map<java.lang.String,​java.lang.Object> context,
                                               ModelForm modelForm)
                                        throws java.io.IOException
        Specified by:
        renderFormatHeaderRowClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowCellOpen

        public void renderFormatHeaderRowCellOpen​(java.lang.Appendable writer,
                                                  java.util.Map<java.lang.String,​java.lang.Object> context,
                                                  ModelForm modelForm,
                                                  ModelFormField modelFormField,
                                                  int positionSpan)
                                           throws java.io.IOException
        Specified by:
        renderFormatHeaderRowCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowCellClose

        public void renderFormatHeaderRowCellClose​(java.lang.Appendable writer,
                                                   java.util.Map<java.lang.String,​java.lang.Object> context,
                                                   ModelForm modelForm,
                                                   ModelFormField modelFormField)
                                            throws java.io.IOException
        Specified by:
        renderFormatHeaderRowCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowFormCellOpen

        public void renderFormatHeaderRowFormCellOpen​(java.lang.Appendable writer,
                                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                                      ModelForm modelForm)
                                               throws java.io.IOException
        Specified by:
        renderFormatHeaderRowFormCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatHeaderRowFormCellClose

        public void renderFormatHeaderRowFormCellClose​(java.lang.Appendable writer,
                                                       java.util.Map<java.lang.String,​java.lang.Object> context,
                                                       ModelForm modelForm)
                                                throws java.io.IOException
        Specified by:
        renderFormatHeaderRowFormCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowOpen

        public void renderFormatItemRowOpen​(java.lang.Appendable writer,
                                            java.util.Map<java.lang.String,​java.lang.Object> context,
                                            ModelForm modelForm)
                                     throws java.io.IOException
        Specified by:
        renderFormatItemRowOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowClose

        public void renderFormatItemRowClose​(java.lang.Appendable writer,
                                             java.util.Map<java.lang.String,​java.lang.Object> context,
                                             ModelForm modelForm)
                                      throws java.io.IOException
        Specified by:
        renderFormatItemRowClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowCellOpen

        public void renderFormatItemRowCellOpen​(java.lang.Appendable writer,
                                                java.util.Map<java.lang.String,​java.lang.Object> context,
                                                ModelForm modelForm,
                                                ModelFormField modelFormField,
                                                int positionSpan)
                                         throws java.io.IOException
        Specified by:
        renderFormatItemRowCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowCellClose

        public void renderFormatItemRowCellClose​(java.lang.Appendable writer,
                                                 java.util.Map<java.lang.String,​java.lang.Object> context,
                                                 ModelForm modelForm,
                                                 ModelFormField modelFormField)
                                          throws java.io.IOException
        Specified by:
        renderFormatItemRowCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowFormCellOpen

        public void renderFormatItemRowFormCellOpen​(java.lang.Appendable writer,
                                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                                    ModelForm modelForm)
                                             throws java.io.IOException
        Specified by:
        renderFormatItemRowFormCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatItemRowFormCellClose

        public void renderFormatItemRowFormCellClose​(java.lang.Appendable writer,
                                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                                     ModelForm modelForm)
                                              throws java.io.IOException
        Specified by:
        renderFormatItemRowFormCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatSingleWrapperOpen

        public void renderFormatSingleWrapperOpen​(java.lang.Appendable writer,
                                                  java.util.Map<java.lang.String,​java.lang.Object> context,
                                                  ModelForm modelForm)
                                           throws java.io.IOException
        Specified by:
        renderFormatSingleWrapperOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatSingleWrapperClose

        public void renderFormatSingleWrapperClose​(java.lang.Appendable writer,
                                                   java.util.Map<java.lang.String,​java.lang.Object> context,
                                                   ModelForm modelForm)
                                            throws java.io.IOException
        Specified by:
        renderFormatSingleWrapperClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowOpen

        public void renderFormatFieldRowOpen​(java.lang.Appendable writer,
                                             java.util.Map<java.lang.String,​java.lang.Object> context,
                                             ModelForm modelForm)
                                      throws java.io.IOException
        Specified by:
        renderFormatFieldRowOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowClose

        public void renderFormatFieldRowClose​(java.lang.Appendable writer,
                                              java.util.Map<java.lang.String,​java.lang.Object> context,
                                              ModelForm modelForm)
                                       throws java.io.IOException
        Specified by:
        renderFormatFieldRowClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowTitleCellOpen

        public void renderFormatFieldRowTitleCellOpen​(java.lang.Appendable writer,
                                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                                      ModelFormField modelFormField)
                                               throws java.io.IOException
        Specified by:
        renderFormatFieldRowTitleCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowTitleCellClose

        public void renderFormatFieldRowTitleCellClose​(java.lang.Appendable writer,
                                                       java.util.Map<java.lang.String,​java.lang.Object> context,
                                                       ModelFormField modelFormField)
                                                throws java.io.IOException
        Specified by:
        renderFormatFieldRowTitleCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowSpacerCell

        public void renderFormatFieldRowSpacerCell​(java.lang.Appendable writer,
                                                   java.util.Map<java.lang.String,​java.lang.Object> context,
                                                   ModelFormField modelFormField)
                                            throws java.io.IOException
        Specified by:
        renderFormatFieldRowSpacerCell in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowWidgetCellOpen

        public void renderFormatFieldRowWidgetCellOpen​(java.lang.Appendable writer,
                                                       java.util.Map<java.lang.String,​java.lang.Object> context,
                                                       ModelFormField modelFormField,
                                                       int positions,
                                                       int positionSpan,
                                                       java.lang.Integer nextPositionInRow)
                                                throws java.io.IOException
        Specified by:
        renderFormatFieldRowWidgetCellOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatFieldRowWidgetCellClose

        public void renderFormatFieldRowWidgetCellClose​(java.lang.Appendable writer,
                                                        java.util.Map<java.lang.String,​java.lang.Object> context,
                                                        ModelFormField modelFormField,
                                                        int positions,
                                                        int positionSpan,
                                                        java.lang.Integer nextPositionInRow)
                                                 throws java.io.IOException
        Specified by:
        renderFormatFieldRowWidgetCellClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFormatEmptySpace

        public void renderFormatEmptySpace​(java.lang.Appendable writer,
                                           java.util.Map<java.lang.String,​java.lang.Object> context,
                                           ModelForm modelForm)
                                    throws java.io.IOException
        Specified by:
        renderFormatEmptySpace in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderLookupField

        public void renderLookupField​(java.lang.Appendable writer,
                                      java.util.Map<java.lang.String,​java.lang.Object> context,
                                      ModelFormField.LookupField lookupField)
                               throws java.io.IOException
        Specified by:
        renderLookupField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderNextPrev

        public void renderNextPrev​(java.lang.Appendable writer,
                                   java.util.Map<java.lang.String,​java.lang.Object> context,
                                   ModelForm modelForm)
      • renderFileField

        public void renderFileField​(java.lang.Appendable writer,
                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                    ModelFormField.FileField textField)
                             throws java.io.IOException
        Specified by:
        renderFileField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderImageField

        public void renderImageField​(java.lang.Appendable writer,
                                     java.util.Map<java.lang.String,​java.lang.Object> context,
                                     ModelFormField.ImageField imageField)
                              throws java.io.IOException
        Specified by:
        renderImageField in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFieldGroupOpen

        public void renderFieldGroupOpen​(java.lang.Appendable writer,
                                         java.util.Map<java.lang.String,​java.lang.Object> context,
                                         ModelForm.FieldGroup fieldGroup)
                                  throws java.io.IOException
        Specified by:
        renderFieldGroupOpen in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderFieldGroupClose

        public void renderFieldGroupClose​(java.lang.Appendable writer,
                                          java.util.Map<java.lang.String,​java.lang.Object> context,
                                          ModelForm.FieldGroup fieldGroup)
                                   throws java.io.IOException
        Specified by:
        renderFieldGroupClose in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderBanner

        public void renderBanner​(java.lang.Appendable writer,
                                 java.util.Map<java.lang.String,​java.lang.Object> context,
                                 ModelForm.Banner banner)
                          throws java.io.IOException
        Specified by:
        renderBanner in interface FormStringRenderer
        Throws:
        java.io.IOException
      • renderBeginningBoundaryComment

        public void renderBeginningBoundaryComment​(java.lang.Appendable writer,
                                                   java.lang.String widgetType,
                                                   ModelWidget modelWidget)
        Renders the beginning boundary comment string.
        Parameters:
        writer - The writer to write to
        widgetType - The widget type: "Screen Widget", "Form Widget", etc.
        modelWidget - The widget
      • renderEndingBoundaryComment

        public void renderEndingBoundaryComment​(java.lang.Appendable writer,
                                                java.lang.String widgetType,
                                                ModelWidget modelWidget)
        Renders the ending boundary comment string.
        Parameters:
        writer - The writer to write to
        widgetType - The widget type: "Screen Widget", "Form Widget", etc.
        modelWidget - The widget
      • renderSortField

        public void renderSortField​(java.lang.Appendable writer,
                                    java.util.Map<java.lang.String,​java.lang.Object> context,
                                    ModelFormField modelFormField,
                                    java.lang.String titleText)
                             throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • createAjaxParamsFromUpdateAreas

        public java.lang.String createAjaxParamsFromUpdateAreas​(java.util.List<ModelForm.UpdateArea> updateAreas,
                                                                java.lang.String extraParams,
                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Create an ajaxXxxx JavaScript CSV string from a list of UpdateArea objects. See OfbizUtil.js.
        Parameters:
        updateAreas -
        extraParams - Renderer-supplied additional target parameters
        context -
        Returns:
        Parameter string or empty string if no UpdateArea objects were found
      • getAjaxParamsFromTarget

        public static java.lang.String getAjaxParamsFromTarget​(java.lang.String target)
        Extracts parameters from a target URL string, prepares them for an Ajax JavaScript call. This method is currently set to return a parameter string suitable for the Prototype.js library.
        Parameters:
        target - Target URL string
        Returns:
        Parameter string
      • appendTooltip

        public void appendTooltip​(java.lang.Appendable writer,
                                  java.util.Map<java.lang.String,​java.lang.Object> context,
                                  ModelFormField modelFormField)
      • makeHyperlinkString

        public void makeHyperlinkString​(java.lang.Appendable writer,
                                        ModelFormField.SubHyperlink subHyperlink,
                                        java.util.Map<java.lang.String,​java.lang.Object> context)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • addAsterisks

        public void addAsterisks​(java.lang.Appendable writer,
                                 java.util.Map<java.lang.String,​java.lang.Object> context,
                                 ModelFormField modelFormField)
      • appendContentUrl

        public void appendContentUrl​(java.lang.Appendable writer,
                                     java.lang.String location)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • makeHyperlinkByType

        public void makeHyperlinkByType​(java.lang.Appendable writer,
                                        java.lang.String linkType,
                                        java.lang.String linkStyle,
                                        java.lang.String targetType,
                                        java.lang.String target,
                                        java.util.Map<java.lang.String,​java.lang.String> parameterMap,
                                        java.lang.String description,
                                        java.lang.String targetWindow,
                                        java.lang.String confirmation,
                                        ModelFormField modelFormField,
                                        javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        java.util.Map<java.lang.String,​java.lang.Object> context)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • makeHyperlinkString

        public void makeHyperlinkString​(java.lang.Appendable writer,
                                        java.lang.String linkStyle,
                                        java.lang.String targetType,
                                        java.lang.String target,
                                        java.util.Map<java.lang.String,​java.lang.String> parameterMap,
                                        java.lang.String description,
                                        java.lang.String confirmation,
                                        ModelFormField modelFormField,
                                        javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        java.util.Map<java.lang.String,​java.lang.Object> context,
                                        java.lang.String targetWindow)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • makeHiddenFormLinkAnchor

        public void makeHiddenFormLinkAnchor​(java.lang.Appendable writer,
                                             java.lang.String linkStyle,
                                             java.lang.String description,
                                             java.lang.String confirmation,
                                             ModelFormField modelFormField,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             java.util.Map<java.lang.String,​java.lang.Object> context)
      • makeHiddenFormLinkForm

        public void makeHiddenFormLinkForm​(java.lang.Appendable writer,
                                           java.lang.String target,
                                           java.lang.String targetType,
                                           java.lang.String targetWindow,
                                           java.util.List<CommonWidgetModels.Parameter> parameterList,
                                           ModelFormField modelFormField,
                                           javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           java.util.Map<java.lang.String,​java.lang.Object> context)
                                    throws java.io.IOException
        Throws:
        java.io.IOException