Assuming this table definition:
CREATE TABLE segments (segments_id serial PRIMARY KEY, payload jsonb);
With JSON values like this:
INSERT INTO segments (payload)
VALUES ('{
"a": [
{
"kind": "person",
Assuming this table definition:
CREATE TABLE segments (segments_id serial PRIMARY KEY, payload jsonb);
With JSON values like this:
INSERT INTO segments (payload)
VALUES ('{
"a": [
{
"kind": "person",
module Ubiquity | |
class ApiSerializer | |
attr_accessor :data | |
def initialize (data) | |
@data ||= data | |
end | |
def license_for_api | |
if data.try(:license).present? | |
remap_license |
ActiveSupport::Inflector.inflections(:en) do |inflect| | |
# Here you can put the singular and plural form you expect | |
inflect.acronym 'API' | |
#inflect.irregular ' API', 'Api' | |
end |
class AccountSettingsController < ApplicationController | |
before_action :set_company | |
def index | |
end | |
def update | |
@company.update(set_record_params) | |
redirect_to account_settings_path | |
end |
<% @account = account %> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="panel panel-default account-form"> | |
<%= form_for(@account, url: update_single_admin_account_setting_path(@account), :html => { class: 'form control' }) do |f| %> | |
<div class="panel-body"> | |
<% if @account.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@account.errors.count, "error") %> prohibited this account from being saved:</h2> |
Following are the steps we followed to implement the feature.
HyraxUploader
.For the mailer report we have WorkReportMailer
which acts as the controller of the Application Mailer. The mailer is called
in the ExportController file.
def send_mail_report
emails = process_email
emails.each do |email|
WorkReportMailer.send_report(email.strip, current_account.cname, params[:email_type]).deliver_later
end
redirect_to hyrax.admin_stats_path(anchor: 'email_reports')
For masking the url we created a seperate routes, controller to fetch the record and generate the url for the download file.
app/controllers/ubiquity/fail_uploads_controller.rb
def download_file
params[:fileset_id]
uuid = params[:uuid]
s3_file_set_url = Ubiquity::ImporterClient.get_s3_url uuid
For Rif template all the fileds have unique codes and we represent eah codes to the corresponding value. Following are the steps we follow to generate the report
CitationExportsController
(app/controllers/ubiquity/citation_exports_controller.rb)
and process the fetched record to render in RIF fromat.app/controllers/concerns/ubiquity/citations_export_concern.rb
)Basically we have a hash which consist of code and the fields that needs to map. Please find the hash below
For OAI we are using the BlackLightOaiProvider gem (https://github.com/projectblacklight/blacklight_oai_provider) which harvest the data automatically once it is configured in the catalog controller. We have divided into two phases.
We do have an ENV variable which acts as a switch to enable this feature .
ENABLE_OAI_METADATA: 'true'