Changeset 335

Show
Ignore:
Timestamp:
03/04/09 12:59:51 (10 years ago)
Author:
samuraraujo
Message:
 
Location:
Explorator/trunk/app/controllers
Files:
2 modified

Legend:

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

    r315 r335  
    11class MessageController < ApplicationController 
    22  def error     
     3  
    34    @message=params[:message] 
    45    render :layout => false 
  • Explorator/trunk/app/controllers/repository_controller.rb

    r332 r335  
    88  @repositories 
    99  def index 
    10     #variable that will store the list of adapters. 
    11     @repositories = Array.new 
    12     #Gets all adapters     
    13     adapters = ConnectionPool.adapters() 
    14     adapters.each do |repository| 
    15       #create a model repository passing the repository's id, title and enableness  
    16       if repository.title!= 'INTERNAL' && (repository.title.index('_LOCAL') || session[:addrepositories].include?(repository)) 
    17         @repositories <<  Repository.new(repository.object_id,repository.title, session[:disablerepositories].include?(repository.title),repository.limit) 
    18       end 
    19     end        
     10    
    2011    render :layout => false 
    2112  end 
     
    6960    session[:disablerepositories].delete(params[:title])  
    7061   ConnectionPool.remove_data_source(adapter) 
    71       redirect_to :controller => 'message',:action => 'error', :message => "SPARQL Enpoint invalid: "+e.message ,:layout => false 
    72     return 
     62#      render_component :controller => 'message',:action => 'error', :message => "SPARQL Enpoint invalid: "+e.message ,:layout => false 
     63redirect_to :action => 'endpointsform' , :message => "SPARQL Enpoint invalid: "+e.message ,:layout => false 
     64return 
    7365end 
    7466       begin  
     
    8577    session[:disablerepositories].delete(params[:title])  
    8678    ConnectionPool.remove_data_source(adapter) 
    87      
    88         redirect_to :controller => 'message',:action => 'error',:message => e.message ,:layout => false 
    89   
    90    return 
     79redirect_to :action => 'endpointsform' ,:message => e.message ,:layout => false 
     80return 
     81#       render_component :controller => 'message',:action => 'error',:message => e.message ,:layout => false 
    9182end 
    92  redirect_to :controller => 'message',:action => 'confirmation', :message => "SPARQL Enpoint added successfuly ",:layout => false 
     83redirect_to :action => 'endpointsform',:message => 'Sparql endpoint added successfully!' ,:messageaction=>'confirmation' 
    9384  
    9485end 
     
    9687 render :partial => 'listenabledrepositories',:layout =>false 
    9788end 
     89 
     90def endpointsform 
     91   #variable that will store the list of adapters. 
     92    @repositories = Array.new 
     93    @message = params[:message] 
     94    puts @message 
     95    #Gets all adapters     
     96    adapters = ConnectionPool.adapters() 
     97    adapters.each do |repository| 
     98      #create a model repository passing the repository's id, title and enableness  
     99      if repository.title!= 'INTERNAL' && (repository.title.index('_LOCAL') || session[:addrepositories].include?(repository)) 
     100        @repositories <<  Repository.new(repository.object_id,repository.title, session[:disablerepositories].include?(repository.title),repository.limit) 
     101      end 
     102    end        
     103 
     104 render :layout =>false 
    98105end 
     106end