Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/xowiki/xowiki.info	26 Jul 2006 22:56:45 -0000	1.18
+++ openacs-4/packages/xowiki/xowiki.info	31 Jul 2006 21:24:12 -0000	1.19
@@ -12,24 +12,25 @@
         <owner url="mailto:neumann@wu-wien.ac.at">Gustaf Neumann</owner>
         <summary>A more generic xotcl-based wikis example with object types
 and subtypes based on the content repository (with category support)</summary>
-        <release-date>2006-07-27</release-date>
+        <release-date>2006-07-31</release-date>
         <description format="text/html">XoWiki is a wiki implementation for OpenACS in xotcl. Instead of trying to
 implement the full set of wiki markup commands of systems like MediaWiki,
 XoWiki is based on a rich text editor and focuses more on integration
 with oacs (e.g categories, general comments, adp-includes).  XoWiki
 combines aspects of wikis (ease of page-creation) with aspects of a
 content management system (revisions, re-usable items, multiple
 languages). Furthermore, XoWiki allows to define different types of links such
-one could define book-structures (where a navigation structure could be built on the fly) or glossaries with differnt kind of word relationships (like synonyms, etc.). XoWiki supports pages in multiple languages and is localized (currently only for English and German). Currently, richtext and plaintext type entries are supported. Included support for adp-substitution in wiki pages and a file-selector. 0.13  supports page templates and uses the new generic form interface. Use of the oo layer for the content repository, reduced number of database interactions.0.18 supports text/enhanced, nice page names, import/export. Support for search (::xowiki::Page and ::xowiki::PlainPage); 0.20 support ::xowiki::Object, directory object, rss generation into syndication table, improved admin pages; 0.21: ajax-ased chat added, new attributes creator and page_title for all xowiki::Pages; 0.22 improved permission checking. 0.24 provides link-types, more includeletes (most-recently viewed, most frequently accessed pages). 0.26 provides Weblog support. 0.27: alignment with xotcl-core 0.38 (use cr_item.name instead of cr_revisions.title), change page_title to title (potential incompatibility) to rely more strictly to the CR data model (most files are effected). 0.28: tag and improved weblog support. 0.30: symbolic oo interface, nicer links, permission management
+one could define book-structures (where a navigation structure could be built on the fly) or glossaries with differnt kind of word relationships (like synonyms, etc.). XoWiki supports pages in multiple languages and is localized (currently only for English and German). Currently, richtext and plaintext type entries are supported. Included support for adp-substitution in wiki pages and a file-selector. 0.13  supports page templates and uses the new generic form interface. Use of the oo layer for the content repository, reduced number of database interactions.0.18 supports text/enhanced, nice page names, import/export. Support for search (::xowiki::Page and ::xowiki::PlainPage); 0.20 support ::xowiki::Object, directory object, rss generation into syndication table, improved admin pages; 0.21: ajax-ased chat added, new attributes creator and page_title for all xowiki::Pages; 0.22 improved permission checking. 0.24 provides link-types, more includeletes (most-recently viewed, most frequently accessed pages). 0.26 provides Weblog support. 0.27: alignment with xotcl-core 0.38 (use cr_item.name instead of cr_revisions.title), change page_title to title (potential incompatibility) to rely more strictly to the CR data model (most files are effected). 0.28: tag and improved weblog support. 0.30: symbolic oo interface, nicer links, permission management. 0.31: per package search
 
 </description>
+        <license>BSD-Style</license>
         <maturity>0</maturity>
 
         <provides url="xowiki" version="0.30"/>
         <requires url="categories" version="1.0d3"/>
         <requires url="file-storage" version="4.7d3"/>
         <requires url="general-comments" version="4.6.1"/>
-        <requires url="xotcl-core" version="0.39"/>
+        <requires url="xotcl-core" version="0.40"/>
 
         <callbacks>
             <callback type="after-install"  proc="::xowiki::sc::register_implementations"/>
