From 6d9685a710718cef286293bf98e500a5b68c5f14 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 11 Jun 2010 09:03:42 +0000 Subject: Use Glib::ustring in libodbcpp for data and std::string for non-data Add support for parameters in SqlViews Uses parameters to implement category browse and search --- gentoobrowse/base.xslt | 15 +++++++++++---- gentoobrowse/present/category.xml | 4 ++++ gentoobrowse/present/search.xml | 4 ++++ gentoobrowse/search.xslt | 6 +++--- gentoobrowse/views/category.xml | 16 ++++++++++++++++ gentoobrowse/views/search.xml | 19 +++++++++++++++++++ 6 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 gentoobrowse/present/category.xml create mode 100644 gentoobrowse/present/search.xml create mode 100644 gentoobrowse/views/category.xml create mode 100644 gentoobrowse/views/search.xml diff --git a/gentoobrowse/base.xslt b/gentoobrowse/base.xslt index b723c59..803d56a 100644 --- a/gentoobrowse/base.xslt +++ b/gentoobrowse/base.xslt @@ -35,10 +35,17 @@
Powered by - Gentoo, - Apache, - PostgreSQL and - XSLT - Driven by dbweb + Gentoo + | + PostgreSQL + | + Apache + | + FastCGI + | + XSLT + | + Project2
diff --git a/gentoobrowse/present/category.xml b/gentoobrowse/present/category.xml new file mode 100644 index 0000000..d6c4748 --- /dev/null +++ b/gentoobrowse/present/category.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/present/search.xml b/gentoobrowse/present/search.xml new file mode 100644 index 0000000..26c7c1d --- /dev/null +++ b/gentoobrowse/present/search.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/search.xslt b/gentoobrowse/search.xslt index c17a5a8..74a791d 100644 --- a/gentoobrowse/search.xslt +++ b/gentoobrowse/search.xslt @@ -1,6 +1,6 @@ + xmlns:project2="http://project2.randomdan.homeip.net/"> - + @@ -18,7 +18,7 @@ - +

Search Results

    diff --git a/gentoobrowse/views/category.xml b/gentoobrowse/views/category.xml new file mode 100644 index 0000000..5e4644e --- /dev/null +++ b/gentoobrowse/views/category.xml @@ -0,0 +1,16 @@ + + + + + + SELECT c.name AS catname, p.name AS pkgname, p.description + FROM categories c, packages p + WHERE c.categoryid = p.categoryid + AND c.name = ? + ORDER BY p.name + + + + + + diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml new file mode 100644 index 0000000..538e852 --- /dev/null +++ b/gentoobrowse/views/search.xml @@ -0,0 +1,19 @@ + + + + + + select c.name as catname, p.name as pkgname, description, + ts_rank((setweight(to_tsvector('english', p.name), 'A') || setweight(to_tsvector('english', p.description), 'B')), + plainto_tsquery('english', ?)) as rank + from packages p, categories c + where (setweight(to_tsvector('english', p.name), 'A') || setweight(to_tsvector('english', p.description), 'B')) @@ plainto_tsquery('english', ?) + and p.categoryid = c.categoryid + order by rank desc, p.name + + + + + + + -- cgit v1.2.3