summaryrefslogtreecommitdiff
path: root/gentoobrowse/views/package.xml
diff options
context:
space:
mode:
Diffstat (limited to 'gentoobrowse/views/package.xml')
-rw-r--r--gentoobrowse/views/package.xml312
1 files changed, 149 insertions, 163 deletions
diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml
index 2e18435..e4797e9 100644
--- a/gentoobrowse/views/package.xml
+++ b/gentoobrowse/views/package.xml
@@ -2,171 +2,157 @@
<block xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:project2="http://project2.randomdan.homeip.net">
<xi:include href="../datasources/postgres-web.xml" />
- <project2:sqlview name="summary" recordname="package" datasource="postgres-web">
+ <project2:sqlrows name="packages" datasource="postgres-web">
<sql>
SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname
FROM packages p, categories c
- WHERE c.name = ?
- AND p.name = ?
- AND p.categoryid = c.categoryid
+ WHERE p.categoryid = c.categoryid
+ <filter name="catAndName">
+ AND c.name = <param name="cat" />
+ AND p.name = <param name="pkg" />
+ </filter>
</sql>
- <parameters>
- <param bind="0" value="/1" />
- <param bind="1" value="/2" />
- </parameters>
- <project2:sqlview name="tracks" recordname="track" datasource="postgres-web">
- <sql>
- SELECT trackedsince
- FROM user_packages up
- WHERE up.packageid = ?
- AND up.userid = ?
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- <param bind="1" value="%loggedInUserID|0" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="versions" recordname="version" datasource="postgres-web">
- <sql>
- SELECT e.ebuildid, e.version, e.moddate, e.slot, e.license
- FROM ebuilds e
- WHERE e.packageid = ?
- ORDER BY versioninst desc
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="packageUrls" recordname="url" datasource="postgres-web">
- <sql>
- SELECT pu.url
- FROM package_urls pu
- WHERE pu.packageid = ?
- ORDER BY pu.url
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="versionUses" recordname="use" datasource="postgres-web">
- <sql>
- SELECT u.*
- FROM ebuilds e, ebuild_uses u
- WHERE e.packageid = ?
- AND e.ebuildid = u.ebuildid
- ORDER BY version
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="versionArchs" recordname="arch" datasource="postgres-web">
- <sql>
- SELECT a.*
- FROM ebuilds e, ebuild_archs a
- WHERE e.packageid = ?
- AND e.ebuildid = a.ebuildid
- ORDER BY version
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="packageBugs" recordname="bug" datasource="postgres-web">
- <sql>
- SELECT b.bugid, b.summary
- FROM bugs b, package_bugs pb
- WHERE b.bugid = pb.bugid
- AND pb.packageid = ?
- ORDER BY b.bugid
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="deps" recordname="package" datasource="postgres-web">
- <sql>
- SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
- FROM ebuilds e, ebuild_deps d, packages pd, categories cd
- WHERE e.packageid = ?
- AND d.ebuildid = e.ebuildid
- AND pd.packageid = d.packageid
- AND pd.categoryid = cd.categoryid
- ORDER BY cd.name, pd.name
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="rdeps" recordname="package" datasource="postgres-web">
- <sql>
- SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
- FROM ebuilds e, ebuild_rdeps d, packages pd, categories cd
- WHERE e.packageid = ?
- AND d.ebuildid = e.ebuildid
- AND pd.packageid = d.packageid
- AND pd.categoryid = cd.categoryid
- ORDER BY cd.name, pd.name
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="depees" recordname="package" datasource="postgres-web">
- <sql>
- SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
- FROM ebuilds e, (
- SELECT ebuildid
- FROM ebuild_rdeps d
- WHERE d.packageid = ?
- UNION
- SELECT ebuildid
- FROM ebuild_deps d
- WHERE d.packageid = ?) d, packages pd, categories cd
- WHERE d.ebuildid = e.ebuildid
- AND pd.packageid = e.packageid
- AND pd.categoryid = cd.categoryid
- ORDER BY cd.name, pd.name
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- <param bind="1" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="maskstatus" recordname="mask" datasource="postgres-web">
- <sql>
- SELECT em.ebuildid, DENSE_RANK() OVER(ORDER BY em.setno) AS setno
- FROM ebuild_masks em, ebuilds e
- WHERE em.ebuildid = e.ebuildid
- AND e.packageid = ?
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="maskdetails" recordname="mask" datasource="postgres-web">
- <sql>
- SELECT DISTINCT DENSE_RANK() OVER(ORDER BY em.setno), ms.person, ms.message, ms.dateadded
- FROM ebuild_masks em, ebuilds e, masksets ms
- WHERE em.ebuildid = e.ebuildid
- AND ms.setno = em.setno
- AND e.packageid = ?
- ORDER BY DENSE_RANK() OVER(ORDER BY em.setno)
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- <project2:sqlview name="changelog" recordname="entry" datasource="postgres-web">
- <sql>
- SELECT date, person, email, comment
- FROM package_changelogs
- WHERE packageid = ?
- ORDER BY date DESC, n
- </sql>
- <parameters>
- <param bind="0" value="^packageid" />
- </parameters>
- </project2:sqlview>
- </project2:sqlview>
+ </project2:sqlrows>
+ <project2:sqlrows name="tracks" datasource="postgres-web">
+ <sql>
+ SELECT up.packageid, up.trackedsince, up.userid
+ FROM user_packages up
+ <filter name="isPkgTrackedByUser">
+ WHERE up.packageid = <param name="pkgid" />
+ AND up.userid = <param name="userid" />
+ </filter>
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="versions" datasource="postgres-web">
+ <sql>
+ SELECT e.ebuildid, e.version, e.moddate, e.slot, e.license
+ FROM ebuilds e
+ <filter name="pkg">
+ WHERE e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY versioninst desc
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="packageUrls" datasource="postgres-web">
+ <sql>
+ SELECT pu.url
+ FROM package_urls pu
+ <filter name="pkg">
+ WHERE pu.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY pu.url
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="versionUses" datasource="postgres-web">
+ <sql>
+ SELECT u.*
+ FROM ebuilds e, ebuild_uses u
+ WHERE e.ebuildid = u.ebuildid
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY version
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="versionArchs" datasource="postgres-web">
+ <sql>
+ SELECT a.*
+ FROM ebuilds e, ebuild_archs a
+ WHERE e.ebuildid = a.ebuildid
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY version
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="packageBugs" datasource="postgres-web">
+ <sql>
+ SELECT b.bugid, b.summary
+ FROM bugs b, package_bugs pb
+ WHERE b.bugid = pb.bugid
+ <filter name="pkg">
+ AND pb.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY b.bugid
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="packageDeps" datasource="postgres-web">
+ <sql>
+ SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
+ FROM ebuilds e, ebuild_deps d, packages pd, categories cd
+ WHERE d.ebuildid = e.ebuildid
+ AND pd.packageid = d.packageid
+ AND pd.categoryid = cd.categoryid
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY cd.name, pd.name
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="packageRdeps" datasource="postgres-web">
+ <sql>
+ SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
+ FROM ebuilds e, ebuild_rdeps d, packages pd, categories cd
+ WHERE d.ebuildid = e.ebuildid
+ AND pd.packageid = d.packageid
+ AND pd.categoryid = cd.categoryid
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY cd.name, pd.name
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="packageDepees" datasource="postgres-web">
+ <sql>
+ SELECT DISTINCT cd.name AS catname, pd.name AS pkgname, pd.description
+ FROM ebuilds e, (
+ SELECT ebuildid
+ FROM ebuild_rdeps d
+ <filter name="pkg">
+ WHERE d.packageid = <param name="pkgid" />
+ </filter>
+ UNION
+ SELECT ebuildid
+ FROM ebuild_deps d
+ <filter name="pkg">
+ WHERE d.packageid = <param name="pkgid" />
+ </filter>) d, packages pd, categories cd
+ WHERE d.ebuildid = e.ebuildid
+ AND pd.packageid = e.packageid
+ AND pd.categoryid = cd.categoryid
+ ORDER BY cd.name, pd.name
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="maskStatus" datasource="postgres-web">
+ <sql>
+ SELECT em.ebuildid, DENSE_RANK() OVER(ORDER BY em.setno) AS setno
+ FROM ebuild_masks em, ebuilds e
+ WHERE em.ebuildid = e.ebuildid
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="maskDetails" datasource="postgres-web">
+ <sql>
+ SELECT DISTINCT DENSE_RANK() OVER(ORDER BY em.setno), ms.person, ms.message, ms.dateadded
+ FROM ebuild_masks em, ebuilds e, masksets ms
+ WHERE em.ebuildid = e.ebuildid
+ AND ms.setno = em.setno
+ <filter name="pkg">
+ AND e.packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY DENSE_RANK() OVER(ORDER BY em.setno)
+ </sql>
+ </project2:sqlrows>
+ <project2:sqlrows name="changeLog" datasource="postgres-web">
+ <sql>
+ SELECT date, person, email, comment
+ FROM package_changelogs
+ <filter name="pkg">
+ WHERE packageid = <param name="pkgid" />
+ </filter>
+ ORDER BY date DESC, n
+ </sql>
+ </project2:sqlrows>
</block>