summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse/checks/loggedIn.xml3
-rw-r--r--gentoobrowse/console/emailebuilds.xml5
-rw-r--r--gentoobrowse/console/fileimport.xml45
-rw-r--r--gentoobrowse/datasources/postgres.xml2
-rw-r--r--gentoobrowse/emails/newpackageversions.xml2
-rw-r--r--gentoobrowse/emails/welcome.xml2
-rw-r--r--gentoobrowse/present/accountTracked.xml2
-rw-r--r--gentoobrowse/present/atom.xml2
-rw-r--r--gentoobrowse/present/category.xml2
-rw-r--r--gentoobrowse/present/index.xml2
-rw-r--r--gentoobrowse/present/package.xml30
-rw-r--r--gentoobrowse/present/search.xml2
-rw-r--r--gentoobrowse/request/doconfirm.xml10
-rw-r--r--gentoobrowse/request/dologin.xml18
-rw-r--r--gentoobrowse/request/dosignup.xml24
-rw-r--r--gentoobrowse/request/track.xml8
-rw-r--r--gentoobrowse/request/untrack.xml4
17 files changed, 92 insertions, 71 deletions
diff --git a/gentoobrowse/checks/loggedIn.xml b/gentoobrowse/checks/loggedIn.xml
index 0b120c2..0785380 100644
--- a/gentoobrowse/checks/loggedIn.xml
+++ b/gentoobrowse/checks/loggedIn.xml
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
-<project2:regexcheck xmlns:project2="http://project2.randomdan.homeip.net" apply-to="%loggedInUserID|" present="login" name="loggedIn">
+<project2:regexcheck xmlns:project2="http://project2.randomdan.homeip.net" present="login" name="loggedIn">
+ <apply-to source="session" name="loggedInUserID"><default value="" /></apply-to>
<regex>[1-9][0-9]*</regex>
<message>Not logged in</message>
</project2:regexcheck>
diff --git a/gentoobrowse/console/emailebuilds.xml b/gentoobrowse/console/emailebuilds.xml
index 051b78c..a227a9d 100644
--- a/gentoobrowse/console/emailebuilds.xml
+++ b/gentoobrowse/console/emailebuilds.xml
@@ -16,8 +16,9 @@
</sql>
</project2:sqlrows>
<project2:iterate name="users" source="usersToEmail">
- <project2:sendmail to="^useremail" server="smtp.random.lan:25" subject="Gentoo Browse - New package versions"
+ <project2:sendmail server="smtp.random.lan:25" subject="Gentoo Browse - New package versions"
present="newpackageversions" from="noreply@gentoobrowse.randomdan.homeip.net" />
+ <to source="parent" name="useremail" depth="1" />
<project2:sqltask datasource="postgres">
<sql>
insert into user_ebuild_emails(ebuildid, userid, sentat)
@@ -33,7 +34,7 @@
where ebe.userid is null
</sql>
<parameters>
- <param name="0" value="^userid" />
+ <param name="0"><value source="parent" name="userid" depth="1" /></param>
</parameters>
</project2:sqltask>
</project2:iterate>
diff --git a/gentoobrowse/console/fileimport.xml b/gentoobrowse/console/fileimport.xml
index b65573f..37b7814 100644
--- a/gentoobrowse/console/fileimport.xml
+++ b/gentoobrowse/console/fileimport.xml
@@ -4,23 +4,28 @@
<xi:include href="../datasources/postgres.xml" />
<project2:sqlrows name="fileTypes" datasource="postgres">
<sql>
- SELECT filetypeid, searchroot, LENGTH(searchroot) + 1 || '-' AS rootlen, searchspec
+ SELECT filetypeid, searchroot, searchspec
FROM filetypes
ORDER BY filetypeid DESC
</sql>
</project2:sqlrows>
- <project2:procrows name="findCacheFiles" newline="&#10;" encoding="ascii" fieldSep="|" quoteChar=""
- path="*find ^searchroot ^searchspec -printf &quot;%p|%t\n&quot; | cut -b ^rootlen | sed &apos;s#^# ^filetypeid |#&apos;" >
- <columns>
- <column>filetypeid</column>
- <column>filename</column>
- <column>moddate</column>
- </columns>
- </project2:procrows>
+ <project2:fsrows name="findCacheFiles" />
<project2:sqlmerge name="files" datasource="postgres" targettable="files">
<project2:iterate name="eachFileType" source="fileTypes">
- <project2:iterate name="eachCacheFile" source="findCacheFiles" />
+ <project2:iterate name="eachCacheFile" source="findCacheFiles">
+ <parameters>
+ <param name="root"><value source="parent" name="searchroot" depth="1" /></param>
+ <param name="spec"><value source="parent" name="searchspec" depth="1" /></param>
+ </parameters>
+ <project2:sqlmergeinsert name="insertFile">
+ <parameters>
+ <param name="filename"><value source="parent" attribute="relPath" depth="1" /></param>
+ <param name="moddate"><value source="parent" attribute="modifiedDate" depth="1"/></param>
+ <param name="filetypeid"><value source="parent" name="filetypeid" depth="2" /></param>
+ </parameters>
+ </project2:sqlmergeinsert>
+ </project2:iterate>
</project2:iterate>
<columns>
<column key="true">filename</column>
@@ -38,19 +43,25 @@
ORDER BY f.fileid
</sql>
</project2:sqlrows>
- <project2:procrows name="readFileContent" newline="&#10;" encoding="utf-8" fieldSep="|" quoteChar=""
- path="*grep -n . ^filename | sed -e &apos;s#:#|#&apos; -e &apos;s#^# ^fileid |#&apos;" >
+ <project2:filerows name="readFileContent" newline="&#10;" encoding="utf-8" fieldSep="" quoteChar="" keepBlankRows="count" >
+ <path source="parent" name="filename" depth="1" />
<columns>
- <column>fileid</column>
- <column>line</column>
<column>content</column>
</columns>
- </project2:procrows>
+ </project2:filerows>
<project2:sqlmerge name="loadCacheContent" datasource="postgres" targettable="filecache"
- updatewhere="*a.fileid IN (SELECT o.fileid FROM files o WHERE o.cachedat IS NULL OR o.cachedat != o.moddate)">
+ updatewhere="a.fileid IN (SELECT o.fileid FROM files o WHERE o.cachedat IS NULL OR o.cachedat != o.moddate)">
<project2:iterate name="eachOutDatedFile" source="outDatedFiles">
- <project2:iterate name="eachFileContent" source="readFileContent" />
+ <project2:iterate name="eachFileContent" source="readFileContent">
+ <project2:sqlmergeinsert name="insertFile">
+ <parameters>
+ <param name="fileid"><value source="parent" name="fileid" depth="2" /></param>
+ <param name="line"><value source="parent" attribute="rownum" depth="1" /></param>
+ <param name="content"><value source="parent" name="content" depth="1" /></param>
+ </parameters>
+ </project2:sqlmergeinsert>
+ </project2:iterate>
</project2:iterate>
<columns>
<column key="true">fileid</column>
diff --git a/gentoobrowse/datasources/postgres.xml b/gentoobrowse/datasources/postgres.xml
index 448892a..d6fbd35 100644
--- a/gentoobrowse/datasources/postgres.xml
+++ b/gentoobrowse/datasources/postgres.xml
@@ -3,8 +3,6 @@
<readonly preferlocal="true">
<dsn host="firebrand">Driver=postgresql;ServerName=firebrand.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;ConnSettings=SET search_path=gentoobrowse,public;</dsn>
<dsn host="defiant">Driver=postgresql;ServerName=defiant.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;ConnSettings=SET search_path=gentoobrowse,public;</dsn>
- <dsn host="akira">Driver=postgresql;ServerName=akira.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;ConnSettings=SET search_path=gentoobrowse,public;</dsn>
- <dsn host="riogrande">Driver=postgresql;ServerName=riogrande.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;ConnSettings=SET search_path=gentoobrowse,public;</dsn>
</readonly>
<masterdsn>Driver=postgresql;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;ConnSettings=SET search_path=gentoobrowse,public;</masterdsn>
</project2:rdbmsdatasource>
diff --git a/gentoobrowse/emails/newpackageversions.xml b/gentoobrowse/emails/newpackageversions.xml
index 45bba93..1132407 100644
--- a/gentoobrowse/emails/newpackageversions.xml
+++ b/gentoobrowse/emails/newpackageversions.xml
@@ -21,7 +21,7 @@
</project2:sqlrows>
<project2:view name="newpackageversionsforuser" source="newpackageversions" rootname="newpackageversions" recordname="version">
<parameters>
- <param name="userid" value="^^userid" />
+ <param name="userid"><value source="parent" name="userid" depth="2" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/emails/welcome.xml b/gentoobrowse/emails/welcome.xml
index ad48f66..f3242ca 100644
--- a/gentoobrowse/emails/welcome.xml
+++ b/gentoobrowse/emails/welcome.xml
@@ -12,7 +12,7 @@
</project2:sqlrows>
<project2:view name="verifyguids" source="verifyguidsbyemail" rootname="verifyguids" recordname="verifyguid">
<parameters>
- <param name="email" value="$email" />
+ <param name="email"><value source="param" name="email" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/present/accountTracked.xml b/gentoobrowse/present/accountTracked.xml
index 5dded3f..746631b 100644
--- a/gentoobrowse/present/accountTracked.xml
+++ b/gentoobrowse/present/accountTracked.xml
@@ -6,7 +6,7 @@
<xi:include href="../views/tracked.xml" />
<project2:view name="trackedPackages" source="trackedPackages" rootname="trackedebuilds" recordname="ebuild" filter="userid">
<parameters>
- <param name="userid" value="%loggedInUserID" />
+ <param name="userid"><value source="session" name="loggedInUserID" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/present/atom.xml b/gentoobrowse/present/atom.xml
index ecbb0b5..040497f 100644
--- a/gentoobrowse/present/atom.xml
+++ b/gentoobrowse/present/atom.xml
@@ -4,7 +4,7 @@
<xi:include href="../views/newebuildsatom.xml" />
<project2:view name="atomebuilds" source="newebuilds" rootname="newebuilds" recordname="ebuild">
<parameters>
- <param name="username" value="/1" />
+ <param name="username"><value source="uri" index="1" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/present/category.xml b/gentoobrowse/present/category.xml
index 6de3875..f45dc97 100644
--- a/gentoobrowse/present/category.xml
+++ b/gentoobrowse/present/category.xml
@@ -4,7 +4,7 @@
<xi:include href="../views/category.xml" />
<project2:view name="categoryPackages" source="categoryPackages" rootname="packages" recordname="package" filter="byCatName">
<parameters>
- <param name="catname" value="/1" />
+ <param name="catname"><value source="uri" index="1" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/present/index.xml b/gentoobrowse/present/index.xml
index 4fa7946..36b5da6 100644
--- a/gentoobrowse/present/index.xml
+++ b/gentoobrowse/present/index.xml
@@ -5,7 +5,7 @@
<project2:view name="newebuilds" source="newebuilds" rootname="newebuilds" recordname="ebuild" filter="syncCount">
<parameters>
<param name="count" value="3" />
- <param name="userID" value="%loggedInUserID|0" />
+ <param name="userID"><value source="session" name="loggedInUserID"><default value="0" type="int" /></value></param>
</parameters>
</project2:view>
<project2:view name="syncs" source="syncs" rootname="syncs" recordname="sync" filter="syncCount">
diff --git a/gentoobrowse/present/package.xml b/gentoobrowse/present/package.xml
index 0b93d04..69c13cc 100644
--- a/gentoobrowse/present/package.xml
+++ b/gentoobrowse/present/package.xml
@@ -4,68 +4,68 @@
<xi:include href="../views/package.xml" />
<project2:view name="package" source="packages" rootname="summary" recordname="package" filter="catAndName">
<parameters>
- <param name="cat" value="/1" />
- <param name="pkg" value="/2" />
+ <param name="cat"><value source="uri" index="1" /></param>
+ <param name="pkg"><value source="uri" index="2" /></param>
</parameters>
<project2:view name="tracked" source="tracks" rootname="tracks" recordname="track" filter="isPkgTrackedByUser">
<parameters>
- <param name="pkgid" value="^packageid" />
- <param name="userid" value="%loggedInUserID|0" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
+ <param name="userid"><value source="session" name="loggedInUserID"><default value="0" type="int" /></value></param>
</parameters>
</project2:view>
<project2:view name="versions" source="versions" rootname="versions" recordname="version" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="urls" source="packageUrls" rootname="packageUrls" recordname="url" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="uses" source="versionUses" rootname="versionUses" recordname="use" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="archs" source="versionArchs" rootname="versionArchs" recordname="arch" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="bugs" source="packageBugs" rootname="packageBugs" recordname="bug" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="deps" source="packageDeps" rootname="deps" recordname="package" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="rdeps" source="packageRdeps" rootname="rdeps" recordname="package" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="depees" source="packageDepees" rootname="depees" recordname="package" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="maskStatus" source="maskStatus" rootname="maskstatus" recordname="mask" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="maskDetails" source="maskDetails" rootname="maskdetails" recordname="mask" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
<project2:view name="changeLog" source="changeLog" rootname="changelog" recordname="entry" filter="pkg">
<parameters>
- <param name="pkgid" value="^packageid" />
+ <param name="pkgid"><value source="parent" name="packageid" depth="1" /></param>
</parameters>
</project2:view>
</project2:view>
diff --git a/gentoobrowse/present/search.xml b/gentoobrowse/present/search.xml
index 60610df..b2f0f97 100644
--- a/gentoobrowse/present/search.xml
+++ b/gentoobrowse/present/search.xml
@@ -10,7 +10,7 @@
</project2:rawview>
<project2:view name="searchResults" source="packageSearch" rootname="searchResults" recordname="package" filter="freeText">
<parameters>
- <param name="criteria" value="$criteria|" />
+ <param name="criteria"><value source="param" name="criteria" default="" /></param>
</parameters>
</project2:view>
</view>
diff --git a/gentoobrowse/request/doconfirm.xml b/gentoobrowse/request/doconfirm.xml
index 9b2b0e5..83785a3 100644
--- a/gentoobrowse/request/doconfirm.xml
+++ b/gentoobrowse/request/doconfirm.xml
@@ -11,21 +11,23 @@
WHERE verifyguid = ?
</sql>
<parameters>
- <param name="0" value="$verifyguid" />
+ <param name="0"><value source="param" name="verifyguid" /></param>
</parameters>
</project2:sqlcheck>
<project2:iterate datasource="postgres-web" name="getUidFromDatabase" source="users" filter="verifyguid">
<parameters>
- <param name="verifyguid" value="$verifyguid" />
+ <param name="verifyguid"><value source="param" name="verifyguid" /></param>
</parameters>
<tasks>
- <project2:sessionset key="loggedInUserID" value="^userid" name="setUidInSession" />
+ <project2:sessionset key="loggedInUserID" name="setUidInSession" />
+ <value source="parent" name="userid" depth="1" />
+ </project2:sessionset>
</tasks>
</project2:iterate>
<project2:sqltask datasource="postgres-web">
<sql>UPDATE users SET verifyguid = NULL WHERE verifyguid = ?</sql>
<parameters>
- <param name="0" value="$verifyguid" />
+ <param name="0"><value source="param" name="verifyguid" /></param>
</parameters>
</project2:sqltask>
</view>
diff --git a/gentoobrowse/request/dologin.xml b/gentoobrowse/request/dologin.xml
index 9e1bc19..b2c7121 100644
--- a/gentoobrowse/request/dologin.xml
+++ b/gentoobrowse/request/dologin.xml
@@ -3,11 +3,13 @@
xmlns:project2="http://project2.randomdan.homeip.net">
<xi:include href="../datasources/postgres-web.xml" />
<xi:include href="../views/user.xml" />
- <project2:regexcheck apply-to="$username" present="login" name="usernameEntered">
+ <project2:regexcheck present="login" name="usernameEntered">
+ <apply-to source="param" name="username" />
<regex>.+</regex>
<message>User name required</message>
</project2:regexcheck>
- <project2:regexcheck apply-to="$password" present="login" name="passwordLength">
+ <project2:regexcheck present="login" name="passwordLength">
+ <apply-to source="param" name="password" />
<regex>.{6,}</regex>
<message>Password too short</message>
</project2:regexcheck>
@@ -20,8 +22,8 @@
AND userpassword = ?
</sql>
<parameters>
- <param name="0" value="$username" />
- <param name="1" value="$password" />
+ <param name="0"><value source="param" name="username" /></param>
+ <param name="1"><value source="param" name="password" /></param>
</parameters>
</project2:sqlcheck>
<project2:sqlcheck datasource="postgres-web" testOp="=" testValue="1" present="confirm" name="checkConfirmed">
@@ -33,15 +35,17 @@
AND verifyguid IS NULL
</sql>
<parameters>
- <param name="0" value="$username" />
+ <param name="0"><value source="param" name="username" /></param>
</parameters>
</project2:sqlcheck>
<project2:iterate datasource="postgres-web" name="getUidFromDatabase" source="users" filter="username">
<parameters>
- <param name="username" value="$username" />
+ <param name="username"><value source="param" name="username" /></param>
</parameters>
<tasks>
- <project2:sessionset key="loggedInUserID" value="^userid" name="setUidInSession" />
+ <project2:sessionset key="loggedInUserID" name="setUidInSession">
+ <value source="parent" name="userid" depth="1" />
+ </project2:sessionset>
</tasks>
</project2:iterate>
</view>
diff --git a/gentoobrowse/request/dosignup.xml b/gentoobrowse/request/dosignup.xml
index 386b585..c0b24df 100644
--- a/gentoobrowse/request/dosignup.xml
+++ b/gentoobrowse/request/dosignup.xml
@@ -2,11 +2,13 @@
<view name="dosignup" present="confirm" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:project2="http://project2.randomdan.homeip.net">
<xi:include href="../datasources/postgres-web.xml" />
- <project2:regexcheck apply-to="$username" present="signup" name="usernameEntered">
+ <project2:regexcheck present="signup" name="usernameEntered">
+ <apply-to source="param" name="username" />
<regex>.+</regex>
<message>User name required</message>
</project2:regexcheck>
- <project2:regexcheck apply-to="$password" present="signup" name="passwordLength">
+ <project2:regexcheck present="signup" name="passwordLength">
+ <apply-to source="param" name="password" />
<regex>.{6,}</regex>
<message>Password too short</message>
</project2:regexcheck>
@@ -18,7 +20,7 @@
WHERE username = ?
</sql>
<parameters>
- <param name="0" value="$username" />
+ <param name="0"><value source="param" name="username" /></param>
</parameters>
</project2:sqlcheck>
<project2:sqlcheck datasource="postgres-web" testOp="=" testValue="0" present="signup" name="freeEmail">
@@ -29,20 +31,22 @@
WHERE useremail = ?
</sql>
<parameters>
- <param name="0" value="$email" />
+ <param name="0"><value source="param" name="email" /></param>
</parameters>
</project2:sqlcheck>
<project2:sqltask datasource="postgres-web">
<sql>INSERT INTO users(username, userrealname, userpassword, useremail, verifyguid)
VALUES(?, ?, ?, ?, uuid_generate_v4())</sql>
<parameters>
- <param name="0" value="$username" />
- <param name="1" value="$realname" />
- <param name="2" value="$password" />
- <param name="3" value="$email" />
+ <param name="0"><value source="param" name="username" /></param>
+ <param name="1"><value source="param" name="realname" /></param>
+ <param name="2"><value source="param" name="password" /></param>
+ <param name="3"><value source="param" name="email" /></param>
</parameters>
</project2:sqltask>
- <project2:sendmail to="$email" server="smtp.random.lan:25" subject="Welcome to Gentoo Browse"
- present="welcome" from="noreply@gentoobrowse.randomdan.homeip.net" />
+ <project2:sendmail server="smtp.random.lan:25" subject="Welcome to Gentoo Browse"
+ present="welcome" from="noreply@gentoobrowse.randomdan.homeip.net">
+ <to source="param" name="email" />
+ </project2:sendmail>
</view>
diff --git a/gentoobrowse/request/track.xml b/gentoobrowse/request/track.xml
index 5d8bbc9..ca7b8c8 100644
--- a/gentoobrowse/request/track.xml
+++ b/gentoobrowse/request/track.xml
@@ -11,15 +11,15 @@
AND userid = ?
</sql>
<parameters>
- <param name="0" value="$packageid" />
- <param name="1" value="%loggedInUserID" />
+ <param name="0"><value source="param" name="packageid" /></param>
+ <param name="1"><value source="session" name="loggedInUserID" /></param>
</parameters>
</project2:sqlcheck>
<project2:sqltask datasource="postgres-web" name="addTrack">
<sql>INSERT INTO user_packages(packageid, userid, trackedsince) VALUES(?, ?, NOW())</sql>
<parameters>
- <param name="0" value="$packageid" />
- <param name="1" value="%loggedInUserID" />
+ <param name="0"><value source="param" name="packageid" /></param>
+ <param name="1"><value source="session" name="loggedInUserID" /></param>
</parameters>
</project2:sqltask>
</request>
diff --git a/gentoobrowse/request/untrack.xml b/gentoobrowse/request/untrack.xml
index 58f595b..1cef535 100644
--- a/gentoobrowse/request/untrack.xml
+++ b/gentoobrowse/request/untrack.xml
@@ -9,8 +9,8 @@
AND userid = ?
</sql>
<parameters>
- <param name="0" value="$packageid" />
- <param name="1" value="%loggedInUserID" />
+ <param name="0"><value source="param" name="packageid" /></param>
+ <param name="1"><value source="session" name="loggedInUserID" /></param>
</parameters>
</project2:sqltask>
</request>