ZCRMSDK 3.0.0.beta → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/ZCRMSDK.rb +3 -1
- data/src/com/zoho/api/authenticator/oauth_token.rb +1 -2
- data/src/com/zoho/api/authenticator/store/db_store.rb +27 -5
- data/src/com/zoho/api/authenticator/store/file_store.rb +26 -4
- data/src/com/zoho/crm/api/attachments/attachment.rb +38 -0
- data/src/com/zoho/crm/api/blue_print/field.rb +24 -4
- data/src/com/zoho/crm/api/fields/field.rb +23 -23
- data/src/com/zoho/crm/api/fields/multi_module_lookup.rb +99 -0
- data/src/com/zoho/crm/api/initializer.rb +4 -1
- data/src/com/zoho/crm/api/notes/note.rb +19 -0
- data/src/com/zoho/crm/api/org/hierarchy_preference.rb +61 -0
- data/src/com/zoho/crm/api/org/org.rb +38 -0
- data/src/com/zoho/crm/api/profiles/category.rb +19 -0
- data/src/com/zoho/crm/api/profiles/profile.rb +0 -19
- data/src/com/zoho/crm/api/record/field.rb +16 -17
- data/src/com/zoho/crm/api/record/line_tax.rb +19 -0
- data/src/com/zoho/crm/api/users/user.rb +34 -0
- data/src/com/zoho/crm/api/util/api_http_connector.rb +1 -1
- data/src/com/zoho/crm/api/util/common_api_handler.rb +5 -3
- data/src/com/zoho/crm/api/util/constants.rb +9 -11
- data/src/com/zoho/crm/api/util/converter.rb +11 -5
- data/src/com/zoho/crm/api/util/data_type_converter.rb +8 -2
- data/src/com/zoho/crm/api/util/form_data_converter.rb +1 -1
- data/src/com/zoho/crm/api/util/json_converter.rb +7 -9
- data/src/com/zoho/crm/api/util/module_fields_handler.rb +1 -1
- data/src/com/zoho/crm/api/util/utility.rb +81 -50
- data/src/com/zoho/crm/api/wizards/button.rb +38 -0
- data/src/com/zoho/crm/api/wizards/transition.rb +80 -0
- data/src/resources/JSONDetails.json +1 -1
- data/src/version.rb +1 -1
- metadata +9 -7
- data/src/com/zoho/crm/api/record/inventory_line_items.rb +0 -252
@@ -57,13 +57,13 @@ module Util
|
|
57
57
|
|
58
58
|
unless value.nil?
|
59
59
|
if key_details.key? Constants::INTERFACE and key_details[Constants::INTERFACE] == true
|
60
|
-
json_details = Initializer.
|
60
|
+
json_details = Initializer.json_details
|
61
61
|
interface_details = json_details[key_details[Constants::STRUCTURE_NAME]]
|
62
62
|
classes = interface_details[Constants::CLASSES]
|
63
63
|
check = false
|
64
64
|
classes.each do |each_class_name|
|
65
65
|
class_name_lower = each_class_name.to_s.downcase
|
66
|
-
value_class_name =
|
66
|
+
value_class_name = Util::Utility.path_to_package(value.class.name).downcase
|
67
67
|
|
68
68
|
if class_name_lower.downcase == value_class_name
|
69
69
|
check = true
|
@@ -96,9 +96,15 @@ module Util
|
|
96
96
|
elsif !value.nil?
|
97
97
|
check = Util::Utility.check_data_type(value,type)
|
98
98
|
end
|
99
|
-
elsif (type.downcase
|
100
|
-
if type.downcase
|
101
|
-
check =
|
99
|
+
elsif (type.downcase == Constants::OBJECT.downcase || (!var_type.nil? && var_type.downcase == Constants::OBJECT.downcase))
|
100
|
+
if type.downcase == Constants::OBJECT.downcase
|
101
|
+
check = true
|
102
|
+
else
|
103
|
+
class_name1 = value.class.name
|
104
|
+
if type.downcase != Util::Utility.path_to_package(class_name1).downcase
|
105
|
+
check = false
|
106
|
+
end
|
107
|
+
var_type = class_name1
|
102
108
|
end
|
103
109
|
end
|
104
110
|
if !check
|
@@ -108,7 +108,10 @@ module Util
|
|
108
108
|
# @raise Exception
|
109
109
|
def self.pre_convert(obj, type)
|
110
110
|
init
|
111
|
-
@@pre_converter_map
|
111
|
+
if @@pre_converter_map.key? type
|
112
|
+
return @@pre_converter_map[type].call(obj)
|
113
|
+
end
|
114
|
+
obj
|
112
115
|
end
|
113
116
|
|
114
117
|
# This method is to convert Java data to JSON data value.
|
@@ -118,7 +121,10 @@ module Util
|
|
118
121
|
# @raise Exception
|
119
122
|
def self.post_convert(obj, type)
|
120
123
|
init
|
121
|
-
@@post_converter_map
|
124
|
+
if @@post_converter_map.key? type
|
125
|
+
return @@post_converter_map[type].call(obj)
|
126
|
+
end
|
127
|
+
obj
|
122
128
|
end
|
123
129
|
|
124
130
|
def self.pre_convert_object_data(obj)
|
@@ -61,7 +61,7 @@ module Util
|
|
61
61
|
|
62
62
|
member_data = request_instance.instance_variable_get(Constants::AT + member_name)
|
63
63
|
|
64
|
-
if !modified.nil? && (modified != 0) && value_checker(request_instance.class.name, member_name, member_details, member_data, @unique_hash, instance_no)
|
64
|
+
if !modified.nil? && (modified != 0) && !member_data.nil? && value_checker(request_instance.class.name, member_name, member_details, member_data, @unique_hash, instance_no)
|
65
65
|
key_name = member_details[Constants::NAME]
|
66
66
|
type = member_details[Constants::TYPE]
|
67
67
|
if type.downcase == Constants::LIST_NAMESPACE.downcase
|
@@ -106,13 +106,11 @@ module Util
|
|
106
106
|
|
107
107
|
if request_instance.is_a? Record::FileDetails
|
108
108
|
lower_case_key_name = key_name.downcase
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
field_value
|
115
|
-
end
|
109
|
+
if field_value.nil? || (field_value.is_a? (String) && field_value.downcase == "null")
|
110
|
+
request_json[lower_case_key_name] = nil
|
111
|
+
else
|
112
|
+
request_json[lower_case_key_name] = field_value
|
113
|
+
end
|
116
114
|
else
|
117
115
|
request_json[key_name] = set_data(member_detail, field_value)
|
118
116
|
end
|
@@ -706,9 +704,9 @@ module Util
|
|
706
704
|
member_value
|
707
705
|
end
|
708
706
|
|
709
|
-
def build_name(
|
707
|
+
def build_name(key_name)
|
710
708
|
sdk_name = ''
|
711
|
-
name_split =
|
709
|
+
name_split = key_name.to_s.split('_')
|
712
710
|
sdk_name = name_split[0].to_s.downcase
|
713
711
|
index = 1
|
714
712
|
|
@@ -51,7 +51,7 @@ module Util
|
|
51
51
|
def self.refresh_fields(module_api_name)
|
52
52
|
@@sync_lock.synchronize do
|
53
53
|
delete_fields(module_api_name)
|
54
|
-
Utility.
|
54
|
+
Utility.get_fields_info(module_api_name)
|
55
55
|
end
|
56
56
|
rescue SDKException => e
|
57
57
|
SDKLog::SDKLogger.severe(Constants::REFRESH_SINGLE_MODULE_FIELDS_ERROR + module_api_name, e)
|
@@ -26,6 +26,10 @@ module Util
|
|
26
26
|
|
27
27
|
@@get_modified_modules = false
|
28
28
|
|
29
|
+
@@api_supported_module = {}
|
30
|
+
|
31
|
+
@@module_api_name = nil
|
32
|
+
|
29
33
|
@@force_refresh = false
|
30
34
|
def self.set_handler_api_path(module_api_name, handler_instance)
|
31
35
|
if handler_instance.nil?
|
@@ -75,7 +79,7 @@ module Util
|
|
75
79
|
record_field_details_json = JSON.parse(File.read(record_field_details_path))
|
76
80
|
return if module_api_name.nil? || record_field_details_json.key?(module_api_name.downcase)
|
77
81
|
|
78
|
-
fill_data_type
|
82
|
+
fill_data_type()
|
79
83
|
|
80
84
|
record_field_details_json[module_api_name.downcase] = {}
|
81
85
|
|
@@ -94,6 +98,13 @@ module Util
|
|
94
98
|
end
|
95
99
|
|
96
100
|
def self.get_fields(module_api_name, handler_instance=nil)
|
101
|
+
@@sync_lock.synchronize do
|
102
|
+
@@module_api_name = module_api_name
|
103
|
+
get_fields_info(module_api_name,handler_instance)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.get_fields_info(module_api_name, handler_instance=nil)
|
97
108
|
require_relative '../initializer'
|
98
109
|
initializer = Initializer.get_initializer
|
99
110
|
record_field_details_path = nil
|
@@ -106,7 +117,7 @@ module Util
|
|
106
117
|
resoures_folder_path = initializer.resources_path + '/' + Constants::RESOURCES
|
107
118
|
|
108
119
|
Dir.mkdir resoures_folder_path unless File.exist? resoures_folder_path
|
109
|
-
record_field_details_path = get_record_json_file_path
|
120
|
+
record_field_details_path = get_record_json_file_path()
|
110
121
|
module_api_name = verify_module_api_name(module_api_name)
|
111
122
|
set_handler_api_path(module_api_name,handler_instance)
|
112
123
|
|
@@ -114,18 +125,19 @@ module Util
|
|
114
125
|
file_exists_flow(module_api_name,record_field_details_path,last_modified_time)
|
115
126
|
elsif initializer.sdk_config.auto_refresh_fields
|
116
127
|
@@new_file = true
|
117
|
-
fill_data_type
|
118
|
-
|
128
|
+
fill_data_type()
|
129
|
+
@@api_supported_module = @@api_supported_module.length == 0 ? get_modules(nil) : @@api_supported_module
|
130
|
+
|
119
131
|
record_field_details_json = File.exist? record_field_details_path ? JSON.parse(File.read(record_field_details_path)) : {}
|
120
132
|
|
121
133
|
record_field_details_json = { Constants::FIELDS_LAST_MODIFIED_TIME => get_current_time_in_millis }
|
122
|
-
|
134
|
+
@@api_supported_module.each_key do |module_name|
|
123
135
|
unless record_field_details_json.key? module_name.downcase
|
124
136
|
record_field_details_json[module_name.downcase] = {}
|
125
137
|
File.open(record_field_details_path, 'w') do |f|
|
126
138
|
f.write(record_field_details_json.to_json)
|
127
139
|
end
|
128
|
-
field_details = get_fields_details(
|
140
|
+
field_details = get_fields_details( @@api_supported_module[module_name][Constants::API_NAME])
|
129
141
|
record_field_details_json = JSON.parse(File.read(record_field_details_path))
|
130
142
|
record_field_details_json[module_name.downcase] = field_details
|
131
143
|
File.open(record_field_details_path, 'w') do |f|
|
@@ -143,7 +155,7 @@ module Util
|
|
143
155
|
modify_fields(record_field_details_path, last_modified_time)
|
144
156
|
@@get_modified_modules = false
|
145
157
|
else
|
146
|
-
fill_data_type
|
158
|
+
fill_data_type()
|
147
159
|
|
148
160
|
record_field_details_json = { module_api_name.downcase => {} }
|
149
161
|
|
@@ -195,9 +207,9 @@ module Util
|
|
195
207
|
end
|
196
208
|
|
197
209
|
def self.modify_fields(record_field_details_path, modified_time)
|
198
|
-
modified_modules =
|
210
|
+
modified_modules = get_modules(modified_time)
|
199
211
|
record_field_details_json = JSON.parse(File.open(record_field_details_path).read)
|
200
|
-
record_field_details_json[Constants::FIELDS_LAST_MODIFIED_TIME] = get_current_time_in_millis
|
212
|
+
record_field_details_json[Constants::FIELDS_LAST_MODIFIED_TIME] = get_current_time_in_millis()
|
201
213
|
File.open(record_field_details_path, 'w') do |f|
|
202
214
|
f.write(record_field_details_json.to_json)
|
203
215
|
end
|
@@ -214,7 +226,7 @@ module Util
|
|
214
226
|
end
|
215
227
|
modified_modules.each_key do |module_api_name|
|
216
228
|
module_data = modified_modules[module_api_name]
|
217
|
-
|
229
|
+
get_fields_info(module_data[Constants::API_NAME])
|
218
230
|
end
|
219
231
|
end
|
220
232
|
|
@@ -226,7 +238,7 @@ module Util
|
|
226
238
|
end
|
227
239
|
end
|
228
240
|
|
229
|
-
record_field_details_path = get_record_json_file_path
|
241
|
+
record_field_details_path = get_record_json_file_path()
|
230
242
|
|
231
243
|
if File.exist? record_field_details_path
|
232
244
|
fields_json = JSON.parse(File.open(record_field_details_path).read)
|
@@ -256,8 +268,8 @@ module Util
|
|
256
268
|
end
|
257
269
|
end
|
258
270
|
|
259
|
-
def self.get_record_json_file_path
|
260
|
-
Converter.new(nil).get_record_json_file_path
|
271
|
+
def self.get_record_json_file_path()
|
272
|
+
Converter.new(nil).get_record_json_file_path()
|
261
273
|
end
|
262
274
|
|
263
275
|
def self.get_related_lists(related_module_name, module_api_name, common_api_handler)
|
@@ -273,7 +285,7 @@ module Util
|
|
273
285
|
resoures_folder_path = initializer.resources_path + '/' + Constants::RESOURCES
|
274
286
|
Dir.mkdir resoures_folder_path unless File.exist? resoures_folder_path
|
275
287
|
|
276
|
-
record_field_details_path = get_record_json_file_path
|
288
|
+
record_field_details_path = get_record_json_file_path()
|
277
289
|
if !File.exist?(record_field_details_path) || (File.exist?(record_field_details_path) && !(JSON.parse(File.read(record_field_details_path)).key? key))
|
278
290
|
is_new_data = true
|
279
291
|
related_list_values = get_related_list_details(module_api_name)
|
@@ -412,8 +424,9 @@ module Util
|
|
412
424
|
field_api_names_recurring_activity = %w[RRULE]
|
413
425
|
field_api_names_reminder = %w[multireminder]
|
414
426
|
field_api_names_consent_look_up = %w[consent_lookup]
|
415
|
-
field_api_name_image_upload = %w[
|
416
|
-
field_api_name_multiselect_lookup = %w[
|
427
|
+
field_api_name_image_upload = %w[imageupload]
|
428
|
+
field_api_name_multiselect_lookup = %w[multiselectlookup]
|
429
|
+
field_api_name_line_tax = %w[linetax]
|
417
430
|
|
418
431
|
field_api_names_string.each do |field_api_name|
|
419
432
|
@@apitype_vs_datatype[field_api_name] = Constants::STRING
|
@@ -511,12 +524,21 @@ module Util
|
|
511
524
|
|
512
525
|
field_api_name_image_upload.each do |field_api_name|
|
513
526
|
@@apitype_vs_datatype[field_api_name] = Constants::LIST_NAMESPACE
|
527
|
+
|
514
528
|
@@apitype_vs_structurename[field_api_name] = Constants::IMAGEUPLOAD_NAMESPACE
|
515
529
|
end
|
530
|
+
|
516
531
|
field_api_name_multiselect_lookup.each do |field_api_name|
|
517
532
|
@@apitype_vs_datatype[field_api_name] = Constants::LIST_NAMESPACE
|
533
|
+
|
518
534
|
@@apitype_vs_structurename[field_api_name] = Constants::RECORD_NAMESPACE
|
519
535
|
end
|
536
|
+
|
537
|
+
field_api_name_line_tax.each do |field_api_name|
|
538
|
+
@@apitype_vs_datatype[field_api_name] = Constants::LIST_NAMESPACE
|
539
|
+
|
540
|
+
@@apitype_vs_structurename[field_api_name] = Constants::LINE_TAX_NAMESPACE
|
541
|
+
end
|
520
542
|
end
|
521
543
|
|
522
544
|
def self.set_data_type(field_detail, field_instance, module_api_name)
|
@@ -531,13 +553,7 @@ module Util
|
|
531
553
|
field_detail[Constants::REQUIRED] = true
|
532
554
|
end
|
533
555
|
|
534
|
-
if Constants::
|
535
|
-
field_detail[Constants::NAME] = key_name
|
536
|
-
field_detail[Constants::TYPE] = Constants::LIST_NAMESPACE
|
537
|
-
field_detail[Constants::STRUCTURE_NAME] = Constants::INVENTORY_LINE_ITEMS
|
538
|
-
field_detail[Constants::SKIP_MANDATORY] = true
|
539
|
-
return
|
540
|
-
elsif (key_name.downcase == Constants::PRICING_DETAILS.downcase) && (module_api_name == Constants::PRICE_BOOKS.downcase)
|
556
|
+
if (key_name.downcase == Constants::PRICING_DETAILS.downcase) && (module_api_name == Constants::PRICE_BOOKS.downcase)
|
541
557
|
field_detail[Constants::NAME] = key_name
|
542
558
|
field_detail[Constants::TYPE] = Constants::LIST_NAMESPACE
|
543
559
|
field_detail[Constants::STRUCTURE_NAME] = Constants::PRICINGDETAILS
|
@@ -567,6 +583,16 @@ module Util
|
|
567
583
|
field_detail[Constants::STRUCTURE_NAME] = Constants::TERRITORY_NAMESPACE
|
568
584
|
field_detail[Constants::LOOKUP] = true
|
569
585
|
return
|
586
|
+
elsif key_name.downcase() == Constants::PRODUCT_NAME.downcase and Constants::INVENTORY_MODULES_ITEMS.include? module_api_name.downcase
|
587
|
+
field_detail[Constants::NAME] = key_name
|
588
|
+
field_detail[Constants::TYPE] = Constants::LINEITEM_PRODUCT
|
589
|
+
field_detail[Constants::STRUCTURE_NAME] = Constants::LINEITEM_PRODUCT
|
590
|
+
field_detail[Constants::LOOKUP] = true
|
591
|
+
return
|
592
|
+
elsif key_name.downcase() == Constants::DISCOUNT.downcase and Constants::INVENTORY_MODULES_ITEMS.include? module_api_name.downcase
|
593
|
+
field_detail[Constants::NAME] = key_name
|
594
|
+
field_detail[Constants::TYPE] = Constants::STRING
|
595
|
+
return
|
570
596
|
elsif key_name.downcase() == Constants::TAX.downcase and module_api_name.downcase() == Constants::PRODUCTS.downcase
|
571
597
|
field_detail[Constants::NAME] = key_name
|
572
598
|
field_detail[Constants::TYPE] = Constants::LIST_NAMESPACE
|
@@ -588,12 +614,11 @@ module Util
|
|
588
614
|
field_detail[Constants::LOOKUP] = true if data_type.downcase.include? Constants::LOOKUP
|
589
615
|
field_detail[Constants::SKIP_MANDATORY] = true if data_type.downcase.include? Constants::CONSENT_LOOKUP
|
590
616
|
|
591
|
-
|
592
617
|
if data_type.downcase.include? Constants::MULTI_SELECT_LOOKUP
|
593
618
|
field_detail[Constants::SKIP_MANDATORY] = true
|
594
|
-
if !
|
595
|
-
if !
|
596
|
-
linking_module =
|
619
|
+
if !field_instance.multiselectlookup.nil?
|
620
|
+
if !field_instance.multiselectlookup.linking_module.nil?
|
621
|
+
linking_module = field_instance.multiselectlookup.linking_module
|
597
622
|
field_detail[Constants::MODULE] = linking_module
|
598
623
|
module_name = linking_module
|
599
624
|
end
|
@@ -603,9 +628,9 @@ module Util
|
|
603
628
|
|
604
629
|
if data_type.downcase.include? Constants::MULTI_USER_LOOKUP
|
605
630
|
field_detail[Constants::SKIP_MANDATORY] = true
|
606
|
-
if !
|
607
|
-
if !
|
608
|
-
linking_module =
|
631
|
+
if !field_instance.multiuserlookup.nil?
|
632
|
+
if !field_instance.multiuserlookup.linking_module.nil?
|
633
|
+
linking_module = field_instance.multiuserlookup.linking_module
|
609
634
|
field_detail[Constants::MODULE] = linking_module
|
610
635
|
module_name = linking_module
|
611
636
|
end
|
@@ -634,7 +659,7 @@ module Util
|
|
634
659
|
field_detail[Constants::MODULE] = module_name
|
635
660
|
end
|
636
661
|
|
637
|
-
if data_type.downcase == Constants::LOOKUP.downcase
|
662
|
+
if data_type.downcase == Constants::LOOKUP.downcase && !field_instance.lookup.nil?
|
638
663
|
module_name = field_instance.lookup.module
|
639
664
|
if !module_name.nil? && (module_name.downcase != Constants::SE_MODULE.downcase)
|
640
665
|
field_detail[Constants::MODULE] = module_name
|
@@ -646,7 +671,7 @@ module Util
|
|
646
671
|
end
|
647
672
|
field_detail[Constants::LOOKUP] = true
|
648
673
|
end
|
649
|
-
|
674
|
+
get_fields_info(module_name) if !module_name.nil? && !module_name.empty?
|
650
675
|
field_detail[Constants::NAME] = key_name
|
651
676
|
end
|
652
677
|
|
@@ -671,9 +696,9 @@ module Util
|
|
671
696
|
modules.each do |module_ins|
|
672
697
|
if module_ins.api_supported
|
673
698
|
module_details = {}
|
674
|
-
module_details[Constants::API_NAME]
|
675
|
-
module_details[Constants::GENERATED_TYPE]
|
676
|
-
api_names[module_ins.api_name.downcase] =
|
699
|
+
module_details[Constants::API_NAME]=module_ins.api_name
|
700
|
+
module_details[Constants::GENERATED_TYPE]=module_ins.generated_type.value
|
701
|
+
api_names[module_ins.api_name.downcase] =module_details
|
677
702
|
end
|
678
703
|
end
|
679
704
|
elsif response_object.is_a? Modules::APIException
|
@@ -685,11 +710,13 @@ module Util
|
|
685
710
|
end
|
686
711
|
end
|
687
712
|
end
|
688
|
-
if
|
713
|
+
if header.nil?
|
689
714
|
begin
|
690
|
-
|
691
|
-
|
692
|
-
|
715
|
+
initializer = Initializer.get_initializer
|
716
|
+
resoures_folder_path = initializer.resources_path + '/' + Constants::RESOURCES
|
717
|
+
Dir.mkdir resoures_folder_path unless File.exist? resoures_folder_path
|
718
|
+
record_field_details_path = get_record_json_file_path()
|
719
|
+
write_module_meta_data(record_field_details_path, api_names)
|
693
720
|
end
|
694
721
|
end
|
695
722
|
api_names
|
@@ -705,7 +732,7 @@ module Util
|
|
705
732
|
|
706
733
|
if related_list_jo[Constants::MODULE] != Constants::NULL_VALUE
|
707
734
|
common_api_handler.module_api_name = related_list_jo[Constants::MODULE]
|
708
|
-
|
735
|
+
get_fields_info(related_list_jo[Constants::MODULE])
|
709
736
|
end
|
710
737
|
return true
|
711
738
|
end
|
@@ -717,14 +744,15 @@ module Util
|
|
717
744
|
@@sync_lock.synchronize do
|
718
745
|
begin
|
719
746
|
module_api_name = verify_module_api_name(module_api_name)
|
720
|
-
if Constants::PHOTO_SUPPORTED_MODULES.
|
747
|
+
if Constants::PHOTO_SUPPORTED_MODULES.include? module_api_name.downcase
|
721
748
|
return true
|
722
749
|
end
|
723
750
|
modules = get_module_names()
|
751
|
+
|
724
752
|
if modules.key? module_api_name.downcase || !modules[module_api_name.downcase].nil?
|
725
753
|
module_meta_data = modules[module_api_name.downcase]
|
726
754
|
|
727
|
-
if module_meta_data[Constants::GENERATED_TYPE] != Constants::GENERATED_TYPE_CUSTOM
|
755
|
+
if module_meta_data.key? Constants::GENERATED_TYPE && module_meta_data[Constants::GENERATED_TYPE] != Constants::GENERATED_TYPE_CUSTOM
|
728
756
|
raise SDKException.new(Constants::UPLOAD_PHOTO_UNSUPPORTED_ERROR,Constants::UPLOAD_PHOTO_UNSUPPORTED_MESSAGE + module_api_name)
|
729
757
|
end
|
730
758
|
end
|
@@ -741,21 +769,24 @@ module Util
|
|
741
769
|
|
742
770
|
def self.get_module_names()
|
743
771
|
module_data = {}
|
772
|
+
initializer = Initializer.get_initializer
|
744
773
|
resoures_folder_path = initializer.resources_path + '/' + Constants::RESOURCES
|
745
774
|
Dir.mkdir resoures_folder_path unless File.exist? resoures_folder_path
|
746
775
|
|
747
|
-
record_field_details_path = get_record_json_file_path
|
776
|
+
record_field_details_path = get_record_json_file_path()
|
748
777
|
|
749
|
-
|
778
|
+
call_get_modules = false
|
750
779
|
if File.exists? record_field_details_path
|
751
780
|
json = JSON.parse(File.read(record_field_details_path))
|
752
781
|
if !json.key? Constants::SDK_MODULE_METADATA
|
753
|
-
|
754
|
-
elsif json[Constants::SDK_MODULE_METADATA].nil?
|
755
|
-
|
782
|
+
call_get_modules = true
|
783
|
+
elsif json[Constants::SDK_MODULE_METADATA].nil? || json[Constants::SDK_MODULE_METADATA].length == 0
|
784
|
+
call_get_modules = true
|
756
785
|
end
|
786
|
+
else
|
787
|
+
call_get_modules = true
|
757
788
|
end
|
758
|
-
if
|
789
|
+
if call_get_modules
|
759
790
|
module_data = get_modules(nil)
|
760
791
|
write_module_meta_data(record_field_details_path, module_data)
|
761
792
|
return module_data
|
@@ -766,7 +797,7 @@ module Util
|
|
766
797
|
end
|
767
798
|
|
768
799
|
def self.write_module_meta_data(record_field_details_path, module_data)
|
769
|
-
field_details_json = File.exist? record_field_details_path ? JSON.parse(File.read(record_field_details_path)):{}
|
800
|
+
field_details_json = (File.exist? record_field_details_path) ? JSON.parse(File.read(record_field_details_path)):{}
|
770
801
|
field_details_json[Constants::SDK_MODULE_METADATA] = module_data
|
771
802
|
File.open(record_field_details_path, 'w') do |f|
|
772
803
|
f.write(field_details_json.to_json)
|
@@ -816,7 +847,7 @@ module Util
|
|
816
847
|
|
817
848
|
def self.refresh_modules
|
818
849
|
@@force_refresh = true
|
819
|
-
|
850
|
+
get_fields_info(nil)
|
820
851
|
@@force_refresh = false
|
821
852
|
end
|
822
853
|
|
@@ -16,6 +16,8 @@ module Wizards
|
|
16
16
|
@color = nil
|
17
17
|
@shape = nil
|
18
18
|
@background_color = nil
|
19
|
+
@visibility = nil
|
20
|
+
@transition = nil
|
19
21
|
@key_modified = Hash.new
|
20
22
|
end
|
21
23
|
|
@@ -181,6 +183,42 @@ module Wizards
|
|
181
183
|
@key_modified['background_color'] = 1
|
182
184
|
end
|
183
185
|
|
186
|
+
# The method to get the visibility
|
187
|
+
# @return A String value
|
188
|
+
|
189
|
+
def visibility
|
190
|
+
@visibility
|
191
|
+
end
|
192
|
+
|
193
|
+
# The method to set the value to visibility
|
194
|
+
# @param visibility [String] A String
|
195
|
+
|
196
|
+
def visibility=(visibility)
|
197
|
+
if visibility!=nil and !visibility.is_a? String
|
198
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: visibility EXPECTED TYPE: String', nil, nil)
|
199
|
+
end
|
200
|
+
@visibility = visibility
|
201
|
+
@key_modified['visibility'] = 1
|
202
|
+
end
|
203
|
+
|
204
|
+
# The method to get the transition
|
205
|
+
# @return An instance of Transition
|
206
|
+
|
207
|
+
def transition
|
208
|
+
@transition
|
209
|
+
end
|
210
|
+
|
211
|
+
# The method to set the value to transition
|
212
|
+
# @param transition [Transition] An instance of Transition
|
213
|
+
|
214
|
+
def transition=(transition)
|
215
|
+
if transition!=nil and !transition.is_a? Transition
|
216
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: transition EXPECTED TYPE: Transition', nil, nil)
|
217
|
+
end
|
218
|
+
@transition = transition
|
219
|
+
@key_modified['transition'] = 1
|
220
|
+
end
|
221
|
+
|
184
222
|
# The method to check if the user has modified the given key
|
185
223
|
# @param key [String] A String
|
186
224
|
# @return A Integer value
|