/[suikacvs]/webroot/swe/lib/suikawiki/main.pl
Suika

Diff of /webroot/swe/lib/suikawiki/main.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.39 by wakaba, Mon Sep 14 02:41:01 2009 UTC revision 1.40 by wakaba, Mon Sep 14 03:12:03 2009 UTC
# Line 45  $names_lock->{file_name} = $db_global_lo Line 45  $names_lock->{file_name} = $db_global_lo
45  $names_lock->lock_type ('Names');  $names_lock->lock_type ('Names');
46      ## NOTE: This lock MUST be used when $sw3pages or $name_prop_db is updated.      ## NOTE: This lock MUST be used when $sw3pages or $name_prop_db is updated.
47    
48    # XXX $db->id_prop
49  require SWE::DB::IDProps;  require SWE::DB::IDProps;
50  my $id_prop_db = SWE::DB::IDProps->new;  my $id_prop_db = SWE::DB::IDProps->new;
51  $id_prop_db->{root_directory_name} = $db_id_dir_name;  $id_prop_db->{root_directory_name} = $db_id_dir_name;
# Line 141  if ($path[0] eq 'n' and @path == 2) { Line 142  if ($path[0] eq 'n' and @path == 2) {
142        exit;        exit;
143      } elsif ($format eq 'xml' and defined $id) {      } elsif ($format eq 'xml' and defined $id) {
144        ## XXX        ## XXX
145          $docobj->{content_db} = $content_db; ## XXX
146        $docobj->{id_locks} = $id_locks;        $docobj->{id_locks} = $id_locks;
147        $docobj->{id_prop_db} = $id_prop_db;        $docobj->{id_prop_db} = $id_prop_db;
148        $docobj->{cache_prop_db} = $cache_prop_db;        $docobj->{cache_prop_db} = $cache_prop_db;
# Line 166  if ($path[0] eq 'n' and @path == 2) { Line 168  if ($path[0] eq 'n' and @path == 2) {
168          $docobj->{id_locks} = $id_locks;          $docobj->{id_locks} = $id_locks;
169          $docobj->{id_prop_db} = $id_prop_db;          $docobj->{id_prop_db} = $id_prop_db;
170          $docobj->{cache_prop_db} = $cache_prop_db;          $docobj->{cache_prop_db} = $cache_prop_db;
171            $docobj->{content_db} = $content_db; ## XXX
172          $docobj->{swml_to_xml} = \&get_xml_data;          $docobj->{swml_to_xml} = \&get_xml_data;
173          $docobj->{name} = $name;          $docobj->{name} = $name;
174          $docobj->{get_page_url} = \&get_page_url;          $docobj->{get_page_url} = \&get_page_url;
# Line 190  if ($path[0] eq 'n' and @path == 2) { Line 193  if ($path[0] eq 'n' and @path == 2) {
193        $html_doc->inner_html ('<!DOCTYPE HTML><title></title>');        $html_doc->inner_html ('<!DOCTYPE HTML><title></title>');
194                
195        $html_doc->get_elements_by_tag_name ('title')->[0]->text_content ($name);        $html_doc->get_elements_by_tag_name ('title')->[0]->text_content ($name);
196        my @link = ({rel => 'alternate',        
197                     type => $docobj->to_text_media_type,        my @link;
198                     href => get_page_url ($name, undef, $id) . '?format=text'},        
199                    {rel => 'alternate',        my $tmt = $docobj->to_text_media_type;
200                     type => $docobj->to_xml_media_type,        if (defined $tmt) {
201                     href => get_page_url ($name, undef, $id) . '?format=xml'},          push @link, {rel => 'alternate', type => $tmt,
202                    {rel => 'archives',                       href => get_page_url ($name, undef, $id) . '?format=text'};
203          }
204    
205          my $xmt = $docobj->to_xml_media_type;
206          if (defined $xmt) {
207            push @link, {rel => 'alternate', type => $xmt,
208                         href => get_page_url ($name, undef, $id) . '?format=xml'};
209          }
210          
211          push @link, {rel => 'archives',
212                     href => get_page_url ($name, undef, undef) . ';history',                     href => get_page_url ($name, undef, undef) . ';history',
213                     title => 'History of the page name'});                     title => 'History of the page name'};
214        if (defined $id) {        if (defined $id) {
215          push @link, {rel => 'archives',          push @link, {rel => 'archives',
216                       href => '../i/' . $id . ';history',                       href => '../i/' . $id . ';history',

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24