Display this screen in html input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
776583
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        if (this.getProperty(DBParams.XML) != null)
            return this.getScreenFieldView().printData(out, iPrintOptions);
        else
            return super.printData(out, iPrintOptions);
    }
212092
public void printControlStartForm(PrintWriter out, int iPrintOptions)
    {
      //?        Record record = ((ReportBreakScreen)this.getScreenField()).getMainRecord();
      //?        String strFile = record.getTableNames(false);
          if ((iPrintOptions & HtmlConstants.FOOTING_SCREEN) == HtmlConstants.FOOTING_SCREEN)
              out.println(Utility.startTag(XMLTags.FOOTING));
          else
              out.println(Utility.startTag(XMLTags.HEADING));
          out.println(Utility.startTag(XMLTags.CONTROLS));
    }
165621
public void printHtmlData(PrintWriter out, InputStream streamIn)
    {
        String str = null;
        if (streamIn != null)
            str = Utility.transferURLStream(null, null, new InputStreamReader(streamIn));
        if ((str == null) || (str.length() == 0))
            str = this.getDefaultXML();
        this.parseHtmlData(out, str);
    }
875234
public String addScreenParams(BasePanel screen, String strURL)
    {
        int iNumCols = screen.getSFieldCount();
        for (int iIndex = 0; iIndex < iNumCols; iIndex++)
        {
            ScreenField sField = screen.getSField(iIndex);
            boolean bPrintControl = true;
            if (sField instanceof BasePanel)
            {
                strURL = this.addScreenParams((BasePanel)sField, strURL);
                bPrintControl = false;      // ie., Don't print buttons
            }
            if (sField.getConverter() == null)
                bPrintControl = false;
            if (screen == this)
                bPrintControl = false;  // My children are the report detail (Not params).
            if (!sField.isInputField())
            	bPrintControl = false;
            if (!sField.isEnabled())
            	bPrintControl = false;
            if (bPrintControl)
                if (sField.getScreenFieldView() != null)
            {
                String strData = sField.getSFieldValue(false, false);    // Match HTML submit (input format/go through converters).
                strURL = Utility.addURLParam(strURL, sField.getSFieldParam(null, false), strData);   // Don't need outside frame stuff in a window
            }
        }
        return strURL;
    }
738962
public boolean printData(PrintWriter out, int iHtmlAttributes)
    {
        boolean bFieldsFound = false;
        String strXmlFilename = this.getProperty(DBParams.XML);                // Html page
        if (strXmlFilename == null)
            strXmlFilename = this.getProperty(DBParams.TEMPLATE);
        if (DBConstants.BLANK.equals(strXmlFilename))
            strXmlFilename = DBConstants.DEFAULT_HELP_FILE;
        if (strXmlFilename != null)
        {
            if ((strXmlFilename.indexOf(':') == -1) && (strXmlFilename.charAt(0) != '/'))
            {
            	if (strXmlFilename.indexOf('/') == -1)
            		strXmlFilename = DBConstants.DEFAULT_HELP_FILE.substring(0, DBConstants.DEFAULT_HELP_FILE.lastIndexOf('/') + 1) + strXmlFilename;
                String strLanguage = ((BaseApplication)this.getTask().getApplication()).getLanguage(false);
                if ((strLanguage == null) || (strLanguage.equalsIgnoreCase("en")))
                    strLanguage = Constants.BLANK;
                if (strLanguage.length() > 0)
                    strLanguage += "/";
                strXmlFilename = strLanguage + strXmlFilename;  // DBConstants.kxxx;
            }
            boolean bHTML = false;
            if ((strXmlFilename.endsWith(".html"))
                || (strXmlFilename.endsWith(".htm")))
                    bHTML = true;
            if (bHTML)
                out.println(Utility.startTag(XMLTags.HTML));
            InputStream streamIn = this.getTask().getInputStream(strXmlFilename);
            if (streamIn != null)
            	Utility.transferURLStream(null, null, new InputStreamReader(streamIn), out);
            else
            	out.println("File not found: " + strXmlFilename + "<br/>");
            if (bHTML)
                out.println(Utility.endTag(XMLTags.HTML));
        }
        else
            return super.printData(out, HtmlConstants.HTML_DISPLAY);     // DO print screen
        return bFieldsFound;
    }
92760
@Override
    public void doRender(Invocation inv) throws Exception {
        if (StringUtils.isEmpty(text)) {
            return;
        }
        
        if (logger.isDebugEnabled()) {
        	logger.debug("trying to render text:" + text);
        }
        
        HttpServletResponse response = inv.getResponse();
        String oldEncoding = response.getCharacterEncoding();
        if (StringUtils.isBlank(oldEncoding) || oldEncoding.startsWith("ISO-")) {
            String encoding = inv.getRequest().getCharacterEncoding();
            Assert.isTrue(encoding != null);
            response.setCharacterEncoding(encoding);
            if (logger.isDebugEnabled()) {
                logger.debug("set response.characterEncoding by default:"
                        + response.getCharacterEncoding());
            }
        }
        
        if (response.getContentType() == null) {
            response.setContentType("text/html");
            if (logger.isDebugEnabled()) {
                logger.debug("set response content-type by default: "
                        + response.getContentType());
            }
        }
        sendResponse(response, text);
    }
