Permalink
Browse files

Initial commit including patches from Jonathan Paugh

  • Loading branch information...
0 parents commit 7a84e0e74ade9510786868fe876063041250f16b @jeyoor committed Feb 11, 2012
Showing with 6,065 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +13 −0 AUTHORS
  3. +165 −0 DESIGN
  4. +27 −0 HACKING
  5. +211 −0 LICENSE
  6. +1 −0 Procfile
  7. +44 −0 README
  8. +64 −0 TODO
  9. +13 −0 doc/INSTALL.txt
  10. +50 −0 doc/clojure_notes.txt
  11. +23 −0 doc/css_notes.txt
  12. +90 −0 doc/enlive_notes.txt
  13. +21 −0 doc/push_seven.sh
  14. +17 −0 doc/redis_clojure_notes.txt
  15. +3 −0 doc/redis_error_notes.txt
  16. +4 −0 doc/redis_imple_notes.txt
  17. +23 −0 doc/redis_notes.txt
  18. +5 −0 doc/ring_notes.txt
  19. +7 −0 doc/sandbar_notes.txt
  20. +65 −0 doc/sources_consulted.txt
  21. +1 −0 doc/windows/dolein.bat
  22. BIN doc/windows/lein_in_windows_vm.doc
  23. +5 −0 gae/META-INF/MANIFEST.MF
  24. +5 −0 gae/WEB-INF/appengine-web.xml
  25. +1 −0 gae/WEB-INF/web.xml
  26. +17 −0 project.clj
  27. BIN redis/dump.rdb
  28. +444 −0 redis/redis.conf
  29. BIN redis/sample.rdb
  30. +1 −0 resources/example_pages/jump.pag
  31. +1 −0 resources/example_pages/test.pag
  32. +14 −0 resources/example_resources/hello.html
  33. +14 −0 resources/example_resources/test.html
  34. +14 −0 resources/example_templates/basic.tmp
  35. +5 −0 resources/example_templates/multi_template.tmp
  36. +13 −0 resources/public/base.css
  37. +14 −0 resources/public/hello.html
  38. BIN resources/public/previews/basic.tmp.jpg
  39. +14 −0 resources/public/test.html
  40. BIN resources/redis/sample.rdb
  41. +12 −0 resources/templates/basic.tmp
  42. +2 −0 run.sh
  43. +25 −0 src/redis/channel.clj
  44. +88 −0 src/redis/connection.clj
  45. +69 −0 src/redis/connection_pool.clj
  46. +193 −0 src/redis/core.clj
  47. +89 −0 src/redis/defcommand.clj
  48. +51 −0 src/redis/pipeline.clj
  49. +211 −0 src/redis/protocol.clj
  50. +14 −0 src/redis/vars.clj
  51. +96 −0 src/testify/.goutputstream-6BQG1V
  52. +1 −0 src/testify/.persist.clj.marks
  53. +15 −0 src/testify/admin_list.html
  54. +134 −0 src/testify/appear.clj
  55. +106 −0 src/testify/backup/core.clj
  56. +24 −0 src/testify/backup/core.clj.BASE
  57. +97 −0 src/testify/backup/core.clj.BASE.moved
  58. +97 −0 src/testify/backup/core.clj.OTHER
  59. +24 −0 src/testify/backup/core.clj.OTHER.moved
  60. +100 −0 src/testify/backup/core.clj.THIS
  61. +99 −0 src/testify/backup/core.clj.THIS.moved
  62. +104 −0 src/testify/backup/core_backup.clj
  63. +88 −0 src/testify/backup/core_debug.clj
  64. +29 −0 src/testify/backup/default_BACKUP.clj
  65. +235 −0 src/testify/backup/dirs.clj
  66. +115 −0 src/testify/backup/dirs_compiled_exception.clj
  67. +121 −0 src/testify/backup/dirs_old.clj
  68. +283 −0 src/testify/backup/fileops.clj
  69. +19 −0 src/testify/backup/fileops_old.clj
  70. +343 −0 src/testify/backup/persist.clj
  71. +101 −0 src/testify/backup/persist2.clj
  72. +319 −0 src/testify/backup/persist_REALBACKUP.clj
  73. +17 −0 src/testify/base.html
  74. +85 −0 src/testify/core.clj
  75. +52 −0 src/testify/debug.clj
  76. +32 −0 src/testify/default.clj
  77. +55 −0 src/testify/html_macros.clj
  78. +64 −0 src/testify/middleware.clj
  79. +13 −0 src/testify/pasteboard.clj
  80. +377 −0 src/testify/persist.clj
  81. +259 −0 src/testify/process.clj
  82. +62 −0 src/testify/process/dyn_backup.clj
  83. +82 −0 src/testify/process/dyn_html.clj
  84. +124 −0 src/testify/remain.clj
  85. +14 −0 src/testify/user_input.html
  86. +14 −0 src/testify/user_list.html
  87. +26 −0 src/testify/util.clj
  88. +15 −0 test/request.html
  89. +10 −0 test/testify/test/core.clj
  90. +11 −0 test/testify/test/persist.clj
  91. +12 −0 test/testreader.html
  92. +22 −0 test/testwriter.html
