ipp_quickbase_devkit 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +87 -0
- data/README.rdoc +112 -0
- data/doc/QuickBaseClient.rb.htm +1896 -0
- data/doc/ReleaseNotes.txt +43 -0
- data/doc/qbc.makeCSVFile.qbc +4 -0
- data/doc/qbc.makeCSVFile.rb +4 -0
- data/doc/quickbase_adapter.rb.htm +399 -0
- data/examples/cookbookfiles/QuickBaseAPICookbook.html +2590 -0
- data/examples/cookbookfiles/addChangeRemoveUserRole.rb +21 -0
- data/examples/cookbookfiles/addOrEditRecord.rb +10 -0
- data/examples/cookbookfiles/application_object.rb +55 -0
- data/examples/cookbookfiles/applyRubyFormulas.rb +10 -0
- data/examples/cookbookfiles/average.rb +27 -0
- data/examples/cookbookfiles/backupApplication.rb +8 -0
- data/examples/cookbookfiles/cacheSchemas.rb +53 -0
- data/examples/cookbookfiles/calculateRunningTotals.rb +11 -0
- data/examples/cookbookfiles/copyrecords.rb +73 -0
- data/examples/cookbookfiles/count.rb +26 -0
- data/examples/cookbookfiles/createRecordNavigatorHTML.rb +42 -0
- data/examples/cookbookfiles/createReportDashboard.rb +35 -0
- data/examples/cookbookfiles/createTable.rb +12 -0
- data/examples/cookbookfiles/deviation.rb +25 -0
- data/examples/cookbookfiles/downloadCookbook.rb +97 -0
- data/examples/cookbookfiles/downloadFile.rb +10 -0
- data/examples/cookbookfiles/downloadFilesToFolder.rb +81 -0
- data/examples/cookbookfiles/downloadToTextFile.rb +64 -0
- data/examples/cookbookfiles/dumpSchema.rb +11 -0
- data/examples/cookbookfiles/duplicateRecord.rb +8 -0
- data/examples/cookbookfiles/dynamicMethods.rb +33 -0
- data/examples/cookbookfiles/editRecords.rb +15 -0
- data/examples/cookbookfiles/findJohnsLast10Records.rb +17 -0
- data/examples/cookbookfiles/findRubyRecords.rb +17 -0
- data/examples/cookbookfiles/formatCurrency.rb +24 -0
- data/examples/cookbookfiles/formatDate.rb +10 -0
- data/examples/cookbookfiles/formatDuration.rb +27 -0
- data/examples/cookbookfiles/formatPercent.rb +24 -0
- data/examples/cookbookfiles/getAllValuesForFields.rb +18 -0
- data/examples/cookbookfiles/getAppDTMInfo.rb +29 -0
- data/examples/cookbookfiles/getApplicationVariable.rb +5 -0
- data/examples/cookbookfiles/getChildTableDBID.rb +11 -0
- data/examples/cookbookfiles/getColumnListForReport.rb +6 -0
- data/examples/cookbookfiles/getFieldChoices.rb +13 -0
- data/examples/cookbookfiles/getFieldIDs.rb +6 -0
- data/examples/cookbookfiles/getFieldNames.rb +6 -0
- data/examples/cookbookfiles/getLastModTime.rb +8 -0
- data/examples/cookbookfiles/getLastRecModTime.rb +8 -0
- data/examples/cookbookfiles/getNumRecords.rb +8 -0
- data/examples/cookbookfiles/getNumTables.rb +4 -0
- data/examples/cookbookfiles/getRecord.rb +5 -0
- data/examples/cookbookfiles/getRecordDisplayURL.rb +13 -0
- data/examples/cookbookfiles/getRecordsAddedToday.rb +20 -0
- data/examples/cookbookfiles/getRecordsAsJSON.rb +6 -0
- data/examples/cookbookfiles/getReportNames.rb +25 -0
- data/examples/cookbookfiles/getRoleInfo.rb +48 -0
- data/examples/cookbookfiles/getServerStatus.rb +11 -0
- data/examples/cookbookfiles/getSortListForReport.rb +6 -0
- data/examples/cookbookfiles/getTableIDs.rb +6 -0
- data/examples/cookbookfiles/getTableName.rb +8 -0
- data/examples/cookbookfiles/getTableNames.rb +25 -0
- data/examples/cookbookfiles/getTimeCreated.rb +8 -0
- data/examples/cookbookfiles/getTimeInMilliseconds.rb +5 -0
- data/examples/cookbookfiles/getUserInfo.rb +26 -0
- data/examples/cookbookfiles/getUserRole.rb +15 -0
- data/examples/cookbookfiles/intranet.rb +101 -0
- data/examples/cookbookfiles/isAverageField.rb +17 -0
- data/examples/cookbookfiles/isDbidString.rb +8 -0
- data/examples/cookbookfiles/isTotalField.rb +16 -0
- data/examples/cookbookfiles/iterateDBPages.rb +8 -0
- data/examples/cookbookfiles/iterateFilteredRecords.rb +12 -0
- data/examples/cookbookfiles/iterateJoinRecords.rb +68 -0
- data/examples/cookbookfiles/iterateRecordInfos.rb +8 -0
- data/examples/cookbookfiles/iterateRecords.rb +23 -0
- data/examples/cookbookfiles/iterateSummaryRecords.rb +13 -0
- data/examples/cookbookfiles/iterateUnionRecords.rb +38 -0
- data/examples/cookbookfiles/listAccessibleApplications.rb +6 -0
- data/examples/cookbookfiles/logRequestAndResponseXML.rb +8 -0
- data/examples/cookbookfiles/lookupFieldPropertyByName.rb +62 -0
- data/examples/cookbookfiles/lookupFieldTypeByName.rb +10 -0
- data/examples/cookbookfiles/makeCSVFile.rb +4 -0
- data/examples/cookbookfiles/makeSlideShow.rb +42 -0
- data/examples/cookbookfiles/makerecs.rb +64 -0
- data/examples/cookbookfiles/max.rb +26 -0
- data/examples/cookbookfiles/min.rb +26 -0
- data/examples/cookbookfiles/percent.rb +29 -0
- data/examples/cookbookfiles/printChildElements.rb +54 -0
- data/examples/cookbookfiles/printNewRecords.rb +12 -0
- data/examples/cookbookfiles/processRESTRequest.rb +21 -0
- data/examples/cookbookfiles/provisionAndInviteNewUser.rb +13 -0
- data/examples/cookbookfiles/purgeRecords.rb +15 -0
- data/examples/cookbookfiles/quickbase_adapter.rb.htm +397 -0
- data/examples/cookbookfiles/quickbase_record_finder.zip +0 -0
- data/examples/cookbookfiles/recordAndFieldIterator.rb +24 -0
- data/examples/cookbookfiles/runImport.rb +9 -0
- data/examples/cookbookfiles/runQuickBaseTwitterConnector.rb +41 -0
- data/examples/cookbookfiles/sendToQuickBase.rb +33 -0
- data/examples/cookbookfiles/setDBvar.rb +6 -0
- data/examples/cookbookfiles/showRequestAndResponseXML.rb +8 -0
- data/examples/cookbookfiles/sqlQuery.rb +11 -0
- data/examples/cookbookfiles/stopOnError.rb +10 -0
- data/examples/cookbookfiles/sum.rb +26 -0
- data/examples/cookbookfiles/twitterFromQuickBase.rb +42 -0
- data/examples/cookbookfiles/twitterWithQuickBase.rb +36 -0
- data/examples/cookbookfiles/uploadCSVData.rb +20 -0
- data/examples/cookbookfiles/uploadExcelData.rb +22 -0
- data/examples/cookbookfiles/uploadFileEveryHour.rb +18 -0
- data/examples/cookbookfiles/uploadFileIntoNewRecord.rb +8 -0
- data/examples/cookbookfiles/uploadFilesFromFolder.exe +0 -0
- data/examples/cookbookfiles/uploadFilesFromFolder.rb +69 -0
- data/examples/cookbookfiles/useCompanyURL.rb +12 -0
- data/examples/cookbookfiles/userRoles.rb +49 -0
- data/examples/cookbookfiles/watchCommunityForum.rb +5 -0
- data/examples/cookbookfiles/wikifyTable.rb +29 -0
- data/examples/cookbookfiles/xmlShortcuts.rb +33 -0
- data/examples/pmp/app/controllers/application.rb +7 -0
- data/examples/pmp/app/controllers/contacts_controller.rb +8 -0
- data/examples/pmp/app/controllers/document_library_controller.rb +2 -0
- data/examples/pmp/app/controllers/issues_controller.rb +5 -0
- data/examples/pmp/app/controllers/projects_controller.rb +22 -0
- data/examples/pmp/app/controllers/resources_controller.rb +2 -0
- data/examples/pmp/app/controllers/tasks_controller.rb +13 -0
- data/examples/pmp/app/controllers/time_cards_controller.rb +5 -0
- data/examples/pmp/app/helpers/application_helper.rb +3 -0
- data/examples/pmp/app/helpers/contacts_helper.rb +2 -0
- data/examples/pmp/app/helpers/document_library_helper.rb +2 -0
- data/examples/pmp/app/helpers/issues_helper.rb +2 -0
- data/examples/pmp/app/helpers/projects_helper.rb +2 -0
- data/examples/pmp/app/helpers/resources_helper.rb +2 -0
- data/examples/pmp/app/helpers/tasks_helper.rb +2 -0
- data/examples/pmp/app/helpers/time_cards_helper.rb +2 -0
- data/examples/pmp/app/models/contacts.rb +26 -0
- data/examples/pmp/app/models/document_library.rb +2 -0
- data/examples/pmp/app/models/issues.rb +6 -0
- data/examples/pmp/app/models/projects.rb +26 -0
- data/examples/pmp/app/models/resources.rb +2 -0
- data/examples/pmp/app/models/tasks.rb +12 -0
- data/examples/pmp/app/models/time_cards.rb +7 -0
- data/examples/pmp/app/schemas/contacts.xml +1 -0
- data/examples/pmp/app/schemas/document_library.xml +1 -0
- data/examples/pmp/app/schemas/issues.xml +1 -0
- data/examples/pmp/app/schemas/pmp.xml +1 -0
- data/examples/pmp/app/schemas/projects.xml +1 -0
- data/examples/pmp/app/schemas/readme.txt +8 -0
- data/examples/pmp/app/schemas/resources.xml +1 -0
- data/examples/pmp/app/schemas/tasks.xml +1 -0
- data/examples/pmp/app/schemas/time_cards.xml +1 -0
- data/examples/pmp/app/views/contacts/companies.rhtml +31 -0
- data/examples/pmp/app/views/contacts/project_contacts.rhtml +31 -0
- data/examples/pmp/app/views/issues/filter_issues.rhtml +26 -0
- data/examples/pmp/app/views/layouts/application.rhtml +56 -0
- data/examples/pmp/app/views/projects/all_projects.rhtml +33 -0
- data/examples/pmp/app/views/projects/home.rhtml +11 -0
- data/examples/pmp/app/views/projects/my_open_projects.rhtml +27 -0
- data/examples/pmp/app/views/projects/open_projects.rhtml +44 -0
- data/examples/pmp/app/views/projects/project_sorted_by_company.rhtml +40 -0
- data/examples/pmp/app/views/projects/projects_sorted_by_priority.rhtml +30 -0
- data/examples/pmp/app/views/projects/updated_projects.rhtml +0 -0
- data/examples/pmp/app/views/tasks/all_tasks.rhtml +27 -0
- data/examples/pmp/app/views/tasks/search.rhtml +23 -0
- data/examples/pmp/app/views/tasks/search2.rhtml +23 -0
- data/examples/pmp/app/views/tasks/search3.rhtml +23 -0
- data/examples/pmp/app/views/time_cards/summary.rhtml +38 -0
- data/examples/pmp/config/boot.rb +45 -0
- data/examples/pmp/config/database.yml +30 -0
- data/examples/pmp/config/environment.rb +60 -0
- data/examples/pmp/config/environments/development.rb +21 -0
- data/examples/pmp/config/environments/production.rb +18 -0
- data/examples/pmp/config/environments/test.rb +19 -0
- data/examples/pmp/config/routes.rb +23 -0
- data/examples/pmp/db/migrate/001_create_projects.rb +10 -0
- data/examples/pmp/db/migrate/002_create_tasks.rb +10 -0
- data/examples/pmp/db/migrate/003_create_issues.rb +10 -0
- data/examples/pmp/db/migrate/004_create_document_libraries.rb +10 -0
- data/examples/pmp/db/migrate/005_create_resources.rb +10 -0
- data/examples/pmp/db/migrate/006_create_time_cards.rb +10 -0
- data/examples/pmp/db/migrate/007_create_contacts.rb +10 -0
- data/examples/pmp/public/404.html +30 -0
- data/examples/pmp/public/500.html +30 -0
- data/examples/pmp/public/app.index.html +277 -0
- data/examples/pmp/public/dispatch.cgi +10 -0
- data/examples/pmp/public/dispatch.fcgi +24 -0
- data/examples/pmp/public/dispatch.rb +10 -0
- data/examples/pmp/public/favicon.ico +0 -0
- data/examples/pmp/public/images/rails.png +0 -0
- data/examples/pmp/public/javascripts/application.js +2 -0
- data/examples/pmp/public/javascripts/controls.js +833 -0
- data/examples/pmp/public/javascripts/dragdrop.js +942 -0
- data/examples/pmp/public/javascripts/effects.js +1088 -0
- data/examples/pmp/public/javascripts/prototype.js +2515 -0
- data/examples/pmp/public/robots.txt +1 -0
- data/examples/pmp/test/fixtures/contacts.yml +5 -0
- data/examples/pmp/test/fixtures/document_libraries.yml +5 -0
- data/examples/pmp/test/fixtures/issues.yml +5 -0
- data/examples/pmp/test/fixtures/projects.yml +5 -0
- data/examples/pmp/test/fixtures/resources.yml +5 -0
- data/examples/pmp/test/fixtures/tasks.yml +5 -0
- data/examples/pmp/test/fixtures/time_cards.yml +5 -0
- data/examples/pmp/test/functional/contacts_controller_test.rb +18 -0
- data/examples/pmp/test/functional/document_library_controller_test.rb +18 -0
- data/examples/pmp/test/functional/issues_controller_test.rb +18 -0
- data/examples/pmp/test/functional/projects_controller_test.rb +18 -0
- data/examples/pmp/test/functional/resources_controller_test.rb +18 -0
- data/examples/pmp/test/functional/tasks_controller_test.rb +18 -0
- data/examples/pmp/test/functional/time_cards_controller_test.rb +18 -0
- data/examples/pmp/test/test_helper.rb +28 -0
- data/examples/pmp/test/unit/contacts_test.rb +10 -0
- data/examples/pmp/test/unit/document_library_test.rb +10 -0
- data/examples/pmp/test/unit/issues_test.rb +10 -0
- data/examples/pmp/test/unit/projects_test.rb +10 -0
- data/examples/pmp/test/unit/resources_test.rb +10 -0
- data/examples/pmp/test/unit/tasks_test.rb +10 -0
- data/examples/pmp/test/unit/time_cards_test.rb +10 -0
- data/lib/QuickBaseClient.rb +5054 -0
- data/lib/QuickBaseCommandLineClient.rb +401 -0
- data/lib/QuickBaseContactsAppBuilder.rb +419 -0
- data/lib/QuickBaseEmailer.rb +334 -0
- data/lib/QuickBaseEventNotifier.rb +592 -0
- data/lib/QuickBaseMisc.rb +96 -0
- data/lib/QuickBaseObjects.rb +566 -0
- data/lib/QuickBaseRSSGenerator.rb +286 -0
- data/lib/QuickBaseTextData.rb +545 -0
- data/lib/QuickBaseTwitterConnector.rb +300 -0
- data/lib/QuickBaseWebClient.rb +126 -0
- data/lib/WorkPlaceClient.rb +45 -0
- data/lib/qbc.makeCSVFile.qbc +4 -0
- data/lib/qbc.makeCSVFile.rb +17 -0
- data/lib/quickbase_adapter.rb +320 -0
- data/lib/runFieldEntryDialog.rb +151 -0
- data/lib/runOfflineFieldEntryDialog.rb +203 -0
- data/rakefile +100 -0
- data/test/run_tests.bat +7 -0
- data/test/spec_all_tests.rb +13 -0
- data/test/spec_smoke_tests.rb +58 -0
- data/test/spec_workplace_addrecord_test.rb +46 -0
- data/test/spec_workplace_base_test.rb +57 -0
- data/test/spec_workplace_editrecord_test.rb +38 -0
- data/test/spec_workplace_json_test.rb +38 -0
- data/test/spec_workplace_objects_test.rb +39 -0
- data/test/spec_workplace_smoke_tests.rb +45 -0
- metadata +353 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'QuickBaseClient'
|
2
|
+
|
3
|
+
qbc = QuickBase::Client.new
|
4
|
+
|
5
|
+
# download the QuickBaseClient.rb.zip from record 24105 in the QuickBase Community Forum
|
6
|
+
# '41' is the field ID of the File Attachment field
|
7
|
+
qbc.downLoadFile("8emtadvk", "24105", "41" )
|
8
|
+
|
9
|
+
# have to write the downloaded data before it exists on your local disk
|
10
|
+
File.open( "The.Latest.QuickBaseClient.rb.zip", "wb" ){|f|f.write(qbc.fileContents)}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
def downloadFiles1(username,password,cwd)
|
5
|
+
qbc = QuickBase::Client.new(username,password)
|
6
|
+
dbid = qbc.findDBByName(cwd)
|
7
|
+
qbc.getSchema(dbid)
|
8
|
+
dbid = qbc.lookupChdbid(cwd.dup)
|
9
|
+
downloadFiles3(qbc,username,password,dbid,"File Attachment")
|
10
|
+
end
|
11
|
+
|
12
|
+
def downloadFiles2(username,password,dbid,fieldName)
|
13
|
+
qbc = QuickBase::Client.new(username,password)
|
14
|
+
qbc.getSchema(dbid)
|
15
|
+
downloadFiles3(qbc,username,password,dbid,fieldName)
|
16
|
+
end
|
17
|
+
|
18
|
+
def downloadFiles3(qbc,username,password,dbid,fieldName)
|
19
|
+
|
20
|
+
fieldNames = qbc.getFieldNames(dbid)
|
21
|
+
clist = ""
|
22
|
+
fid = ""
|
23
|
+
fieldNames.each{|f|
|
24
|
+
id = qbc.lookupFieldIDByName(f)
|
25
|
+
fid = id.dup if f == fieldName
|
26
|
+
clist << id
|
27
|
+
clist << "."
|
28
|
+
}
|
29
|
+
clist[-1,1]=""
|
30
|
+
|
31
|
+
if fid == ""
|
32
|
+
fid = fieldName.dup
|
33
|
+
fieldName = qbc.lookupFieldNameFromID(fid)
|
34
|
+
end
|
35
|
+
|
36
|
+
qbc.iterateRecords(dbid,fieldNames,nil,nil,nil,clist,"3"){|r|
|
37
|
+
if r and r[fieldName] and r[fieldName].length > 0
|
38
|
+
next if r[fieldName].include?("https:") or r[fieldName].include?("http:")
|
39
|
+
puts "Downloading #{r[fieldName]}"
|
40
|
+
qbc.downLoadFile(dbid,r["Record ID#"],fid)
|
41
|
+
if qbc.fileContents
|
42
|
+
filename = r[fieldName]
|
43
|
+
File.open( filename, "wb" ){|f|
|
44
|
+
f.write(qbc.fileContents)
|
45
|
+
}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
}
|
49
|
+
puts "\nFinished downloading files in QuickBase Record ID# order."
|
50
|
+
puts "(Later copies of files overwrite previous copies)."
|
51
|
+
puts "\nYou can repeat this download using downloadFilesToFolder.exe #{username} #{password} #{dbid} #{fid}."
|
52
|
+
end
|
53
|
+
|
54
|
+
def getInputAndRun
|
55
|
+
mycwd = Dir.pwd.gsub('/','\\')
|
56
|
+
|
57
|
+
if ARGV[3]
|
58
|
+
downloadFiles2(ARGV[0],ARGV[1],ARGV[2],ARGV[3])
|
59
|
+
else
|
60
|
+
|
61
|
+
print "\nPlease enter your QuickBase username: "
|
62
|
+
username = gets.chomp
|
63
|
+
print "\nPlease enter your QuickBase password: "
|
64
|
+
password = gets.chomp
|
65
|
+
print "\nEnter 'y' if to download the files from a '#{mycwd}' QuickBase application: "
|
66
|
+
y = gets.chomp
|
67
|
+
|
68
|
+
if y == "y" or y == "Y"
|
69
|
+
downloadFiles1(username,password,mycwd)
|
70
|
+
else
|
71
|
+
print "\nPlease enter the id of your QuickBase table: "
|
72
|
+
dbid = gets.chomp
|
73
|
+
print "\nPlease enter the name or id of the QuickBase File Attachment field in your table. (e.g. File): "
|
74
|
+
fieldName = gets.chomp
|
75
|
+
downloadFiles2(username,password,dbid,fieldName)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
getInputAndRun
|
@@ -0,0 +1,64 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseTextData'
|
3
|
+
|
4
|
+
# download the Ingredients table in the QuickBase API Cookbook v2 to a text file
|
5
|
+
QuickBase::TextData.downloadData("username","password","bb2mad4ss")
|
6
|
+
|
7
|
+
=begin
|
8
|
+
|
9
|
+
The 'downloadData' line above will write a file called 'downloadedTextData.txt' in your current directory.
|
10
|
+
The contents will be something close to the text below. You can edit the text and send it back to QuickBase
|
11
|
+
using QuickBase::TextData.uploadData("username","password","downloadedTextData.txt")
|
12
|
+
|
13
|
+
dbid:bb2mad4ss
|
14
|
+
record:1
|
15
|
+
Name:Ruby wrapper for QuickBase HTTP API
|
16
|
+
Description:This is a Ruby language wrapper for the QuickBase HTTP API. It includes routines for all everything in the API, plus additional routines to reduce the amount of code you have to write to get things done using the QuickBase API.
|
17
|
+
File Attachment:
|
18
|
+
URL:https://www.quickbase.com/db/8emtadvk?a=dr&r=ztj&rl=cjtm
|
19
|
+
Contact E-mail:
|
20
|
+
record:2
|
21
|
+
Name:QuickBase HTTP API
|
22
|
+
Description:
|
23
|
+
File Attachment:
|
24
|
+
URL:https://www.quickbase.com/up/6mztyxu8/g/rc7/en/va/QuickBaseAPI.htm
|
25
|
+
Contact E-mail:
|
26
|
+
record:3
|
27
|
+
Name:One-Click Ruby Installer for Windows
|
28
|
+
Description:This is a [one-click, self-contained Windows installer] that contains the Ruby language itself, dozens of popular extensions and packages, a syntax-highlighting editor and execution environment, and a Windows help file that contains the full text of the book, Programming Ruby: The Pragmatic Programmer's Guide.
|
29
|
+
File Attachment:
|
30
|
+
URL:http://rubyinstaller.rubyforge.org/wiki/wiki.pl
|
31
|
+
Contact E-mail:
|
32
|
+
record:4
|
33
|
+
Name:Visual Basic SDK
|
34
|
+
Description:
|
35
|
+
File Attachment:
|
36
|
+
URL:https://www.quickbase.com/db/6mztyxu8?a=dr&r=c4
|
37
|
+
Contact E-mail:
|
38
|
+
record:5
|
39
|
+
Name:Perl SDK
|
40
|
+
Description:
|
41
|
+
File Attachment:
|
42
|
+
URL:https://www.quickbase.com/db/6mztyxu8?a=dr&r=c5
|
43
|
+
Contact E-mail:
|
44
|
+
record:6
|
45
|
+
Name:Javascript SDK
|
46
|
+
Description:
|
47
|
+
File Attachment:
|
48
|
+
URL:https://www.quickbase.com/db/6mztyxu8?a=dr&r=c8
|
49
|
+
Contact E-mail:
|
50
|
+
record:7
|
51
|
+
Name:Java SDK
|
52
|
+
Description:
|
53
|
+
File Attachment:
|
54
|
+
URL:https://www.quickbase.com/db/6mztyxu8?a=dr&r=c6
|
55
|
+
Contact E-mail:
|
56
|
+
record:8
|
57
|
+
Name:Excel
|
58
|
+
Description:
|
59
|
+
File Attachment:
|
60
|
+
URL:
|
61
|
+
Contact E-mail:
|
62
|
+
|
63
|
+
|
64
|
+
=end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
qbc = QuickBase::Client.new(ARGV[0],ARGV[1])
|
5
|
+
qbc.getSchema(ARGV[2])
|
6
|
+
File.open("#{ARGV[2]}.schema.xml","w"){|f|f.write(qbc.qdbapi)}
|
7
|
+
|
8
|
+
# run this using 'ruby dumpSchema.rb <username> <password> <tableID>'
|
9
|
+
# e.g. 'ruby dumpSchema.rb fred@flinstone wilma 8emtadvk'
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
require 'QuickBaseClient'
|
4
|
+
|
5
|
+
qbc = QuickBase::Client.new
|
6
|
+
|
7
|
+
puts "\n\nDescription of QuickBase API Cookbook application:\n\n"
|
8
|
+
|
9
|
+
puts qbc.bcdcajmrf.xml_desc
|
10
|
+
|
11
|
+
puts "\n\nIngredients from the QuickBase API Cookbook:\n\n"
|
12
|
+
|
13
|
+
qbc.bcdcajmrh.qid_1.printChildElements(qbc.records)
|
14
|
+
|
15
|
+
puts "\n\nValue of field 6 from record 24105 in table 8emtadvk:\n\n"
|
16
|
+
|
17
|
+
puts qbc.dbid_8emtadvk.rid_24105.fid_6 # prints 'Ruby wrapper for QuickBase HTTP API'
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
require 'Date'
|
4
|
+
|
5
|
+
# login and connect to the "Email Outbox" application
|
6
|
+
qbc = QuickBase::Client.new("username","password","Email Outbox")
|
7
|
+
|
8
|
+
# find the "Messages" table in the "Email Outbox" application
|
9
|
+
outboxMessagesTable = qbc.lookupChdbid("Messages")
|
10
|
+
|
11
|
+
today = Date.today
|
12
|
+
today = today.strftime("%m-%d-%Y")
|
13
|
+
|
14
|
+
# for every record that was created today, change the "from" field to "fred@bedrock.com" and the "to" field to "wilma@bedrock.com"
|
15
|
+
qbc.editRecords(outboxMessagesTable,{"from"=>"fred@bedrock.com","to"=>"wilma@bedrock.com"},"{'1'.EX.'#{today}'}")
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
communityForumRecords = qbc.getAllValuesForFields("8emtadvk",["Subject","Message"],"{'4'.CT.', John'}",nil,nil,"6.10",nil,"structured","num-10")
|
8
|
+
|
9
|
+
puts "\n --- Ten most recent QuickBase Community Forum Records owned by ', John' ---\n\n"
|
10
|
+
|
11
|
+
numRecords = communityForumRecords["Subject"].length
|
12
|
+
(0..(numRecords-1)).each{|index|
|
13
|
+
print "\n#{index+1})\nSubject: "
|
14
|
+
print communityForumRecords["Subject"][index]
|
15
|
+
puts "\nMessage:"
|
16
|
+
puts communityForumRecords["Message"][index].gsub!("<BR/>","\n")
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
communityForumRecords = qbc.getAllValuesForFields("8emtadvk",["Subject","Message"],"{'0'.CT.'ruby'}",nil,nil,"6.10")
|
8
|
+
|
9
|
+
puts "\n --- QuickBase Community Forum Records containing the word 'ruby' ---\n\n"
|
10
|
+
|
11
|
+
numRecords = communityForumRecords["Subject"].length
|
12
|
+
(0..(numRecords-1)).each{|index|
|
13
|
+
print "\nSubject: "
|
14
|
+
print communityForumRecords["Subject"][index]
|
15
|
+
puts "\nMessage:"
|
16
|
+
puts communityForumRecords["Message"][index].gsub!("<BR/>","\n")
|
17
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
# read and format the "currency" field from all the records in a table
|
8
|
+
qbc.iterateRecords("dbiddbid",["currency"]){|rec|
|
9
|
+
formattedValue = qbc.formatCurrency(rec['currency'],{"currencySymbol" => "$"})
|
10
|
+
puts "Raw currency value from QuickBase: #{rec['currency']}, Formatted value: #{formattedValue}"
|
11
|
+
}
|
12
|
+
|
13
|
+
=begin
|
14
|
+
|
15
|
+
Sample output from this script:
|
16
|
+
|
17
|
+
Raw currency value from QuickBase: 7.33, Formatted value: $7.33
|
18
|
+
Raw currency value from QuickBase: 0.33, Formatted value: $0.33
|
19
|
+
Raw currency value from QuickBase: 1.01, Formatted value: $1.01
|
20
|
+
Raw currency value from QuickBase: 1888888.00, Formatted value: $1888888.00
|
21
|
+
Raw currency value from QuickBase: 1111.1111, Formatted value: $1111.1111
|
22
|
+
Raw currency value from QuickBase: 23.23, Formatted value: $23.23
|
23
|
+
|
24
|
+
=end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
createdFieldValue = qbc.getAllValuesForFields("8emtadvk",["Created"],"{'3'.EX.'24105'}")
|
7
|
+
createdFieldValue = createdFieldValue["Created"][0]
|
8
|
+
formattedCreatedFieldValue = qbc.formatDate(createdFieldValue)
|
9
|
+
puts "Message 24105 in the QuickBase Community Forum was created on #{formattedCreatedFieldValue} (#{createdFieldValue})."
|
10
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
# read and format the "duration" field from all the records in a table
|
8
|
+
qbc.iterateRecords("dbiddbid",["duration"]){|rec|
|
9
|
+
rawValue = rec['duration']
|
10
|
+
days = qbc.formatDuration(rawValue.dup,"days")
|
11
|
+
hours = qbc.formatDuration(rawValue.dup,"hours")
|
12
|
+
minutes = qbc.formatDuration(rawValue.dup,"minutes")
|
13
|
+
printf("Raw value: %-15s Days: %-10s Hours: %-10s Minutes: %-10s\n", rec['duration'], days, hours, minutes)
|
14
|
+
}
|
15
|
+
|
16
|
+
=begin
|
17
|
+
|
18
|
+
Sample output from this script:
|
19
|
+
|
20
|
+
Raw value: 172800000 Days: 2 Hours: 48 Minutes: 2880
|
21
|
+
Raw value: 285120000 Days: 3 Hours: 79 Minutes: 4752
|
22
|
+
Raw value: 2160000000 Days: 25 Hours: 600 Minutes: 36000
|
23
|
+
Raw value: 10658304000 Days: 123 Hours: 2960 Minutes: 177638
|
24
|
+
Raw value: 37152000 Days: 0 Hours: 10 Minutes: 619
|
25
|
+
Raw value: 86400000 Days: 1 Hours: 24 Minutes: 1440
|
26
|
+
|
27
|
+
=end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
# read and format the "percent" field from all the records in a table
|
8
|
+
qbc.iterateRecords("dbiddbid",["percent"]){|rec|
|
9
|
+
formattedValue = qbc.formatPercent(rec['percent'])
|
10
|
+
puts "Raw percent value from QuickBase: #{rec['percent']}, Formatted value: #{formattedValue}"
|
11
|
+
}
|
12
|
+
|
13
|
+
=begin
|
14
|
+
|
15
|
+
Sample output from this script:
|
16
|
+
|
17
|
+
Raw percent value from QuickBase: 0.005, Formatted value: 0.5
|
18
|
+
Raw percent value from QuickBase: 0.12, Formatted value: 12
|
19
|
+
Raw percent value from QuickBase: 0.9999, Formatted value: 99.99
|
20
|
+
Raw percent value from QuickBase: 0.5, Formatted value: 50
|
21
|
+
Raw percent value from QuickBase: 0.13, Formatted value: 13
|
22
|
+
Raw percent value from QuickBase: 0.33123, Formatted value: 33.12
|
23
|
+
|
24
|
+
=end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
|
7
|
+
cookbookRecords = qbc.getAllValuesForFields("bb2mad4sr",["Title","Keywords"])
|
8
|
+
|
9
|
+
puts "\n --- QuickBase API Cookbook v2 ---\n\n"
|
10
|
+
|
11
|
+
numRecords = cookbookRecords["Title"].length
|
12
|
+
(0..(numRecords-1)).each{|index|
|
13
|
+
print "Title: "
|
14
|
+
print cookbookRecords["Title"][index]
|
15
|
+
print " (Keywords: "
|
16
|
+
print cookbookRecords["Keywords"][index]
|
17
|
+
puts ")"
|
18
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
require 'QuickBaseClient'
|
4
|
+
|
5
|
+
qbc = QuickBase::Client.new
|
6
|
+
|
7
|
+
puts "\n\nDate/time information about the QuickBase Community Forum:\n\n"
|
8
|
+
|
9
|
+
qbc.getAppDTMInfo("bbqm84dzy")
|
10
|
+
|
11
|
+
puts "Time of request : #{qbc.formatFieldValue(qbc.requestTime.text,'timestamp')}"
|
12
|
+
puts "Time next request allowed : #{qbc.formatFieldValue(qbc.requestNextAllowedTime.text,'timestamp')}"
|
13
|
+
puts "Time application last modified : #{qbc.formatFieldValue(qbc.lastModifiedTime,'timestamp')}"
|
14
|
+
puts "Time any record last modified : #{qbc.formatFieldValue(qbc.lastRecModTime,'timestamp')}"
|
15
|
+
|
16
|
+
|
17
|
+
=begin
|
18
|
+
|
19
|
+
Output of the above script:
|
20
|
+
|
21
|
+
Date/time information about the QuickBase Community Forum:
|
22
|
+
|
23
|
+
Time of request : 05-03-2009 03:52 PM
|
24
|
+
Time next request allowed : 05-03-2009 03:52 PM
|
25
|
+
Time application last modified : 03-26-2009 01:55 PM
|
26
|
+
Time any record last modified : 05-02-2009 10:10 AM
|
27
|
+
|
28
|
+
=end
|
29
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
# change "username" "password" to your QuickBase username and password
|
5
|
+
qbc = QuickBase::Client.new("username","password")
|
6
|
+
qbc.printRequestsAndResponses=true
|
7
|
+
applicationDBID = qbc.findDBByname("QuickBase API Cookbook v2")
|
8
|
+
qbc.getSchema(applicationDBID)
|
9
|
+
childDBID = qbc.lookupChdbid("Ingredients")
|
10
|
+
puts "The dbid of the 'Ingredients' table in the QuickBase API Cookbook v2 application is #{childDBID}"
|
11
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
require 'QuickBaseClient'
|
2
|
+
|
3
|
+
qbc = QuickBase::Client.new
|
4
|
+
qbc.getSchema("8emtadvk")
|
5
|
+
puts "Columns for QuickBase Community Forum 'List all' report: #{qbc.getColumnListForQuery(nil,'List All')}"
|
6
|
+
puts "Columns for QuickBase Community Forum 'List all' report: #{qbc.getColumnListForQuery("1",nil)}"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'QuickBaseClient'
|
3
|
+
|
4
|
+
qbc = QuickBase::Client.new("username","password")
|
5
|
+
|
6
|
+
# get the available choices for the 'Ingredient 1' field in the
|
7
|
+
# 'Recipes' table of the 'QuickBase API Cookbook v2' application
|
8
|
+
choices = qbc.getFieldChoices( "bb2mad4sr", "Ingredient 1" )
|
9
|
+
|
10
|
+
if choices
|
11
|
+
puts "\n------ Ingredients choices from the QuickBase API Cookbook v2 ------\n\n"
|
12
|
+
puts choices.join("\n")
|
13
|
+
end
|