/[cvs]/nfo/perl/libs/Data/README.html
ViewVC logotype

Diff of /nfo/perl/libs/Data/README.html

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

revision 1.3 by joko, Sat Nov 9 01:05:20 2002 UTC revision 1.4 by joko, Fri Nov 29 04:48:23 2002 UTC
# Line 12  Line 12 
12  <UL>  <UL>
13    
14          <LI><A HREF="#name">NAME</A></LI>          <LI><A HREF="#name">NAME</A></LI>
15            <LI><A HREF="#aims">AIMS</A></LI>
16          <LI><A HREF="#synopsis">SYNOPSIS</A></LI>          <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
17          <UL>          <UL>
18    
19                    <LI><A HREF="#basic access">BASIC ACCESS</A></LI>
20                    <LI><A HREF="#advanced access">ADVANCED ACCESS</A></LI>
21                    <LI><A HREF="#synchronization">SYNCHRONIZATION</A></LI>
22                  <LI><A HREF="#note">NOTE</A></LI>                  <LI><A HREF="#note">NOTE</A></LI>
23          </UL>          </UL>
24    
# Line 26  Line 30 
30          <LI><A HREF="#todo">TODO</A></LI>          <LI><A HREF="#todo">TODO</A></LI>
31          <UL>          <UL>
32    
33                  <LI><A HREF="#handle the following errors/cases:">Handle the following errors/cases:</A></LI>                  <LI><A HREF="#bugs">BUGS</A></LI>
34                    <LI><A HREF="#features">FEATURES</A></LI>
35                  <UL>                  <UL>
36    
37                          <LI><A HREF="#dbierror [tangram]: dbd::mysql::st execute failed: unknown column 't1.requestdump' in 'field list'">``DBI-Error [Tangram]: DBD::mysql::st execute failed: Unknown column 't1.requestdump' in 'field list'''</A></LI>                          <LI><A HREF="#links / references">LINKS / REFERENCES</A></LI>
                         <LI><A HREF="#compare schema (structure diff) with database ...">Compare schema (structure diff) with database ...</A></LI>  
                 </UL>  
   
                 <LI><A HREF="#introduce some features:">Introduce some features:</A></LI>  
                 <UL>  
   
                         <LI><A HREF="#links:">Links:</A></LI>  
