[Gd-chatter] r11678 - trunk/libraries/network/web-framework

turbo24prg at gwydiondylan.org turbo24prg at gwydiondylan.org
Sun Feb 17 18:18:02 CET 2008


Author: turbo24prg
Date: Sun Feb 17 18:18:02 2008
New Revision: 11678

Removed:
   trunk/libraries/network/web-framework/utils.dylan
Modified:
   trunk/libraries/network/web-framework/dsp.dylan
   trunk/libraries/network/web-framework/library.dylan
   trunk/libraries/network/web-framework/web-framework.lid
Log:
Job: minor
 - make use of uri library
 - remove regular-expressions
 - use new tag-definer behaviour


Modified: trunk/libraries/network/web-framework/dsp.dylan
==============================================================================
--- trunk/libraries/network/web-framework/dsp.dylan	(original)
+++ trunk/libraries/network/web-framework/dsp.dylan	Sun Feb 17 18:18:02 2008
@@ -11,22 +11,37 @@
 // sent values
 define thread variable *form* = #f;
 
+define url-map
+  url "/login",
+    action get () => (login);
+  url "/logout",
+    action get () => (logout);
+end;
+
 define tag show-login-url in web-framework (page :: <dylan-server-page>)
  (redirect :: type-union(<string>, <boolean>), current :: <boolean>)
-  format(current-response().output-stream, "/?login%s",
-    if (redirect)
-      format-to-string("&amp;redirect=%s",
-        encode-url(if (current) current-url() else redirect end if, reserved?: #t));
-    else "" end);
+  let url = parse-url("/login");
+  if (redirect)
+    url.uri-query["redirect"] := if (current) 
+        build-uri(current-url())
+      else 
+        redirect 
+      end if;
+  end if;
+  output("%s", url);
 end;
 
 define tag show-logout-url in web-framework (page :: <dylan-server-page>)
  (redirect :: type-union(<string>, <boolean>), current :: <boolean>)
-  format(current-response().output-stream, "/?logout%s",
-    if (redirect)
-      format-to-string("&amp;redirect=%s",
-        encode-url(if (current) current-url() else redirect end if, reserved?: #t));
-    else "" end);
+  let url = parse-url("/logout");
+  if (redirect)
+    url.uri-query["redirect"] := if (current) 
+        build-uri(current-url()) 
+      else 
+        redirect 
+      end if;
+  end if;
+  output("%s", url);
 end;
 
 

Modified: trunk/libraries/network/web-framework/library.dylan
==============================================================================
--- trunk/libraries/network/web-framework/library.dylan	(original)
+++ trunk/libraries/network/web-framework/library.dylan	Sun Feb 17 18:18:02 2008
@@ -9,7 +9,7 @@
   use xml-parser;
   use system, import: { file-system, date, locators };
   use dood;
-  use regular-expressions;
+  use uri;
 
   export object-table,
     web-framework,
@@ -254,7 +254,7 @@
   use koala;
   use dsp;
   use format;
-  use regular-expressions;
+  use uri;
 
   use web-framework-macro, export: all;
   use storage;
@@ -273,5 +273,4 @@
     error-test-definer,
     error-tests-definer;
 
-  export printable;
 end;

Modified: trunk/libraries/network/web-framework/web-framework.lid
==============================================================================
--- trunk/libraries/network/web-framework/web-framework.lid	(original)
+++ trunk/libraries/network/web-framework/web-framework.lid	Sun Feb 17 18:18:02 2008
@@ -9,4 +9,3 @@
        users
        dsp
        permission
-       utils



More information about the chatter mailing list