Class: DwcOccurrencesController

Inherits:
ApplicationController show all
Includes:
DataControllerConfiguration::ProjectDataControllerConfiguration
Defined in:
app/controllers/dwc_occurrences_controller.rb

Instance Method Summary collapse

Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration

#annotator_params

Methods included from RedirectHelper

#destroy_redirect

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form

Methods included from Api::Intercept

#intercept_api

Methods included from TokenAuthentication

#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate

Instance Method Details

#collector_id_metadataObject



25
26
27
# File 'app/controllers/dwc_occurrences_controller.rb', line 25

def 
  render json: helpers.
end

#createObject

TODO: remove



30
31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/dwc_occurrences_controller.rb', line 30

def create
  respond_to do |format|
    format.html do
      @object.set_dwc_occurrence
      redirect_to browse_collection_objects_task_path(collection_object_id: @object.id)
    end
    format.json {
      render status: 302 and return
    }
  end
end

#metadataObject



6
7
8
# File 'app/controllers/dwc_occurrences_controller.rb', line 6

def 
  @dwc_occurrences = DwcOccurrence.where(project_id: sessions_current_project_id)
end

#predicatesObject



10
11
# File 'app/controllers/dwc_occurrences_controller.rb', line 10

def predicates
end

#set_objectObject (protected)



44
45
46
47
48
49
50
# File 'app/controllers/dwc_occurrences_controller.rb', line 44

def set_object
  @object = GlobalID::Locator.locate(params[:object_global_id])

  if @object.nil? || (@object.project_id != sessions_current_project_id)
    render status: 404 and return
  end
end

#statusObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/dwc_occurrences_controller.rb', line 13

def status
  if @object
    render json: {
      object: params[:object_global_id],
      id: @object.dwc_occurrence&.id,
      updated_at:  @object.dwc_occurrence&.updated_at
    }
  else
    render json: {}, status: :unprocessable_entity
  end
end