summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-12-14 21:42:31 +0000
committerrandomdan <randomdan@localhost>2011-12-14 21:42:31 +0000
commit234c2996722af16b03cf3df9e895ac8ef04ddcd5 (patch)
treed2170d110eb0805be896bf12f4f87b5f54f25e87
parentDrop Boost::program_options in favour of our own, pluggable system which inte... (diff)
downloadgentoobrowse-234c2996722af16b03cf3df9e895ac8ef04ddcd5.tar.bz2
gentoobrowse-234c2996722af16b03cf3df9e895ac8ef04ddcd5.tar.xz
gentoobrowse-234c2996722af16b03cf3df9e895ac8ef04ddcd5.zip
Pluggable script engines
XML script parser moved to XML module Script parsing object multiple instantiation bug fix Scripts changed to match new standardized format and layout
-rw-r--r--gentoobrowse/.p2config2
-rw-r--r--gentoobrowse/console/bugassociate.xml4
-rw-r--r--gentoobrowse/console/bugimport.xml26
-rw-r--r--gentoobrowse/console/categorymetadata.xml10
-rw-r--r--gentoobrowse/console/changelogs.xml24
-rw-r--r--gentoobrowse/console/fileimport.xml16
-rw-r--r--gentoobrowse/console/packageimport.xml60
-rw-r--r--gentoobrowse/console/packagelicenses.xml6
-rw-r--r--gentoobrowse/console/packagemasks.xml16
-rw-r--r--gentoobrowse/console/packagemetadata.xml14
-rw-r--r--gentoobrowse/console/use.global.xml10
-rw-r--r--gentoobrowse/console/use.local.xml16
-rw-r--r--gentoobrowse/datasources/postgres-web.xml14
-rw-r--r--gentoobrowse/datasources/postgres.xml8
-rw-r--r--gentoobrowse/request/doconfirm.xml2
-rw-r--r--gentoobrowse/views/poweredBy.xml4
16 files changed, 124 insertions, 108 deletions
diff --git a/gentoobrowse/.p2config b/gentoobrowse/.p2config
index 333a0a9..0bb6084 100644
--- a/gentoobrowse/.p2config
+++ b/gentoobrowse/.p2config
@@ -1,3 +1,5 @@
+[common]
+consolelogLevel = 9
[cgi]
sessionModule = couchsession
errorContentType=text/xml-xslt
diff --git a/gentoobrowse/console/bugassociate.xml b/gentoobrowse/console/bugassociate.xml
index d8decc5..d0b9ed1 100644
--- a/gentoobrowse/console/bugassociate.xml
+++ b/gentoobrowse/console/bugassociate.xml
@@ -9,8 +9,8 @@
AND namedpackages(b.summary) @> ARRAY[c.name || '/' || p.name]
</sql>
<columns>
- <column key="true">bugid</column>
- <column key="true">packageid</column>
+ <bugid key="true" />
+ <packageid key="true" />
</columns>
</project2:sqlmerge>
</bugassoc>
diff --git a/gentoobrowse/console/bugimport.xml b/gentoobrowse/console/bugimport.xml
index 1408e53..3e9c5f4 100644
--- a/gentoobrowse/console/bugimport.xml
+++ b/gentoobrowse/console/bugimport.xml
@@ -3,18 +3,22 @@
xmlns:project2="http://project2.randomdan.homeip.net">
<project2:filerows name="bugurls" newline="&#10;" encoding="ascii" fieldSep="" quoteChar="" path="console/bug.urls">
<columns>
- <column>url</column>
+ <url />
</columns>
</project2:filerows>
<project2:xpathrows name="buglist" html="true" warnings="false" timeout="60000">
<proxy value="cache.random.lan:8080" />
<url source="parent" name="url" depth="1" />
- <filterview name="bugdetails" root="/html/body/div/ul/li/a">
- <field name="bugid" xpath="number(substring-before(substring-after(.,'Bug:'),' '))" />
- <field name="summary" xpath="em" />
- <field name="status" xpath="substring-before(substring-after(.,'status:'),' ')" />
- <field name="severity" xpath="substring-after(.,'severity:')" />
- </filterview>
+ <filterviews>
+ <bugdetails root="/html/body/div/ul/li/a">
+ <fields>
+ <bugid xpath="number(substring-before(substring-after(.,'Bug:'),' '))" />
+ <summary xpath="em" />
+ <status xpath="substring-before(substring-after(.,'status:'),' ')" />
+ <severity xpath="substring-after(.,'severity:')" />
+ </fields>
+ </bugdetails>
+ </filterviews>
</project2:xpathrows>
<project2:iterate name="eachurl" source="bugurls">
@@ -29,10 +33,10 @@
<project2:iterate name="eachbug" source="buglist" filter="bugdetails" />
</project2:iterate>
<columns>
- <column key="true">bugid</column>
- <column>severity</column>
- <column>status</column>
- <column>summary</column>
+ <bugid key="true" />
+ <severity />
+ <status />
+ <summary />
</columns>
</project2:sqlmerge>
<xi:include href="bugassociate.xml" />
diff --git a/gentoobrowse/console/categorymetadata.xml b/gentoobrowse/console/categorymetadata.xml
index 7e1159f..8eb337d 100644
--- a/gentoobrowse/console/categorymetadata.xml
+++ b/gentoobrowse/console/categorymetadata.xml
@@ -13,9 +13,13 @@
</project2:sqlrows>
<project2:xpathrows name="cat" html="false" warnings="true">
<url source="parent" name="path" depth="1" />
- <filterview name="catmetadata" root="/catmetadata">
- <field name="longdesc" xpath="longdescription[@lang='en']" />
- </filterview>
+ <filterviews>
+ <catmetadata root="/catmetadata">
+ <fields>
+ <field name="longdesc" xpath="longdescription[@lang='en']" />
+ </fields>
+ </catmetadata>
+ </filterviews>
</project2:xpathrows>
<project2:iterate name="eachcat" source="catblanksummaries">
<project2:iterate name="catdetail" source="cat" filter="catmetadata">
diff --git a/gentoobrowse/console/changelogs.xml b/gentoobrowse/console/changelogs.xml
index 3ed1f50..1c1c73e 100644
--- a/gentoobrowse/console/changelogs.xml
+++ b/gentoobrowse/console/changelogs.xml
@@ -15,16 +15,18 @@
</project2:sqlrows>
<project2:filerows name="logcontent" encoding="utf-8" newline="" fieldSep="">
<path source="parent" name="path" depth="1" />
- <columns><column>text</column></columns>
+ <columns>
+ <text />
+ </columns>
</project2:filerows>
<project2:regexrows name="logentries">
<sourceText source="parent" name="text" depth="1" />
<regex>(\d+ *(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\w* \d+); *([^&lt;]+)? *&lt;([^ &gt;]+)[&gt;\s]\s*(?:[^:]*:)?\s*(.*?)(?:\R\*|\s*$|\R\R)</regex>
<columns>
- <column>date</column>
- <column>person</column>
- <column>email</column>
- <column>comment</column>
+ <date />
+ <person />
+ <email />
+ <comment />
</columns>
</project2:regexrows>
<project2:sqlmerge name="changelogs" datasource="postgres" targettable="package_changelogs">
@@ -63,12 +65,12 @@
</project2:iterate>
</project2:iterate>
<columns>
- <column key="true">packageid</column>
- <column key="true">date</column>
- <column key="true">n</column>
- <column>person</column>
- <column>email</column>
- <column>comment</column>
+ <packageid key="true" />
+ <date key="true" />
+ <n key="true" />
+ <person />
+ <email />
+ <comment />
</columns>
</project2:sqlmerge>
<project2:sqltask name="update" datasource="postgres">
diff --git a/gentoobrowse/console/fileimport.xml b/gentoobrowse/console/fileimport.xml
index 19585cd..8772821 100644
--- a/gentoobrowse/console/fileimport.xml
+++ b/gentoobrowse/console/fileimport.xml
@@ -27,9 +27,9 @@
</project2:iterate>
</project2:iterate>
<columns>
- <column key="true">filename</column>
- <column>moddate</column>
- <column>filetypeid</column>
+ <filename key="true" />
+ <moddate />
+ <filetypeid />
</columns>
</project2:sqlmerge>
@@ -43,10 +43,10 @@
ORDER BY f.fileid
</sql>
</project2:sqlrows>
- <project2:filerows name="readFileContent" newline="&#10;" encoding="utf-8" fieldSep="" quoteChar="" keepBlankRows="count" >
+ <project2:filerows name="readFileContent" newline="&#10;" encoding="utf-8" fieldSep="" quoteChar="" keepBlankRows="false" countBlankRows="true">
<path source="parent" name="filename" depth="1" />
<columns>
- <column>content</column>
+ <content />
</columns>
</project2:filerows>
@@ -64,9 +64,9 @@
</project2:iterate>
</project2:iterate>
<columns>
- <column key="true">fileid</column>
- <column key="true">line</column>
- <column>content</column>
+ <fileid key="true" />
+ <line key="true" />
+ <content />
</columns>
</project2:sqlmerge>
diff --git a/gentoobrowse/console/packageimport.xml b/gentoobrowse/console/packageimport.xml
index 5dba528..c136294 100644
--- a/gentoobrowse/console/packageimport.xml
+++ b/gentoobrowse/console/packageimport.xml
@@ -4,7 +4,7 @@
<project2:sqlmerge name="categories" datasource="postgres" targettable="categories" useview="yes">
<sql>SELECT DISTINCT (REGEXP_MATCHES(filename, '^[^/]+'))[1] AS name FROM files WHERE filetypeid = 1</sql>
<columns>
- <column key="true">name</column>
+ <name key="true" />
</columns>
</project2:sqlmerge>
@@ -24,9 +24,9 @@
AND fc.line = 8
</sql>
<columns>
- <column key="true">categoryid</column>
- <column key="true">name</column>
- <column>description</column>
+ <categoryid key="true" />
+ <name key="true" />
+ <description />
</columns>
</project2:sqlmerge>
@@ -47,14 +47,14 @@
AND p.name = f.name
</sql>
<columns>
- <column key="true">ebuildid</column>
- <column>packageid</column>
- <column>version</column>
- <column>versioninst</column>
- <column>slot</column>
- <column>license</column>
- <column>firstseen</column>
- <column>moddate</column>
+ <ebuildid key="true" />
+ <packageid />
+ <version />
+ <versioninst />
+ <slot />
+ <license />
+ <firstseen />
+ <moddate />
</columns>
</project2:sqlmerge>
@@ -67,8 +67,8 @@
AND filetypeid = 1
</sql>
<columns>
- <column key="true">ebuildid</column>
- <column key="true">arch</column>
+ <ebuildid key="true" />
+ <arch key="true" />
</columns>
</project2:sqlmerge>
@@ -81,8 +81,8 @@
AND filetypeid = 1
</sql>
<columns>
- <column key="true">ebuildid</column>
- <column key="true">use</column>
+ <ebuildid key="true" />
+ <use key="true" />
</columns>
</project2:sqlmerge>
@@ -98,8 +98,8 @@
WHERE url LIKE '%://%'
</sql>
<columns>
- <column key="true">packageid</column>
- <column key="true">url</column>
+ <packageid key="true" />
+ <url key="true" />
</columns>
</project2:sqlmerge>
@@ -127,12 +127,12 @@
AND c.name = cat
</sql>
<columns>
- <column key="true">ebuildid</column>
- <column key="true">packageid</column>
- <column key="true">slot</column>
- <column key="true">op</column>
- <column key="true">versionspec</column>
- <column key="true">flags</column>
+ <ebuildid key="true" />
+ <packageid key="true" />
+ <slot key="true" />
+ <op key="true" />
+ <versionspec key="true" />
+ <flags key="true" />
</columns>
</project2:sqlmerge>
@@ -160,12 +160,12 @@
AND c.name = cat
</sql>
<columns>
- <column key="true">ebuildid</column>
- <column key="true">packageid</column>
- <column key="true">slot</column>
- <column key="true">op</column>
- <column key="true">versionspec</column>
- <column key="true">flags</column>
+ <ebuildid key="true" />
+ <packageid key="true" />
+ <slot key="true" />
+ <op key="true" />
+ <versionspec key="true" />
+ <flags key="true" />
</columns>
</project2:sqlmerge>
diff --git a/gentoobrowse/console/packagelicenses.xml b/gentoobrowse/console/packagelicenses.xml
index 22cbaf8..1ed5897 100644
--- a/gentoobrowse/console/packagelicenses.xml
+++ b/gentoobrowse/console/packagelicenses.xml
@@ -14,7 +14,7 @@
<project2:filerows name="lic" encoding="iso-8859-1">
<path source="parent" name="path" depth="1" />
<columns>
- <column>text</column>
+ <text />
</columns>
</project2:filerows>
<project2:sqlmerge name="update" datasource="postgres" targettable="license"
@@ -30,8 +30,8 @@
</project2:iterate>
</project2:iterate>
<columns>
- <column key="true">name</column>
- <column>legalbumph</column>
+ <name key="true" />
+ <legalbumph />
</columns>
</project2:sqlmerge>
<project2:sqltask name="update" datasource="postgres">
diff --git a/gentoobrowse/console/packagemasks.xml b/gentoobrowse/console/packagemasks.xml
index 915e115..6fafbb4 100644
--- a/gentoobrowse/console/packagemasks.xml
+++ b/gentoobrowse/console/packagemasks.xml
@@ -21,11 +21,11 @@
GROUP BY d.setno
</sql>
<columns>
- <column key="true">setno</column>
- <column>person</column>
- <column>email</column>
- <column>dateadded</column>
- <column>message</column>
+ <setno key="true" />
+ <person />
+ <email />
+ <dateadded />
+ <message />
</columns>
</project2:sqlmerge>
<project2:sqlmerge name="masks" datasource="postgres" targettable="ebuild_masks" useview="yes">
@@ -35,9 +35,9 @@
WHERE content NOT LIKE '#%'
</sql>
<columns>
- <column key="true">line</column>
- <column key="true">setno</column>
- <column key="true">ebuildid</column>
+ <line key="true" />
+ <setno key="true" />
+ <ebuildid key="true" />
</columns>
</project2:sqlmerge>
</packagemasks>
diff --git a/gentoobrowse/console/packagemetadata.xml b/gentoobrowse/console/packagemetadata.xml
index abcb209..f4b1a2f 100644
--- a/gentoobrowse/console/packagemetadata.xml
+++ b/gentoobrowse/console/packagemetadata.xml
@@ -14,11 +14,15 @@
</project2:sqlrows>
<project2:xpathrows name="pkg" html="false" warnings="true">
<url source="parent" name="path" depth="1" />
- <filterview name="pkgmetadata" root="/pkgmetadata">
- <field name="longdesc" xpath="longdescription" />
- <field name="maintainer" xpath="maintainer/email" />
- <field name="herd" xpath="herd" />
- </filterview>
+ <filterviews>
+ <pkgmetadata root="/pkgmetadata">
+ <fields>
+ <longdesc xpath="longdescription" />
+ <maintainer xpath="maintainer/email" />
+ <herd xpath="herd" />
+ </fields>
+ </pkgmetadata>
+ </filterviews>
</project2:xpathrows>
<project2:iterate name="eachpkg" source="pkgblanksummaries">
<project2:iterate name="pkgdetail" source="pkg" filter="pkgmetadata">
diff --git a/gentoobrowse/console/use.global.xml b/gentoobrowse/console/use.global.xml
index 69fb1d2..dc092bb 100644
--- a/gentoobrowse/console/use.global.xml
+++ b/gentoobrowse/console/use.global.xml
@@ -3,15 +3,15 @@
xmlns:project2="http://project2.randomdan.homeip.net">
<project2:filerows name="gcl" newline="&#10;" encoding="utf-8" fieldSep="" quoteChar="" path="/usr/portage/profiles/use.desc">
<columns>
- <column>text</column>
+ <text />
</columns>
</project2:filerows>
<project2:regexrows name="gcla">
<sourceText source="parent" name="text" depth="1" />
<regex>([^ ]+) - (.+)</regex>
<columns>
- <column>use</column>
- <column>description</column>
+ <use />
+ <description />
</columns>
</project2:regexrows>
<project2:sqlmerge name="mergeguse" datasource="postgres" targettable="use_global">
@@ -19,8 +19,8 @@
<project2:iterate name="flags" source="gcla" />
</project2:iterate>
<columns>
- <column key="true">use</column>
- <column>description</column>
+ <use key="true" />
+ <description />
</columns>
</project2:sqlmerge>
</test>
diff --git a/gentoobrowse/console/use.local.xml b/gentoobrowse/console/use.local.xml
index 97141d0..456c5cc 100644
--- a/gentoobrowse/console/use.local.xml
+++ b/gentoobrowse/console/use.local.xml
@@ -3,17 +3,17 @@
xmlns:project2="http://project2.randomdan.homeip.net">
<project2:filerows name="cl" newline="&#10;" encoding="utf-8" fieldSep="" quoteChar="" path="/usr/portage/profiles/use.local.desc">
<columns>
- <column>text</column>
+ <text />
</columns>
</project2:filerows>
<project2:regexrows name="cla">
<sourceText source="parent" name="text" depth="1" />
<regex>([^/]+)/([^:]+):([^ ]+) - (.+)</regex>
<columns>
- <column>category</column>
- <column>package</column>
- <column>use</column>
- <column>description</column>
+ <category />
+ <package />
+ <use />
+ <description />
</columns>
</project2:regexrows>
<project2:sqlmerge name="mergeguse" datasource="postgres" targettable="use_local">
@@ -41,9 +41,9 @@
</project2:iterate>
</project2:iterate>
<columns>
- <column key="true">packageid</column>
- <column key="true">use</column>
- <column>description</column>
+ <packageid key="true" />
+ <use key="true" />
+ <description />
</columns>
</project2:sqlmerge>
</test>
diff --git a/gentoobrowse/datasources/postgres-web.xml b/gentoobrowse/datasources/postgres-web.xml
index 426f6ee..be19a4e 100644
--- a/gentoobrowse/datasources/postgres-web.xml
+++ b/gentoobrowse/datasources/postgres-web.xml
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
-<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres-web">
- <readonly preferlocal="true">
- <dsn host="firebrand"><postgresql>host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></dsn>
- <dsn host="defiant"><postgresql>host=defiant.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></dsn>
- <dsn host="akira"><postgresql>host=akira.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></dsn>
- <dsn host="riogrande"><postgresql>host=riogrande.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></dsn>
+<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres-web" preferlocal="true">
+ <readonly>
+ <dsn host="firebrand" provider="postgresql" dsn="host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" />
+ <dsn host="defiant" provider="postgresql" dsn="host=defiant.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" />
+ <dsn host="akira" provider="postgresql" dsn="host=akira.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" />
+ <dsn host="riogrande" provider="postgresql" dsn="host=riogrande.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" />
</readonly>
- <masterdsn><postgresql>host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></masterdsn>
+ <masterdsn provider="postgresql" dsn="host=firebrand.random.lan user=apache dbname=gentoo options='-c search_path=gentoobrowse,public'" />
</project2:rdbmsdatasource>
diff --git a/gentoobrowse/datasources/postgres.xml b/gentoobrowse/datasources/postgres.xml
index 8a2c975..8281549 100644
--- a/gentoobrowse/datasources/postgres.xml
+++ b/gentoobrowse/datasources/postgres.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
-<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres">
- <readonly preferlocal="true">
- <dsn host="firebrand"><postgresql>sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></dsn>
+<project2:rdbmsdatasource xmlns:project2="http://project2.randomdan.homeip.net" name="postgres" preferlocal="true">
+ <readonly>
+ <dsn host="firebrand" provider="postgresql" dsn="sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'" />
</readonly>
- <masterdsn><postgresql>sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'</postgresql></masterdsn>
+ <masterdsn provider="postgresql" dsn="sslmode=disable user=gentoo dbname=gentoo options='-c search_path=gentoobrowse,public'" />
</project2:rdbmsdatasource>
diff --git a/gentoobrowse/request/doconfirm.xml b/gentoobrowse/request/doconfirm.xml
index e71d396..dd7b036 100644
--- a/gentoobrowse/request/doconfirm.xml
+++ b/gentoobrowse/request/doconfirm.xml
@@ -15,7 +15,7 @@
<verifyguid source="param" name="verifyguid" />
</parameters>
<tasks>
- <project2:sessionset key="loggedInUserID" name="setUidInSession" />
+ <project2:sessionset key="loggedInUserID" name="setUidInSession">
<value source="parent" name="userid" depth="1" />
</project2:sessionset>
</tasks>
diff --git a/gentoobrowse/views/poweredBy.xml b/gentoobrowse/views/poweredBy.xml
index 7a8faab..273b8a1 100644
--- a/gentoobrowse/views/poweredBy.xml
+++ b/gentoobrowse/views/poweredBy.xml
@@ -2,8 +2,8 @@
<block xmlns:project2="http://project2.randomdan.homeip.net">
<project2:filerows name="poweredBy" path="datasources/poweredBy.txt" fieldSep="|" newline="&#10;" encoding="ascii">
<columns>
- <column>name</column>
- <column>url</column>
+ <name />
+ <url />
</columns>
</project2:filerows>
<project2:view name="viewPoweredBy" source="poweredBy" rootname="power" recordname="by" />