IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5338


Ignore:
Timestamp:
Oct 14, 2005, 2:03:47 PM (21 years ago)
Author:
jhoblitt
Message:

update new2newed()
add PS::IPP::MetaDB::Image::NotifyReceived
add class field to PS::IPP::MetaDB::Image::Newed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-MetaDB/lib/PS/IPP/MetaDB.pm

    r5337 r5338  
    11# Copyright (C) 2005  Joshua Hoblitt
    22#
    3 # $Id: MetaDB.pm,v 1.11 2005-10-14 23:47:46 jhoblitt Exp $
     3# $Id: MetaDB.pm,v 1.12 2005-10-15 00:03:47 jhoblitt Exp $
    44
    55package PS::IPP::MetaDB;
     
    118118    my %p = @_;
    119119
    120     $class->search(
     120    my $new = PS::IPP::MetaDB::Image::New->search(
    121121        exp_id      => $p{exp_id},
     122        class       => $p{class},
    122123        class_id    => $p{class_id},
    123     )->delete_all;
    124 
    125     $class->create({
    126         exp_id      => $p{exp_id},
    127         class_id    => $p{class_id},
     124    );
     125
     126    PS::IPP::MetaDB::Image::NotifyReceived->create({
     127        file_id => $new->file_id,
     128    });
     129
     130    PS::IPP::MetaDB::Image::Newed->create({
     131        exp_id      => $new->exp_id,
     132        class       => $new->class,
     133        class_id    => $new->class_id,
    128134        url         => $p{url},
    129135    });
     136
     137    $new->delete;
    130138}
    131139
     
    222230}
    223231
     232=item * notify_received
     233
     234This is a queue of pending file received notifications that need to be send to
     235OTIS.  Once a notification is successfully sent to OTIS the entry is removed
     236from this queue.
     237
     238=over 4
     239
     240=item * file_id
     241
     242OTIS's ID string for the file, i.e. it's filename.
     243
     244=back
     245
     246=cut
     247
     248package PS::IPP::MetaDB::Image::NotifyReceived;
     249
     250use base qw( PS::IPP::MetaDB );
     251
     252__PACKAGE__->register_init(\&init);
     253
     254sub init
     255{
     256    __PACKAGE__->table("notify_received");
     257    __PACKAGE__->create_table(q{
     258        file_id      BIGINT          NOT NULL PRIMARY KEY,
     259    });
     260    __PACKAGE__->set_up_table;
     261}
     262
    224263=item * metadata_new
    225264
     
    483522exposure ID #, keyed on the C<exposure_component> table.
    484523
     524=item * class
     525
     526The 'type' of data this is.
     527
    485528=item * class_id
    486529
     
    506549    __PACKAGE__->create_table(q{
    507550        exp_id      BIGINT          NOT NULL PRIMARY KEY,
     551        class       VARCHAR(256)    NOT NULL,
    508552        class_id    BIGINT          NOT NULL,
    509553        url         VARCHAR(255)    NOT NULL
     
    512556}
    513557
     558
    514559=item * prepared
    515560
Note: See TracChangeset for help on using the changeset viewer.