@@ -0,0 +1,6 @@
+*~
+lib
+*.class
+classes
+*.war
+*#
13 AUTHORS
@@ -0,0 +1,13 @@
+Authors:
+Jeyan Oorjitham <jeyoor at gmx.com>
+Jonathan Paugh <jpaugh at gmx.us>
+
+
+This work was started during studies at Oral Roberts University ( oru.edu )
+and owes a massive debt to Dr. Dave Eland. ( lxsrv7.oru.edu/~daveland )
+
+Special thanks to:
+Christophe Grand -- enlive
+Phil Hagelberg -- leiningen
+Salvatore Sanfilippo -- redis
+And many, many more
165 DESIGN
@@ -0,0 +1,165 @@
+Testify Design
+
+things E {pages,templates,resources}
+
+EVERYTHING is in redis...
+
+Templates
+ Ordinary HTML
+ CSS classes define overrides
+ text
+ override content
+ regex out da evil chars, mon
+ multitext
+ override content
+ provide multiline editing
+ regex out any evil chars?
+ image
+ ONLY allows images hosted on local site
+ override attr:src
+ video
+ ONLY allows GodTube (for now)
+ See sample script for override (id is fe10cmnu) [override whole tag?], use substitute
+ Allow user to copy/paste all html, just regex for the id?
+
+ Sample script
+ <script type="text/javascript" src="http://www.godtube.com/embed/source/fe10cmnu.js?w=400&h=255&ap=true&sl=true&title=true"></script>
+ Examples <!-- for subs, type indicator -->
+ <a id="bob" class="target" class="link"> href="blahahha" </a>
+ Input form would say Bob (type a URL):
+ <object id="bob" class="target" class="link">. .... </object>
+ Input form would say
+
+Persistence Structure?
+ Setup for each thing
+ resources (SET with names of resources)
+ pages (SET with names)
+ templates (SET with names)
+ res:name:file (ARBITRARY DATA)
+ res:name:type (? provide MIME type info to hanlder that pushes?)
+ pag:name:template (TEMPNAME)
+ pag:name:subs (SUBHASH)
+ pag:name:token (DELETION checksum)
+ tmp:name:html (flatfile?)
+
+Code
+ Persist (model)
+ CREATE
+ Given newname, create thing --
+ if sadd newname == 1
+ set thing:name:field1 resp1
+ set thing:name:field2 resp2
+ else
+ print "error! Already exists!"
+ READ
+ Lookup all things --
+ sort things asc alpha
+ Given pagename, give subs and template --
+ if sismember pages pagename == 1
+ get thing:pagename:template
+ if sismember templates platename == 1
+
+ else
+ print "error! page not found"
+ else
+ print "error! page not found"
+ Given tempname, give subs
+ UPDATE
+ Given name, newthing
+ DELETE
+ Given name, delete thing
+ if sismember things name == 1
+ srem name
+ rem thing:name:field1
+ rem thing:name:field2
+ RESTORE
+ For each existing thingname
+ Check if its fieldname is valid (if not, DELETE)
+ If valid, Check it has a matching name in momma set (if not, create it)
+
+ For each category, with fields and defaults
+ Check name for all fields
+ Plug defaults in for missing fields "restored"
+
+ Process (controller)
+ Input list creation
+ given template,
+ get list of subs,
+ return html form
+
+ Substitution
+ given page,
+ return html
+
+ From lookup all map, create partitioned list for appear
+
+ Appear (use enliven?)
+ Give resource
+ From a URL, return a resource
+ Enlive templates
+ Basic
+ Include add page
+ (Include gallery?)
+ Include backlinks
+ Generate (from a [lazy?] seq)
+ message
+ form
+ listing (with appropriate links)
+
+HTML Template
+ Basic header
+ Content
+ Ajax popup?
+
+Sitemap
+ Home (ajaxified?) list of pages
+ Add page
+ Select template
+ Generate input form
+ (Parse CSS classes from template)
+ Input's Type-name map is made from template (TODO: save this to redis?)
+ Plug this type-name map into the input form
+ BASED on type, PERFORM different transformation
+ (client & server VALDIATE)
+ Enter substitutions
+ Save substitutions to redis
+ Delete page
+ Check auth-token
+ If matches, delete page
+ Admin mode
+ Login
+ User submits auth token
+ User receives auth cookie [auth cookie saved to redis w/ expire]
+ TODO CSRF protect?
+ Regenerate next auth token
+ User does admin stuff
+ Auth cookie expires [& on server]
+ Add template
+ Generate validated input form
+ TODO CSRF token?
+ Retrieve & validate HTML
+ Save to redis
+ Add resource
+ Generate validated input form
+ TODO CSRF token?
+ Save resource to redis
+ Delete page
+ Delete template
+ Delete resource
+Bg workers
+ Save redis stuff
+ Return resource file from redis (code in appear?)
+ "purity" checks?
+ expire authentication
+ s
+Internal Datastructure Notes
+ How to call create-thing
+ (create-thing "resource" "super.txt" [':file, 'here] [':type,'text/plaintext] )
+ (get-thing "resource" "hi.txt" ":file")
+ '' hashiyf
+ (hashify-thing "page" "jeyan_test" "subs" ":key1" "val1" ":key2" "val2")
+
+Issues with persist
+ Vebosity
+ No hash/set type check support
+ Autoboxing with "(\"aoeuaoeu\")" around stuff
27 HACKING
@@ -0,0 +1,27 @@
+To watch everything that goes into the Redis server, connect to it via telnet,
+and run the monitor command.
+
+ $ telnet localhost 6379
+ > auth test
+ > monitor
+
+You'll get to see every command that hits the server.
+
+If you want to muck around with Redis yourself, you can do so easily from
+Python:
+
+ $ easy_install redis
+ $ python
+ >> from redis import Redis
+ >> rserv = Redis(hostname='localhost', port=6379)
+ >> rserv.auth('test')
+ >> rserv.keys('template*html')
+ 1
+ template:my_template:html
+ >> rserv.get('template:my_template:html')
+
+Of course, if you want to go old-school, you can run these commands from telnet.
+
+ ...
+ > keys template*html
+ > get template:my_template:html
Oops, something went wrong.

0 comments on commit 7a84e0e

Please sign in to comment.