home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-2.iso / Developer / webobjects / extensions / win-nt / WOPerl-lite-10e7.exe / Examples / WOPerl / DodgeLite / Application.pl < prev    next >
Encoding:
Perl Script  |  1996-08-09  |  1.9 KB  |  79 lines

  1. # $Id: Application.pl,v 1.1 1996/07/26 05:15:15 pedja Exp $
  2.  
  3. # Application.pl: converted from the original Application.wos
  4. # The original file contains the following notice:
  5. #
  6. # You may freely copy, distribute, and reuse the code in this example.
  7. # NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  8. # fitness for any particular use.
  9. # This example consistes of beta, untested code. Use it at your own risk.
  10. # Written by Jean-Marie Hullot, CTO, NeXT Software Inc
  11.  
  12. package WO::DodgeLite;
  13. use WOPerl;
  14.  
  15. @IVARS=qw(dodgeData);
  16. @SESSION=qw(customerChoice);
  17. %FLAGS=(
  18.   'rawSet' => 1,
  19. #  'traceSet' => 1,
  20. #  'traceGet' => 1,
  21. #  'traceInvoke' => 1,
  22. );
  23.  
  24. sub awake {
  25.   my $self=shift;
  26.   #obj($self)->setTraceGet(1);
  27.   #obj($self)->setTraceSet(1);
  28.   my $filePath = $WOApp->pathForResourceOfType("DodgeData","dict");
  29.   my $dd=NSDictionary->dictionaryWithContentsOfFile($filePath);
  30.   $self->{'dodgeData'}=$dd;
  31.   return;
  32. }
  33.  
  34. # Get all the car objects
  35. sub allCars {
  36.   my $self=shift;
  37.   return $self->{'dodgeData'}->objectForKey("cars")->allValues;
  38. }
  39.  
  40. # Get all the car models
  41. sub modelsDict {
  42.   return $_[0]->{'dodgeData'}->objectForKey('models');
  43. }
  44.  
  45. # Get all the types of cars
  46. sub typesDict {
  47.   return $_[0]->{'dodgeData'}->objectForKey('types');
  48. }
  49.  
  50. # Get all the option packages
  51. sub packagesDict {
  52.   return $_[0]->{'dodgeData'}->objectForKey('packages');
  53. }
  54.  
  55. # Get all the car colors
  56. sub colorsDict {
  57.   return $_[0]->{'dodgeData'}->objectForKey('colors');
  58. }
  59.  
  60. # The following methods provide access to other pages.  They are used in
  61. # the declaration files.  For example,
  62. #     CARPAGE:WOActiveImage {
  63. #         src = "../Images/Buttons/ChangeOptions.gif";
  64. #         action = WOApp.carPage;
  65. #     };
  66.  
  67. # Return the first page
  68. sub mainPage { return $WOApp->pageWithName("Main"); }
  69.  
  70. # Return the second page
  71. sub selectedCarsPage { return $WOApp->pageWithName("SelectedCars"); }
  72.  
  73. # Return the third page
  74. sub carPage { return $WOApp->pageWithName("Car"); }
  75.  
  76. 'WO::DodgeLite';
  77. #EOF
  78.