quickbase_client 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -2
- data/lib/QuickBaseClient.rb +45 -9
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -14,7 +14,7 @@ require 'QuickBaseClient'
|
|
14
14
|
|
15
15
|
qbc = QuickBase::Client.new("quickbase_username","quickbase_password")
|
16
16
|
|
17
|
-
qbc.grantedDBs{|db| puts "dbid
|
17
|
+
qbc.grantedDBs{|db| puts "dbid: #{db.dbinfo.dbid}, dbname: #{db.dbinfo.dbname}" }
|
18
18
|
|
19
19
|
|
20
20
|
== Documentation
|
@@ -29,7 +29,9 @@ More information about the QuickBase Client is available here -
|
|
29
29
|
|
30
30
|
== Change History
|
31
31
|
|
32
|
-
1.0.
|
32
|
+
1.0.9 - 03/26/2011 - Added aliases, getCSVForReport(), makeCSVFileForReport(), getCriteriaForQuery().
|
33
|
+
|
34
|
+
1.0.8 - 03/11/2011 - Fixed a problem with getApplicationVariables().
|
33
35
|
|
34
36
|
1.0.7 - 03/06/2011 - Fixed a problem with formatTimeOfDay().
|
35
37
|
|
data/lib/QuickBaseClient.rb
CHANGED
@@ -1235,6 +1235,8 @@ class Client
|
|
1235
1235
|
end
|
1236
1236
|
clistForQuery
|
1237
1237
|
end
|
1238
|
+
|
1239
|
+
alias getColumnListForReport getColumnListForQuery
|
1238
1240
|
|
1239
1241
|
# Returns the slist associated with a query.
|
1240
1242
|
def getSortListForQuery( id, name )
|
@@ -1249,6 +1251,24 @@ class Client
|
|
1249
1251
|
end
|
1250
1252
|
slistForQuery
|
1251
1253
|
end
|
1254
|
+
|
1255
|
+
alias getSortListForReport getSortListForQuery
|
1256
|
+
|
1257
|
+
# Returns the criteria associated with a query.
|
1258
|
+
def getCriteriaForQuery( id, name )
|
1259
|
+
criteriaForQuery = nil
|
1260
|
+
if id
|
1261
|
+
query = lookupQuery( id )
|
1262
|
+
elsif name
|
1263
|
+
query = lookupQueryByName( name )
|
1264
|
+
end
|
1265
|
+
if query and query.elements["qycrit"]
|
1266
|
+
criteriaForQuery = query.elements["qycrit"].text.dup
|
1267
|
+
end
|
1268
|
+
criteriaForQuery
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
alias getCriteriaForReport getCriteriaForQuery
|
1252
1272
|
|
1253
1273
|
# Returns a valid query operator.
|
1254
1274
|
def verifyQueryOperator( operator, fieldType )
|
@@ -2011,15 +2031,15 @@ class Client
|
|
2011
2031
|
def doQuery( dbid, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
|
2012
2032
|
|
2013
2033
|
@dbid, @clist, @slist, @fmt, @options = dbid, clist, slist, fmt, options
|
2014
|
-
|
2015
|
-
xmlRequestData = getQueryRequestXML( query, qid, qname )
|
2016
2034
|
|
2017
2035
|
@clist ||= getColumnListForQuery(qid, qname)
|
2036
|
+
@slist ||= getSortListForQuery(qid, qname)
|
2018
2037
|
|
2019
|
-
xmlRequestData
|
2020
|
-
xmlRequestData << toXML( :
|
2021
|
-
xmlRequestData << toXML( :
|
2022
|
-
xmlRequestData << toXML( :
|
2038
|
+
xmlRequestData = getQueryRequestXML( query, qid, qname )
|
2039
|
+
xmlRequestData << toXML( :clist, @clist ) if @clist
|
2040
|
+
xmlRequestData << toXML( :slist, @slist ) if @slist
|
2041
|
+
xmlRequestData << toXML( :fmt, @fmt ) if @fmt
|
2042
|
+
xmlRequestData << toXML( :options, @options ) if @options
|
2023
2043
|
|
2024
2044
|
sendRequest( :doQuery, xmlRequestData )
|
2025
2045
|
|
@@ -2142,6 +2162,9 @@ class Client
|
|
2142
2162
|
# Uses the active table id.
|
2143
2163
|
def _downLoadFile( rid, fid, vid = "0" ) downLoadFile( @dbid, rid, fid, vid ) end
|
2144
2164
|
|
2165
|
+
alias downloadFile downLoadFile
|
2166
|
+
alias _downloadFile _downLoadFile
|
2167
|
+
|
2145
2168
|
# API_EditRecord
|
2146
2169
|
def editRecord( dbid, rid, fvlist, disprec = nil, fform = nil, ignoreError = nil, update_id = nil, msInUTC =nil )
|
2147
2170
|
|
@@ -2275,12 +2298,14 @@ class Client
|
|
2275
2298
|
def _genAddRecordForm( fvlist = nil ) genAddRecordForm( @dbid, fvlist ) end
|
2276
2299
|
|
2277
2300
|
# API_GenResultsTable
|
2278
|
-
def genResultsTable( dbid, query = nil, clist = nil, slist = nil, jht = nil, jsa = nil, options = nil )
|
2301
|
+
def genResultsTable( dbid, query = nil, clist = nil, slist = nil, jht = nil, jsa = nil, options = nil, qid = nil, qname = nil )
|
2279
2302
|
|
2280
2303
|
@dbid, @query, @clist, @slist, @jht, @jsa, @options = dbid, query, clist, slist, jht, jsa, options
|
2281
|
-
@query = "{'0'.CT.''}" if @query.nil?
|
2282
2304
|
|
2283
|
-
|
2305
|
+
@clist ||= getColumnListForQuery(qid, qname)
|
2306
|
+
@slist ||= getSortListForQuery(qid, qname)
|
2307
|
+
|
2308
|
+
xmlRequestData = getQueryRequestXML( query, qid, qname )
|
2284
2309
|
xmlRequestData << toXML( :clist, @clist ) if @clist
|
2285
2310
|
xmlRequestData << toXML( :slist, @slist ) if @slist
|
2286
2311
|
xmlRequestData << toXML( :jht, @jht ) if @jht
|
@@ -4422,6 +4447,17 @@ class Client
|
|
4422
4447
|
end
|
4423
4448
|
}
|
4424
4449
|
end
|
4450
|
+
|
4451
|
+
# Create a CSV file using the records for a Report.
|
4452
|
+
def makeCSVFileForReport(filename,dbid=@dbid,query=nil,qid=nil,qname=nil)
|
4453
|
+
csv = getCSVForReport(dbid,query,qid,qname)
|
4454
|
+
File.open(filename,"w"){|f|f.write(csv || "")}
|
4455
|
+
end
|
4456
|
+
|
4457
|
+
# Get the CSV data for a Report.
|
4458
|
+
def getCSVForReport(dbid,query=nil,qid=nil,qname=nil)
|
4459
|
+
genResultsTable(dbid,query,nil,nil,nil,nil,"csv",qid,qname)
|
4460
|
+
end
|
4425
4461
|
|
4426
4462
|
# Upload a file into a new record in a table.
|
4427
4463
|
# Additional field values can optionally be set.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickbase_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-03-
|
12
|
+
date: 2011-03-26 00:00:00.000000000 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
description: Wraps the QuickBase HTTP API and adds classes and methods to minimize
|