logo       


r9867 - trunk/documentation/topic/cgi-bin: msg#00025

Subject: r9867 - trunk/documentation/topic/cgi-bin
Author: housel
Date: Sat May 14 06:08:45 2005
New Revision: 9867

Added:
   trunk/documentation/topic/cgi-bin/
   trunk/documentation/topic/cgi-bin/topic.cgi   (contents, props changed)
Log:
Bug: 7249
Beginning of a simple "content manager" for viewing topic-centered
documentation online.


Added: trunk/documentation/topic/cgi-bin/topic.cgi
==============================================================================
--- (empty file)
+++ trunk/documentation/topic/cgi-bin/topic.cgi Sat May 14 06:08:45 2005
@@ -0,0 +1,58 @@
+#!/usr/local/bin/perl -w
+
+use CGI;
+use CGI::Carp;
+use strict;
+
+my $www = "/usr/local/www";
+my $wwwdata = "$www/data";
+my $wwwtopic = "$www/topic";
+my $uri = "http://www.gwydiondylan.org/cgi-bin/topic.cgi";;
+
+open(HEAD, '<', "$wwwdata/header.html") || exit 1;
+my @head = <HEAD>;
+close(HEAD);
+
+open(MENU, '<', "$wwwdata/menu.html") || exit 1;
+my @menu = <MENU>;
+close(MENU);
+
+open(FOOT, '<', "$wwwdata/footer.html") || exit 1;
+my @foot = <FOOT>;
+close(FOOT);
+
+my $q = new CGI;
+my $view = $q->param('view') || 'default';
+my $path = $q->path_info;
+
+if($view eq 'download') {
+    if(($path =~ m|^/reference/|
+       || $path =~ m|^/map/|
+       || $path =~ m|^/concept/|
+       || $path =~ m|^/task/|)
+       && $path =~ m|\.xml$|
+       && -f "$wwwtopic$path"
+       && open(DOWNLOAD, '<', "$wwwtopic$path")) {
+       print $q->header('text/xml'), <DOWNLOAD>;
+       close(DOWNLOAD);
+       exit 0;
+    } else {
+       print $q->header('text/html', '404 Not Found'),
+             $q->start_html('404 Not Found'),
+             $q->h1('404 Not Found'),
+             $q->end_html;
+       exit 0;
+    }
+} elsif($view eq 'default') {
+    print $q->header, @head, @menu;
+
+    print $q->h1("Hello topic"),
+    $q->p($q->path_info);
+
+    print @foot;
+} else {
+    exit 1;
+}
+
+exit 0;
+
-- 
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter



Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe