DCValue[] titleArray = items[i].getDC("title", null, Item.ANY); String title = LocaleSupport.getLocalizedMessage(pageContext, "jsp.general.untitled");  if (titleArray.length > 0) { title = titleArray[0].value; }   DCValue[] authors = items[i].getDC("contributor", Item.ANY, Item.ANY);   DCValue[] dateIssued = items[i].getDC("date", "issued", Item.ANY); DCDate dd = null;  if (dateIssued.length > 0) { dd = new DCDate(dateIssued[0].value); }   out.print("<tr><td headers=\"t1\" nowrap=\"nowrap\" class=\""); out.print((i == highlightRow) ? "highlight" : row); out.print("RowOddCol\" align=\"right\">");  if (emphasiseDate) { out.print("<strong>"); }  out.print(UIUtil.displayDate(dd, false, false));  if (emphasiseDate) { out.print("</strong>"); }  HttpServletRequest hrq = (HttpServletRequest) pageContext .getRequest();   if (showThumbs) { out.print(getThumbMarkup(hrq, items[i])); }   out.print("</td><td headers=\"t2\" class=\""); out.print((i == highlightRow) ? "highlight" : row); out.print("RowEvenCol\">");  if (emphasiseTitle) { out.print("<strong>"); }  out.print("<a href=\""); out.print(hrq.getContextPath()); out.print("/handle/"); out.print(items[i].getHandle()); out.print("\">"); out.print(Utils.addEntities(title)); out.print("</a>");  if (emphasiseTitle) { out.print("</strong>"); }   out.print("</td><td headers=\"t3\" class=\""); out.print((i == highlightRow) ? "highlight" : row); out.print("RowOddCol\">");  for (int j = 0; j < authors.length; j++) { out.print("<em>" + Utils.addEntities(authors[j].value) + "</em>");  if (j < (authors.length - 1)) { out.print("; "); } }  out.println("</td></tr>");  row = (row.equals("odd") ? "even" : "odd");
String field = st.nextToken().toLowerCase().trim(); String cOddOrEven = ((colCount % 2) == 0 ? "Odd" : "Even");   if (field.indexOf("(date)") > 0) { field = field.replaceAll("\\(date\\)", ""); isDate = true; }        StringTokenizer eq = new StringTokenizer(field, ".");  String[] tokens = { "", "", "" }; int k = 0; while(eq.hasMoreTokens()) { tokens[k] = eq.nextToken().toLowerCase().trim(); k++; } String schema = tokens[0]; String element = tokens[1]; String qualifier = tokens[2];   if ((field.equals(dateField) && emphasiseDate) || (field.equals(titleField) && emphasiseTitle)) { emph = true; }   String id = "t" + Integer.toString(colCount); String css = "oddRow" + cOddOrEven + "Col"; String message = "itemlist." + field;   out.print("<th id=\"" + id +  "\" class=\"" + css + "\">" + (emph ? "<strong>" : "") + LocaleSupport.getLocalizedMessage(pageContext, message) + (emph ? "</strong>" : "") + "</th>");   for (int i = 0; i < items.length; i++) {  DCValue[] metadataArray; if (qualifier.equals("*")) { metadataArray = items[i].getDC(element, Item.ANY, Item.ANY); } else if (qualifier.equals("")) { metadataArray = items[i].getDC(element, null, Item.ANY); } else { metadataArray = items[i].getDC(element, qualifier, Item.ANY); }   String metadata = "-"; if (metadataArray.length > 0) {  if (isDate) {   String thumbs = ""; if (showThumbs) { thumbs = getThumbMarkup(hrq, items[i]); } DCDate dd = new DCDate(metadataArray[0].value); metadata = UIUtil.displayDate(dd, false, false) + thumbs; }  else if (field.equals(titleField)) { metadata = "<a href=\"" + hrq.getContextPath() + "/handle/" + items[i].getHandle() + "\">" + Utils.addEntities(metadataArray[0].value) + "</a>"; }  else { StringBuffer sb = new StringBuffer(); for (int j = 0; j < metadataArray.length; j++) { sb.append(Utils.addEntities(metadataArray[j].value)); if (j < (metadataArray.length - 1)) { sb.append("; "); } } metadata = "<em>" + sb.toString() + "</em>"; } }   String rOddOrEven; if (i == highlightRow) { rOddOrEven = "highlight"; } else { rOddOrEven = ((i % 2) == 1 ? "odd" : "even"); }   String extras = ""; if (isDate) { extras = "nowrap=\"nowrap\" align=\"right\""; }  int idx = ((i + 1) * columns) - columns + colCount - 1; frags[idx] = "<td headers=\"" + id + "\" class=\"" + rOddOrEven + "Row" + cOddOrEven + "Col\" " + extras + ">" + (emph ? "<strong>" : "") + metadata + (emph ? "</strong>" : "") + "</td>";  }  colCount++; isDate = false; emph = false;
    public int doStartTag() throws JspException    {        JspWriter out = pageContext.getOut();        boolean emphasiseDate = false;        boolean emphasiseTitle = false;        if (emphColumn != null)        {            emphasiseDate = emphColumn.equalsIgnoreCase("date");            emphasiseTitle = emphColumn.equalsIgnoreCase("title");        }        try        {            out.println("<table align=\"center\" class=\"miscTable\" summary=\"This table browse all dspace content\">");            // Write column headings            out.print("<tr><th id=\"t1\" class=\"oddRowOddCol\">"                    + (emphasiseDate ? "<strong>" : "")                    + LocaleSupport.getLocalizedMessage(pageContext,                            "org.dspace.app.webui.jsptag.ItemListTag.issueDate")                    + (emphasiseDate ? "</strong>" : "") + "</th>");            out.println("<th id=\"t2\" class=\"oddRowEvenCol\">"                    + (emphasiseTitle ? "<strong>" : "")                    + LocaleSupport.getLocalizedMessage(pageContext,                            "org.dspace.app.webui.jsptag.ItemListTag.title")                    + (emphasiseTitle ? "</strong>" : "") + "</th>");            out.println("<th id=\"t3\" class=\"oddRowOddCol\">"                    + LocaleSupport.getLocalizedMessage(pageContext,                            "org.dspace.app.webui.jsptag.ItemListTag.authors")                    + "</th></tr>");            // Row: toggles between Odd and Even            String row = "even";            for (int i = 0; i < items.length; i++)            {                // Title - we just use the first one                DCValue[] titleArray = items[i].getDC("title", null, Item.ANY);                String title = LocaleSupport.getLocalizedMessage(pageContext,                                "jsp.general.untitled");                if (titleArray.length > 0)                {                    title = titleArray[0].value;                }                // Authors....                DCValue[] authors = items[i].getDC("contributor", Item.ANY,                        Item.ANY);                // Date issued                DCValue[] dateIssued = items[i].getDC("date", "issued",                        Item.ANY);                DCDate dd = null;                if (dateIssued.length > 0)                {                    dd = new DCDate(dateIssued[0].value);                }                // First column is date                out.print("<tr><td headers=\"t1\" nowrap=\"nowrap\" class=\"");                out.print((i == highlightRow) ? "highlight" : row);                out.print("RowOddCol\" align=\"right\">");                if (emphasiseDate)                {                    out.print("<strong>");                }                out.print(UIUtil.displayDate(dd, false, false));                if (emphasiseDate)                {                    out.print("</strong>");                }                HttpServletRequest hrq = (HttpServletRequest) pageContext                        .getRequest();                // display thumbnails if required                if (showThumbs)                {                    out.print(getThumbMarkup(hrq, items[i]));                }                // Second column is title                out.print("</td><td headers=\"t2\" class=\"");                out.print((i == highlightRow) ? "highlight" : row);                out.print("RowEvenCol\">");                if (emphasiseTitle)                {                    out.print("<strong>");                }                out.print("<a href=\"");                out.print(hrq.getContextPath());                out.print("/handle/");                out.print(items[i].getHandle());                out.print("\">");                out.print(Utils.addEntities(title));                out.print("</a>");                if (emphasiseTitle)                {                    out.print("</strong>");                }                // Third column is authors                out.print("</td><td headers=\"t3\" class=\"");                out.print((i == highlightRow) ? "highlight" : row);                out.print("RowOddCol\">");                for (int j = 0; j < authors.length; j++)                {                    out.print("<em>" + Utils.addEntities(authors[j].value)                            + "</em>");                    if (j < (authors.length - 1))                    {                        out.print("; ");                    }                }                out.println("</td></tr>");                row = (row.equals("odd") ? "even" : "odd");            }            out.println("</table>");        }        catch (IOException ie)        {            throw new JspException(ie);        }        return SKIP_BODY;    }