38                  </UL>                  </UL>
39    
40          </UL>          </UL>
# Line 50  Line 48 
48  <P>Data::Storage - Interface for accessing various Storage implementations for Perl in an independent way</P>  <P>Data::Storage - Interface for accessing various Storage implementations for Perl in an independent way</P>
49  <P>  <P>
50  <HR>  <HR>
51  <H1><A NAME="synopsis">SYNOPSIS</A></H1>  <H1><A NAME="aims">AIMS</A></H1>
52  <PRE>  <PRE>
53    ... the basic way:</PRE>    - should encapsulate Tangram, DBI, DBD::CSV and LWP:: to access them in an unordinary (more convenient) way ;)
54      - introduce a generic layered structure, refactor *SUBLAYER*-stuff, make (e.g.) this possible:
55        Perl Data::Storage[DBD::CSV]  -&gt;  Perl LWP::  -&gt;  Internet HTTP/FTP/*  -&gt;  Host Daemon  -&gt;  csv-file
56      - provide generic synchronization mechanisms across arbitrary/multiple storages based on ident/checksum
57        maybe it's possible to have schema-, structural- and semantical modifications synchronized???</PRE>
58    <P>
59    <HR>
60    <H1><A NAME="synopsis">SYNOPSIS</A></H1>
61    <P>
62    <H2><A NAME="basic access">BASIC ACCESS</A></H2>
63    <P>
64    <H2><A NAME="advanced access">ADVANCED ACCESS</A></H2>
65  <PRE>  <PRE>
66    ... via inheritance:    ... via inheritance:
67  </PRE>  </PRE>
# Line 72  Line 81 
81      );      );
82      $self-&gt;{storage}-&gt;insert($proxyObj);</PRE>      $self-&gt;{storage}-&gt;insert($proxyObj);</PRE>
83  <P>  <P>
84    <H2><A NAME="synchronization">SYNCHRONIZATION</A></H2>
85    <PRE>
86      my $nodemapping = {
87        'LangText' =&gt; 'langtexts.csv',
88        'Currency' =&gt; 'currencies.csv',
89        'Country'  =&gt; 'countries.csv',
90      };</PRE>
91    <PRE>
92      my $propmapping = {
93        'LangText' =&gt; [
94          [ 'source:lcountrykey'  =&gt;  'target:country' ],
95          [ 'source:lkey'         =&gt;  'target:key' ],
96          [ 'source:lvalue'       =&gt;  'target:text' ],
97        ],
98        'Currency' =&gt; [
99          [ 'source:ckey'         =&gt;  'target:key' ],
100          [ 'source:cname'        =&gt;  'target:text' ],
101        ],
102        'Country' =&gt; [
103          [ 'source:ckey'         =&gt;  'target:key' ],
104          [ 'source:cname'        =&gt;  'target:text' ],
105        ],
106      };</PRE>
107    <PRE>
108      sub syncResource {</PRE>
109    <PRE>
110        my $self = shift;
111        my $node_source = shift;
112        my $mode = shift;
113        my $opts = shift;
114    </PRE>
115    <PRE>
116    
117        $mode ||= '';
118        $opts-&gt;{erase} ||= 0;</PRE>
119    <PRE>
120    
121        $logger-&gt;info( __PACKAGE__ . &quot;-&gt;syncResource( node_source $node_source mode $mode erase $opts-&gt;{erase} )&quot;);</PRE>
122    <PRE>
123    
124        # resolve metadata for syncing requested resource
125        my $node_target = $nodemapping-&gt;{$node_source};
126        my $mapping = $propmapping-&gt;{$node_source};</PRE>
127    <PRE>
128    
129        if (!$node_target || !$mapping) {
130          # loggger.... &quot;no target, sorry!&quot;
131          print &quot;error while resolving resource metadata&quot;, &quot;\n&quot;;
132          return;
133        }</PRE>
134    <PRE>
135    
136        if ($opts-&gt;{erase}) {
137          $self-&gt;_erase_all($node_source);
138        }</PRE>
139    <PRE>
140    
141        # create new sync object
142        my $sync = Data::Transfer::Sync-&gt;new(
143          storages =&gt; {
144            L =&gt; $self-&gt;{bizWorks}-&gt;{backend},
145            R =&gt; $self-&gt;{bizWorks}-&gt;{resources},
146          },
147          id_authorities        =&gt;  [qw( L ) ],
148          checksum_authorities  =&gt;  [qw( L ) ],
149          write_protected       =&gt;  [qw( R ) ],
150          verbose               =&gt;  1,
151        );</PRE>
152    <PRE>
153    
154        # sync
155        # todo: filter!?
156        $sync-&gt;syncNodes( {
157          direction       =&gt;  $mode,                 # | +PUSH | +PULL | -FULL | +IMPORT | -EXPORT
158          method          =&gt;  'checksum',            # | -timestamp | -manual
159          source          =&gt;  &quot;L:$node_source&quot;,
160          source_ident    =&gt;  'storage_method:id',
161          source_exclude  =&gt;  [qw( id cs )],
162          target          =&gt;  &quot;R:$node_target&quot;,
163          target_ident    =&gt;  'property:oid',
164          mapping         =&gt;  $mapping,
165        } );</PRE>
166    <PRE>
167      }</PRE>
168    <P>
169  <H2><A NAME="note">NOTE</A></H2>  <H2><A NAME="note">NOTE</A></H2>
170  <P>This module heavily relies on DBI and Tangram, but adds a lot of additional bugs and quirks.  <P>This module heavily relies on DBI and Tangram, but adds a lot of additional bugs and quirks.
171  Please look at their documentation and/or this code for additional information.</P>  Please look at their documentation and/or this code for additional information.</P>
172  <P>  <P>
173  <HR>  <HR>
174  <H1><A NAME="requirements">REQUIREMENTS</A></H1>  <H1><A NAME="requirements">REQUIREMENTS</A></H1>
175  <P>For full functionality:  <PRE>
176    DBI              from CPAN    For full functionality:
177    Tangram          from CPAN      DBI              from CPAN
178    Class::Tangram   from CPAN      DBD::mysql       from CPAN
179    MySQL::Diff      from <A HREF="http://adamspiers.org/computing/mysqldiff/">http://adamspiers.org/computing/mysqldiff/</A>      Tangram 2.04     from CPAN         (hmmm, 2.04 won't do in some cases)
180    ... and all their dependencies</P>      Tangram 2.05     from <A HREF="http://">http://</A>...   (2.05 seems okay but there are also additional patches from our side)
181        Class::Tangram   from CPAN
182        DBD::CSV         from CPAN
183        MySQL::Diff      from <A HREF="http://adamspiers.org/computing/mysqldiff/">http://adamspiers.org/computing/mysqldiff/</A>
184        ... and all their dependencies</PRE>
185  <P>  <P>
186  <HR>  <HR>
187  <H1><A NAME="description">DESCRIPTION</A></H1>  <H1><A NAME="description">DESCRIPTION</A></H1>
188  <P>Data::Storage is module for a accessing various ``data structures'' stored inside  <P>Data::Storage is a module for accessing various ``data structures'' stored inside
189  various ``data containers''. It sits on top of DBI and/or Tangram.</P>  various ``data containers''. It sits on top of DBI and/or Tangram.</P>
190  <P>  <P>
191  <HR>  <HR>
# Line 100  License or the Artistic License, as spec Line 198  License or the Artistic License, as spec
198  <HR>  <HR>
199  <H1><A NAME="acknowledgements">ACKNOWLEDGEMENTS</A></H1>  <H1><A NAME="acknowledgements">ACKNOWLEDGEMENTS</A></H1>
200  <P>Larry Wall for Perl, Tim Bunce for DBI, Jean-Louis Leroy for Tangram and Set::Object,  <P>Larry Wall for Perl, Tim Bunce for DBI, Jean-Louis Leroy for Tangram and Set::Object,
201  Sam Vilain for Class::Tangram, Adam Spiers for MySQL::Diff and all contributors.</P>  Sam Vilain for Class::Tangram, Jochen Wiedmann and Jeff Zucker for DBD::CSV and related,
202    Adam Spiers for MySQL::Diff and all contributors.</P>
203  <P>  <P>
204  <HR>  <HR>
205  <H1><A NAME="support / warranty">SUPPORT / WARRANTY</A></H1>  <H1><A NAME="support / warranty">SUPPORT / WARRANTY</A></H1>
# Line 109  Sam Vilain for Class::Tangram, Adam Spie Line 208  Sam Vilain for Class::Tangram, Adam Spie
208  <HR>  <HR>
209  <H1><A NAME="todo">TODO</A></H1>  <H1><A NAME="todo">TODO</A></H1>
210  <P>  <P>
211  <H2><A NAME="handle the following errors/cases:">Handle the following errors/cases:</A></H2>  <H2><A NAME="bugs">BUGS</A></H2>
212  <P>  <P>``DBI-Error [Tangram]: DBD::mysql::st execute failed: Unknown column 't1.requestdump' in 'field list'''</P>
 <H3><A NAME="dbierror [tangram]: dbd::mysql::st execute failed: unknown column 't1.requestdump' in 'field list'">``DBI-Error [Tangram]: DBD::mysql::st execute failed: Unknown column 't1.requestdump' in 'field list'''</A></H3>  
213  <PRE>  <PRE>
214      ... occours when operating on object-attributes not introduced yet:    ... occours when operating on object-attributes not introduced yet:
215      this should be detected and appended/replaced through:    this should be detected and appended/replaced through:
216      &quot;Schema-Error detected, maybe (just) an inconsistency.    &quot;Schema-Error detected, maybe (just) an inconsistency.
217      Please check if your declaration in schema-module &quot;a&quot; matches structure in database &quot;b&quot; or try to run&quot;    Please check if your declaration in schema-module &quot;a&quot; matches structure in database &quot;b&quot; or try to run&quot;
218      db_setup.pl --dbkey=import --action=deploy</PRE>    db_setup.pl --dbkey=import --action=deploy</PRE>
219  <P>  <P>Compare schema (structure diff) with database ...</P>
 <H3><A NAME="compare schema (structure diff) with database ...">Compare schema (structure diff) with database ...</A></H3>  
220  <PRE>  <PRE>
221    ... when issuing &quot;db_setup.pl --dbkey=import --action=deploy&quot;    ... when issuing &quot;db_setup.pl --dbkey=import --action=deploy&quot;
222    on a database with an already deployed schema, use an additional &quot;--update&quot; then    on a database with an already deployed schema, use an additional &quot;--update&quot; then
# Line 150  Sam Vilain for Class::Tangram, Adam Spie Line 247  Sam Vilain for Class::Tangram, Adam Spie
247    As we can see, creations of Classes and new Class variables is handled    As we can see, creations of Classes and new Class variables is handled
248    automatically and this is believed to be the most common case under normal circumstances.</PRE>    automatically and this is believed to be the most common case under normal circumstances.</PRE>
249  <P>  <P>
250  <H2><A NAME="introduce some features:">Introduce some features:</A></H2>  <H2><A NAME="features">FEATURES</A></H2>
251  <PRE>  <PRE>
252    - Get this stuff together with UML (Unified Modeling Language) and/or standards from ODMG.    - Get this stuff together with UML (Unified Modeling Language) and/or standards from ODMG.
253    - Make it possible to load/save schemas in XMI (XML Metadata Interchange),    - Make it possible to load/save schemas in XMI (XML Metadata Interchange),
# Line 158  Sam Vilain for Class::Tangram, Adam Spie Line 255  Sam Vilain for Class::Tangram, Adam Spie
255      Integrate/bundle this with a web-/html-based UML modeling tool or      Integrate/bundle this with a web-/html-based UML modeling tool or
256      some other interesting stuff like the &quot;Co-operative UML Editor&quot; from Uni Darmstadt. (web-/java-based)      some other interesting stuff like the &quot;Co-operative UML Editor&quot; from Uni Darmstadt. (web-/java-based)
257    - Enable Round Trip Engineering. Keep code and diagrams in sync. Don't annoy/bother the programmers.    - Enable Round Trip Engineering. Keep code and diagrams in sync. Don't annoy/bother the programmers.
258    - Add some more handlers:    - Add support for some more handlers/locators to be able to
259      - look at DBD::CSV, Text::CSV, XML::CSV, XML::Excel       access the following standards/protocols/interfaces/programs/apis transparently:
260    - Add some more locations/locators:      +  DBD::CSV (via Data::Storage::Handler::DBI)
261      - PerlDAV: <A HREF="http://www.webdav.org/perldav/">http://www.webdav.org/perldav/</A>     (-) Text::CSV, XML::CSV, XML::Excel
262    - Move to t3, use InCASE</PRE>      -  MAPI
263        -  LDAP
264        -  DAV (look at PerlDAV: <A HREF="http://www.webdav.org/perldav/">http://www.webdav.org/perldav/</A>)
265        -  Mbox (use formail for seperating/splitting entries/nodes)
266        -  Cyrus (cyrdeliver - what about cyrretrieve (export)???)
267        -  use File::DiffTree, use File::Compare
268        -  Hibernate
269        -  &quot;Win32::UserAccountDb&quot;
270        -  &quot;*nix::UserAccountDb&quot;
271        -  .wab - files (Windows Address Book)
272        -  .pst - files (Outlook Post Storage?)
273        -  XML (e.g. via XML::Simple?)
274      - Move to t3, look at InCASE</PRE>
275  <P>  <P>
276  <H3><A NAME="links:">Links:</A></H3>  <H3><A NAME="links / references">LINKS / REFERENCES</A></H3>
277  <PRE>  <PRE>
278    Specs:    Specs:
279      UML 1.3 Spec: <A HREF="http://cgi.omg.org/cgi-bin/doc?ad/99-06-08.pdf">http://cgi.omg.org/cgi-bin/doc?ad/99-06-08.pdf</A>      UML 1.3 Spec: <A HREF="http://cgi.omg.org/cgi-bin/doc?ad/99-06-08.pdf">http://cgi.omg.org/cgi-bin/doc?ad/99-06-08.pdf</A>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed