From 2726606fc8066d91053368d0bd556b959cccf0bb Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Fri, 12 Nov 2010 21:13:27 +0000 Subject: [PATCH] slightly enhanced interface for /Table_YMark_p.html git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7318 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Table_YMark_p.html | 343 +++++++++++++++++++------------------- htroot/Table_YMark_p.java | 29 +++- 2 files changed, 195 insertions(+), 177 deletions(-) diff --git a/htroot/Table_YMark_p.html b/htroot/Table_YMark_p.html index 1f2b89503..1b59256ec 100644 --- a/htroot/Table_YMark_p.html +++ b/htroot/Table_YMark_p.html @@ -6,6 +6,9 @@ #(/showtable)# #%env/templates/metas.template%# + + + - #%env/templates/header.template%# #%env/templates/submenuConfig.template%# - #(showselection)#:: -

YMark Table Administration

-
- #(/showselection)# -
- #(showtable)#:: - -
- -
-

- - - - - - - -

-
-
- - - - - #{columns}# - - #{/columns}# - - #{list}# - - - - #{columns}# - - #{/columns}# - - #{/list}# -
PK#[header]#
#[pk]##[cell]#
-
-
- - #(/showtable)# - #(showedit)#:: -
-
-
Row Editor -
-
Primary Key
-
#[pk]#
- #{list}# -
#[key]#
-
- -
- #{/list}# -
-
- - - -
-
-
-
-
- #(/showedit)# -
- #(showselection)#:: -
-
Table Selection -
-
- -
-
- -
-
- -
-
- - entries -
-
- -
-
- -
-
-
-
- Search Table -
-
- -
-
- - -
-
-
-
- Filter Table -
- -
-
- -
-
- -
-
- -
- -
-
- Import Bookmarks -
-
- -
-
- -
-
- -
-
- +

YMark Table Administration

+
+ #(showtable)#:: +
+
+ +

+ + + + + + + +

+
+ + + + + #{columns}# + + #{/columns}# + + #{list}# + + + + #{columns}# + + #{/columns}# + + #{/list}# +
PK#[header]#
#[pk]##[cell]#
+
+
+
+ #(/showtable)# + #(showedit)#:: +
+
+
Row Editor +
+
Primary Key
+
#[pk]#
+ #{list}# +
#[key]#
+
+ +
+ #{/list}# +
+
+ + + +
+
+
+
+
+ #(/showedit)# +
+ #(showselection)#:: +
+
+
Table Selection +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ #{columns}# + #[col]#
+ #{/columns}# +
+
+ +
+
+ Search/Filter Table +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ Import Bookmarks +
+
+ +
+
+ +
+
+ +
+
+ +
+
-
-
- -
- -
- #(/showselection)# + + + + #(/showselection)# #%env/templates/footer.template%# diff --git a/htroot/Table_YMark_p.java b/htroot/Table_YMark_p.java index b5030a407..3fe06ce0f 100644 --- a/htroot/Table_YMark_p.java +++ b/htroot/Table_YMark_p.java @@ -25,7 +25,7 @@ public class Table_YMark_p { prop.put("showedit", 0); prop.put("showselection", 0); - String table = (post == null) ? null : post.get("table", null); + String table = (post == null) ? "admin_bookmarks" : post.get("table", "admin_bookmarks"); if (table != null && !sb.tables.hasHeap(table)) table = null; // get the user name for the selected table @@ -85,18 +85,33 @@ public class Table_YMark_p { prop.put("pattern", pattern); List columns = null; - if (table != null) try { + columns = new ArrayList(); + for (Map.Entry entry: post.entrySet()) { + if (entry.getKey().startsWith("col_")) { + columns.add(entry.getKey().substring(4)); + } + } + if (columns.isEmpty() && table != null) try { columns = sb.tables.columns(table); } catch (IOException e) { Log.logException(e); - columns = new ArrayList(); } - final Iterator cit = columns.iterator(); count = 0; - while(cit.hasNext()) { - prop.put("showselection_columns_" + count + "_col", cit.next()); - count++; + if (table != null) { + Iterator cit; + String col; + try { + cit = sb.tables.columns(table).iterator(); + while(cit.hasNext()) { + col = cit.next(); + prop.put("showselection_columns_" + count + "_col", col); + prop.put("showselection_columns_" + count + "_checked", columns.contains(col) ? 1 : 0); + count++; + } + } catch (IOException e) { + Log.logException(e); + } } prop.put("showselection_columns", count);