Commits

Greg Slepak committed db78b07

- changed all views to include from "includes" instead of "/includes" so that example-site can work in a non-root location
- updated INSTALL with example on how to get Dragonfly running on apache in non-root
- fixed issue with $GET

Comments (0)

Files changed (9)

 	
 Then that's the folder you'll want to copy the files into.
 
+If you'd like Dragonfly to live somewhere else inside your site root,
+see the Example step at the end of this document.
+
  ================================
  = Step 2 - Configure Dragonfly =
  ================================
 If you want to prevent .html files from being processed through Dragonfly, open the
 .htaccess file in the site root and read the comments there for how to disable that behavior.
 
+ ===========================================================
+ = Example: Testing Demo Site on Apache in Non-Root Folder =
+ ===========================================================
 
-TODO: discuss installing and using plugins.
+Say you want to test Dragonfly out by placing the entire
+directory into the root of your site. The demo site will then
+be located here:
+
+	<site root>/dragonfly/example-site/
+
+And to access it you would use this URL:
+
+	http://www.mysite.com/dragonfly/example-site/
+
+You must make two changes (possible 3) to get it to work with Apache:
+
+1) Change this line in .htaccess 
+
+	RewriteBase /
+To:
+	RewriteBase /dragonfly/example-site/
+	
+2) Edit config.lsp and change this line:
+
+	(constant (global 'DOCUMENT_ROOT) (env "DOCUMENT_ROOT"))
+To:
+	(constant (global 'DOCUMENT_ROOT) "/server/path/to/mysite.com/dragonfly/example-site")
+
+	Note that "/server/path/to" is made up. You would want to use
+	the absolute path to the location of the 'example-site' folder
+	on your server.
+
+A possible third step is required if your newlisp binary is not
+installed in /usr/bin/newlisp. If it's installed somewhere else
+(for example: /path/to/bin/newlisp), then you may need to also
+edit 'index.cgi' file and change the top-line from:
+
+	#!/usr/bin/env newlisp
+To:
+	#!/path/to/bin/newlisp
 	newlisp -d 8080 -w . -http
 
 Open Your browser and type localhost:8080 - have FUN!
+
+For installation information see INSTALL.

example-site/dragonfly-framework/lib/request.lsp

    (replace REGEX_HEX_ENCODED_CHAR str (char (int (string "0x" $1))) 0x10000)
 )
 
-(constant 'REGEX_QUERY (regex-comp {&([^&=]+?)=?([^&=]*?)(?=&|$)} 1))
+(constant 'REGEX_QUERY (regex-comp {&([^&=]+)=?([^&=]*?)(?=&|$)} 1))
 
 (define (parse-query query)
 	(when (starts-with query "?") (pop query))
 	(push "&" query)
+	(DF:log-debug "parsing query: " query " => " (find-all REGEX_QUERY query (list $1 (url-decode $2)) 0x10000))
 	(find-all REGEX_QUERY query (list $1 (url-decode $2)) 0x10000)
 )
 
 		(dolist (pair (parse-query temp))
 			($POST (first pair) (last pair))
 		)
-		; TODO: log an error here
+		(DF:log-err "couldn't get POST info!")
 	)
 )
 

example-site/dragonfly-framework/plugins-active/dragonfly_basic.lsp

 		<li>Pid of running newLISP process: "(sys-info 6)"</li>
 		<li>Version number as an integer constant: "(sys-info 7)"</li>
 		<li>Operating system constant: "(sys-info 8)"</li>
-		<li>Used symbols in Dragonfly: <pre>"(symbols 'Dragonfly)"</pre></li>
+		<li>Used symbols in Dragonfly: <div style=\"width: 474px;\">"(symbols 'Dragonfly)"</div></li>
 		<li>Last system error: "(sys-error)"</li>
 	</ul>
 	

example-site/includes/css/twitter.css

 	margin: 0px;
 	padding: 7px 0px 0px 15px;
 	top: 6px;
-	background: transparent url(/includes/images/tip.gif) no-repeat 20px 0;
+	background: transparent url(includes/images/tip.gif) no-repeat 20px 0;
 	font-style: normal;
 }

example-site/views/404

 			<p><% (title "| marchildmann.com") %><p>
 		</div>
 		
-		<img src="/includes/images/houses.jpg" class="border" alt="Houses" width="474" height="267"/>
+		<img src="includes/images/houses.jpg" class="border" alt="Houses" width="474" height="267"/>
 		
 		
 		<h1>We did the best we can ...</h1>

example-site/views/dragonfly_welcome

 			<p><% (title "| Dragonfly web framework") %><p>
 		</div>
 		
-		<img src="/includes/images/houses.jpg" class="border" alt="Houses" width="474" height="267"/>
+		<img src="includes/images/houses.jpg" class="border" alt="Houses" width="474" height="267"/>
 		
 		<h1>Introduction</h1>
 		<p class="extract">Dragonfly is a <b>web framework for newLISP</b>. Development started in June 2009. It focuses on <b>speed</b>, small memory consumption and a <b>small learning curve</b>. Other goodies are a plug and play architecture for writing own helpers or modules and a very <b>easy deployment</b>. It's possible to use it with the builtin newLISP webserver.

example-site/views/partials/header

 	<title><% (title "Dragonfly web framework - User Guide") %></title>
 	<% (meta "author" "Marc Hildmann") %>
 	<% (meta "keywords" "newlisp, framework, dragonfly, web framework") %>
-	<% (css "screen" "/includes/css/screen.css") %>
-	<% (script "/includes/js/dragonfly.js") %>
+	<% (css "screen" "includes/css/screen.css") %>
+	<% (script "includes/js/dragonfly.js") %>
 	<% (rss "Dragonfly web framework RSS Feed" "/dragonfly_rssfeed/xml") %>
 </head>

example-site/views/partials/navigation

 <!-- BEGIN NAVIGATION -->
-<img src="/includes/images/marchildmann-com.gif" alt="MarcHildmann.com" width="474" height="50"/>
+<img src="includes/images/marchildmann-com.gif" alt="MarcHildmann.com" width="474" height="50"/>
 <ul>
 	<li>
 	<a href="index.html" onclick="toggleMenu(); return false;" id="guidesMenu">Dragonfly web framework</a>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.