password: String? = null,
cert: String? = null,
updateInterval: Long = 0,
+ maxItemAge: Int = 0,
itemStateMode: Int = 0) : FeedCollection
{
var feedcollectionId = -1
var feedCol: FeedCollection
dataSource.connection.use { connection ->
connection.prepareStatement("""
- insert into feedcollections (group_id, pos, name, update_interval, item_state_mode) select ?, coalesce(max(pos), 0)+1, ?, ?, ? from groups
+ insert into feedcollections (group_id, pos, name, update_interval, max_item_age, item_state_mode) select ?, coalesce(max(pos), 0)+1, ?, ?, ?, ? from groups
""".trimIndent(), Statement.RETURN_GENERATED_KEYS).use { stmt ->
stmt.setInt(1, parent.id)
stmt.setString(2, name)
stmt.setLong(3, updateInterval)
- stmt.setInt(4, itemStateMode)
+ stmt.setInt(4, maxItemAge)
+ stmt.setInt(5, itemStateMode)
stmt.execute()
stmt.generatedKeys.use { rs ->
if(rs.next()) {
import de.unixwork.ui.SubListItem
import de.unixwork.ui.TabViewType
import de.unixwork.ui.TableModel
+import de.unixwork.ui.UiInteger
import de.unixwork.ui.UiList
import de.unixwork.ui.UiString
import de.unixwork.ui.UiText
var password: UiString? = null
var cert: UiString? = null
var readstatus: UiList<String>? = null
+ var maxItemAge: UiInteger? = null
val w = dialogWindow(
parent = window.ui,
val urlStr = urls.toString()
val uris = urlStr.split("\n").map { it.trim() }.filter { it.isNotBlank() }
var itemStateMode = readstatus?.selectedIndex ?: 0
+ val maxItemAge = maxItemAge?.intValue() ?: -1
if(itemStateMode < 0 || itemStateMode > 2) {
itemStateMode = 0
}
password.toString(),
cert.toString(),
0, // TODO
+ maxItemAge,
itemStateMode
)
user = ui.string()
password = ui.string()
cert = ui.string()
+ maxItemAge = ui.integer()
+ maxItemAge?.setIntValue(-1)
groups.addAll(sourceList.groups)
println("prev group: $newFeedPrevGroup")
elm
}
}
+ row {
+ rlabel("Max Item Age (Days)")
+ spinbox(intValue = maxItemAge, min = -1.0, max = 100000.0, step = 1.0, colspan = 2)
+ }
row {
rlabel("User")