Index: openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml	19 Jun 2006 00:40:04 -0000	1.8
+++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml	31 Jul 2006 21:24:12 -0000	1.9
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<message_catalog package_key="xowiki" package_version="0.27" locale="de_DE" charset="ISO-8859-1">
+<message_catalog package_key="xowiki" package_version="0.30" locale="de_DE" charset="ISO-8859-1">
 
   <msg key="back">Zur�ck</msg>
   <msg key="content">Inhalt</msg>
@@ -17,6 +17,7 @@
   <msg key="popular_tags_link">h�ufige Schlagworte</msg>
   <msg key="references_label">Verweise auf diese Seite:</msg>
   <msg key="revisions">Verlauf</msg>
+  <msg key="search">Suche</msg>
   <msg key="title">Titel</msg>
   <msg key="view">Ansehen</msg>
   <msg key="your_tags_label">Pers�nliche Schlagworte</msg>
Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml	19 Jun 2006 00:40:04 -0000	1.8
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml	31 Jul 2006 21:24:12 -0000	1.9
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<message_catalog package_key="xowiki" package_version="0.27" locale="en_US" charset="ISO-8859-1">
+<message_catalog package_key="xowiki" package_version="0.30" locale="en_US" charset="ISO-8859-1">
 
   <msg key="admin">Admin</msg>
   <msg key="back">Back</msg>
@@ -19,6 +19,7 @@
   <msg key="popular_tags_link">popular tags</msg>
   <msg key="references_label">References to this Page:</msg>
   <msg key="revisions">Revisions</msg>
+  <msg key="search">Search</msg>
   <msg key="title">Title</msg>
   <msg key="view">View</msg>
   <msg key="your_tags_label">Your Tags</msg>
Index: openacs-4/packages/xowiki/tcl/package-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/xowiki/tcl/package-procs.tcl	26 Jul 2006 22:56:46 -0000	1.1
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl	31 Jul 2006 21:24:12 -0000	1.2
@@ -249,8 +249,9 @@
   } {
     my instvar folder_id
     db_foreach get_pages "select page_id from xowiki_page, cr_revisions r, cr_items i \
-	where page_id = r.revision_id and i.item_id = r.item_id and i.parent_id = $folder_id " {
-	  search::queue -object_id $page_id -event DELETE
+	where page_id = r.revision_id and i.item_id = r.item_id and i.parent_id = $folder_id \
+	and i.live_revision = page_id" {
+	  #search::queue -object_id $page_id -event DELETE
 	  search::queue -object_id $page_id -event INSERT
 	}
   }
Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v
diff -u -r1.43 -r1.44
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl	26 Jul 2006 22:56:46 -0000	1.43
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl	31 Jul 2006 21:24:12 -0000	1.44
@@ -239,6 +239,26 @@
          "
       }
     }
+
+    if {[apm_version_names_compare $from_version_name "0.31"] == -1 &&
+	[apm_version_names_compare $to_version_name "0.31"] > -1} {
+      ns_log notice "-- upgrading to 0.31"
+      set folder_ids [list]
+      set package_ids [list]
+      db_foreach get_xowiki_packages {select * from apm_packages where package_key = 'xowiki'} {
+	set folder_id [db_string get_folder_id "select f.folder_id from cr_items c, cr_folders f \
+		where c.name = 'xowiki: $package_id' and c.item_id = f.folder_id"]
+	if {$folder_id ne ""} {
+	  db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in 
+	    (select item_id as object_id from cr_items where parent_id = :folder_id)}
+	  db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in 
+	    (select r.revision_id as object_id from cr_revisions r, cr_items i where 
+	     i.item_id = r.item_id and i.parent_id = :folder_id)}
+	  Package create ::$package_id -volatile -folder_id $folder_id -use_ns_conn false
+	  ::$package_id reindex
+	}
+      }
+    }
   }
 
   #
@@ -771,7 +791,11 @@
     append __template_variables__ "</ul>\n"
     regsub -all [template::adp_variable_regexp] $content {\1@\2;noquote@} content
     set template_code [template::adp_compile -string $content]
