Changeset 128
- Timestamp:
- 10/25/08 22:12:05 (5 years ago)
- Location:
- Explorator/trunk/app
- Files:
-
- 4 modified
-
controllers/explorator_controller.rb (modified) (1 diff)
-
helpers/explorator_helper.rb (modified) (1 diff)
-
models/explorator_application.rb (modified) (5 diffs)
-
models/resource_set.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Explorator/trunk/app/controllers/explorator_controller.rb
r121 r128 15 15 # attr_accessor :resourceset 16 16 #default rails method. returns the view index.rhtml. 17 def index 18 17 def index 19 18 end 20 19 -
Explorator/trunk/app/helpers/explorator_helper.rb
r124 r128 22 22 if((@filter!=nil)&&(@filter!="")) 23 23 resources = resources.select {|x| 24 puts x24 25 25 render_resource(x).to_s().downcase.index(@filter.downcase) != nil} 26 26 @size = resources.size() -
Explorator/trunk/app/models/explorator_application.rb
r119 r128 17 17 class Application 18 18 attr_accessor :uri 19 19 20 def initialize(id) 20 21 super() 21 22 @uri = 'http://www.tecweb.inf.puc-rio.br/application/id/'+ id + '/' 22 23 end 23 def instance() 24 25 if @instance == nil24 def instance() 25 if @instance == nil 26 @cache = Hash.new 26 27 @instance=EXPLORATOR::Application.new(@uri + 'default') 27 28 @instance.explorator::uuid=@uri … … 36 37 def add(resourceset) 37 38 raise ExploratorError.new('Must be a ResourceSet instance') if !resourceset.instance_of? EXPLORATOR::Set 39 puts '## Adding to cache ##' 40 puts resourceset.uri 41 @cache['<' + resourceset.uri + '>'] = resourceset 42 38 43 if instance.explorator::set == nil 39 44 instance.explorator::set = [resourceset] … … 44 49 #get a resource set 45 50 def get(uri) 46 EXPLORATOR::Set.new(uri) 51 #EXPLORATOR::Set.new(uri) 52 puts '## Retrieving from the cache ##' 53 puts uri 54 @cache[uri] 47 55 end 48 56 ##verifies whether the set was added in the pool … … 85 93 end 86 94 end 95 @cache = Hash.new 87 96 #remove the resources from the application 88 97 instance.explorator::set = [] … … 116 125 #remove a specific resource set from the pool 117 126 def remove(uri) 127 @cache[uri]=nil 118 128 resource = EXPLORATOR::Set.new(uri) 119 129 #before remove store the set expression. -
Explorator/trunk/app/models/resource_set.rb
r111 r128 64 64 end 65 65 #defines a new expression and reevaluates the expression. 66 def expression=(exp) 66 def expression=(exp) 67 puts '## Evaluating Expression ##' 67 68 puts exp 68 69 # begin 69 70 #for avoid loop evaluation. 70 current_expression = self.explorator::expression71 current_expression = self.explorator::expression 71 72 exp.gsub!("'" + self.to_s + "'",current_expression) if current_expression != nil 72 #evaluates the expression 73 74 x = eval(exp) 75 73 #evaluates the expression 74 x = eval(exp) 76 75 # updates the expression 77 76 self.explorator::expression = exp
