Show
Ignore:
Timestamp:
07/26/04 10:24:39 (4 years ago)
Author:
deveiant
Message:

- Removed some old cruft/unimplemented features from the docs.

- Added the 'uri' attribute to applets so they know where they've been installed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Arrow/trunk/lib/arrow/applet.rb

    r116 r125  
    3232#                }, 
    3333#            }, 
    34 #            :monitors           => { 
    35 #                :averageExecutionTimer => { 
    36 #                    :description => 
    37 #                        "Average execution time of each applet method.", 
    38 #                    :type => AverageTimerTable, 
    39 #                }, 
    40 #                :cumulativeRuntime => { 
    41 #                    :description => 
    42 #                        "Total time used by this applet.", 
    43 #                    :type => TotalTimer, 
    44 #                } 
    45 #            } 
    4634#        } 
    4735# 
    48 #        # Define the 'display' action 
     36#        # Define the 'display' action 
    4937#        action( 'display' ) {|txn| 
    50 #            Monitor[self].cumulativeRuntime.time do 
    51 #                char = txn.vargs[:char] || 'x' 
    52 #                char_page = self.make_character_page( char ) 
    53 #                templ = self.loadTemplate( :main ) 
    54 #                templ.char_page = char_page 
    55 # 
    56 #                return templ 
    57 #            end 
     38#            char = txn.vargs[:char] || 'x' 
     39#            char_page = self.make_character_page( char ) 
     40#            templ = self.loadTemplate( :main ) 
     41#            templ.char_page = char_page 
     42# 
     43#            return templ 
    5844#        } 
    5945# 
     
    6349#        # the related signature values can be set. 
    6450#        formaction = action( :form ) {|txn| 
    65 #            Monitor[self].cumulativeRuntime.time do 
    66 #                templ = self.loadTemplate( :form ) 
    67 #                templ.txn = txn 
    68 #                return templ 
    69 #            end 
     51#            templ = self.loadTemplate( :form ) 
     52#            templ.txn = txn 
     53#            return templ 
    7054#        } 
    7155#        formaction.template = "form.tmpl" 
    7256# 
     57#        # Make a page full of  
    7358#        def make_character_page( char ) 
    74 #            Monitor[self].averageExecutionTimer.time( :make_character_page ) do 
    75 #                page = (char * 80) 
     59#            page = '' 
     60#            40.times do 
     61#                page << (char * 80) << "\n" 
    7662#            end 
    7763#        end 
     
    404390 
    405391 
    406     ### Create a new Arrow::Applet object with the specified +config+ 
    407     ### (an Arrow::Config object) and +templateFactory+ (an 
    408     ### Arrow::TemplateFactory object). 
    409     def initialize( config, templateFactory ) 
    410         @config          = config 
    411         @templateFactory = templateFactory 
    412         @signature       = self.class.signature 
    413         @runCount        = 0 
    414         @totalUtime      = 0 
    415         @totalStime      = 0 
     392    ### Create a new Arrow::Applet object with the specified +config+ (an 
     393    ### Arrow::Config object), +templateFactory+ (an Arrow::TemplateFactory 
     394    ### object), and the +uri+ the applet will live under in the appserver (a 
     395    ### String). 
     396    def initialize( config, templateFactory, uri ) 
     397        @config             = config 
     398        @templateFactory    = templateFactory 
     399        @uri                = uri 
     400 
     401        @signature          = self.class.signature 
     402        @runCount           = 0 
     403        @totalUtime         = 0 
     404        @totalStime         = 0 
    416405 
    417406        # Make a regexp out of all public <something>_action methods 
     
    429418    # The Arrow::Config object which contains the system's configuration. 
    430419    attr_accessor :config 
     420 
     421    # The URI the applet answers to 
     422    attr_reader :uri 
    431423 
    432424    # The Struct that contains the configuration values for this applet