apidae 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/apidae/import_controller.rb +5 -0
- data/app/models/apidae/apidae_data_parser.rb +16 -1
- data/app/models/apidae/export.rb +9 -0
- data/app/models/apidae/obj.rb +2 -1
- data/app/views/apidae/import/_form.html.erb +4 -3
- data/lib/apidae/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aecffb4dbac3b6d3b2c73f08d0ca3647c8d4c807
|
4
|
+
data.tar.gz: f55420c1dc448d89bd4819950c150f6e08d73624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ce804f3dd69a73d049c4c3b093cfee288eae63a348507bd76c14925bb3ec2fd14ad11dcb7faf46fb5b4760b4e6fecb3b999c9ebf2912cf846c6859e105ccac
|
7
|
+
data.tar.gz: 518f6e0bbfbe3b176a375da2133349955a550570f1e6aa3654554519f1fa7dbafe24b611b779671bff0bf7208d1bfbf525c945546376b7b57026a55f110d490f
|
@@ -91,6 +91,11 @@ module Apidae
|
|
91
91
|
logger.error("Error is : #{err}")
|
92
92
|
success = false
|
93
93
|
e.update(status: Export::CANCELLED)
|
94
|
+
rescue Exception => e
|
95
|
+
logger.error "Failed to import file : #{e.file_url}"
|
96
|
+
logger.error("Error is : #{err}")
|
97
|
+
success = false
|
98
|
+
e.update(status: Export::CANCELLED)
|
94
99
|
end
|
95
100
|
success
|
96
101
|
end
|
@@ -9,6 +9,9 @@ module Apidae
|
|
9
9
|
TWITTER = 3755
|
10
10
|
YELP = 4007
|
11
11
|
TRIP_ADVISOR = 4000
|
12
|
+
FAX = 202
|
13
|
+
MOBILE_WEBSITE = 3769
|
14
|
+
SHORTY_URL = 4923
|
12
15
|
|
13
16
|
CONTACTS_MAP = {
|
14
17
|
'telephone' => PHONE,
|
@@ -18,7 +21,10 @@ module Apidae
|
|
18
21
|
'google' => GOOGLE,
|
19
22
|
'trip_advisor' => TRIP_ADVISOR,
|
20
23
|
'twitter' => TWITTER,
|
21
|
-
'yelp' => YELP
|
24
|
+
'yelp' => YELP,
|
25
|
+
'fax' => FAX,
|
26
|
+
'mobile_website' => MOBILE_WEBSITE,
|
27
|
+
'shorty_url' => SHORTY_URL
|
22
28
|
}
|
23
29
|
|
24
30
|
MODE_AUTO = 'auto'
|
@@ -183,6 +189,15 @@ module Apidae
|
|
183
189
|
when TRIP_ADVISOR
|
184
190
|
contact_details[:trip_advisor] ||= {}
|
185
191
|
contact_details[:trip_advisor][c[:identifiant]] = c[:coordonnees][:fr]
|
192
|
+
when FAX
|
193
|
+
contact_details[:fax] ||= {}
|
194
|
+
contact_details[:fax][c[:identifiant]] = c[:coordonnees][:fr]
|
195
|
+
when MOBILE_WEBSITE
|
196
|
+
contact_details[:mobile_website] ||= {}
|
197
|
+
contact_details[:mobile_website][c[:identifiant]] = c[:coordonnees][:fr]
|
198
|
+
when SHORTY_URL
|
199
|
+
contact_details[:shorty_url] ||= {}
|
200
|
+
contact_details[:shorty_url][c[:identifiant]] = c[:coordonnees][:fr]
|
186
201
|
else
|
187
202
|
end
|
188
203
|
end
|
data/app/models/apidae/export.rb
CHANGED
@@ -7,6 +7,15 @@ module Apidae
|
|
7
7
|
|
8
8
|
validates_presence_of :file_url, :project_id
|
9
9
|
|
10
|
+
before_save :normalize_url
|
11
|
+
|
12
|
+
def normalize_url
|
13
|
+
self.file_url = file_url.strip
|
14
|
+
unless file_url.include?('/')
|
15
|
+
self.file_url = "http://export.apidae-tourisme.com/exports/#{file_url}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
10
19
|
# Note : handle reset case
|
11
20
|
def self.pending
|
12
21
|
where(remote_status: 'SUCCESS', status: PENDING).order(:id)
|
data/app/models/apidae/obj.rb
CHANGED
@@ -16,7 +16,8 @@ module Apidae
|
|
16
16
|
store_accessor :type_data, :categories, :themes, :capacity, :classification, :labels, :chains, :area, :track,
|
17
17
|
:products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
|
18
18
|
store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id
|
19
|
-
store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :
|
19
|
+
store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :fax,
|
20
|
+
:mobile_website, :shorty_url, :contacts
|
20
21
|
store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments
|
21
22
|
store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
|
22
23
|
store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes
|
@@ -9,9 +9,10 @@
|
|
9
9
|
</div>
|
10
10
|
<% end %>
|
11
11
|
<p>
|
12
|
-
Pour que les données soient importées correctement,
|
13
|
-
|
14
|
-
|
12
|
+
Pour que les données soient importées correctement, vos projets doivent être configurés pour exporter les données
|
13
|
+
au format <strong>JSON V2</strong>, en <strong>groupant les objets exportés</strong>. L'adresse du fichier d'export
|
14
|
+
est à récupérer dans :<br/>
|
15
|
+
<em>Page du projet Apidae > Onglet "Calcul des sélections et Exports " > Accéder à la ficher de l'export > Champ "Fichier d'export"</em>
|
15
16
|
</p>
|
16
17
|
|
17
18
|
<div class="<%= styles[:form_field] %>">
|
data/lib/apidae/version.rb
CHANGED