| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
package org.melati.admin; |
| 47 | |
|
| 48 | |
import java.util.Vector; |
| 49 | |
import java.util.Enumeration; |
| 50 | |
|
| 51 | |
import org.melati.Melati; |
| 52 | |
import org.melati.servlet.FormDataAdaptor; |
| 53 | |
import org.melati.servlet.InvalidUsageException; |
| 54 | |
import org.melati.servlet.Form; |
| 55 | |
import org.melati.servlet.TemplateServlet; |
| 56 | |
import org.melati.template.ServletTemplateContext; |
| 57 | |
import org.melati.template.FormParameterException; |
| 58 | |
|
| 59 | |
import org.melati.poem.AccessToken; |
| 60 | |
import org.melati.poem.AccessPoemException; |
| 61 | |
import org.melati.poem.BaseFieldAttributes; |
| 62 | |
import org.melati.poem.Capability; |
| 63 | |
import org.melati.poem.Column; |
| 64 | |
import org.melati.poem.ColumnInfo; |
| 65 | |
import org.melati.poem.ColumnInfoTable; |
| 66 | |
import org.melati.poem.ColumnTypePoemType; |
| 67 | |
import org.melati.poem.Database; |
| 68 | |
import org.melati.poem.DeletionIntegrityPoemException; |
| 69 | |
import org.melati.poem.DisplayLevel; |
| 70 | |
import org.melati.poem.ExecutingSQLPoemException; |
| 71 | |
import org.melati.poem.Field; |
| 72 | |
import org.melati.poem.Initialiser; |
| 73 | |
import org.melati.poem.Persistent; |
| 74 | |
import org.melati.poem.PoemException; |
| 75 | |
import org.melati.poem.PoemThread; |
| 76 | |
import org.melati.poem.PoemType; |
| 77 | |
import org.melati.poem.PoemTypeFactory; |
| 78 | |
import org.melati.poem.ReferencePoemType; |
| 79 | |
import org.melati.poem.Setting; |
| 80 | |
import org.melati.poem.Table; |
| 81 | |
import org.melati.poem.TableInfo; |
| 82 | |
import org.melati.poem.TableInfoTable; |
| 83 | |
import org.melati.poem.ValidationPoemException; |
| 84 | |
|
| 85 | |
import org.melati.poem.util.EnumUtils; |
| 86 | |
import org.melati.poem.util.MappedEnumeration; |
| 87 | |
import org.melati.util.MelatiBugMelatiException; |
| 88 | |
import org.melati.util.MelatiRuntimeException; |
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | 0 | public class Admin extends TemplateServlet { |
| 126 | |
private static final long serialVersionUID = 1L; |
| 127 | |
|
| 128 | 0 | private static String screenStylesheetURL = null; |
| 129 | 0 | private static String primaryDisplayTable = null; |
| 130 | 0 | private static String homepageURL = null; |
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
protected static Persistent create(Table table, |
| 136 | |
final ServletTemplateContext context) { |
| 137 | 0 | Persistent result = table.create(new Initialiser() { |
| 138 | 0 | public void init(Persistent object) throws AccessPoemException, |
| 139 | |
ValidationPoemException { |
| 140 | 0 | Form.extractFields(context, object); |
| 141 | 0 | } |
| 142 | |
}); |
| 143 | 0 | result.postEdit(true); |
| 144 | 0 | return result; |
| 145 | |
} |
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
protected static final String adminTemplate(String name) { |
| 151 | 0 | return "org/melati/admin/" + name; |
| 152 | |
} |
| 153 | |
|
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | |
protected static String dsdTemplate(ServletTemplateContext context) { |
| 158 | |
|
| 159 | |
|
| 160 | |
|
| 161 | |
|
| 162 | |
|
| 163 | 0 | String c = PoemThread.database().getClass().getName(); |
| 164 | 0 | int dot = c.lastIndexOf('.'); |
| 165 | 0 | String p = c.substring(0, dot); |
| 166 | |
|
| 167 | 0 | context.put("package", p); |
| 168 | 0 | return adminTemplate("DSD"); |
| 169 | |
} |
| 170 | |
|
| 171 | |
|
| 172 | |
|
| 173 | |
|
| 174 | |
protected static String primarySelectTemplate(ServletTemplateContext context, |
| 175 | |
Melati melati) throws PoemException { |
| 176 | 0 | final Table table = melati.getTable(); |
| 177 | |
|
| 178 | |
Field primaryCriterion; |
| 179 | |
|
| 180 | 0 | Column column = table.primaryCriterionColumn(); |
| 181 | 0 | if (column != null) { |
| 182 | 0 | String sea = context.getForm("field_" + column.getName()); |
| 183 | 0 | primaryCriterion = new Field( |
| 184 | |
sea == null ? |
| 185 | |
( |
| 186 | |
melati.getObject() == null ? |
| 187 | |
null : column.getRaw(melati.getObject())) |
| 188 | |
: column.getType().rawOfString(sea), |
| 189 | |
new BaseFieldAttributes(column,column.getType().withNullable(true))); |
| 190 | 0 | } else |
| 191 | 0 | primaryCriterion = null; |
| 192 | |
|
| 193 | 0 | context.put("primaryCriterion", primaryCriterion); |
| 194 | 0 | return adminTemplate("PrimarySelect"); |
| 195 | |
} |
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
protected static String selectionTemplate(ServletTemplateContext context, |
| 202 | |
Melati melati) { |
| 203 | 0 | selection(context, melati); |
| 204 | 0 | return adminTemplate("Selection"); |
| 205 | |
} |
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | |
|
| 210 | |
|
| 211 | |
|
| 212 | |
|
| 213 | |
protected static String selectionRightTemplate( |
| 214 | |
ServletTemplateContext context, Melati melati) { |
| 215 | 0 | selection(context, melati); |
| 216 | 0 | context.put("inRight", Boolean.TRUE); |
| 217 | 0 | return adminTemplate("Selection"); |
| 218 | |
} |
| 219 | |
|
| 220 | |
|
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
|
| 227 | |
|
| 228 | |
|
| 229 | |
|
| 230 | |
|
| 231 | |
|
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
|
| 236 | |
|
| 237 | |
|
| 238 | |
|
| 239 | |
protected static ServletTemplateContext selection( |
| 240 | |
ServletTemplateContext context, Melati melati) { |
| 241 | 0 | final Table table = melati.getTable(); |
| 242 | |
|
| 243 | 0 | final Database database = table.getDatabase(); |
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | 0 | final Persistent criteria = table.newPersistent(); |
| 248 | |
|
| 249 | 0 | Vector whereClause = new Vector(); |
| 250 | |
|
| 251 | 0 | for (Enumeration c = table.columns(); c.hasMoreElements();) { |
| 252 | 0 | Column column = (Column) c.nextElement(); |
| 253 | 0 | String name = "field_" + column.getName(); |
| 254 | 0 | String fieldValue = Form.getFieldNulled(context, name); |
| 255 | 0 | if (fieldValue != null) { |
| 256 | 0 | column |
| 257 | |
.setRaw_unsafe(criteria, column.getType().rawOfString(fieldValue)); |
| 258 | |
|
| 259 | |
|
| 260 | 0 | whereClause.addElement(name + "=" + melati.urlEncode(fieldValue)); |
| 261 | |
} |
| 262 | 0 | } |
| 263 | |
|
| 264 | 0 | context.put("whereClause", EnumUtils.concatenated("&", whereClause |
| 265 | |
.elements())); |
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | 0 | PoemType searchColumnsType = getSearchColumnsType(database, table); |
| 270 | |
|
| 271 | 0 | Vector orderings = new Vector(); |
| 272 | 0 | Vector orderClause = new Vector(); |
| 273 | |
|
| 274 | |
|
| 275 | 0 | for (int o = 1; o <= table.displayColumnsCount(DisplayLevel.summary); ++o) { |
| 276 | 0 | String name = "field_order-" + o; |
| 277 | 0 | String orderColumnIDString = Form.getFieldNulled(context, name); |
| 278 | 0 | Integer orderColumnID = null; |
| 279 | |
|
| 280 | 0 | if (orderColumnIDString != null) { |
| 281 | 0 | String toggleName = "field_order-" + o + "-toggle"; |
| 282 | 0 | String orderColumnSortOrderToggle = Form.getFieldNulled(context, |
| 283 | |
toggleName); |
| 284 | 0 | Boolean toggle = new Boolean(orderColumnSortOrderToggle); |
| 285 | 0 | orderColumnID = (Integer) searchColumnsType |
| 286 | |
.rawOfString(orderColumnIDString); |
| 287 | 0 | ColumnInfo info = (ColumnInfo) searchColumnsType |
| 288 | |
.cookedOfRaw(orderColumnID); |
| 289 | 0 | String desc = Boolean.TRUE.equals(info.getSortdescending()) ? (Boolean.TRUE |
| 290 | |
.equals(toggle) ? "" : " DESC") |
| 291 | |
: (Boolean.TRUE.equals(toggle) ? " DESC" : ""); |
| 292 | 0 | orderings.addElement(database.quotedName(info.getName()) + desc); |
| 293 | 0 | orderClause.addElement(name + "=" + orderColumnIDString); |
| 294 | |
} |
| 295 | |
} |
| 296 | |
|
| 297 | 0 | String orderBySQL = null; |
| 298 | 0 | if (orderings.elements().hasMoreElements()) |
| 299 | 0 | orderBySQL = EnumUtils.concatenated(", ", orderings.elements()); |
| 300 | 0 | context.put("orderClause", EnumUtils.concatenated("&", orderClause |
| 301 | |
.elements())); |
| 302 | |
|
| 303 | 0 | int start = 0; |
| 304 | 0 | String startString = Form.getFieldNulled(context, "start"); |
| 305 | 0 | if (startString != null) { |
| 306 | |
try { |
| 307 | 0 | start = Math.max(0, Integer.parseInt(startString)); |
| 308 | 0 | } catch (NumberFormatException e) { |
| 309 | 0 | throw new MelatiBugMelatiException("How did you get that in there?", |
| 310 | |
new FormParameterException("start", "Param must be an Integer")); |
| 311 | 0 | } |
| 312 | |
} |
| 313 | |
|
| 314 | 0 | final int resultsPerPage = 20; |
| 315 | 0 | context.put("results", table.selection(table.whereClause(criteria), |
| 316 | |
orderBySQL, false, start, resultsPerPage)); |
| 317 | |
|
| 318 | 0 | return context; |
| 319 | |
} |
| 320 | |
|
| 321 | |
|
| 322 | |
|
| 323 | |
|
| 324 | |
protected static String popupSelectTemplate(ServletTemplateContext context, |
| 325 | |
Melati melati) throws PoemException { |
| 326 | 0 | popupSelect(context, melati); |
| 327 | 0 | return adminTemplate("PopupSelect"); |
| 328 | |
} |
| 329 | |
|
| 330 | |
protected static ServletTemplateContext popupSelect(ServletTemplateContext context, |
| 331 | |
Melati melati) throws PoemException { |
| 332 | 0 | final Table table = melati.getTable(); |
| 333 | |
|
| 334 | 0 | final Database database = table.getDatabase(); |
| 335 | |
|
| 336 | |
|
| 337 | |
|
| 338 | 0 | final Persistent criteria = table.newPersistent(); |
| 339 | |
|
| 340 | 0 | MappedEnumeration criterias = new MappedEnumeration(table |
| 341 | |
.getSearchCriterionColumns()) { |
| 342 | 0 | public Object mapped(Object c) { |
| 343 | 0 | return ((Column) c).asField(criteria).withNullable(true); |
| 344 | |
} |
| 345 | |
}; |
| 346 | |
|
| 347 | 0 | context.put("criteria", EnumUtils.vectorOf(criterias)); |
| 348 | 0 | PoemType searchColumnsType = getSearchColumnsType(database, table); |
| 349 | |
|
| 350 | 0 | Vector orderings = new Vector(); |
| 351 | |
|
| 352 | 0 | Enumeration searchColumns = searchColumnsType.possibleRaws(); |
| 353 | 0 | int o = 0; |
| 354 | 0 | while (searchColumns.hasMoreElements()) { |
| 355 | 0 | String name = "order-" + o++; |
| 356 | 0 | orderings.addElement(new Field(searchColumns.nextElement(), |
| 357 | |
new BaseFieldAttributes(name, searchColumnsType))); |
| 358 | 0 | } |
| 359 | |
|
| 360 | 0 | context.put("orderings", orderings); |
| 361 | |
|
| 362 | 0 | return context; |
| 363 | |
} |
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
private static PoemType getSearchColumnsType(final Database database, final Table table) { |
| 369 | 0 | PoemType searchColumnsType = new ReferencePoemType(database |
| 370 | |
.getColumnInfoTable(), false) { |
| 371 | 0 | protected Enumeration _possibleRaws() { |
| 372 | 0 | return new MappedEnumeration(table.getSearchCriterionColumns()) { |
| 373 | 0 | public Object mapped(Object column) { |
| 374 | 0 | return ((Column) column).getColumnInfo().getTroid(); |
| 375 | |
} |
| 376 | |
}; |
| 377 | |
} |
| 378 | |
}; |
| 379 | 0 | return searchColumnsType; |
| 380 | |
} |
| 381 | |
|
| 382 | |
|
| 383 | |
|
| 384 | |
|
| 385 | |
protected static String selectionWindowPrimarySelectTemplate( |
| 386 | |
ServletTemplateContext context, Melati melati) throws PoemException { |
| 387 | 0 | context.put("inPopup", Boolean.TRUE); |
| 388 | 0 | return primarySelectTemplate(context, melati); |
| 389 | |
} |
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
protected static String selectionWindowSelectionTemplate( |
| 395 | |
ServletTemplateContext context, Melati melati) { |
| 396 | 0 | selection(context, melati); |
| 397 | 0 | context.put("inPopup", Boolean.TRUE); |
| 398 | 0 | return adminTemplate("Selection"); |
| 399 | |
} |
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
|
| 407 | |
|
| 408 | |
|
| 409 | |
|
| 410 | |
|
| 411 | |
protected static String addTemplate(final ServletTemplateContext context, |
| 412 | |
Melati melati) throws PoemException { |
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
|
| 417 | |
|
| 418 | |
|
| 419 | |
|
| 420 | |
|
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | 0 | Enumeration columns = melati.getTable().getDetailDisplayColumns(); |
| 425 | 0 | Vector fields = new Vector(); |
| 426 | 0 | while (columns.hasMoreElements()) { |
| 427 | 0 | Column column = (Column) columns.nextElement(); |
| 428 | 0 | String stringValue = context.getForm("field_" + column.getName()); |
| 429 | 0 | Object value = null; |
| 430 | 0 | if (stringValue != null) |
| 431 | 0 | value = column.getType().rawOfString(stringValue); |
| 432 | 0 | else if (column.getType() instanceof ColumnTypePoemType) |
| 433 | 0 | value = PoemTypeFactory.STRING.getCode(); |
| 434 | 0 | fields.add(new Field(value, column)); |
| 435 | 0 | } |
| 436 | 0 | if (melati.getTable() instanceof TableInfoTable) { |
| 437 | 0 | Database database = melati.getDatabase(); |
| 438 | |
|
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | 0 | final int troidHeight = 1; |
| 443 | 0 | final int troidWidth = 20; |
| 444 | 0 | Field troidNameField = new Field("id", new BaseFieldAttributes( |
| 445 | |
"troidName", "Troid column", "Name of TROID column", database |
| 446 | |
.getColumnInfoTable().getNameColumn().getType(), troidWidth, |
| 447 | |
troidHeight, null, false, true, true)); |
| 448 | |
|
| 449 | 0 | fields.add(troidNameField); |
| 450 | |
} |
| 451 | 0 | context.put("fields", fields.elements()); |
| 452 | 0 | return adminTemplate("Add"); |
| 453 | |
} |
| 454 | |
|
| 455 | |
|
| 456 | |
|
| 457 | |
|
| 458 | |
|
| 459 | |
|
| 460 | |
|
| 461 | |
|
| 462 | |
protected static String addUpdateTemplate(ServletTemplateContext context, |
| 463 | |
Melati melati) throws PoemException { |
| 464 | |
|
| 465 | 0 | Persistent newPersistent = create(melati.getTable(), context); |
| 466 | |
|
| 467 | 0 | if (melati.getTable() instanceof TableInfoTable) |
| 468 | 0 | melati.getDatabase().addTableAndCommit((TableInfo) newPersistent, |
| 469 | |
context.getForm("field_troidName")); |
| 470 | 0 | if (melati.getTable() instanceof ColumnInfoTable) |
| 471 | 0 | ((ColumnInfo) newPersistent).getTableinfo().actualTable() |
| 472 | |
.addColumnAndCommit((ColumnInfo) newPersistent); |
| 473 | |
|
| 474 | 0 | context.put("object", newPersistent); |
| 475 | 0 | return adminTemplate("Updated"); |
| 476 | |
} |
| 477 | |
|
| 478 | |
|
| 479 | |
|
| 480 | |
|
| 481 | |
|
| 482 | |
|
| 483 | |
|
| 484 | |
|
| 485 | |
protected static String updateTemplate(ServletTemplateContext context, |
| 486 | |
Melati melati) throws PoemException { |
| 487 | 0 | Persistent object = melati.getObject(); |
| 488 | 0 | object.preEdit(); |
| 489 | 0 | Form.extractFields(context, object); |
| 490 | 0 | object.postEdit(false); |
| 491 | 0 | return adminTemplate("Updated"); |
| 492 | |
} |
| 493 | |
|
| 494 | |
protected static String deleteTemplate(ServletTemplateContext context, |
| 495 | |
Melati melati) throws PoemException { |
| 496 | |
try { |
| 497 | 0 | if (melati.getTable().getName().equals("tableinfo")) { |
| 498 | 0 | TableInfo tableInfo = (TableInfo) melati.getObject(); |
| 499 | 0 | melati.getDatabase().deleteTableAndCommit(tableInfo); |
| 500 | 0 | } else if (melati.getTable().getName().equals("columninfo")) { |
| 501 | 0 | ColumnInfo columnInfo = (ColumnInfo) melati.getObject(); |
| 502 | 0 | columnInfo.getTableinfo().actualTable().deleteColumnAndCommit( |
| 503 | |
columnInfo); |
| 504 | 0 | } else |
| 505 | 0 | melati.getObject().delete(); |
| 506 | |
|
| 507 | 0 | return adminTemplate("Updated"); |
| 508 | 0 | } catch (DeletionIntegrityPoemException e) { |
| 509 | 0 | context.put("object", e.object); |
| 510 | 0 | context.put("references", e.references); |
| 511 | 0 | context.put("returnURL", melati.getSameURL() + "?action=Delete"); |
| 512 | 0 | return adminTemplate("DeleteFailure"); |
| 513 | |
} |
| 514 | |
} |
| 515 | |
|
| 516 | |
protected static String duplicateTemplate(ServletTemplateContext context, |
| 517 | |
Melati melati) throws PoemException { |
| 518 | 0 | Persistent dup = melati.getObject().duplicated(); |
| 519 | 0 | Form.extractFields(context, dup); |
| 520 | |
try { |
| 521 | 0 | dup.getTable().create(dup); |
| 522 | 0 | } catch (ExecutingSQLPoemException e) { |
| 523 | 0 | throw new NonUniqueKeyValueAnticipatedException(e); |
| 524 | 0 | } |
| 525 | 0 | context.put("object", dup); |
| 526 | 0 | return adminTemplate("Updated"); |
| 527 | |
} |
| 528 | |
|
| 529 | |
|
| 530 | |
|
| 531 | |
|
| 532 | |
|
| 533 | |
|
| 534 | |
|
| 535 | |
|
| 536 | |
|
| 537 | |
|
| 538 | |
protected static String modifyTemplate(ServletTemplateContext context, |
| 539 | |
Melati melati) throws FormParameterException { |
| 540 | 0 | String action = melati.getRequest().getParameter("action"); |
| 541 | 0 | if ("Update".equals(action)) |
| 542 | 0 | return updateTemplate(context, melati); |
| 543 | 0 | if ("Delete".equals(action)) |
| 544 | 0 | return deleteTemplate(context, melati); |
| 545 | 0 | if ("Duplicate".equals(action)) |
| 546 | 0 | return duplicateTemplate(context, melati); |
| 547 | |
else |
| 548 | 0 | throw new MelatiBugMelatiException("How did you get that in there?", |
| 549 | |
new FormParameterException( |
| 550 | |
"action", "Bad action from Edit: " + action)); |
| 551 | |
} |
| 552 | |
|
| 553 | |
protected static String uploadTemplate(ServletTemplateContext context) |
| 554 | |
throws PoemException { |
| 555 | 0 | context.put("field", context.getForm("field")); |
| 556 | 0 | return adminTemplate("Upload"); |
| 557 | |
} |
| 558 | |
|
| 559 | |
|
| 560 | |
|
| 561 | |
|
| 562 | |
|
| 563 | |
|
| 564 | |
|
| 565 | |
|
| 566 | |
|
| 567 | |
|
| 568 | |
|
| 569 | |
|
| 570 | |
|
| 571 | |
|
| 572 | |
protected static String uploadDoneTemplate(ServletTemplateContext context) |
| 573 | |
throws PoemException { |
| 574 | 0 | String field = context.getForm("field"); |
| 575 | 0 | context.put("field", field); |
| 576 | 0 | String url = ""; |
| 577 | 0 | url = context.getMultipartForm("file").getDataURL(); |
| 578 | 0 | if (url == null) |
| 579 | 0 | throw new NullUrlDataAdaptorException(context.getMultipartForm("file").getFormDataAdaptor()); |
| 580 | 0 | context.put("url", url); |
| 581 | 0 | return adminTemplate("UploadDone"); |
| 582 | |
} |
| 583 | |
|
| 584 | 0 | static class NullUrlDataAdaptorException extends MelatiRuntimeException { |
| 585 | |
private static final long serialVersionUID = 1L; |
| 586 | |
private FormDataAdaptor fda; |
| 587 | |
NullUrlDataAdaptorException(FormDataAdaptor fda) { |
| 588 | |
this.fda = fda; |
| 589 | |
} |
| 590 | |
|
| 591 | |
|
| 592 | |
public String getMessage() { |
| 593 | |
return "The configured FormDataAdaptor (" + fda.getClass().getName() + ") returns a null URL."; |
| 594 | |
} |
| 595 | |
} |
| 596 |