Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3bb3a4a5

Von Sven Schöling vor etwa 8 Jahren hinzugefügt

  • ID 3bb3a4a56b0be39fd60f011137ffbadd9dba3fd7
  • Vorgänger 8d06fb89
  • Nachfolger 8b374ce4

GDPDU: Weitere fixes

Unterschiede anzeigen:

SL/GDPDU.pm
1 1
package SL::GDPDU;
2 2

  
3 3
# TODO:
4
# translations
5 4
# optional: background jobable
6 5

  
7 6
use strict;
......
64 63

  
65 64
# callbacks that produce the xml spec for these column types
66 65
my %column_types = (
67
  'Rose::DB::Object::Metadata::Column::Integer'   => sub { $_[0]->tag('Numeric', sub { $_[0]->tag('Accuracy', 0) }) },
68
  'Rose::DB::Object::Metadata::Column::BigInt'    => sub { $_[0]->tag('Numeric', sub { $_[0]->tag('Accuracy', 0) }) },
66
  'Rose::DB::Object::Metadata::Column::Integer'   => sub { $_[0]->tag('Numeric') },  # see Caveats for integer issues
67
  'Rose::DB::Object::Metadata::Column::BigInt'    => sub { $_[0]->tag('Numeric') },  # see Caveats for integer issues
69 68
  'Rose::DB::Object::Metadata::Column::Text'      => sub { $_[0]->tag('AlphaNumeric') },
70 69
  'Rose::DB::Object::Metadata::Column::Varchar'   => sub { $_[0]->tag('AlphaNumeric') },
71 70
  'Rose::DB::Object::Metadata::Column::Character' => sub { $_[0]->tag('AlphaNumeric') },
......
181 180
    ->tag('DecimalSymbol', '.')
182 181
    ->tag('DigitGroupingSymbol', '|')     # see CAVEATS in documentation
183 182
    ->tag('VariableLength', sub { $self
184
      ->tag('ColumnDelimiter', ',')
185
      ->tag('RecordDelimiter', '
')
183
      ->tag('ColumnDelimiter', ',')       # see CAVEATS for missing RecordDelimiter
186 184
      ->tag('TextEncapsulator', '"')
187 185
      ->columns($table)
188 186
      ->foreign_keys($table)
......
259 257
sub do_csv_export {
260 258
  my ($self, $table) = @_;
261 259

  
262
  my $csv = Text::CSV_XS->new({ binary => 1, eol => "\n", sep_char => ",", quote_char => '"' });
260
  my $csv = Text::CSV_XS->new({ binary => 1, eol => "\r\n", sep_char => ",", quote_char => '"' });
263 261

  
264 262
  my ($fh, $filename) = File::Temp::tempfile();
265 263
  binmode($fh, ':utf8');
......
453 451

  
454 452
=item *
455 453

  
456
Number pasing seems to be fragile. Official docs state that behaviour for too
457
low C<Accuracy> settings is undefined.
454
Number parsing seems to be fragile. Official docs state that behaviour for too
455
low C<Accuracy> settings is undefined. Accuracy of 0 is not taken to mean
456
Integer but instead generates a warning for redudancy.
458 457

  
459 458
There is no dedicated integer type.
460 459

  
......
492 491

  
493 492
L<http://www.gdpdu-portal.com/forum/index.php?mode=thread&id=1392>
494 493

  
494
=item *
495

  
496
It is not possible to define a C<RecordDelimiter> with XML entities. &#x0A;
497
generates the error message:
498

  
499
  C<RecordDelimiter>-Wert (&#x0A;) sollte immer aus ein oder zwei Zeichen
500
  bestehen.
501

  
502
Instead we just use the implicit default RecordDelimiter CRLF.
503

  
504
=item *
505

  
506
Not confirmed yet:
507

  
508
Foreign keys seem only to work with previously defined tables (which would be
509
utterly insane).
510

  
495 511
=back
496 512

  
497 513
=head1 AUTHOR

Auch abrufbar als: Unified diff