[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

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

revision 1.569, Thu Feb 8 18:35:56 2007 UTC revision 1.570, Fri Feb 9 22:51:33 2007 UTC
# Line 219  Line 219 
219          $self->{_ca} = RemoteCustomAttributes->new($FIG_Config::attrURL);          $self->{_ca} = RemoteCustomAttributes->new($FIG_Config::attrURL);
220      } elsif ($FIG_Config::attrDbName) {      } elsif ($FIG_Config::attrDbName) {
221          Trace("Local attribute database $FIG_Config::attrDbName chosen.") if T(3);          Trace("Local attribute database $FIG_Config::attrDbName chosen.") if T(3);
222          $self->{_ca} = CustomAttributes->new(user => scalar(getpwent()));          my $user = ($FIG_Config::arch eq 'win' ? 'self' : scalar(getpwent()));
223            $self->{_ca} = CustomAttributes->new(user => $user);
224      }      }
225    
226      #      #
# Line 9915  Line 9916 
9916    
9917  A method, read_attribute_transaction_log, is provided to read the transaction_logs and implement the changes therein. In each of the methods add_attribute, delete_attribute, and change_attribute there is an optional boolean that can be set to prevent writing of the transaction_log. The read_attribute_transaction_log reads the log and then adds/changes/deletes the records as appropriate. Without this boolean there is a circular reference.  A method, read_attribute_transaction_log, is provided to read the transaction_logs and implement the changes therein. In each of the methods add_attribute, delete_attribute, and change_attribute there is an optional boolean that can be set to prevent writing of the transaction_log. The read_attribute_transaction_log reads the log and then adds/changes/deletes the records as appropriate. Without this boolean there is a circular reference.
9918    
 =head3 get_attributes  
   
9919  Get attributes requires one of four keys:  Get attributes requires one of four keys:
9920  fid (which can be genome, peg, rna, or other id, or a reference to a list of ids),  fid (which can be genome, peg, rna, or other id, or a reference to a list of ids),
9921  key,  key,
9922  value,  value,
9923  url  url
9924    
   
9925  It will find any attribute that has the characteristics that you request, and if any values match it will return a four-ple of:  It will find any attribute that has the characteristics that you request, and if any values match it will return a four-ple of:
9926  [fid, key, value, url]  [fid, key, value, url]
9927    
# Line 10197  Line 10195 
10195      }      }
10196  }  }
10197    
10198    =head3 parse_oid
10199    
10200    C<< my ($type, $id) = FIG::parse_oid($idValue); >>
10201    
10202    Convert an attribute object ID to an object type and an ID applicable to that type.
10203    This information can be used to convert an ID string obtained from the L</get_attributes>
10204    method to an object name and ID suitable for plugging into the C<GetEntity> method
10205    of an B<ERDB> database.
10206    
10207    =over 4
10208    
10209    =item idValue
10210    
10211    ID string from the attribute database.
10212    
10213    =item RETURN
10214    
10215    Returns a two-element list consisting of the object type and its individual ID.
10216    
10217    =back
10218    
10219    =cut
10220    
10221    sub parse_oid {
10222        my ($idValue) = @_;
10223        my @retVal = CustomAttributes::ParseID($idValue);
10224        return @retVal;
10225    }
10226    
10227    =head3 form_oid
10228    
10229    C<< my $idValue = FIG::form_oid($type, $id); >>
10230    
10231    Convert an object type and ID into an ID string for the attribute database.
10232    
10233    =over 4
10234    
10235    =item type
10236    
10237    Object type. This should usually correspond to an entity name in a database. It can
10238    only contain letters. This means no digits, spaces, or even underscores.
10239    
10240    =item id
10241    
10242    Individual object ID.
10243    
10244    =item RETURN
10245    
10246    Returns the string used to represent the object in the attribute database.
10247    
10248    =back
10249    
10250    =cut
10251    
10252    sub form_oid {
10253        # Get the parameters.
10254        my ($type, $id) = @_;
10255        my $retVal = CustomAttributes::FormID($type, $id);
10256        return $retVal;
10257    }
10258    
10259  =head3 delete_matching_attributes  =head3 delete_matching_attributes
10260    
10261  C<< my @attributeList = $fig->delete_matching_attributes($objectID, $key, @values); >>  C<< my @attributeList = $fig->delete_matching_attributes($objectID, $key, @values); >>
# Line 10600  Line 10659 
10659   }   }
10660  }  }
10661    
 =head2 Methods to get keys and values  
   
 I have added several methods to just get keys and values. Each of the methods has "distinct" in the name when appopriate. This is both to distinguish these methods from the older methods with similar names and to act as a reminder that the methods just return distinct values.  
   
10662  =head3 get_genome_keys  =head3 get_genome_keys
10663    
10664  Get all the keys that apply to genomes and only genomes.  Get all the keys that apply to genomes and only genomes.

Legend:
Removed from v.1.569  
changed lines
  Added in v.1.570

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3