Generates the printable output for the given list.<p>

@return html code
973956
public String generateHtml() {

        StringBuffer result = new StringBuffer(2048);
        result.append(htmlStart(null));
        result.append(CmsListExplorerColumn.getExplorerStyleDef());
        result.append(bodyStart("dialog", null));
        result.append(dialogStart());
        result.append(dialogContentStart(getParamTitle()));
        result.append(m_list.printableHtml());
        result.append(dialogContentEnd());
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
1185928
public String getListHTML(String base,
                              boolean parent)
        throws IOException
    {
        if (!isDirectory())
            return null;
        
      
        String[] ls = list();
        if (ls==null)
            return null;
        Arrays.sort(ls);
        
        String title = "Directory: "+URI.decodePath(base);
        title=StringUtil.replace(StringUtil.replace(title,"<","&lt;"),">","&gt;");
        StringBuffer buf=new StringBuffer(4096);
        buf.append("<HTML><HEAD><TITLE>");
        buf.append(title);
        buf.append("</TITLE></HEAD><BODY>\n<H1>");
        buf.append(title);
        buf.append("</H1><TABLE BORDER=0>");
        
        if (parent)
        {
            buf.append("<TR><TD><A HREF=");
            buf.append(URI.encodePath(URI.addPaths(base,"../")));
            buf.append(">Parent Directory</A></TD><TD></TD><TD></TD></TR>\n");
        }
        
        DateFormat dfmt=DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
                                                       DateFormat.MEDIUM);
        for (int i=0 ; i< ls.length ; i++)
        {   
            String encoded=URI.encodePath(ls[i]);
            Resource item = addPath(encoded);
            
            buf.append("<TR><TD><A HREF=\"");
            
            String path=URI.addPaths(base,encoded);
            
            if (item.isDirectory() && !path.endsWith("/"))
                path=URI.addPaths(path,"/");
            buf.append(path);
            buf.append("\">");
            buf.append(StringUtil.replace(StringUtil.replace(ls[i],"<","&lt;"),">","&gt;"));
            buf.append("&nbsp;");
            buf.append("</TD><TD ALIGN=right>");
            buf.append(item.length());
            buf.append(" bytes&nbsp;</TD><TD>");
            buf.append(dfmt.format(new Date(item.lastModified())));
            buf.append("</TD></TR>\n");
        }
        buf.append("</TABLE>\n");
	buf.append("</BODY></HTML>\n");
        
        return buf.toString();
    }
442291
public static String[] render(final Throwable throwable) {

        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        try {
            throwable.printStackTrace(pw);
        } catch (RuntimeException ex) {
            // nothing to do
        }
        pw.flush();
        LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
        ArrayList<String> lines = new ArrayList<>();
        try {
            String line = reader.readLine();
            while (line != null) {
                lines.add(line);
                line = reader.readLine();
            }
        } catch (IOException ex) {
            if (ex instanceof InterruptedIOException) {
                Thread.currentThread().interrupt();
            }
            lines.add(ex.toString());
        }
        //String[] tempRep = new String[lines.size()];
        return lines.toArray(new String[0]);
    }
