| 1 | |
package org.paneris.bibliomania; |
| 2 | |
|
| 3 | |
import java.io.File; |
| 4 | |
|
| 5 | |
import org.melati.poem.Database; |
| 6 | |
import org.melati.poem.DefinitionSource; |
| 7 | |
import org.melati.poem.PoemException; |
| 8 | |
import org.paneris.bibliomania.fti.Library; |
| 9 | |
import org.paneris.bibliomania.fti.Text; |
| 10 | |
import org.paneris.bibliomania.generated.ChapterTableBase; |
| 11 | |
|
| 12 | |
public class ChapterTable<T extends Chapter> extends ChapterTableBase<Chapter> implements Library { |
| 13 | |
|
| 14 | |
public ChapterTable( |
| 15 | |
Database database, String name, DefinitionSource definitionSource) |
| 16 | |
throws PoemException { |
| 17 | 2 | super(database, name, definitionSource); |
| 18 | 2 | } |
| 19 | |
|
| 20 | |
public Text text(long textID) { |
| 21 | 0 | Text it = (Chapter)getTextidColumn().firstWhereEq(new Long(textID)); |
| 22 | 0 | return it; |
| 23 | |
} |
| 24 | |
|
| 25 | |
public Unit unitWithPath(String path) { |
| 26 | 0 | if (path == null || !path.endsWith(".html")) |
| 27 | 0 | return null; |
| 28 | 0 | File f = new File(path); |
| 29 | |
|
| 30 | 0 | return (Unit)firstSelection("path = '" + f.getParent() + "/' AND " + |
| 31 | |
"filename = '" + f.getName() + "'"); |
| 32 | |
} |
| 33 | |
} |