954800
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        this.addHiddenParam(out, TrxMessageHeader.LOG_TRX_ID, this.getProperty(TrxMessageHeader.LOG_TRX_ID));
        return super.printData(out, iPrintOptions);   // Don't print
    }
1317527
public static void print(ResultSet rs, PrintStream out) throws SQLException {
    ResultSetMetaData meta = rs.getMetaData();
    int columns = meta.getColumnCount();
    for (int i = 0; i < columns; i++) {
      if (i > 0) {
        out.print(",");
      }
      out.print("\"");
      out.print(meta.getColumnName(i + 1));
      out.print("\"");
    }
    out.println();

    while (rs.next()) {
      for (int i = 0; i < columns; i++) {
        if (i > 0) {
          out.print(",");
        }
        String value = rs.getString(i + 1);
        if (value != null) {
          out.print("\"");
          out.print(value.replaceAll("\"", "\"\""));
          out.print("\"");
        } else {
          out.print("NULL");
        }
      }
      out.println();
    }
  }
407596
public void printControlEndForm(PrintWriter out, int iPrintOptions)
    {
        out.println(Utility.endTag(XMLTags.CONTROLS));
        if ((iPrintOptions & HtmlConstants.FOOTING_SCREEN) == HtmlConstants.FOOTING_SCREEN)
            out.println(Utility.endTag(XMLTags.FOOTING));
        else
            out.println(Utility.endTag(XMLTags.HEADING));
    }
916836
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        boolean bFieldsFound = false;
        String strFieldName = this.getScreenField().getSFieldParam();
        String strFieldData = this.getZmlImagePath();
        if (strFieldData == null)
            strFieldData = HtmlConstants.ICON_DIR + "Noimage.gif";
        strFieldData = Utility.encodeXML(strFieldData);
        out.println("    " + Utility.startTag(strFieldName) + strFieldData + Utility.endTag(strFieldName));
        return bFieldsFound;
    }
220833
public void printDisplayControl(PrintWriter out)
    {
        if (this.getScreenField().getConverter() != null)
        {
            String strFieldName = this.getScreenField().getConverter().getField().getFieldName(false, false);
            this.printInputControl(out, null, strFieldName, null, null, null, HtmlConstants.BUTTON, 0);   // Button that does nothing?
        }
        else if (this.getScreenField().getParentScreen() instanceof GridScreen)
        { // These are command buttons such as "Form" or "Detail"
            this.printInputControl(out, null, null, null, null, null, HtmlConstants.BUTTON, 0);   // Button that does nothing?
        }
    }
953158
public boolean printControl(PrintWriter out, int iPrintOptions)
    {
        boolean bFieldsFound = true;    // This will keep screen from printing (non-existent sub-fields)
        MenusModel recMenus = (MenusModel)((BaseMenuScreen)this.getScreenField()).getMainRecord();
        
        if ((recMenus.getField(MenusModel.XML_DATA).isNull()) || (recMenus.getField(MenusModel.XML_DATA).toString().startsWith("<HTML>")) || (recMenus.getField(Menus.XML_DATA).toString().startsWith("<html>")))
        {
            String filename = ((PropertiesField)recMenus.getField(MenusModel.PARAMS)).getProperty(DBParams.XML);
            if ((filename != null) && (filename.length() > 0))
            {
                InputStream streamIn = this.getTask().getInputStream(filename);
                if (streamIn == null)
                {
                	Utility.getLogger().warning("XmlFile not found " + filename);
                	return false;
                }
                String str = Utility.transferURLStream(null, null, new InputStreamReader(streamIn));
                recMenus.getField(MenusModel.XML_DATA).setString(str);
            }
        }
        if (!recMenus.getField(MenusModel.XML_DATA).isNull())
        {
            String str = recMenus.getField(Menus.XML_DATA).toString();
            str = Utility.replaceResources(str, null, null, (BaseMenuScreen)this.getScreenField());
            recMenus.getField(MenusModel.XML_DATA).setString(str);
        }

        String strContentArea = recMenus.getSubMenuXML();
        out.println(strContentArea);

        return bFieldsFound;
    }
994801
public void printHtmlMenuStart(PrintWriter out, ResourceBundle reg)
        throws DBException
    {
        this.printHtmlBanner(out, reg);
        this.printHtmlLogo(out, reg);
        this.printHtmlMenubar(out, reg);

        String strHTML = reg.getString("htmlTableStart");
        strHTML = Utility.replaceResources(strHTML, reg, null, null);
        if ((strHTML == null) || (strHTML.length() == 0))
            strHTML = "<table border=\"0\" cellspacing=\"10\" width=\"100%\">\n<tr>";
        out.println(strHTML);

        this.printHtmlNavMenu(out);

        strHTML = reg.getString("htmlContentStart");
        if ((strHTML == null) || (strHTML.length() == 0))
            strHTML = "<td valign=\"top\">";
        out.println(strHTML);
    }
