Class: ResolverController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/resolver_controller.rb

Constant Summary

Constants included from Searchable

Searchable::ABSTRACT

Instance Method Summary collapse

Methods inherited from ApplicationController

#archivesspace, can_access?, permission_mappings, set_access_control

Methods included from JsonHelper

#merge_notes, #process_json_notes

Methods included from Searchable

#default_search_opts, #get_filter_years, #handle_results, #html_notes, #process_results, #process_search_results, #repo_context, #search_terms, #set_up_advanced_search, #set_up_and_run_search, #set_up_search, #strip_facet_fields

Methods included from HandleFaceting

#fetch_only_facets, #get_pretty_facet_value, #strip_facets

Methods included from ManipulateNode

#inheritance, #process_mixed_content, #strip_mixed_content

Instance Method Details

#resolve_editObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'frontend/app/controllers/resolver_controller.rb', line 6

def resolve_edit
  if params.has_key? :uri
    resolver = Resolver.new(params[:uri])

    if params.has_key?(:autoselect_repo) && resolver.repository && resolver.repository != session[:repo]
      self.class.session_repo(session, resolver.repository)
      selected = JSONModel(:repository).find(session[:repo_id])
      flash[:success] = I18n.t("repository._frontend.messages.changed", JSONModelI18nWrapper.new(:repository => selected))
    end
    redirect_to resolver.edit_uri
  else
    unauthorised_access
  end
end

#resolve_readonlyObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'frontend/app/controllers/resolver_controller.rb', line 22

def resolve_readonly
  if params.has_key? :uri
    resolver = Resolver.new(params[:uri])

    if params.has_key?(:autoselect_repo) && resolver.repository && resolver.repository != session[:repo]
      self.class.session_repo(session, resolver.repository)
      selected = JSONModel(:repository).find(session[:repo_id])
      flash[:success] = I18n.t("repository._frontend.messages.changed", JSONModelI18nWrapper.new(:repository => selected))
    end
    redirect_to resolver.view_uri
  else
    unauthorised_access
  end
end