Changeset 6769


Ignore:
Timestamp:
Mar 11, 2015, 8:08:43 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1325: Lists of items

Improved code for printing out the synchronization filter on the information page. Instead of jus using the PropertyFilter.toString() method a PropertyFilterFormatter is used. This makes some cosmetic changes as well as loading names of annotation types, etc. which are used instead of the ID values.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/itemlists/view_list.jsp

    r6768 r6769  
    5151  import="net.sf.basedb.util.Values"
    5252  import="net.sf.basedb.util.formatter.Formatter"
     53  import="net.sf.basedb.util.formatter.PropertyFilterFormatter"
    5354  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
    5455  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     
    9697  final boolean isOwner = list.isOwner();
    9798  Formatter<Date> timeFormatter = FormatterFactory.getDateTimeFormatter(sc);
     99  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    98100  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, list);
    99101  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
     
    266268        <td><%=list.getSize()%></td>
    267269      </tr>
    268       <tr>
     270      <tr style="vertical-align: top;">
    269271        <th>Sync filter</th>
    270272        <td>
     
    276278            for (int filterRow = 0; filterRow < syncFilter.getFilterRows(); filterRow++)
    277279            {
    278               sb.append(filterRow > 0 ? "OR " : "");
    279               sb.append(Values.getString(syncFilter.getPropertyFilters(filterRow), " AND ", true));
    280               sb.append("\n");
     280              sb.append(filterRow > 0 ? "\nOR " : "");
     281              sb.append(Values.getString(syncFilter.getPropertyFilters(filterRow), "\n   AND ", true, new PropertyFilterFormatter(dc, dateFormatter)));
    281282            }
    282283            %>
    283284            Yes (last sync: <%=timeFormatter.format(list.getSyncDate()) %>) [<a href="index.jsp?ID=<%=ID%>&item_id=<%=itemId%>&cmd=ReSyncFilter">Re-sync</a>]<br>
    284             <pre><%=sb.toString()%></pre>
     285            <pre style="margin: 5px;"><%=HTML.encodeTags(sb.toString())%></pre>
    285286            <%
    286287          }
Note: See TracChangeset for help on using the changeset viewer.