01: package com.teamkonzept.webman.refsel;
02:
03: import java.sql.*;
04:
05: import com.teamkonzept.db.*;
06: import com.teamkonzept.lib.*;
07: import com.teamkonzept.webman.*;
08: import de.webman.generator.*;
09: import com.teamkonzept.webman.refsel.db.queries.*;
10:
11: public class TKWMFirstRS implements TKWMReferenceSelector {
12:
13: public boolean checkSelection() {
14: return false;
15: }
16:
17: public String getSelectionData(TKHashtable params) {
18: return "";
19: }
20:
21: public TKVector getSelectionNodes(String selectionData,
22: int siteNodeId) throws SQLException {
23: TKVector nodes = new TKVector(1);
24: nodes.addElement(new Integer(siteNodeId));
25: return nodes;
26: }
27:
28: public TKDBResult getSelectionValues(String selectionData,
29: int siteNodeId) throws SQLException {
30: TKDBResult values = null;
31:
32: TKQuery query = TKDBManager.newQuery(TKWMDBRSSisters.class);
33: query.setQueryParams("SITE_NODE_ID", new Integer(siteNodeId));
34: query.execute();
35: ResultSet rs = query.fetchResultSet();
36:
37: if (rs != null) {
38: values = new TKDBResult(rs);
39: }
40: return values;
41: }
42:
43: public void reduceReferences(String selectionData,
44: TKVector allRefUrls, TKVector allRefDocs,
45: TKVector allRefNodes, GenNode currAnchor) {
46: for (int i = allRefUrls.size() - 1; i > 0; i--) {
47: // TKLog.log().println("remove index "+i+": "+allRefUrls.get(i) );
48: allRefUrls.removeElementAt(i);
49: if (allRefDocs != null)
50: allRefDocs.removeElementAt(i);
51: allRefNodes.removeElementAt(i);
52: }
53: }
54:
55: }
|