1349132
public void printDataStartForm(PrintWriter out, int iPrintOptions)
    {
        String strRecordName = "norecord";
        Record record = this.getMainRecord();
        if (record != null)
            strRecordName = record.getTableNames(false);
        if ((iPrintOptions & HtmlConstants.MAIN_HEADING_SCREEN) == HtmlConstants.MAIN_HEADING_SCREEN)
        {
            out.println(Utility.startTag(XMLTags.HEADING));
            out.println(Utility.startTag(XMLTags.FILE));
            out.println(Utility.startTag(strRecordName));
        }
        if ((iPrintOptions & HtmlConstants.MAIN_FOOTING_SCREEN) == HtmlConstants.MAIN_FOOTING_SCREEN)
        {
            out.println(Utility.startTag(XMLTags.FOOTING));
            out.println(Utility.startTag(XMLTags.FILE));
            out.println(Utility.startTag(strRecordName));
        }
        if ((iPrintOptions & HtmlConstants.REPORT_SCREEN) != HtmlConstants.REPORT_SCREEN)
            out.println(Utility.startTag(XMLTags.DATA));    // If not a report
    }
1176221
public boolean printControl(PrintWriter out, int iPrintOptions)
    {
        boolean bFieldsFound = super.printControl(out, iPrintOptions);
        if (!bFieldsFound)
        {
            int iNumCols = this.getSFieldCount();
            for (int iIndex = 0; iIndex < iNumCols; iIndex++)
            {
                ScreenField sField = this.getSField(iIndex);
                boolean bPrintControl = this.isPrintableControl(sField, iPrintOptions);
                if (this.isToolbar())
                    if (sField.getConverter() == null)
                        bPrintControl = false;
                if (this instanceof BaseGridScreen)
                    if (iIndex < ((BaseGridScreen)this).getNavCount())
                        bPrintControl = true;   // Move to isPrintable.
                if (bPrintControl)
                {
                    if (!bFieldsFound)
                        this.printControlStartForm(out, iPrintOptions);    // First time
                    this.printControlStartField(out, iPrintOptions);
                    sField.printControl(out, iPrintOptions);
                    this.printControlEndField(out, iPrintOptions);
                    bFieldsFound = true;
                }
            }
            if (bFieldsFound)
                this.printControlEndForm(out, iPrintOptions);
        }
        return bFieldsFound;
    }
73268
public void printHtmlMenubar(PrintWriter out, ResourceBundle reg)
        throws DBException
    {
        char chMenubar = ScreenFieldViewAdapter.getFirstToUpper(this.getProperty(DBParams.MENUBARS), 'Y');
        if (chMenubar == 'Y')
        {
            String strUserName = this.getProperty(DBParams.USER_NAME);
            String strUserID = this.getProperty(DBParams.USER_ID);
            if ((strUserName == null) || (DBConstants.ANON_USER_ID.equals(strUserID)) || (Utility.isNumeric(strUserName)))
                strUserName = DBConstants.BLANK;
            String strNav = reg.getString((strUserName.length() > 0) ? "htmlMenubar" : "htmlMenubarAnon");
            strNav = Utility.replaceResources(strNav, reg, null, null);
            String strScreen = ((BasePanel)this.getScreenField()).getScreenURL();
            strScreen = Utility.encodeXML(strScreen);
            String strTitle = this.getProperty("title");                // Menu page
            if ((strTitle == null) || (strTitle.length() == 0))
                strTitle = ((BasePanel)this.getScreenField()).getTitle();
            strNav = Utility.replace(strNav, HtmlConstants.URL_TAG, strScreen);
            strNav = Utility.replace(strNav, HtmlConstants.TITLE_TAG, strTitle);
            strNav = Utility.replace(strNav, HtmlConstants.USER_NAME_TAG, strUserName);
            this.writeHtmlString(strNav, out);
        }
    }
270784
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        boolean bFieldsFound = false;
        String strFieldName = this.getScreenField().getSFieldParam();
        String strFieldData = this.getScreenField().getSFieldValue(true, false);
        if ((this.getScreenField().getConverter() != null)
            && (!(this.getScreenField().getConverter().getField() instanceof XmlField))
            && (!(this.getScreenField().getConverter().getField() instanceof HtmlField))
            && (!(this.getScreenField().getConverter().getField() instanceof XMLPropertiesField)))
                strFieldData = Utility.encodeXML(strFieldData);
        out.println("    " + Utility.startTag(strFieldName) + strFieldData + Utility.endTag(strFieldName));
        return bFieldsFound;
    }