Difference between revisions of "Building a DataSet"

From EPrints Documentation
Jump to: navigation, search
Line 1: Line 1:
 
==Modify EPrint Status Field==
 
==Modify EPrint Status Field==
 
We must start my modifying the eprint_status field so that it can have the new value dark_archive.
 
We must start my modifying the eprint_status field so that it can have the new value dark_archive.
<code>
+
<pre>
 
push( @{$c->{fields}->{eprint}}, {
 
push( @{$c->{fields}->{eprint}}, {
 
name=>"eprint_status", type=>"set", required=>1,
 
name=>"eprint_status", type=>"set", required=>1,
Line 7: Line 7:
 
replace_core=>1 #this flag must be used with EXTREME caution, it makes is very easy to break things
 
replace_core=>1 #this flag must be used with EXTREME caution, it makes is very easy to break things
 
});
 
});
</code>
+
</pre>
  
  
 
==Add the dark archive dataset definition==
 
==Add the dark archive dataset definition==
  
<code>
+
<pre>
 
         dark_archive => {
 
         dark_archive => {
 
                 sqlname => "eprint",
 
                 sqlname => "eprint",
Line 24: Line 24:
 
                 datestamp => "lastmod",
 
                 datestamp => "lastmod",
 
         },
 
         },
</code>
+
</pre>
  
 
  epadmin update_database_structure <repoid>
 
  epadmin update_database_structure <repoid>

Revision as of 14:42, 29 March 2011

Modify EPrint Status Field

We must start my modifying the eprint_status field so that it can have the new value dark_archive.

push( @{$c->{fields}->{eprint}}, {
name=>"eprint_status", type=>"set", required=>1,
options=>[qw/ inbox buffer archive deletion dark_archive /] },
replace_core=>1 #this flag must be used with EXTREME caution, it makes is very easy to break things
});


Add the dark archive dataset definition

        dark_archive => {
                sqlname => "eprint",
                virtual => 1,
                class => "EPrints::DataObj::EPrint",
                confid => "eprint",
                import => 1,
                index => 1,
                filters => [ { meta_fields => [ 'eprint_status' ], value => 'dark_archive', describe=>0 } ],
                dataset_id_field => "eprint_status",
                datestamp => "lastmod",
        },
epadmin update_database_structure <repoid>