660550
public String buildElementList() {

        StringBuffer retValue = new StringBuffer(512);
        retValue.append("<table border=\"0\">\n");
        retValue.append("<tr>\n");
        retValue.append(
            "\t<td class=\"textbold\" unselectable=\"on\">"
                + key(Messages.GUI_EDITOR_DIALOG_ELEMENTS_PAGEELEMENT_0)
                + "</td>\n");
        retValue.append("\t<td class=\"textbold\" unselectable=\"on\">&nbsp;&nbsp;"
            + key(Messages.GUI_EDITOR_DIALOG_ELEMENTS_ENABLED_0)
            + "&nbsp;&nbsp;</td>\n");
        retValue.append("</tr>\n");
        retValue.append("<tr><td colspan=\"2\"><span style=\"height: 6px;\"></span></td></tr>\n");

        try {

            // get the list of all possible elements
            List<CmsDialogElement> elementList = computeElements();

            // get all present bodies from the temporary file
            CmsFile file = getCms().readFile(getParamTempfile(), CmsResourceFilter.IGNORE_EXPIRATION);
            CmsXmlPage page = CmsXmlPageFactory.unmarshal(getCms(), file);

            // show all possible elements
            Iterator<CmsDialogElement> i = elementList.iterator();
            while (i.hasNext()) {
                // get the current list element
                CmsDialogElement element = i.next();
                // build an element row
                retValue.append("<tr>\n");
                retValue.append("\t<td style=\"white-space: nowrap;\" unselectable=\"on\">" + element.getNiceName());
                retValue.append("</td>\n");
                retValue.append("\t<td class=\"textcenter\" unselectable=\"on\"><input type=\"checkbox\" name=\"");
                retValue.append(PREFIX_PARAM_BODY);
                retValue.append(element.getName());
                retValue.append("\" value=\"true\"");

                if ((!page.hasValue(element.getName(), getElementLocale()) && element.isMandantory())
                    || page.isEnabled(element.getName(), getElementLocale())) {
                    retValue.append(" checked=\"checked\"");
                }
                if (element.isMandantory() || element.getName().equals(getParamElementname())) {
                    retValue.append(" disabled=\"disabled\"");
                }
                retValue.append(">");
                retValue.append("<script type=\"text/javascript\">registerElement(\"");

                retValue.append(element.getName());
                retValue.append("\", ");
                retValue.append(page.isEnabled(element.getName(), getElementLocale()));
                retValue.append(");</script>");

                retValue.append("</td>\n");
                retValue.append("</tr>\n");
            }

        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        }

        retValue.append("</table>\n");
        return retValue.toString();
    }
903230
public function cmdGetLibrary()
    {
        $list = $this->getListLibrary();
        $this->outputFormat($list);
        $this->outputFormatTableLibrary($list);
        $this->output();
    }
1025223
public List<CmsFormatterBean> getFormatters() {

        CmsFormatterBean mainFormatter = createFormatterBean(m_mainFormat, true);
        List<CmsFormatterBean> formatters = new ArrayList<CmsFormatterBean>();
        formatters.add(mainFormatter);
        for (Format format : m_otherFormats) {
            formatters.add(createFormatterBean(format, false));
        }
        return formatters;
    }
562071
@Override
    public String printHelp() {
        List<CommandLineParser<CI>> parsers = getChildParsers();
        if (parsers != null && parsers.size() > 0) {
            StringBuilder sb = new StringBuilder();
            sb.append(processedCommand.printHelp(helpNames()))
                    .append(Config.getLineSeparator())
                    .append(processedCommand.name())
                    .append(" commands:")
                    .append(Config.getLineSeparator());

            int maxLength = 0;

            for (CommandLineParser child : parsers) {
                int length = child.getProcessedCommand().name().length();
                if (length > maxLength) {
                    maxLength = length;
                }
            }

            for (CommandLineParser child : parsers) {
                sb.append(child.getFormattedCommand(4, maxLength + 2))
                        .append(Config.getLineSeparator());
            }

            return sb.toString();
        }
        else
            return processedCommand.printHelp(helpNames());
    }