+    #my log "--pl before adp_eval '[template::adp_level]'"
+    set my_parse_level [template::adp_level]
     if {[catch {set template_value [template::adp_eval template_code]} errmsg]} {
+      set ::template::parse_level $my_parse_level 
+      #my log "--pl after adp_eval '[template::adp_level]' mpl=$my_parse_level"
       return "Error in Page $name: $errmsg<br>$content<p>Possible values are$__template_variables__"
     }
     return $template_value
Index: openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl	26 Jul 2006 22:56:46 -0000	1.11
+++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl	31 Jul 2006 21:24:12 -0000	1.12
@@ -13,7 +13,7 @@
 
   returns a datasource for the search package
 } {
-  ns_log notice "--datasource called with revision_id = $revision_id"
+  ns_log notice "--sc datasource called with revision_id = $revision_id"
 
   set page [::xowiki::Package instantiate_from_page -revision_id $revision_id]
   $page volatile
@@ -22,13 +22,24 @@
   set text [ad_html_text_convert -from text/html -to text/plain -- $html]
   #set text [ad_text_to_html $html]; #this could be used for entity encoded html text in rss entries
   
-  ns_log notice "-- INDEXING $revision_id -> $text"
+  #ns_log notice "--sc INDEXING $revision_id -> $text"
   #$page set unresolved_references 0
   $page instvar item_id
+  db_dml delete_old_revisions {delete from txt where object_id in \
+      (select revision_id from cr_revisions where item_id = :item_id and revision_id != :revision_id)}
+  foreach tag {h1 h2 h3 h4 h5 b strong} {
+    foreach {match words} [regexp -all -inline "<$tag>(\[^<\]+)</$tag>" $html] {
+      foreach w [split $words] {
+	if {$w eq ""} continue
+	set word($w) 1
+      }
+    }
+  }
+  ns_log notice "--sc keywords $revision_id -> [array names word]"
 
   return [list object_id $revision_id title [$page title] \
-	      content $text keywords {} \
-	      storage_type text mime text/plain \
+	      content $html keywords [array names word] \
+	      storage_type text mime text/html \
 	      syndication [list \
 			link [::xowiki::Page pretty_link -fully_qualified 1 [$page set name]] \
 			description $text \
Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl	26 Jul 2006 22:56:46 -0000	1.1
+++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl	31 Jul 2006 21:24:12 -0000	1.2
@@ -122,7 +122,7 @@
 	set page [self]
 	$package_id return_page -adp $template_file -variables {
 	  references name title item_id page context header_stuff return_url
-	  content references lang_links 
+	  content references lang_links package_id
 	  rev_link edit_link delete_link new_link admin_link index_link 
 	  tags no_tags tags_with_links save_tag_link popular_tags_link 
 	  gc_link gc_comments 
Index: openacs-4/packages/xowiki/www/view-default.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-default.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/xowiki/www/view-default.adp	26 Jul 2006 22:56:46 -0000	1.1
+++ openacs-4/packages/xowiki/www/view-default.adp	31 Jul 2006 21:24:13 -0000	1.2
@@ -32,7 +32,11 @@
   <if @new_link@ not nil><a href="@new_link@" accesskey='n'>#xowiki.new#</a> &middot;</if>
   <if @delete_link@ not nil><a href="@delete_link@" accesskey='d'>#xowiki.delete#</a> &middot;</if>
   <if @admin_link@ not nil><a href="@admin_link@" accesskey='a'>#xowiki.admin#</a> &middot;</if>
+  <a href='#' onclick='document.getElementById("do_search").style.display="inline";document.getElementById("do_search_q").focus(); return false;'>#xowiki.search#</a> &middot;
   <if @index_link@ not nil><a href="@index_link@" accesskey='i'>#xowiki.index#</a></if>
+<span id='do_search' style='display: none'> 
+  <FORM action='/search/search'><INPUT  id='do_search_q' name='q' type='text'><INPUT type="hidden" name="search_package_id" value="@package_id@" /></FORM> 
+   </span>
 </div>
 
 @content;noquote@
Fisheye: Tag 1.11 refers to a dead (removed) revision in file `openacs-4/packages/xowiki/www/pages/index.vuh'.
Fisheye: No comparison available.  Pass `N' to diff?