ipp_quickbase_devkit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. data/LICENSE +87 -0
  2. data/README.rdoc +112 -0
  3. data/doc/QuickBaseClient.rb.htm +1896 -0
  4. data/doc/ReleaseNotes.txt +43 -0
  5. data/doc/qbc.makeCSVFile.qbc +4 -0
  6. data/doc/qbc.makeCSVFile.rb +4 -0
  7. data/doc/quickbase_adapter.rb.htm +399 -0
  8. data/examples/cookbookfiles/QuickBaseAPICookbook.html +2590 -0
  9. data/examples/cookbookfiles/addChangeRemoveUserRole.rb +21 -0
  10. data/examples/cookbookfiles/addOrEditRecord.rb +10 -0
  11. data/examples/cookbookfiles/application_object.rb +55 -0
  12. data/examples/cookbookfiles/applyRubyFormulas.rb +10 -0
  13. data/examples/cookbookfiles/average.rb +27 -0
  14. data/examples/cookbookfiles/backupApplication.rb +8 -0
  15. data/examples/cookbookfiles/cacheSchemas.rb +53 -0
  16. data/examples/cookbookfiles/calculateRunningTotals.rb +11 -0
  17. data/examples/cookbookfiles/copyrecords.rb +73 -0
  18. data/examples/cookbookfiles/count.rb +26 -0
  19. data/examples/cookbookfiles/createRecordNavigatorHTML.rb +42 -0
  20. data/examples/cookbookfiles/createReportDashboard.rb +35 -0
  21. data/examples/cookbookfiles/createTable.rb +12 -0
  22. data/examples/cookbookfiles/deviation.rb +25 -0
  23. data/examples/cookbookfiles/downloadCookbook.rb +97 -0
  24. data/examples/cookbookfiles/downloadFile.rb +10 -0
  25. data/examples/cookbookfiles/downloadFilesToFolder.rb +81 -0
  26. data/examples/cookbookfiles/downloadToTextFile.rb +64 -0
  27. data/examples/cookbookfiles/dumpSchema.rb +11 -0
  28. data/examples/cookbookfiles/duplicateRecord.rb +8 -0
  29. data/examples/cookbookfiles/dynamicMethods.rb +33 -0
  30. data/examples/cookbookfiles/editRecords.rb +15 -0
  31. data/examples/cookbookfiles/findJohnsLast10Records.rb +17 -0
  32. data/examples/cookbookfiles/findRubyRecords.rb +17 -0
  33. data/examples/cookbookfiles/formatCurrency.rb +24 -0
  34. data/examples/cookbookfiles/formatDate.rb +10 -0
  35. data/examples/cookbookfiles/formatDuration.rb +27 -0
  36. data/examples/cookbookfiles/formatPercent.rb +24 -0
  37. data/examples/cookbookfiles/getAllValuesForFields.rb +18 -0
  38. data/examples/cookbookfiles/getAppDTMInfo.rb +29 -0
  39. data/examples/cookbookfiles/getApplicationVariable.rb +5 -0
  40. data/examples/cookbookfiles/getChildTableDBID.rb +11 -0
  41. data/examples/cookbookfiles/getColumnListForReport.rb +6 -0
  42. data/examples/cookbookfiles/getFieldChoices.rb +13 -0
  43. data/examples/cookbookfiles/getFieldIDs.rb +6 -0
  44. data/examples/cookbookfiles/getFieldNames.rb +6 -0
  45. data/examples/cookbookfiles/getLastModTime.rb +8 -0
  46. data/examples/cookbookfiles/getLastRecModTime.rb +8 -0
  47. data/examples/cookbookfiles/getNumRecords.rb +8 -0
  48. data/examples/cookbookfiles/getNumTables.rb +4 -0
  49. data/examples/cookbookfiles/getRecord.rb +5 -0
  50. data/examples/cookbookfiles/getRecordDisplayURL.rb +13 -0
  51. data/examples/cookbookfiles/getRecordsAddedToday.rb +20 -0
  52. data/examples/cookbookfiles/getRecordsAsJSON.rb +6 -0
  53. data/examples/cookbookfiles/getReportNames.rb +25 -0
  54. data/examples/cookbookfiles/getRoleInfo.rb +48 -0
  55. data/examples/cookbookfiles/getServerStatus.rb +11 -0
  56. data/examples/cookbookfiles/getSortListForReport.rb +6 -0
  57. data/examples/cookbookfiles/getTableIDs.rb +6 -0
  58. data/examples/cookbookfiles/getTableName.rb +8 -0
  59. data/examples/cookbookfiles/getTableNames.rb +25 -0
  60. data/examples/cookbookfiles/getTimeCreated.rb +8 -0
  61. data/examples/cookbookfiles/getTimeInMilliseconds.rb +5 -0
  62. data/examples/cookbookfiles/getUserInfo.rb +26 -0
  63. data/examples/cookbookfiles/getUserRole.rb +15 -0
  64. data/examples/cookbookfiles/intranet.rb +101 -0
  65. data/examples/cookbookfiles/isAverageField.rb +17 -0
  66. data/examples/cookbookfiles/isDbidString.rb +8 -0
  67. data/examples/cookbookfiles/isTotalField.rb +16 -0
  68. data/examples/cookbookfiles/iterateDBPages.rb +8 -0
  69. data/examples/cookbookfiles/iterateFilteredRecords.rb +12 -0
  70. data/examples/cookbookfiles/iterateJoinRecords.rb +68 -0
  71. data/examples/cookbookfiles/iterateRecordInfos.rb +8 -0
  72. data/examples/cookbookfiles/iterateRecords.rb +23 -0
  73. data/examples/cookbookfiles/iterateSummaryRecords.rb +13 -0
  74. data/examples/cookbookfiles/iterateUnionRecords.rb +38 -0
  75. data/examples/cookbookfiles/listAccessibleApplications.rb +6 -0
  76. data/examples/cookbookfiles/logRequestAndResponseXML.rb +8 -0
  77. data/examples/cookbookfiles/lookupFieldPropertyByName.rb +62 -0
  78. data/examples/cookbookfiles/lookupFieldTypeByName.rb +10 -0
  79. data/examples/cookbookfiles/makeCSVFile.rb +4 -0
  80. data/examples/cookbookfiles/makeSlideShow.rb +42 -0
  81. data/examples/cookbookfiles/makerecs.rb +64 -0
  82. data/examples/cookbookfiles/max.rb +26 -0
  83. data/examples/cookbookfiles/min.rb +26 -0
  84. data/examples/cookbookfiles/percent.rb +29 -0
  85. data/examples/cookbookfiles/printChildElements.rb +54 -0
  86. data/examples/cookbookfiles/printNewRecords.rb +12 -0
  87. data/examples/cookbookfiles/processRESTRequest.rb +21 -0
  88. data/examples/cookbookfiles/provisionAndInviteNewUser.rb +13 -0
  89. data/examples/cookbookfiles/purgeRecords.rb +15 -0
  90. data/examples/cookbookfiles/quickbase_adapter.rb.htm +397 -0
  91. data/examples/cookbookfiles/quickbase_record_finder.zip +0 -0
  92. data/examples/cookbookfiles/recordAndFieldIterator.rb +24 -0
  93. data/examples/cookbookfiles/runImport.rb +9 -0
  94. data/examples/cookbookfiles/runQuickBaseTwitterConnector.rb +41 -0
  95. data/examples/cookbookfiles/sendToQuickBase.rb +33 -0
  96. data/examples/cookbookfiles/setDBvar.rb +6 -0
  97. data/examples/cookbookfiles/showRequestAndResponseXML.rb +8 -0
  98. data/examples/cookbookfiles/sqlQuery.rb +11 -0
  99. data/examples/cookbookfiles/stopOnError.rb +10 -0
  100. data/examples/cookbookfiles/sum.rb +26 -0
  101. data/examples/cookbookfiles/twitterFromQuickBase.rb +42 -0
  102. data/examples/cookbookfiles/twitterWithQuickBase.rb +36 -0
  103. data/examples/cookbookfiles/uploadCSVData.rb +20 -0
  104. data/examples/cookbookfiles/uploadExcelData.rb +22 -0
  105. data/examples/cookbookfiles/uploadFileEveryHour.rb +18 -0
  106. data/examples/cookbookfiles/uploadFileIntoNewRecord.rb +8 -0
  107. data/examples/cookbookfiles/uploadFilesFromFolder.exe +0 -0
  108. data/examples/cookbookfiles/uploadFilesFromFolder.rb +69 -0
  109. data/examples/cookbookfiles/useCompanyURL.rb +12 -0
  110. data/examples/cookbookfiles/userRoles.rb +49 -0
  111. data/examples/cookbookfiles/watchCommunityForum.rb +5 -0
  112. data/examples/cookbookfiles/wikifyTable.rb +29 -0
  113. data/examples/cookbookfiles/xmlShortcuts.rb +33 -0
  114. data/examples/pmp/app/controllers/application.rb +7 -0
  115. data/examples/pmp/app/controllers/contacts_controller.rb +8 -0
  116. data/examples/pmp/app/controllers/document_library_controller.rb +2 -0
  117. data/examples/pmp/app/controllers/issues_controller.rb +5 -0
  118. data/examples/pmp/app/controllers/projects_controller.rb +22 -0
  119. data/examples/pmp/app/controllers/resources_controller.rb +2 -0
  120. data/examples/pmp/app/controllers/tasks_controller.rb +13 -0
  121. data/examples/pmp/app/controllers/time_cards_controller.rb +5 -0
  122. data/examples/pmp/app/helpers/application_helper.rb +3 -0
  123. data/examples/pmp/app/helpers/contacts_helper.rb +2 -0
  124. data/examples/pmp/app/helpers/document_library_helper.rb +2 -0
  125. data/examples/pmp/app/helpers/issues_helper.rb +2 -0
  126. data/examples/pmp/app/helpers/projects_helper.rb +2 -0
  127. data/examples/pmp/app/helpers/resources_helper.rb +2 -0
  128. data/examples/pmp/app/helpers/tasks_helper.rb +2 -0
  129. data/examples/pmp/app/helpers/time_cards_helper.rb +2 -0
  130. data/examples/pmp/app/models/contacts.rb +26 -0
  131. data/examples/pmp/app/models/document_library.rb +2 -0
  132. data/examples/pmp/app/models/issues.rb +6 -0
  133. data/examples/pmp/app/models/projects.rb +26 -0
  134. data/examples/pmp/app/models/resources.rb +2 -0
  135. data/examples/pmp/app/models/tasks.rb +12 -0
  136. data/examples/pmp/app/models/time_cards.rb +7 -0
  137. data/examples/pmp/app/schemas/contacts.xml +1 -0
  138. data/examples/pmp/app/schemas/document_library.xml +1 -0
  139. data/examples/pmp/app/schemas/issues.xml +1 -0
  140. data/examples/pmp/app/schemas/pmp.xml +1 -0
  141. data/examples/pmp/app/schemas/projects.xml +1 -0
  142. data/examples/pmp/app/schemas/readme.txt +8 -0
  143. data/examples/pmp/app/schemas/resources.xml +1 -0
  144. data/examples/pmp/app/schemas/tasks.xml +1 -0
  145. data/examples/pmp/app/schemas/time_cards.xml +1 -0
  146. data/examples/pmp/app/views/contacts/companies.rhtml +31 -0
  147. data/examples/pmp/app/views/contacts/project_contacts.rhtml +31 -0
  148. data/examples/pmp/app/views/issues/filter_issues.rhtml +26 -0
  149. data/examples/pmp/app/views/layouts/application.rhtml +56 -0
  150. data/examples/pmp/app/views/projects/all_projects.rhtml +33 -0
  151. data/examples/pmp/app/views/projects/home.rhtml +11 -0
  152. data/examples/pmp/app/views/projects/my_open_projects.rhtml +27 -0
  153. data/examples/pmp/app/views/projects/open_projects.rhtml +44 -0
  154. data/examples/pmp/app/views/projects/project_sorted_by_company.rhtml +40 -0
  155. data/examples/pmp/app/views/projects/projects_sorted_by_priority.rhtml +30 -0
  156. data/examples/pmp/app/views/projects/updated_projects.rhtml +0 -0
  157. data/examples/pmp/app/views/tasks/all_tasks.rhtml +27 -0
  158. data/examples/pmp/app/views/tasks/search.rhtml +23 -0
  159. data/examples/pmp/app/views/tasks/search2.rhtml +23 -0
  160. data/examples/pmp/app/views/tasks/search3.rhtml +23 -0
  161. data/examples/pmp/app/views/time_cards/summary.rhtml +38 -0
  162. data/examples/pmp/config/boot.rb +45 -0
  163. data/examples/pmp/config/database.yml +30 -0
  164. data/examples/pmp/config/environment.rb +60 -0
  165. data/examples/pmp/config/environments/development.rb +21 -0
  166. data/examples/pmp/config/environments/production.rb +18 -0
  167. data/examples/pmp/config/environments/test.rb +19 -0
  168. data/examples/pmp/config/routes.rb +23 -0
  169. data/examples/pmp/db/migrate/001_create_projects.rb +10 -0
  170. data/examples/pmp/db/migrate/002_create_tasks.rb +10 -0
  171. data/examples/pmp/db/migrate/003_create_issues.rb +10 -0
  172. data/examples/pmp/db/migrate/004_create_document_libraries.rb +10 -0
  173. data/examples/pmp/db/migrate/005_create_resources.rb +10 -0
  174. data/examples/pmp/db/migrate/006_create_time_cards.rb +10 -0
  175. data/examples/pmp/db/migrate/007_create_contacts.rb +10 -0
  176. data/examples/pmp/public/404.html +30 -0
  177. data/examples/pmp/public/500.html +30 -0
  178. data/examples/pmp/public/app.index.html +277 -0
  179. data/examples/pmp/public/dispatch.cgi +10 -0
  180. data/examples/pmp/public/dispatch.fcgi +24 -0
  181. data/examples/pmp/public/dispatch.rb +10 -0
  182. data/examples/pmp/public/favicon.ico +0 -0
  183. data/examples/pmp/public/images/rails.png +0 -0
  184. data/examples/pmp/public/javascripts/application.js +2 -0
  185. data/examples/pmp/public/javascripts/controls.js +833 -0
  186. data/examples/pmp/public/javascripts/dragdrop.js +942 -0
  187. data/examples/pmp/public/javascripts/effects.js +1088 -0
  188. data/examples/pmp/public/javascripts/prototype.js +2515 -0
  189. data/examples/pmp/public/robots.txt +1 -0
  190. data/examples/pmp/test/fixtures/contacts.yml +5 -0
  191. data/examples/pmp/test/fixtures/document_libraries.yml +5 -0
  192. data/examples/pmp/test/fixtures/issues.yml +5 -0
  193. data/examples/pmp/test/fixtures/projects.yml +5 -0
  194. data/examples/pmp/test/fixtures/resources.yml +5 -0
  195. data/examples/pmp/test/fixtures/tasks.yml +5 -0
  196. data/examples/pmp/test/fixtures/time_cards.yml +5 -0
  197. data/examples/pmp/test/functional/contacts_controller_test.rb +18 -0
  198. data/examples/pmp/test/functional/document_library_controller_test.rb +18 -0
  199. data/examples/pmp/test/functional/issues_controller_test.rb +18 -0
  200. data/examples/pmp/test/functional/projects_controller_test.rb +18 -0
  201. data/examples/pmp/test/functional/resources_controller_test.rb +18 -0
  202. data/examples/pmp/test/functional/tasks_controller_test.rb +18 -0
  203. data/examples/pmp/test/functional/time_cards_controller_test.rb +18 -0
  204. data/examples/pmp/test/test_helper.rb +28 -0
  205. data/examples/pmp/test/unit/contacts_test.rb +10 -0
  206. data/examples/pmp/test/unit/document_library_test.rb +10 -0
  207. data/examples/pmp/test/unit/issues_test.rb +10 -0
  208. data/examples/pmp/test/unit/projects_test.rb +10 -0
  209. data/examples/pmp/test/unit/resources_test.rb +10 -0
  210. data/examples/pmp/test/unit/tasks_test.rb +10 -0
  211. data/examples/pmp/test/unit/time_cards_test.rb +10 -0
  212. data/lib/QuickBaseClient.rb +5054 -0
  213. data/lib/QuickBaseCommandLineClient.rb +401 -0
  214. data/lib/QuickBaseContactsAppBuilder.rb +419 -0
  215. data/lib/QuickBaseEmailer.rb +334 -0
  216. data/lib/QuickBaseEventNotifier.rb +592 -0
  217. data/lib/QuickBaseMisc.rb +96 -0
  218. data/lib/QuickBaseObjects.rb +566 -0
  219. data/lib/QuickBaseRSSGenerator.rb +286 -0
  220. data/lib/QuickBaseTextData.rb +545 -0
  221. data/lib/QuickBaseTwitterConnector.rb +300 -0
  222. data/lib/QuickBaseWebClient.rb +126 -0
  223. data/lib/WorkPlaceClient.rb +45 -0
  224. data/lib/qbc.makeCSVFile.qbc +4 -0
  225. data/lib/qbc.makeCSVFile.rb +17 -0
  226. data/lib/quickbase_adapter.rb +320 -0
  227. data/lib/runFieldEntryDialog.rb +151 -0
  228. data/lib/runOfflineFieldEntryDialog.rb +203 -0
  229. data/rakefile +100 -0
  230. data/test/run_tests.bat +7 -0
  231. data/test/spec_all_tests.rb +13 -0
  232. data/test/spec_smoke_tests.rb +58 -0
  233. data/test/spec_workplace_addrecord_test.rb +46 -0
  234. data/test/spec_workplace_base_test.rb +57 -0
  235. data/test/spec_workplace_editrecord_test.rb +38 -0
  236. data/test/spec_workplace_json_test.rb +38 -0
  237. data/test/spec_workplace_objects_test.rb +39 -0
  238. data/test/spec_workplace_smoke_tests.rb +45 -0
  239. metadata +353 -0