957590
protected String htmlPagingBar() {

        if (getNumberOfPages() < 2) {
            return "";
        }
        StringBuffer html = new StringBuffer(1024);
        CmsMessages messages = Messages.get().getBundle(getWp().getLocale());
        html.append("<table width='100%' cellspacing='0' style='margin-top: 5px;'>\n");
        html.append("\t<tr>\n");
        html.append("\t\t<td class='main'>\n");
        // prev button
        String id = "listPrev";
        String name = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_NAME_0);
        String iconPath = ICON_LEFT;
        boolean enabled = getCurrentPage() > 1;
        String helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELP_0);
        if (!enabled) {
            helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELPDIS_0);
        }
        String onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() - 1) + ")";
        html.append(A_CmsHtmlIconButton.defaultButtonHtml(
            CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT,
            id,
            name,
            helpText,
            enabled,
            iconPath,
            null,
            onClic));
        html.append("\n");
        // next button
        id = "listNext";
        name = messages.key(Messages.GUI_LIST_PAGING_NEXT_NAME_0);
        iconPath = ICON_RIGHT;
        enabled = getCurrentPage() < getNumberOfPages();
        helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELP_0);
        if (!enabled) {
            helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELPDIS_0);
        }
        onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() + 1) + ")";
        html.append(A_CmsHtmlIconButton.defaultButtonHtml(
            CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT,
            id,
            name,
            helpText,
            enabled,
            iconPath,
            null,
            onClic));
        html.append("\n");
        // page selection list
        html.append("\t\t\t&nbsp;&nbsp;&nbsp;");
        html.append("\t\t\t<select name='listPageSet' id='id-page_set' onChange =\"listSetPage('");
        html.append(getId());
        html.append("', this.value);\" style='vertical-align: bottom;'>\n");
        html.append(
            htmlPageSelector(
                getNumberOfPages(),
                getMaxItemsPerPage(),
                getSize(),
                getCurrentPage(),
                getWp().getLocale()));
        html.append("\t\t\t</select>\n");
        html.append("\t\t\t&nbsp;&nbsp;&nbsp;");
        boolean isNotSearching = true;
        if (getMetadata().isSearchable()) {
            isNotSearching = CmsStringUtil.isEmptyOrWhitespaceOnly(m_searchFilter);
        }
        if (isNotSearching) {
            html.append(
                messages.key(
                    Messages.GUI_LIST_PAGING_TEXT_2,
                    new Object[] {m_name.key(getWp().getLocale()), new Integer(getTotalSize())}));
        } else {
            html.append(messages.key(
                Messages.GUI_LIST_PAGING_FILTER_TEXT_3,
                new Object[] {m_name.key(getWp().getLocale()), new Integer(getSize()), new Integer(getTotalSize())}));
        }
        html.append("\t\t</td>\n");
        html.append("\t</tr>\n");
        html.append("</table>\n");
        return html.toString();
    }
947985
public String list()
   {
      StringBuilder sb = new StringBuilder();

      Context c = null;
      try
      {
         c = new InitialContext();
         Context context = (Context)c.lookup("java:");
         sb.append("java:").append(NEW_LINE);
         list(context, " ", sb);
      }
      catch (Throwable t)
      {
         log.debug(t.getMessage(), t);
      }
      finally
      {
         if (c != null)
         {
            try
            {
               c.close();
            }
            catch (Throwable ignore)
            {
               // Ignore
            }
         }
      }

      return sb.toString();
   }
400059
protected String customHtmlEnd() {

        StringBuffer result = new StringBuffer(512);
        result.append("<form name='actions' method='post' action='");
        result.append(getFirstWp().getDialogRealUri());
        result.append("' class='nomargin' onsubmit=\"return submitAction('ok', null, 'actions');\">\n");
        result.append(getFirstWp().allParamsAsHidden());
        result.append("<div class=\"dialogspacer\" unselectable=\"on\">&nbsp;</div>\n");
        result.append("<!-- button row start -->\n<div class=\"dialogbuttons\" unselectable=\"on\">\n");
        result.append("<input name='");
        result.append(CmsDialog.DIALOG_CONFIRMED);
        result.append("' type='button' value='");
        result.append(
            Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CONFIRM_0).key(getFirstWp().getLocale()));
        result.append("' onclick=\"submitAction('");
        result.append(CmsDialog.DIALOG_CONFIRMED);
        result.append("', form);\" class='dialogbutton'>\n");
        result.append("<input name='");
        result.append(CmsDialog.DIALOG_CANCEL);
        result.append("' type='button' value='");
        result.append(
            Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CANCEL_0).key(getFirstWp().getLocale()));
        result.append("' onclick=\"submitAction('");
        result.append(CmsDialog.DIALOG_CANCEL);
        result.append("', form);\" class='dialogbutton'>\n");
        result.append("</div>\n<!-- button row end -->\n");
        result.append("</form>\n");
        return result.toString();
    }
