Changeset 396

Show
Ignore:
Timestamp:
04/08/09 23:18:49 (9 years ago)
Author:
samuraraujo
Message:
 
Location:
Explorator/trunk
Files:
1 removed
5 modified

Legend:

Unmodified
Added
Removed
  • Explorator/trunk/app/controllers/application_controller.rb

    r394 r396  
    88  #global attribute use for all explorator controllers 
    99  @resourceset 
     10 
    1011  def session_init 
    11     #puts  session[:application].instance 
    12     if session[:application] == nil        
     12     if session[:application] == nil        
    1313      session[:disablerepositories]=Array.new 
    1414      session[:disablerepositories] << 'INTERNAL' 
    1515      session[:disablerepositories] << 'EXPLORATOR(Local)'      
    1616      session[:addrepositories] = Array.new 
    17       session[:application] =  Application.new(session.session_id) 
     17      session[:application] =  Application.new(request.session_options[:id]) 
    1818    end 
    1919    Thread.current[:addrepositories]=session[:addrepositories] 
  • Explorator/trunk/app/controllers/explorator_controller.rb

    r394 r396  
    4141  def create     
    4242    begin       
    43       puts params[:exp] 
     43#      puts params[:exp] 
    4444      #creates a new set.  
    4545      #the expression must be passed by the uri 
     
    6666  # must has been defined before. 
    6767  def update      
    68     puts params[:exp] 
     68#    puts params[:exp] 
    6969    #reevaluate the expression and return the set 
    7070    resource = session[:application].get(params[:uri]) 
     
    8484  def execute 
    8585    #eval an expression     
    86     puts params[:exp] 
     86#    puts params[:exp] 
    8787    eval (params[:exp]) 
    8888  end 
  • Explorator/trunk/app/controllers/repository_controller.rb

    r394 r396  
    2929        repository.limit=params[:limit].rstrip 
    3030        repository.limit=nil if repository.limit == 0 || repository.limit =='' 
    31         puts repository.limit 
     31          
    3232      end 
    3333    end        
  • Explorator/trunk/app/models/explorator_application.rb

    r362 r396  
    3838  def add(resourceset)     
    3939    raise ExploratorError.new('Must be a ResourceSet instance') if !resourceset.instance_of? EXPLORATOR::Set 
    40     puts '## Adding to cache ##' 
    41     puts resourceset.uri 
    42     puts @cache 
     40      
    4341    @cache[RDF::Resource.new(resourceset.uri)] = resourceset     
    4442    if instance.explorator::set == nil 
     
    5048  #get a resource set 
    5149  def get(uri)         
    52     #EXPLORATOR::Set.new(uri)  
    53     puts '## Retrieving from the cache ##' 
    54     puts uri 
    55     @cache[RDFS::Resource.new(uri)] 
     50     
     51    resource = RDFS::Resource.new(uri) 
     52    cachedset =    @cache[resource] 
     53    if cachedset == nil 
     54      add(EXPLORATOR::Set.new(uri)) 
     55    end 
     56    @cache[resource] 
     57  
    5658  end     
    5759  ##verifies whether the set was added in the pool 
  • Explorator/trunk/config/initializers/session_store.rb

    r395 r396  
    66# no regular words or you'll be exposed to dictionary attacks. 
    77ActionController::Base.session = { 
    8   :key         => '_explorator_session', 
    9   :secret      => '5d242ad0bb45d319b25af36f47acaaff9629eb596333e7d96d118b3aa4483d0662f2592feee03a16db0b7084b22adc8cd685b2cf47a93f83adb1a69f118aa2d6' 
     8  :key         => '_explorator_session2', 
     9  :secret      => '5d242ad0bb45d319b25af36f47acaaff9629eb596333e7d96d118b3aa4483d0662f2592feee03a16db0b7084b22adc8cd685b2cf47a93f83adb1a69f118aa2d6', 
     10    
    1011} 
    1112 
     
    1718#ActionController::Session::MemCacheStore.new('explorator',ActionController::Base.session_options ) 
    1819ActionController::Base.session_store = :memory_store 
     20  
     21  
    1922#ActionController::Base.session_store = ActionController::Session::MemoryStore.new(nil) 
    2023#ActionController::Session::MemCacheStore.destroy_all