Module: Umlaut::Routes::RouteSets

Included in:
Umlaut::Routes
Defined in:
lib/umlaut/routes.rb

Instance Method Summary collapse

Instance Method Details

#a_zObject

some special direct links to A-Z type searches, including legacy redirects for SFX-style urls, to catch any bookmarks.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/umlaut/routes.rb', line 82

def a_z
  add_routes do |options|
    # Special one for alpha list
    get 'journal_list(/:id(/:page))' => 'search#journal_list', :defaults => { :page => '1', :id => 'A' }
    
    
    # Catch redirected from SFX A-Z and citation linker urls
    # v2 A-Z links redirected to umlaut, point to journal_list
    # code in journal_list filter picks out SFX URL vars for
    # letter. 
    get '/resolve/azlist/default' => 'search#journal_list', :page => '1', :id => 'A'
    
    # SFX v3 A-Z list url format
    get 'resolve/az' => 'search#journal_list', :page => '1', :id => 'A'
  end
end

#adminObject



191
192
193
194
195
196
197
# File 'lib/umlaut/routes.rb', line 191

def admin
  add_routes do |options|
    namespace "admin" do
      get 'service_errors(/:service_id)' => "service_errors#index"
    end
  end
end

#export_emailObject



138
139
140
141
142
143
144
145
146
# File 'lib/umlaut/routes.rb', line 138

def export_email
  add_routes do |options|
    get  'export_email/email'      => "export_email#email"
    post 'export_email/send_email' => "export_email#send_email"

    get  'export_email/txt'      => "export_email#txt"
    post 'export_email/send_txt'   => "export_email#send_txt"
  end
end

#feedbackObject



184
185
186
187
188
189
# File 'lib/umlaut/routes.rb', line 184

def feedback
  add_routes do |options|
    get 'feedback(/:request_id)', :to => "feedback#new", :as => "feedback"
    post 'feedback(/:request_id)' => 'feedback#create'
  end
end

#javascriptObject



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/umlaut/routes.rb', line 165

def javascript
  add_routes do |options|
    # Legacy location for update_html.js used by JQuery Content Utility
    # to embed JS on external sites. Redirect to new location. 
    # Intentionally non-fingerprinted, most efficient thing
    # we can do in this case is let the web server take care
    # of Last-modified-by etc headers. 
    get 'javascripts/jquery/umlaut/update_html.js' => redirect("/assets/umlaut/update_html.js", :status => 301)
    
    # The loader doens't work _exactly_ like the new umlaut-ui.js, but
    # it's close enough that it'll work better redirecting than just
    # 404'ing. 
    get 'js_helper/loader' => redirect("/assets/umlaut_ui.js")
    
    
    get 'images/spinner.gif' => redirect("/assets/spinner.gif")
  end
end


128
129
130
131
132
133
134
135
136
# File 'lib/umlaut/routes.rb', line 128

def link_router
  add_routes do |options|
    # legacy with the index, to keep old bookmarks working, needs to come first
    get 'link_router/index(/:id)' => "link_router#index"

    get 'link_router/:id'        => "link_router#index", :as => "link_router"

  end
end

#open_searchObject



122
123
124
125
126
# File 'lib/umlaut/routes.rb', line 122

def open_search
  add_routes do |options|
    get 'open_search(/index)' => "open_search#index"
  end
end


74
75
76
77
78
# File 'lib/umlaut/routes.rb', line 74

def permalinks
  add_routes do |options|
    get 'go/:id' => 'store#index'
  end
end

#resolveObject

This is a legacy wild controller route that’s not recommended for RESTful applications. Note: This route will make all actions in every controller accessible via GET requests. match ‘:controller(/:action(/:id(.:format)))’



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/umlaut/routes.rb', line 103

def resolve
  add_routes do |options|
    # Prevent resolve/index/:id, should always be resolve/index?id=foo, 
    # to keep OpenURLs good, and avoid errors with DOI's with slashes in em etc. 
    get 'resolve(.:format)' => "resolve#index"

    # ResolveController still uses rails 2.0 style 'wildcard' routes, 
    # TODO tighten this up to only match what oughta be matched.           
    # Note: This route will make all actions in this controller accessible via GET requests.          
    get 'resolve(/:action(/:id(.:format)))' => "resolve"

    get 'resolve/get_permalink'
    match 'resolve/display_coins', :via => [:get, :post]
    get 'resolve/background_status'
    get 'resolve/partial_html_sections'
    get 'resolve/api'
  end
end

#resourcesObject



148
149
150
151
152
# File 'lib/umlaut/routes.rb', line 148

def resources
  add_routes do |options|
    get 'resource/proxy'
  end
end

#rootObject

for now include root generation in Umlaut auto-generation



68
69
70
71
72
# File 'lib/umlaut/routes.rb', line 68

def root
  add_routes do |options|
    root :to => "search#index"
  end
end

#searchObject



154
155
156
157
158
159
160
161
162
163
# File 'lib/umlaut/routes.rb', line 154

def search
  add_routes do |options|
    get 'search(/index)' => "search#index"
    get 'search/journals'
    get 'search/books'
    get 'search/journal_search'
    get 'search/journal_list', :to => redirect("/journal_list")
    get 'search/auto_complete_for_journal_title'
  end
end