1359366
protected String printList()
  {
    String output = "[";
    
    SimpleEntry pointer = first;
    int counter = 0;
    while((pointer != null) && (counter < 3))
    {
      output += "@"+Integer.toHexString(pointer.hashCode());
      pointer = pointer.next;
      if(pointer != null)
        output +=  ", ";
      counter++;
    }
    if(pointer != null)
    {
      output += "..., @"+Integer.toHexString(last.hashCode()) + "]";
    }
    else
      output += "]";
    
    return output;
  }
502518
public Map<String, List<CmsJspResourceWrapper>> getElementsInContainer() {

        return CmsCollectionsGenericWrapper.createLazyMap(obj -> {
            if (obj instanceof String) {
                List<CmsJspResourceWrapper> elements = new ArrayList<>();
                CmsContainerBean container = getPage().getContainers().get(obj);
                if (container != null) {
                    for (CmsContainerElementBean element : container.getElements()) {
                        try {
                            element.initResource(m_cms);
                            elements.add(CmsJspResourceWrapper.wrap(m_cms, element.getResource()));
                        } catch (Exception e) {
                            LOG.error(e.getLocalizedMessage(), e);
                        }
                    }
                }
                return elements;
            } else {
                return null;
            }
        });

    }
511826
protected function generateOutput()
    {
        $output = '';

        foreach ($this->messageList as $message) {
            $flashMessage = GeneralUtility::makeInstance(
                'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
                $message[2],
                $message[1],
                $message[0]
            );
            $output .= $flashMessage->render();
        }

        return $output;
    }
751819
public static String render(List<SimpleHTMLTag> tags) {
        HTMLRenderer renderer = new HTMLRenderer(tags);

        return renderer.render();
    }
504759
static void printList(final PrintWriter pw, final List<?> l) {
        for (int i = 0; i < l.size(); ++i) {
            Object o = l.get(i);
            if (o instanceof List) {
                printList(pw, (List<?>) o);
            } else {
                pw.print(o.toString());
            }
        }
    }
938428
public List<CmsDetailPageInfo> toList() {

        List<CmsDetailPageInfo> result = new ArrayList<CmsDetailPageInfo>();
        for (String key : m_map.keySet()) {
            for (CmsDetailPageInfo info : m_map.get(key)) {
                result.add(info);
            }
        }
        return result;
    }
978060
public void generatePdf(OutputStream out, List<Map<String, Object>> rows, List<ColumnDef> columns) {
        try {
            Document document = new Document();
            PdfWriter.getInstance(document, out);
            if (columns == null)
            {
                if (rows.size() > 0) return;
                columns = new ArrayList<ColumnDef>(CollectionUtils.collect(rows.get(0).keySet(), new Transformer() {
                    @Override
                    public Object transform(final Object input) {
                        return new ColumnDef()
                        {{
                                setName((String)input);
                            }};
                    }
                }));
            }
                if (columns.size() > 14)
                    document.setPageSize(PageSize.A1);
                else if (columns.size() > 10)
                    document.setPageSize(PageSize.A2);
                else if (columns.size() > 7)
                    document.setPageSize(PageSize.A3);
                else
                    document.setPageSize(PageSize.A4);
            document.open();
            Font font = FontFactory.getFont(FontFactory.COURIER, 8, Font.NORMAL, BaseColor.BLACK);
            Font headerFont = FontFactory.getFont(FontFactory.COURIER, 8, Font.BOLD, BaseColor.BLACK);

            int size = columns.size();
            PdfPTable table = new PdfPTable(size);
            for (ColumnDef column : columns)
            {
                PdfPCell c1 = new PdfPCell(new Phrase(column.getName(), headerFont));
                c1.setHorizontalAlignment(Element.ALIGN_CENTER);
                table.addCell(c1);
            }
            table.setHeaderRows(1);
            if (rows != null)
                for (Map<String, Object> row : rows)
                {
                    for (ColumnDef column : columns)
                    {
                        table.addCell(new Phrase(String.valueOf(row.get(column.getName())), font));
                    }
                }
            document.add(table);
            document.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }