[bknr-cvs] r1970 - in branches/xml-class-rework/projects/hello-web: . src website/templates

bknr at bknr.net bknr at bknr.net
Sat Jul 22 12:58:44 UTC 2006


Author: hhubner
Date: 2006-07-22 08:58:44 -0400 (Sat, 22 Jul 2006)
New Revision: 1970

Added:
   branches/xml-class-rework/projects/hello-web/src/news.lisp
   branches/xml-class-rework/projects/hello-web/website/templates/index.xml
   branches/xml-class-rework/projects/hello-web/website/templates/user-error.xml
Removed:
   branches/xml-class-rework/projects/hello-web/website/templates/index.bknr
   branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr
Modified:
   branches/xml-class-rework/projects/hello-web/
   branches/xml-class-rework/projects/hello-web/src/config.lisp
   branches/xml-class-rework/projects/hello-web/src/handlers.lisp
   branches/xml-class-rework/projects/hello-web/src/hello-web.asd
   branches/xml-class-rework/projects/hello-web/src/init.lisp
   branches/xml-class-rework/projects/hello-web/src/packages.lisp
   branches/xml-class-rework/projects/hello-web/src/webserver.lisp
Log:
Correct file endings of xml files
Add RSS feed demo



Property changes on: branches/xml-class-rework/projects/hello-web
___________________________________________________________________
Name: svn:ignore
   + datastore


Modified: branches/xml-class-rework/projects/hello-web/src/config.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/config.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/config.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -3,7 +3,7 @@
 ;; URL für BASE HREFs
 (defparameter *website-url* "http://hello-web.bknr.net")
 
-(defparameter *root-directory* #p"home:bknr-svn/hello-web/")
+(defparameter *root-directory* #p"home:bknr-svn/projects/hello-web/")
 
 (defparameter *store-directory* (merge-pathnames #p"datastore/" *root-directory*))
 

Modified: branches/xml-class-rework/projects/hello-web/src/handlers.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/handlers.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/handlers.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -14,4 +14,5 @@
   (with-bknr-page (req :title "demo handler")
     (html (:p "This is the demo handler, the object id of user "
 	      (:b (:princ-safe (first (decoded-handler-path handler req)))) " is "
-	      (:b (:princ-safe (store-object-id object)))))))
\ No newline at end of file
+	      (:b (:princ-safe (store-object-id object)))))))
+

Modified: branches/xml-class-rework/projects/hello-web/src/hello-web.asd
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/hello-web.asd	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/hello-web.asd	2006-07-22 12:58:44 UTC (rev 1970)
@@ -20,7 +20,6 @@
 	       :cl-ppcre
 	       :aserve
 	       :cxml
-	       :cl-typesetting
 	       :mime
 	       :bknr-modules)
 
@@ -30,4 +29,5 @@
 	       (:file "tags" :depends-on ("config"))
 	       (:file "handlers" :depends-on ("config"))
 	       (:file "webserver" :depends-on ("handlers"))
+	       (:file "news" :depends-on ("config"))
 	       (:file "init" :depends-on ("webserver"))))