@@ -0,0 +1,8 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ # List the Pages from the QuickBase Support Center
6
+ qbc.iterateDBPages("9kaw8phg"){|page|
7
+ puts "Page: #{page['name']}, Type: #{page['type']}, ID: #{page['id']}\n"
8
+ }
@@ -0,0 +1,12 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new
5
+
6
+ puts "----------------------------------------------------------------------"
7
+ puts "Latest Community Forum records with Subject beginning with A through E"
8
+ puts "----------------------------------------------------------------------"
9
+
10
+ qbc.iterateFilteredRecords("8emtadvk",[{"Subject"=>"^[A-E].+"}],nil,nil,"List Changes",nil,nil,"structured","num-100") {|record|
11
+ puts record["Subject"]
12
+ }
@@ -0,0 +1,68 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ # make a list of the tables to be joined
7
+ tablesToJoin = Array.new
8
+
9
+ table1 = Hash.new
10
+ table1["dbid"]="bccr737mz" #table id
11
+ table1["fields"] = Array["a","b","c"] #fields to retrieve
12
+ table1["joinfield"] = "c" #field to compare across all tables' records
13
+ tablesToJoin << table1
14
+
15
+ table2 = Hash.new
16
+ table2["dbid"]="bccr737m2"
17
+ table2["fields"] = Array["c","d","e"]
18
+ table2["joinfield"] = "c"
19
+ tablesToJoin << table2
20
+
21
+ table3 = Hash.new
22
+ table3["dbid"]="bccr737m3"
23
+ table3["fields"] = Array["cc","g","gf"]
24
+ table3["joinfield"] = "cc"
25
+ tablesToJoin << table3
26
+
27
+ puts "------ Joined records from 3 tables ------"
28
+ recnum = 1
29
+ qbc.iterateJoinRecords(tablesToJoin) {|joinedRecord|
30
+ print "\n#{recnum}. "
31
+ joinedRecord.each{|field,value|
32
+ print "#{field}: #{value}, "
33
+ }
34
+ recnum += 1
35
+ }
36
+
37
+ =begin
38
+
39
+ The output using unrealistically simple data is below.
40
+ Note that field 'c' is in two tables and is merged.
41
+ The value of 'c' from the second table is included in the joined record.
42
+
43
+ ------ Joined records from 3 tables ------
44
+
45
+ 1. cc: c, a: a2, b: b2, c: c, d: d, e: e, g: g, gf: sda,
46
+ 2. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: cv, gf: sdafad,
47
+ 3. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: sad, gf: sad,
48
+ 4. cc: c, a: a2, b: b2, c: c, d: d, e: e, g: sad, gf: sad,
49
+ 5. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: g, gf: sda,
50
+ 6. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: cv, gf: sdafad,
51
+ 7. cc: c, a: a2, b: b2, c: c, d: d, e: e, g: sad, gf: sad,
52
+ 8. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: sad, gf: sad,
53
+ 9. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: g, gf: sda,
54
+ 10. cc: c, a: a2, b: b2, c: c, d: d, e: e, g: cv, gf: sdafad,
55
+ 11. cc: c, a: a2, b: b2, c: c, d: sadf, e: df, g: sad, gf: sad,
56
+ 12. cc: c, a: a, b: b, c: c, d: d, e: e, g: g, gf: sda,
57
+ 13. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: cv, gf: sdafad,
58
+ 14. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: sad, gf: sad,
59
+ 15. cc: c, a: a, b: b, c: c, d: d, e: e, g: sad, gf: sad,
60
+ 16. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: g, gf: sda,
61
+ 17. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: cv, gf: sdafad,
62
+ 18. cc: c, a: a, b: b, c: c, d: d, e: e, g: sad, gf: sad,
63
+ 19. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: sad, gf: sad,
64
+ 20. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: g, gf: sda,
65
+ 21. cc: c, a: a, b: b, c: c, d: d, e: e, g: cv, gf: sdafad,
66
+ 22. cc: c, a: a, b: b, c: c, d: sadf, e: df, g: sad, gf: sad,
67
+
68
+ =end
@@ -0,0 +1,8 @@
1
+ require 'QuickBaseClient'
2
+
3
+ puts "\n\nQuickBase Formula Functions Reference:\n\n"
4
+
5
+ QuickBase::Client.new.iterateRecordInfos("6ewwzuuj"){|ri|
6
+ puts "------------------------------"
7
+ ri.each{|field,value| puts "#{field}: #{value}\n"}
8
+ }
@@ -0,0 +1,23 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new
5
+ puts " ---------- Records from the QuickBase Community Forum containing 'Ruby wrapper' ----------"
6
+
7
+ recordNumber=1
8
+
9
+ qbc.iterateRecords("8emtadvk",["Subject","Created","Message"],"{'0'.CT.'Ruby wrapper'}") {|record|
10
+
11
+ print "\n\n#{recordNumber}."
12
+
13
+ print "\nSubject: ", record["Subject"]
14
+
15
+ print "\nCreated: ", qbc.formatDate(record["Created"])
16
+
17
+ message = record["Message"]
18
+ message.gsub!("<BR/>","\n") if message.include?("<BR/>")
19
+
20
+ print "\nMessage: ", message
21
+
22
+ recordNumber += 1
23
+ }
@@ -0,0 +1,13 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ puts "\nSummary of types of published applications in the QuickBase Application Library:\n"
7
+ printf( "\n%-20s %10s %10s","Type","Count","Popularity\n")
8
+ qbc.iterateSummaryRecords("bbtt9cjr7", ["Type","Popularity"]){|record|
9
+ if record["Type"]
10
+ printf( "\n%-20s %10s %10s",record["Type"],record["Count"],record["Popularity:Total"])
11
+ end
12
+ }
13
+ puts "\n\nCompare the output to Summary at the bottom of this report - \n\nhttps://www.quickbase.com/db/bbtt9cjr7?a=q&qid=28\n\n"
@@ -0,0 +1,38 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ # make a list of the tables to be merged
7
+ table1 = Hash.new
8
+ table1["dbid"]="bccr737mz"
9
+ table2 = Hash.new
10
+ table2["dbid"]="bccr737m2"
11
+ tablesToMerge = Array[table1,table2]
12
+
13
+ # fields are expected to be the same in both tables
14
+ fields = Array["c"]
15
+
16
+ puts "------ Merged records from 2 tables ------"
17
+ recnum = 1
18
+ qbc.iterateUnionRecords(tablesToMerge,fields) {|uniqueRecord|
19
+ print "\n#{recnum}. "
20
+ uniqueRecord.each{|field,value|
21
+ print "#{field}: #{value}, "
22
+ }
23
+ recnum += 1
24
+ }
25
+
26
+ =begin
27
+
28
+ The output using unrealistically simple data is below.
29
+
30
+ ------ Merged records from 2 tables ------
31
+
32
+ 1. c: ad,
33
+ 2. c: c,
34
+ 3. c: c1,
35
+ 4. c: v,
36
+ 5. c: Get records containing a certain value,
37
+
38
+ =end
@@ -0,0 +1,6 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new("username","password")
4
+ qbc.grantedDBs() { |database|
5
+ qbc.printChildElements(database)
6
+ }
@@ -0,0 +1,8 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ # change "username" "password" to your QuickBase username and password
5
+ qbc = QuickBase::Client.new("username","password")
6
+ puts "Logging XML requests and responses in file logfile.csv."
7
+ qbc.logToFile( "logfile.csv" )
8
+ qbc.getSchema("8emtadvk") #QuickBase Community Forum database
@@ -0,0 +1,62 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ qbc.getSchema("8emtadvk")
6
+ showTimeInDateModified = qbc.lookupFieldPropertyByName("Date Modified","display_time") == "1" ? "is" : "is not"
7
+
8
+ puts "\nFor the Date Modified field in the QuickBase Community Forum, the time of day #{showTimeInDateModified} displayed.\n"
9
+
10
+ puts "\nThe field properties you can lookup are: \n\n"
11
+ puts qbc.validFieldProperties.join("\n")
12
+
13
+ =begin
14
+
15
+ The above code prints -
16
+
17
+
18
+ For the Date Modified field in the QuickBase Community Forum, the time of day is displayed.
19
+
20
+ The field properties you can lookup are:
21
+
22
+ allowHTML
23
+ allow_new_choices
24
+ appears_by_default
25
+ append_only
26
+ blank_is_zero
27
+ bold
28
+ carrychoices
29
+ comma_start
30
+ cover_text
31
+ decimal_places
32
+ default_kind
33
+ default_today
34
+ display_dow
35
+ display_month
36
+ display_relative
37
+ display_time
38
+ display_today
39
+ display_user
40
+ display_zone
41
+ does_average
42
+ does_total
43
+ doesdatacopy
44
+ exact
45
+ find_enabled
46
+ foreignkey
47
+ label
48
+ nowrap
49
+ num_lines
50
+ required
51
+ sort_as_given
52
+ unique
53
+ use_new_window
54
+ target_dbid
55
+ target_dbname
56
+ target_fieldname
57
+ target_fid
58
+ source_fieldname
59
+ source_fid
60
+
61
+ =end
62
+
@@ -0,0 +1,10 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new
5
+
6
+ qbc.getSchema("8emtadvk") #Messages table in QuickBase Community Forum
7
+
8
+ puts qbc.lookupFieldTypeByName("Thread")
9
+
10
+ # the line above prints "url" on the screen
@@ -0,0 +1,4 @@
1
+ require 'QuickBaseClient'
2
+ qbc = QuickBase::Client.new( "my_username", "my_password", "My QuickBase Database" )
3
+ qbc.makeSVFile( "MyCSVFile.csv" )
4
+ qbc.signOut
@@ -0,0 +1,42 @@
1
+ require 'QuickBaseClient'
2
+ require 'QuickBaseMisc'
3
+
4
+ username = ARGV[0] || ENV["quickbase_username"]
5
+ password = ARGV[1] || ENV["quickbase_password"]
6
+
7
+ qbc = QuickBase::Client.new(username,password)
8
+
9
+ cwd = Dir.pwd.gsub('/','\\')
10
+
11
+ dbid = qbc.findDBByName(cwd)
12
+ if dbid.nil?
13
+ dbid = qbc.createDatabase(cwd,"#{username}'s slide show from #{cwd}.")
14
+ qbc.addField(dbid,"Picture","file")
15
+ qbc.addField(dbid,"HtmlPage","file")
16
+ else
17
+ qbc.getSchema(dbid)
18
+ dbid = qbc.lookupChdbid(cwd.dup)
19
+ qbc.getSchema(dbid)
20
+ end
21
+ pictureFieldID = QuickBase::Misc.decimalToBase32(6)
22
+ htmlPageFieldID = QuickBase::Misc.decimalToBase32(7)
23
+ Dir.foreach(cwd){|file|
24
+ next unless [".jpeg", ".jpg",".gif",".bmp",".png"].include?(file.downcase[file.rindex('.'),file.length])
25
+ renamedFile = file.dup
26
+ renamedFile.gsub!("&","And")
27
+ renamedFile.gsub!("'"," ")
28
+ if renamedFile != file
29
+ File.rename(file,renamedFile)
30
+ end
31
+ puts "Uploading #{renamedFile}"
32
+ rid, updateid = qbc.uploadFile(dbid, renamedFile.dup, "Picture")
33
+ thisRid = QuickBase::Misc.decimalToBase32(rid.to_i)
34
+ prevRid = QuickBase::Misc.decimalToBase32(rid.to_i-1)
35
+ nextRid = QuickBase::Misc.decimalToBase32(rid.to_i+1)
36
+ pictureURL = "https://www.quickbase.com/up/#{dbid}/g/r#{thisRid}/e#{pictureFieldID}/va/#{renamedFile.dup}"
37
+ prevHtmlURL = "https://www.quickbase.com/up/#{dbid}/g/r#{prevRid}/e#{htmlPageFieldID}/va/slide.html"
38
+ nextHtmlURL = "https://www.quickbase.com/up/#{dbid}/g/r#{nextRid}/e#{htmlPageFieldID}/va/slide.html"
39
+ html = "<center><img src=\"#{pictureURL}\" /><br>#{renamedFile.dup}<b>#{}</b><hr><a href=\"#{prevHtmlURL}\">Previous</a> <a href=\"#{nextHtmlURL}\">Next</a></center>"
40
+ File.open("slide.html","w"){|f|f.write(html)}
41
+ qbc.updateFile(dbid,rid,"slide.html","HtmlPage")
42
+ }
@@ -0,0 +1,64 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ #
5
+ # This script reads the list of records from a Documents table and a Doctors table
6
+ # And creates mssing records in a Progress table for all the combinations of Doctors and Documents
7
+ #
8
+
9
+ # Check the command line for username, password ---------------------
10
+ if ARGV.length == 1 and ARGV[0] == "?"
11
+ puts "\n\nUsage: ruby makerecs.rb username password\n\nThis program adds records to the Progress table\nfor each record added to the Documents table.\n\n"
12
+ exit 1
13
+ elsif ARGV.length > 1
14
+ username = ARGV[0]
15
+ password = ARGV[1]
16
+ else
17
+ puts "\nPlease enter your username and password, e.g.\n\n\truby makerecs.rb fred amliw\n\n"
18
+ exit 1
19
+ end
20
+
21
+ documentsDBID = "xxxxxxxxx" # fictitious! please use a valid table dbid
22
+ doctorsDBID = "yyyyyyyyy" # fictitious! please use a valid table dbid
23
+ progressDBID = "zzzzzzzzz" # fictitious! please use a valid table dbid
24
+
25
+ # Signin to QuickBase ----------------------------------------------
26
+ qbc = QuickBase::Client.new( username, password )
27
+
28
+ # Collect the record IDs from the Documents table -------------------
29
+ documentRids = qbc.getAllRecordIDs( documentsDBID ) #Documents table
30
+ puts "Document IDs = #{documentRids.join( ',' )}"
31
+
32
+ # Collect the record IDs from the Doctors table ---------------------
33
+ doctorRids = qbc.getAllRecordIDs( doctorsDBID ) #Doctors table
34
+ puts "Doctor IDs = #{doctorRids.join( ',' )}"
35
+
36
+ # Collect the Document and Doctor IDs from the Progress table -------
37
+ progressIDs = qbc.getAllValuesForFields( progressDBID, [ "DoctorID", "DocumentID" ] ) # Progress table
38
+
39
+ puts "Progress Document IDs = #{progressIDs["DocumentID"].join(',')}"
40
+ puts "Progress Doctor IDs = #{progressIDs["DoctorID"].join(',')}"
41
+
42
+ # Collect the Documents that are missing from the Progress table ----------------
43
+ missingProgressDocuments = Array.new
44
+ documentRids.each{ |documentRid|
45
+ if not progressIDs["DocumentID"].include?( documentRid )
46
+ missingProgressDocuments << documentRid
47
+ end
48
+ }
49
+
50
+ puts "Missing Progress Document IDs = #{missingProgressDocuments.join(',')}"
51
+
52
+ # For each missing Document, add a record to the Progress table for each Doctor -
53
+ missingProgressDocuments.each{ |documentRid|
54
+ doctorRids.each{ |doctorRid|
55
+ qbc.clearFieldValuePairList
56
+ qbc.addFieldValuePair( "DocumentID", nil, nil, documentRid )
57
+ fieldValueList = qbc.addFieldValuePair( "DoctorID", nil, nil, doctorRid )
58
+ qbc.addRecord( progressDBID, fieldValueList )
59
+ }
60
+ }
61
+
62
+ # Signout from QuickBase --------------------------------------------
63
+ qbc.signOut
64
+
@@ -0,0 +1,26 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ qbc.iterateRecords("bcct3jb3b",["number"]){|record|
7
+ puts "number: #{record['number']}"
8
+ }
9
+
10
+ max = qbc.max("bcct3jb3b",["number"])
11
+ puts "max: #{max['number']}"
12
+
13
+ =begin
14
+
15
+ number: 62
16
+ number: 21
17
+ number: 76
18
+ number: 13
19
+ number: 34
20
+ number: 2
21
+ number: 66
22
+ number: 2
23
+ number: 3
24
+ max: 76.0
25
+
26
+ =end
@@ -0,0 +1,26 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ qbc.iterateRecords("bcct3jb3b",["number"]){|record|
7
+ puts "number: #{record['number']}"
8
+ }
9
+
10
+ min = qbc.min("bcct3jb3b",["number"])
11
+ puts "min: #{min['number']}"
12
+
13
+ =begin
14
+
15
+ number: 62
16
+ number: 21
17
+ number: 76
18
+ number: 13
19
+ number: 34
20
+ number: 2
21
+ number: 66
22
+ number: 2
23
+ number: 3
24
+ min: 2.0
25
+
26
+ =end