[wellwell-devel] [wellwell] Add Nitesi interface which currently provides a [q] tag.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Thu Jun 28 11:56:00 UTC 2012


commit 9763e168bde4c7310371613b0d7dee3011c766b4
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jun 28 13:55:05 2012 +0200

    Add Nitesi interface which currently provides a [q] tag.

 lib/WellWell/Nitesi.pm |   50 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/lib/WellWell/Nitesi.pm b/lib/WellWell/Nitesi.pm
new file mode 100644
index 0000000..40324c4
--- /dev/null
+++ b/lib/WellWell/Nitesi.pm
@@ -0,0 +1,50 @@
+# WellWell::Nitesi - WellWell Nitesi interface
+#
+# Copyright (C) 2012 Stefan Hornburg (Racke) <racke at linuxia.de>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package WellWell::Nitesi;
+
+use strict;
+use warnings;
+
+use Nitesi::Query::DBI;
+
+use Vend::Config;
+use Vend::Data;
+
+Vend::Config::parse_tag('UserTag', 'q MapRoutine WellWell::Nitesi::query');
+
+sub query {
+    my %dbif;
+    my $product_table;
+
+    unless ($Vend::Cfg->{Query}) {
+        $product_table = $Vend::Cfg->{ProductFiles}->[0];
+
+        unless ($dbif{products} = database_exists_ref($product_table)) {
+            die ::errmsg('Database missing: %s', $product_table);
+        }
+
+        $Vend::Cfg->{Query} = Nitesi::Query::DBI->new(dbh => $dbif{products}->dbh);
+    }
+    
+    return $Vend::Cfg->{Query};
+}
+
+1;
+



More information about the wellwell-devel mailing list