Modified: branches/xml-class-rework/projects/hello-web/src/init.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/init.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/init.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -11,6 +11,7 @@
   (unless (find-user "anonymous")
     (make-user "anonymous")		; used for all anonymous sessions
     (make-user "admin" :password "admin" :full-name "Administrator" :flags '(:admin))
-    (import-image "bknr-logo.png" :keywords '(:banner :bknr)))
+    (import-image "bknr-logo.png" :keywords '(:banner :bknr))
+    (make-rss-channel "default" "BKNR Hello Web" "default RSS channel of the BKNR hello web site" *website-url*))
   
   (publish-hello-web))

Added: branches/xml-class-rework/projects/hello-web/src/news.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/news.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/news.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -0,0 +1,23 @@
+(in-package :hello-web)
+
+(define-persistent-class news-item (rss-item)
+  ((title :read)
+   (text :read)))
+
+(defmethod rss-item-title ((item news-item))
+  (news-item-title item))
+
+(defmethod rss-item-description ((item news-item))
+  (news-item-text item))
+
+(defmethod rss-item-guid ((item news-item))
+  (format nil "~A/~A" *website-url* (store-object-id item)))
+
+(defmethod rss-item-link ((item news-item))
+  (format nil "~A/~A" *website-url* (store-object-id item)))
+
+(defmethod rss-item-channel ((item news-item))
+  "default")
+
+(defun make-news-item (title text &rest args)
+  (apply #'make-object 'news-item :title title :text text args))
\ No newline at end of file

Modified: branches/xml-class-rework/projects/hello-web/src/packages.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/packages.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/packages.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -41,6 +41,7 @@
 	:bknr.images
 	:bknr.datastore
 	:bknr.indices
+	:bknr.rss
 	:hello-web.config
 	:net.aserve
 	:xhtml-generator)

Modified: branches/xml-class-rework/projects/hello-web/src/webserver.lisp
===================================================================
--- branches/xml-class-rework/projects/hello-web/src/webserver.lisp	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/src/webserver.lisp	2006-07-22 12:58:44 UTC (rev 1970)
@@ -9,13 +9,12 @@
 
 (defun publish-hello-web (&key (port *webserver-port*) (listeners 20))
 
-  (setf bknr.web::*login-default-url* "/admin")
-
   (make-instance 'website
 		 :name "Hello Web CMS"
 		 :handler-definitions `(("/hello-object" hello-object-handler)
 					("/" redirect-handler
 					 :prefix "/" :to "/index")
+					("/rss" rss-handler)
 					("/" template-handler
 					 :prefix "/"
 					 :destination ,(namestring (merge-pathnames #p"templates/" *website-directory*))

Deleted: branches/xml-class-rework/projects/hello-web/website/templates/index.bknr
===================================================================
--- branches/xml-class-rework/projects/hello-web/website/templates/index.bknr	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/website/templates/index.bknr	2006-07-22 12:58:44 UTC (rev 1970)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:bknr="http://bknr.net"
-  xmlns:hello-web="http://hello-web.bknr.net"
-  >
-	<head>
-		<link rel="stylesheet" href="/static/styles.css" />
-		<script src="/static/javascript.js" type="text/javascript"><!-- x -->	
-		</script> 
-		<title>Hello Web</title>
-	</head>
-
-	<body id="hello-web">
-		<h2>Hello Web!</h2>
-		<hello-web:test-tag arg="blub" />
-		<h2>Handler demo</h2>
-		<a href="/hello-object/anonymous">see the output of a user-defined handler</a>
-	</body>
-</html>

Copied: branches/xml-class-rework/projects/hello-web/website/templates/index.xml (from rev 1969, branches/xml-class-rework/projects/hello-web/website/templates/index.bknr)

Deleted: branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr
===================================================================
--- branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr	2006-07-22 12:58:44 UTC (rev 1970)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:bknr="http://bknr.net"
-  xmlns:lisp-ecoop05="http://lisp-ecoop05.bknr.net"
-  xmlns:menu="http://bknr.net/menu"
-  >
-Your request could not be processed because an error occured:
-<pre>
-$(error-message)
-</pre>
-</html>
\ No newline at end of file

Copied: branches/xml-class-rework/projects/hello-web/website/templates/user-error.xml (from rev 1969, branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr)
===================================================================
--- branches/xml-class-rework/projects/hello-web/website/templates/user-error.bknr	2006-07-22 11:30:36 UTC (rev 1969)
+++ branches/xml-class-rework/projects/hello-web/website/templates/user-error.xml	2006-07-22 12:58:44 UTC (rev 1970)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:bknr="http://bknr.net"
+  xmlns:lisp-ecoop05="http://lisp-ecoop05.bknr.net"
+  xmlns:menu="http://bknr.net/menu"
+  >
+Your request could not be processed because an error occured:
+<p>
+$(error-message)
+</p>
+</html>
\ No newline at end of file




More information about the Bknr-cvs mailing list