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,33 @@
1
+ <h1>All Projects</h1>
2
+
3
+ This View shows how to display records using the names of QuickBase queries and fields.
4
+ <p>
5
+ Queries defined in the QuickBase UI (i.e. 'Table' Reports) include filtering and sorting criteria and the list of columns to display.
6
+ The list of @projects is retrieved from QuickBase using <i>find_by_sql("All Projects")</i> in the <i>projects.rb</i> model class.
7
+ The list of fields in the QuickBase 'All Projects' report is retrieved using <i>reportFields = connection.raw_connection.clist.split('.')</i>
8
+ in the <i>projects.rb</i> model class, and controls the list of columns displayed below using <i>column.quickBaseFieldAttributes["quickBaseFieldId"]</i>.
9
+ <p>
10
+ See the <i>QuickBaseColumn</i> class in quickbase_adapter.rb to understand how this works.
11
+ <hr>
12
+
13
+ <table border="1">
14
+
15
+ <tr>
16
+ <% Projects.columns.each { |column| %>
17
+ <% if @reportColumns.include?(column.quickBaseFieldAttributes["quickBaseFieldId"]) %>
18
+ <td><b><%= column.human_name %></b></td>
19
+ <% end %>
20
+ <% } %>
21
+ </tr>
22
+
23
+ <% for project in @projects do %>
24
+ <tr>
25
+ <% Projects.columns.each { |column| %>
26
+ <% if @reportColumns.include?(column.quickBaseFieldAttributes["quickBaseFieldId"]) %>
27
+ <td><%= project[column.human_name] %></td>
28
+ <% end %>
29
+ <% } %>
30
+ </tr>
31
+ <% end %>
32
+
33
+ </table>
@@ -0,0 +1,11 @@
1
+
2
+ <b>
3
+ Click on the links on the left to see different ways to retrieve records from QuickBase.
4
+ <p>
5
+ You can retrieve records using ActiveRecord 'find' calls, hard-coded SQL SELECT statements,
6
+ QuickBase Reports, and queries written in the QuickBase query language.
7
+ <p>
8
+ You can also retrieve data from any QuickBase table you have access to, even if it's not in
9
+ the QuickBase application associated with your Rails application.
10
+
11
+ </b>
@@ -0,0 +1,27 @@
1
+ <h1>My Open Projects</h1>
2
+
3
+ This View shows how to display records using a QuickBase query and Rails methods to retrieve column
4
+ data. Note that column names that contain spaces must be accessed using a string. If you don't see any
5
+ records listed below, add a Projects record in QuickBase and make yourself the Project Lead.
6
+
7
+ <hr>
8
+
9
+ <table border="1">
10
+
11
+ <tr>
12
+ <td><b>Name</b></td>
13
+ <td><b>Priority</b></td>
14
+ <td><b>Status</b></td>
15
+ <td><b>Percent Complete</b></td>
16
+ </tr>
17
+
18
+ <% for project in @projects do %>
19
+ <tr>
20
+ <td><%= project.attributes["Project Name"] %></td>
21
+ <td><%= project.Priority %></td>
22
+ <td><%= project.Status %></td>
23
+ <td><%= project["Percent Complete"] %></td>
24
+ </tr>
25
+ <% end %>
26
+
27
+ </table>
@@ -0,0 +1,44 @@
1
+ <h1>Open Projects</h1>
2
+
3
+ This View shows how to display records using a QuickBase query and Rails methods to retrieve column
4
+ data. Note that column names that contain spaces must be accessed using a string.
5
+ <p>
6
+ This view also shows the counts of Projects by status in the form of sentences.
7
+ This is a basic example of something that is impossible to do within the regular QuickBase UI.
8
+
9
+ <hr>
10
+
11
+ <% statusCount = {} %>
12
+
13
+ <table border="1">
14
+
15
+ <tr>
16
+ <td><b>Name</b></td>
17
+ <td><b>Priority</b></td>
18
+ <td><b>Status</b></td>
19
+ <td><b>Estimated Project Start Date</b></td>
20
+ <td><b>Planned Finish Date</b></td>
21
+ </tr>
22
+
23
+ <% for project in @projects do %>
24
+ <tr>
25
+ <td><%= project.attributes["Project Name"] %></td>
26
+ <td><%= project.Priority %></td>
27
+ <td><%= project.Status %></td>
28
+ <% statusCount[project.Status] ||= 0 %>
29
+ <% statusCount[project.Status] += 1 %>
30
+ <td><%= project["Estimated Project Start Date"] %></td>
31
+ <td><%= project["Planned Finish Date"] %></td>
32
+ </tr>
33
+ <% end %>
34
+
35
+ </table>
36
+
37
+ <hr>
38
+
39
+ <b>
40
+ <% statusCount.each{|key,value| %>
41
+ <p>The number of <%= key %> projects is <%= value %>.
42
+ <% } %>
43
+ </b>
44
+
@@ -0,0 +1,40 @@
1
+ <h1>Project sorted by Company</h1>
2
+
3
+ This View shows how to switch the rows and columns from a QuickBase Report.
4
+
5
+ <hr>
6
+
7
+ <table border="1">
8
+
9
+ <tr>
10
+ <td></td>
11
+ <% for project in @projects do %>
12
+ <td><b><%= project.Company %></b></td>
13
+ <% end %>
14
+ </tr>
15
+
16
+ <tr>
17
+ <td><b>Project Name</b></td>
18
+ <% for project in @projects do %>
19
+ <td><%= project["Project Name"] %></td>
20
+ <% end %>
21
+ </tr>
22
+
23
+ <tr>
24
+ <td><b>Project Priority</b></td>
25
+ <% for project in @projects do %>
26
+ <td><%= project.Priority %></td>
27
+ <% end %>
28
+ </tr>
29
+
30
+ <tr>
31
+ <td><b>Project Status</b></td>
32
+ <% for project in @projects do %>
33
+ <td><%= project.Status %></td>
34
+ <% end %>
35
+ </tr>
36
+
37
+ </table>
38
+
39
+
40
+
@@ -0,0 +1,30 @@
1
+ <h1>Projects sorted by Priority, displayed from left to right</h1>
2
+
3
+ The model method <i>Projects.projects_sorted_by_priority</i>, in projects.rb, shows how to
4
+ get records using the low-level <i>execute</i> method from the QuickBase adapter. Note that using
5
+ <i>execute</i> effectively bypasses ActiveRecord, but you can access column values using Ruby's
6
+ Hash syntax, e.g. <i>project["Project Name"]</i>
7
+
8
+ <hr>
9
+
10
+ <table border="1">
11
+
12
+ <tr>
13
+ <td><b>Project Name</b></td>
14
+ <% for project in @projects do %>
15
+ <td><%= project["Project Name"] %></td>
16
+ <% end %>
17
+ </tr>
18
+
19
+ <tr>
20
+ <td><b>Project Summary</b></td>
21
+ <% for project in @projects do %>
22
+ <td><%= project["Project Summary"] %></td>
23
+ <% end %>
24
+ </tr>
25
+
26
+
27
+ </table>
28
+
29
+
30
+
@@ -0,0 +1,27 @@
1
+ <h1>All Tasks</h1>
2
+
3
+ This View shows how to display records from QuickBase without any model code and without
4
+ ActiveRecord, by using the underlying QuickBase API directly.
5
+ <p>
6
+ It breaks the MVC paradigm, but it's not the end of the world!
7
+ <hr>
8
+ <% fieldNames = Array["Project Phase","Task Name","Duration", "Milestone","Start","Calculated Finish Date","Days Overdue","Status","Priority","% Complete"] %>
9
+
10
+ <table border="1">
11
+ <tr>
12
+ <% fieldNames.each{|fieldName| %>
13
+ <td><b><%= fieldName %></b></td>
14
+ <% } %>
15
+ </tr>
16
+
17
+ <% dbid = ActiveRecord::Base.connection.setActiveTable("Tasks") %>
18
+ <% qbClient = ActiveRecord::Base.connection.raw_connection %>
19
+ <% qbClient.iterateRecords(dbid, fieldNames, nil,nil, "All Tasks") { |task| %>
20
+ <tr>
21
+ <% fieldNames.each{ |fieldName| %>
22
+ <td><%= qbClient.formatFieldValue(task[fieldName],qbClient.lookupFieldTypeByName(fieldName)) %></td>
23
+ <% } %>
24
+ </tr>
25
+ <% } %>
26
+
27
+ </table>
@@ -0,0 +1,23 @@
1
+ <h1>Tasks: find all records for which any field contains '<%= params[:s] %>'</h1>
2
+
3
+ This View shows how to search QuickBase records using the query language in the QuickBase HTTP API.
4
+ <hr>
5
+
6
+ <% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
7
+
8
+ <table border="1">
9
+ <tr>
10
+ <% fieldNames.each{|fieldName| %>
11
+ <td><b><%= fieldName %></b></td>
12
+ <% } %>
13
+ </tr>
14
+
15
+ <% for task in @tasks do %>
16
+ <tr>
17
+ <% fieldNames.each{ |fieldName| %>
18
+ <td><%= task[fieldName] %></td>
19
+ <% } %>
20
+ </tr>
21
+ <% end %>
22
+
23
+ </table>
@@ -0,0 +1,23 @@
1
+ <h1>Tasks with Status = '<%= params[:status] %>'</h1>
2
+
3
+ This View shows how to search QuickBase records using a simple SQL statement.
4
+ <hr>
5
+
6
+ <% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
7
+
8
+ <table border="1">
9
+ <tr>
10
+ <% fieldNames.each{|fieldName| %>
11
+ <td><b><%= fieldName %></b></td>
12
+ <% } %>
13
+ </tr>
14
+
15
+ <% for task in @tasks do %>
16
+ <tr>
17
+ <% fieldNames.each{ |fieldName| %>
18
+ <td><%= task[fieldName] %></td>
19
+ <% } %>
20
+ </tr>
21
+ <% end %>
22
+
23
+ </table>
@@ -0,0 +1,23 @@
1
+ <h1>Tasks with Status = '<%= params[:status] %>'</h1>
2
+
3
+ This View shows how to search QuickBase records using a Rails 'find_all_by_??' method call.
4
+ <hr>
5
+
6
+ <% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
7
+
8
+ <table border="1">
9
+ <tr>
10
+ <% fieldNames.each{|fieldName| %>
11
+ <td><b><%= fieldName %></b></td>
12
+ <% } %>
13
+ </tr>
14
+
15
+ <% for task in @tasks do %>
16
+ <tr>
17
+ <% fieldNames.each{ |fieldName| %>
18
+ <td><%= task[fieldName] %></td>
19
+ <% } %>
20
+ </tr>
21
+ <% end %>
22
+
23
+ </table>
@@ -0,0 +1,38 @@
1
+ <h1>Time Cards</h1>
2
+
3
+
4
+ <hr>
5
+
6
+ <% fieldList = Array["Project Name","Week Starting On","Sun","Mon","Tue","Wed","Thu","Fri","Sat","Weekly Total"] %>
7
+ <% totalFieldList = Array["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Weekly Total"] %>
8
+ <% totals = {} %>
9
+ <% totalFieldList.each {|fieldName| totals[fieldName] = 0} %>
10
+
11
+ <table border="1">
12
+
13
+ <tr>
14
+ <% fieldList.each {|fieldName| %>
15
+ <td><b><%= fieldName %></b></td>
16
+ <% } %>
17
+ </tr>
18
+
19
+ <% for rec in @time_cards do %>
20
+ <tr>
21
+ <% fieldList.each {|fieldName| %>
22
+ <td><%= rec[fieldName] %></td>
23
+ <% } %>
24
+ </tr>
25
+ <% totalFieldList.each {|fieldName| totals[fieldName] += rec[fieldName].to_i } %>
26
+ <% end %>
27
+
28
+ <tr>
29
+ <% fieldList.each {|fieldName| %>
30
+ <% if totalFieldList.include?(fieldName) %>
31
+ <td><b><%= totals[fieldName] %></b></td>
32
+ <% else %>
33
+ <td></td>
34
+ <% end %>
35
+ <% } %>
36
+ </tr>
37
+
38
+ </table>
@@ -0,0 +1,45 @@
1
+ # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
+
3
+ unless defined?(RAILS_ROOT)
4
+ root_path = File.join(File.dirname(__FILE__), '..')
5
+
6
+ unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
7
+ require 'pathname'
8
+ root_path = Pathname.new(root_path).cleanpath(true).to_s
9
+ end
10
+
11
+ RAILS_ROOT = root_path
12
+ end
13
+
14
+ unless defined?(Rails::Initializer)
15
+ if File.directory?("#{RAILS_ROOT}/vendor/rails")
16
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
17
+ else
18
+ require 'rubygems'
19
+
20
+ environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
21
+ environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
22
+ rails_gem_version = $1
23
+
24
+ if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
25
+ # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
26
+ rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
27
+
28
+ if rails_gem
29
+ gem "rails", "=#{rails_gem.version.version}"
30
+ require rails_gem.full_gem_path + '/lib/initializer'
31
+ else
32
+ STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
33
+ Install the missing gem with 'gem install -v=#{version} rails', or
34
+ change environment.rb to define RAILS_GEM_VERSION with your desired version.
35
+ )
36
+ exit 1
37
+ end
38
+ else
39
+ gem "rails"
40
+ require 'initializer'
41
+ end
42
+ end
43
+
44
+ Rails::Initializer.run(:set_load_path)
45
+ end
@@ -0,0 +1,30 @@
1
+ development:
2
+ adapter: quickbase
3
+ database: Project Manager Plus
4
+ username:
5
+ password:
6
+ printRequestsAndResponses: false
7
+ cacheSchemas: true
8
+ decimalPrecision: 38
9
+ host: localhost
10
+
11
+ # Warning: The database defined as 'test' will be erased and
12
+ # re-generated from your development database when you run 'rake'.
13
+ # Do not set this db to the same as development or production.
14
+ test:
15
+ adapter: quickbase
16
+ database: Project Manager Plus
17
+ username:
18
+ password:
19
+ cacheSchemas: true
20
+ decimalPrecision: 38
21
+ host: localhost
22
+
23
+ production:
24
+ adapter: quickbase
25
+ database: Project Manager Plus
26
+ username:
27
+ password:
28
+ cacheSchemas: true
29
+ decimalPrecision: 38
30
+ host: localhost
@@ -0,0 +1,60 @@
1
+ # Be sure to restart your web server when you modify this file.
2
+
3
+ # Uncomment below to force Rails into production mode when
4
+ # you don't control web/app server and can't set it the proper way
5
+ # ENV['RAILS_ENV'] ||= 'production'
6
+
7
+ # Specifies gem version of Rails to use when vendor/rails is not present
8
+ RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
9
+
10
+ # Bootstrap the Rails environment, frameworks, and default configuration
11
+ require File.join(File.dirname(__FILE__), 'boot')
12
+
13
+ Rails::Initializer.run do |config|
14
+ # Settings in config/environments/* take precedence over those specified here
15
+
16
+ # Skip frameworks you're not going to use (only works if using vendor/rails)
17
+ # config.frameworks -= [ :action_web_service, :action_mailer ]
18
+
19
+ # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
20
+ # config.plugins = %W( exception_notification ssl_requirement )
21
+
22
+ # Add additional load paths for your own custom dirs
23
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
24
+
25
+ # Force all environments to use the same logger level
26
+ # (by default production uses :info, the others :debug)
27
+ # config.log_level = :debug
28
+
29
+ # Use the database for sessions instead of the file system
30
+ # (create the session table with 'rake db:sessions:create')
31
+ # config.action_controller.session_store = :active_record_store
32
+
33
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
34
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
35
+ # like if you have constraints or database-specific column types
36
+ # config.active_record.schema_format = :sql
37
+
38
+ # Activate observers that should always be running
39
+ # config.active_record.observers = :cacher, :garbage_collector
40
+
41
+ # Make Active Record use UTC-base instead of local time
42
+ # config.active_record.default_timezone = :utc
43
+
44
+ # See Rails::Configuration for more options
45
+ end
46
+
47
+ # Add new inflection rules using the following format
48
+ # (all these examples are active by default):
49
+ # Inflector.inflections do |inflect|
50
+ # inflect.plural /^(ox)$/i, '\1en'
51
+ # inflect.singular /^(ox)en/i, '\1'
52
+ # inflect.irregular 'person', 'people'
53
+ # inflect.uncountable %w( fish sheep )
54
+ # end
55
+
56
+ # Add new mime types for use in respond_to blocks:
57
+ # Mime::Type.register "text/richtext", :rtf
58
+ # Mime::Type.register "application/x-mobile", :mobile
59
+
60
+ # Include your application configuration below