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,6 @@
1
+ require 'QuickBaseClient'
2
+
3
+ puts "\n\nThe field IDs for the QuickBase Community Forum are : #{QuickBase::Client.new.getFieldIDs("8emtadvk").join(",")}\n\n"
4
+
5
+
6
+
@@ -0,0 +1,6 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ puts "Fields from the QuickBase Community Forum: "
5
+ qbc = QuickBase::Client.new
6
+ puts qbc.getFieldNames("8emtadvk")
@@ -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
+ qbc.getDBInfo("8emtadvk")
7
+ lastModifiedTimeString = qbc.formatFieldValue(qbc.lastModifiedTime,"timestamp")
8
+ puts "The last thing modified in the QuickBase Community Forum was at #{lastModifiedTimeString} (#{qbc.lastModifiedTime})."
@@ -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
+ qbc.getDBInfo("8emtadvk")
7
+ lastRecModTimeString = qbc.formatFieldValue(qbc.lastRecModTime,"timestamp")
8
+ puts "A record was last modified in the QuickBase Community Forum at #{lastRecModTimeString} (#{qbc.lastRecModTime})."
@@ -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
+ numRecords = qbc.getNumRecords("8emtadvk")
7
+ puts "There are #{numRecords} in the QuickBase Community Forum database"
8
+
@@ -0,0 +1,4 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+ puts "There are #{qbc.getNumTables("bbtt9cjr6")} tables in the QuickBase Application Library."
@@ -0,0 +1,5 @@
1
+ require 'QuickBaseClient'
2
+ qbc = QuickBase::Client.new
3
+ qbc.getRecord("24105","8emtadvk"){|myRecord|
4
+ myRecord.each{|key,value| puts "Field: #{key}, Value: #{value}\n" }
5
+ }
@@ -0,0 +1,13 @@
1
+
2
+ require 'QuickBaseMisc'
3
+
4
+ r = QuickBase::Misc.decimalToBase32(24105)
5
+ puts "<a href=\"https://www.quickbase.com/db/8emtadvk?a=dr&r=#{r}\">Ruby API home page</a>"
6
+
7
+ =begin
8
+
9
+ The above code prints this HTML link -
10
+
11
+ <a href="https://www.quickbase.com/db/8emtadvk?a=dr&r=ztj">Ruby API home page</a>
12
+
13
+ =end
@@ -0,0 +1,20 @@
1
+
2
+ require 'QuickBaseClient'
3
+ require 'Date'
4
+
5
+ # change "username" "password" to your QuickBase username and password
6
+ qbc = QuickBase::Client.new("username","password")
7
+
8
+ today = Date.today
9
+ today = today.strftime("%m-%d-%Y")
10
+ communityForumRecords = qbc.getAllValuesForFields("8emtadvk",["Subject","Message"],"{'1'.EX.'#{today}'}",nil,nil,"6.10")
11
+
12
+ puts "\n --- QuickBase Community Forum Records added today ---\n\n"
13
+
14
+ numRecords = communityForumRecords["Subject"].length
15
+ (0..(numRecords-1)).each{|index|
16
+ print "\nSubject: "
17
+ print communityForumRecords["Subject"][index]
18
+ puts "\nMessage:"
19
+ puts communityForumRecords["Message"][index].gsub!("<BR/>","\n")
20
+ }
@@ -0,0 +1,6 @@
1
+ require "QuickBaseClient"
2
+
3
+ # print the list of QuickBase formula functions in JSON format:
4
+
5
+ qbc=QuickBase::Client.new(ENV["quickbase_username"],ENV["quickbase_password"])
6
+ puts qbc.getAllValuesForFieldsAsPrettyJSON("6ewwzuuj",["Function Name"])
@@ -0,0 +1,25 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ # list the reports from the Formula Functions Reference table in the QuickBase Support Center
6
+ puts qbc.getReportNames("6ewwzuuj")
7
+
8
+ =begin
9
+
10
+ The above code prints the list below:-
11
+
12
+ All Functions
13
+ All Functions and Operators
14
+ Boolean Functions
15
+ Formula Export View
16
+ gsa_formula functions ref
17
+ List All
18
+ List Changes
19
+ Number Functions
20
+ Operators - Binary
21
+ Operators - Unary
22
+ Text Functions
23
+ Time and Date Functions
24
+
25
+ =end
@@ -0,0 +1,48 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new
5
+
6
+ puts "\nRoles in the QuickBase Community Forum\n\n"
7
+
8
+ qbc.getRoleInfo("bbqm84dzy") { |role|
9
+ puts "id: #{role.attributes['id']}"
10
+ puts "name: #{role.elements['name'].text}"
11
+ puts "access id: #{role.elements['access'].attributes['id']}"
12
+ puts "access name: #{role.elements['access'].text}"
13
+ puts "============================="
14
+ }
15
+
16
+ =begin
17
+
18
+ Output of the above script:
19
+
20
+ Roles in the QuickBase Community Forum
21
+
22
+ id: 10
23
+ name: Viewer
24
+ access id: 3
25
+ access name: Basic Access
26
+ =============================
27
+ id: 11
28
+ name: Participant
29
+ access id: 3
30
+ access name: Basic Access
31
+ =============================
32
+ id: 12
33
+ name: Administrator
34
+ access id: 1
35
+ access name: Administrator
36
+ =============================
37
+ id: 17
38
+ name: Product Manager
39
+ access id: 1
40
+ access name: Administrator
41
+ =============================
42
+ id: 18
43
+ name: Participant with Modify Own
44
+ access id: 3
45
+ access name: Basic Access
46
+ =============================
47
+
48
+ =end
@@ -0,0 +1,11 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+ serverStatus = qbc.getServerStatus
5
+
6
+ puts "\nversion: #{serverStatus['version']}"
7
+ puts "users: #{serverStatus['users']}"
8
+ puts "groups: #{serverStatus['groups']}"
9
+ puts "databases: #{serverStatus['databases']}"
10
+ puts "uptime: #{serverStatus['uptime']}"
11
+ puts "updays: #{serverStatus['updays']}"
@@ -0,0 +1,6 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+ qbc.getSchema("8emtadvk")
5
+ puts "Sort fields for QuickBase Community Forum 'List Changes' report: #{qbc.getSortListForQuery(nil,'List Changes')}"
6
+ puts "Sort fields for QuickBase Community Forum 'List Changes' report: #{qbc.getSortListForQuery('2',nil)}"
@@ -0,0 +1,6 @@
1
+ require 'QuickBaseClient'
2
+
3
+ puts "\nThe QuickBase Support Center has these child tables:\n\n"
4
+ puts QuickBase::Client.new.getTableIDs("9kaw8phg").join("\n")
5
+
6
+
@@ -0,0 +1,8 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ puts "The name of the table for dbid 'bbqm84dzy' is '#{qbc.getTableName('bbqm84dzy')}'."
6
+
7
+ # The above code prints -
8
+ # The name of the table for dbid 'bbqm84dzy' is 'QuickBase Community Forum'.
@@ -0,0 +1,25 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new
5
+ tableNames = qbc.getTableNames("bbtt9cjr6")
6
+ puts "\nTables in the QuickBase Application Library:\n\n"
7
+ puts tableNames.join( "\n")
8
+
9
+ =begin
10
+ Output of the above script:
11
+
12
+ Tables in the QuickBase Application Library:
13
+
14
+ Applications
15
+ Versions
16
+ Files
17
+ Reviews
18
+ Activity Log
19
+ Bookmarks
20
+ Feedback
21
+ Featured Apps
22
+ Categories
23
+
24
+ =end
25
+
@@ -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
+ qbc.getDBInfo("8emtadvk")
7
+ createdTimeString = qbc.formatFieldValue(qbc.createdTime,"timestamp")
8
+ puts "The QuickBase Community Forum was created #{createdTimeString} (#{qbc.createdTime})."
@@ -0,0 +1,5 @@
1
+ require 'QuickBaseMisc'
2
+
3
+ puts "\n\nThe time now in milliseconds is #{QuickBase::Misc.time_in_milliseconds}."
4
+ puts "\nThe time in milliseconds at the beginning of today was #{QuickBase::Misc.time_in_milliseconds(Date.today)}."
5
+ puts "\nThe time in milliseconds at this time tomorrow will be #{QuickBase::Misc.time_in_milliseconds(DateTime.now + 1)}."
@@ -0,0 +1,26 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ def displayUserInfo( qbc, emailAddress = nil)
5
+
6
+ qbc.getUserInfo emailAddress
7
+
8
+ puts "name : #{qbc.name}"
9
+ puts "first name : #{qbc.firstName}"
10
+ puts "last name : #{qbc.lastName}"
11
+ puts "login : #{qbc.login}"
12
+ puts "email : #{qbc.email}"
13
+ puts "screen name : #{qbc.screenName}"
14
+ puts "externalAuth: #{qbc.externalAuth}"
15
+ puts "user id : #{qbc.userid}"
16
+
17
+ end
18
+
19
+
20
+ qbc = QuickBase::Client.new("username","password")
21
+
22
+ puts "\n\nInformation in QuickBase about the person running this script:\n\n"
23
+ displayUserInfo(qbc)
24
+
25
+ puts "\n\nInformation in QuickBase about fred_flinstone@internet.com:\n\n"
26
+ displayUserInfo(qbc, "fred_flinstone@internet.com")
@@ -0,0 +1,15 @@
1
+
2
+ require 'QuickBaseClient'
3
+
4
+ qbc = QuickBase::Client.new("username","password")
5
+
6
+ qbc.getUserInfo( "fred_flinstone@internet.com")
7
+
8
+ qbc.getUserRole("bbqm84dzy",qbc.userid)
9
+
10
+ puts "user id : #{qbc.userid}"
11
+ puts "user name: #{qbc.username}"
12
+ puts "role id : #{qbc.roleid}"
13
+ puts "role name: #{qbc.rolename}"
14
+ puts "access id: #{qbc.accessid}"
15
+ puts "access : #{qbc.access}"
@@ -0,0 +1,101 @@
1
+
2
+ require 'rubygems'
3
+ require 'ramaze'
4
+ require 'QuickBaseClient'
5
+ require 'cgi'
6
+
7
+ #-----------------------------------------------------------
8
+ class MainController < Ramaze::Controller
9
+
10
+ map '/'
11
+ layout :page
12
+
13
+ #-----------------------------------------------------------
14
+ def index
15
+ @title = "Intranet"
16
+ html = "<form method=\"post\" action=\"/listQuickBaseApplications\">"
17
+ html << "<p>User name:<input type=\"text\" name=\"username\"></input></p>"
18
+ html << "<p>Password :<input type=\"text\" name=\"password\"></input></p>"
19
+ html << "<input type=\"submit\" name=\"my_quickbase\" value=\"My QuickBase.\">"
20
+ html << "</form>"
21
+ end
22
+
23
+ #-----------------------------------------------------------
24
+ def listQuickBaseApplications
25
+ @title = "My QuickBase"
26
+ if request['username'] and request['password']
27
+ @qbc = QuickBase::Client.new(request['username'], request['password'])
28
+ if @qbc and @qbc.requestSucceeded
29
+ html = ""
30
+ grantedDBname = ""
31
+ grantedDBid = ""
32
+ dbproc = proc { |element|
33
+ if element.is_a?(REXML::Element)
34
+ if element.has_text?
35
+ if element.name == "dbname"
36
+ grantedDBname = element.text
37
+ elsif element.name == "dbid"
38
+ grantedDBid = element.text
39
+ end
40
+ end
41
+ end
42
+ }
43
+ @qbc.grantedDBs("1","1","1"){|grantedDB|
44
+ @qbc.processChildElements(grantedDB,true,dbproc)
45
+ html << "<br>(<a href=\"/showSchema/#{CGI.escape(request['username'])}/#{CGI.escape(request['password'])}/#{grantedDBid}/#{CGI.escape(grantedDBname)}\">schema</a>) <a href=\"https://www.quickbase.com/db/#{grantedDBid}\">#{grantedDBname}</a>"
46
+ }
47
+ html
48
+ else
49
+ "<p><b>Oops - something went wrong while connecting to QuickBase.<br>Please check your username and password.</b></p>"
50
+ end
51
+ else
52
+ "<p><b>Oops - please specifiy your QuickBase username and password.</b></p>"
53
+ end
54
+ end
55
+
56
+ #-----------------------------------------------------------
57
+ def showSchema(username,password,dbid,dbname)
58
+ @title = "Schema for #{dbname}"
59
+ html = "Oops - couldn't find the schema for that table."
60
+ @qbc = QuickBase::Client.new(username,password)
61
+ if @qbc and @qbc.requestSucceeded
62
+ @qbc.getSchema(dbid)
63
+ if @qbc.requestSucceeded
64
+ schema = ""
65
+
66
+ # if you get 'undefined variable transitive' from the next line
67
+ # edit rexml\document.rb and change 'trans=false' to ''transitive=false'
68
+ @qbc.qdbapi.write(schema, 3)
69
+
70
+ schema.gsub!("<","&lt;")
71
+ schema.gsub!(">","&gt;")
72
+ html = "<pre>#{schema}</pre>"
73
+ end
74
+ end
75
+ html
76
+ end
77
+
78
+ #-----------------------------------------------------------
79
+ def error
80
+ "<p><b>Sorry - that is not a valid web page on this web site.</b></p>"
81
+ end
82
+
83
+ #-----------------------------------------------------------
84
+ def page
85
+ %{
86
+ <html>
87
+ <head>
88
+ <title>#@title</title>
89
+ </head>
90
+ <body>
91
+ <h2>#@title</h2><a href ="/index">Home</a>
92
+ <hr>
93
+ #@content
94
+ </body>
95
+ </html>
96
+ }
97
+ end
98
+ end
99
+
100
+ Ramaze.start
101
+
@@ -0,0 +1,17 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ qbc.getSchema("93htvp8y")
6
+
7
+ if qbc.isAverageField?("Subject")
8
+ puts "The 'Subject' field in the QuickBase Community Forum has an Average at the bottom of reports."
9
+ else
10
+ puts "The 'Subject' field in the QuickBase Community Forum does not have a Average at the bottom of reports."
11
+ end
12
+
13
+ if qbc.isAverageField?("# of Posts")
14
+ puts "The '# of Posts' field in the QuickBase Community Forum has a Average at the bottom of reports."
15
+ else
16
+ puts "The '# of Posts' field in the QuickBase Community Forum does not have a Average at the bottom of reports."
17
+ end
@@ -0,0 +1,8 @@
1
+
2
+ require 'QuickBaseMisc'
3
+
4
+ print "\n\nEnter a string: "
5
+ string = gets.chop
6
+
7
+ puts "\n\n'#{string}' is #{QuickBase::Misc.isDbidString?(string) ? '' : 'not'} a valid QuickBase table id string.\n\n"
8
+
@@ -0,0 +1,16 @@
1
+ require 'QuickBaseClient'
2
+
3
+ qbc = QuickBase::Client.new
4
+
5
+ qbc.getSchema("8emtadvk")
6
+ if qbc.isTotalField?("Subject")
7
+ puts "The 'Subject' field in the QuickBase Community Forum has a Total at the bottom of reports."
8
+ else
9
+ puts "The 'Subject' field in the QuickBase Community Forum does not have a Total at the bottom of reports."
10
+ end
11
+
12
+ if qbc.isTotalField?("# of Posts")
13
+ puts "The '# of Posts' field in the QuickBase Community Forum has a Total at the bottom of reports."
14
+ else
15
+ puts "The '# of Posts' field in the QuickBase Community Forum does not have a Total at the bottom of reports."
16
+ end