Changeset 7481
- Timestamp:
- Apr 26, 2018, 8:58:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.12-stable/www/common/plugin/parse_file.jsp
r6684 r7481 24 24 @version 2.0 25 25 --%> 26 <%@page import="org.json.simple.JSONObject"%>27 26 <%@ page pageEncoding="UTF-8" session="false" 28 27 contentType="text/html; charset=UTF-8" … … 49 48 import="java.io.InputStream" 50 49 import="org.json.simple.JSONArray" 50 import="org.json.simple.JSONObject" 51 51 %> 52 52 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 173 173 %> 174 174 <base:page type="iframe" title="Test with file"> 175 <base:head scripts="tabcontrol-2.js,~parse_file.js" styles="table.css,tabcontrol.css" /> 175 <base:head scripts="tabcontrol-2.js,~parse_file.js" styles="table.css,tabcontrol.css"> 176 <style> 177 #fileData td 178 { 179 white-space: nowrap; 180 max-width: 20em; 181 min-width: 4em; 182 overflow: hidden; 183 text-overflow: ellipsis; 184 } 185 #fileData td:first-child 186 { 187 font-weight: bold; 188 } 189 .skipped 190 { 191 padding: 1px 2px 1px 2px; 192 color: #777777; 193 font-style: italic; 194 } 195 </style> 196 </base:head> 176 197 <base:body> 177 198 <div class="absolutefull bottomborder"> … … 216 237 <div class="itemlist" style="<%=messages.size()==0 ? "" : "border-top-width: 1px;"%>"> 217 238 <div class="data"> 218 <table style="border: 0;" >239 <table style="border: 0;" id="fileData"> 219 240 <thead class="bg-filled-100"> 220 241 <tr> … … 234 255 int rowClassIndex = 0; 235 256 236 while (currentLine < =maxLines && currentLine < headerLines)257 while (currentLine < maxLines && currentLine < headerLines) 237 258 { 238 259 FlatFileParser.Line line = parser.getLine(currentLine); 239 260 linePatterns.add(Pattern.quote(line.line())); 240 261 String[] data = null; 262 int numMoreColumns = 0; 241 263 if (line.type() == FlatFileParser.LineType.HEADER) 242 264 { … … 246 268 { 247 269 data = parser.trimQuotes(splitter.split(line.line(), 99)); 270 if (data.length == 99) 271 { 272 numMoreColumns = splitter.split(line.line()).length - 99; 273 } 248 274 } 249 275 else … … 254 280 <tr class="<%=rowclass[rowClassIndex]%> highlight"> 255 281 <td class="cell"><%=line.lineNo()%></td> 256 <td class="cell"><%=data.length %></td>282 <td class="cell"><%=data.length+numMoreColumns%></td> 257 283 <td class="cell"><%=line.type()%></td> 258 284 <td class="cell"> … … 290 316 { 291 317 if (lastLine == FlatFileParser.LineType.DATA) parser.nextData(); 292 while (currentLine < =maxLines && parser.hasMoreData())318 while (currentLine < maxLines && parser.hasMoreData()) 293 319 { 294 320 FlatFileParser.Data data = parser.nextData(); … … 298 324 %> 299 325 <tr> 300 <td class=" error" colspan="103">326 <td class="skipped bg-filled-100" colspan="103"> 301 327 Skipped <%=parser.getNumSkippedLines()%> lines 302 328 (<%=parser.getIgnoredLines()%> ignored; <%=parser.getUnknownLines()%> unknown) … … 320 346 </td> 321 347 <% 322 for (int i = 0; i < data.columns() ; ++i)348 for (int i = 0; i < data.columns() && i < 99; ++i) 323 349 { 324 350 %>
Note: See TracChangeset
for help on using the changeset viewer.