lib/QuickBaseClient.rb in quickbase_client-1.0.15 vs lib/QuickBaseClient.rb in quickbase_client-1.0.16
- old
+ new
@@ -33,31 +33,31 @@
# The API_ wrapper methods just set things up for sendRequest() and put values from the
# response into member variables.
class Client
attr_reader :access, :accessid, :accountLimit, :accountUsage, :action, :admin
- attr_reader :adminOnly, :ancestorappid, :app, :appdbid, :appdata, :applicationLimit, :applicationUsage, :authenticationXML
- attr_reader :cacheSchemas, :cachedSchemas, :chdbids, :choice, :clist, :create, :createapptoken, :createdTime, :databases, :dbdesc
- attr_reader :dbid, :dbidForRequestURL, :dbname, :delete, :apptoken, :disprec, :domain, :downLoadFileURL
+ attr_reader :adminOnly, :ancestorappid, :app, :appdbid, :appdata, :applicationLimit, :applicationUsage, :apptoken, :authenticationXML
+ attr_reader :cacheSchemas, :cachedSchemas, :chdbids, :choice, :clist, :copyfid, :create, :createapptoken, :createdTime
+ attr_reader :databases, :dbdesc, :dbid, :dbidForRequestURL, :dbname, :delete, :destrid, :disprec, :domain, :downLoadFileURL
attr_reader :email, :errcode, :errdetail, :errtext, :excludeparents, :externalAuth, :fform
attr_reader :fid, :fids, :field, :fields, :field_data, :field_data_list, :fieldTypeLabelMap, :fieldValue, :fileContents, :fileUploadToken, :firstName, :fmt, :fname, :fnames, :fvlist
attr_reader :hours, :HTML, :httpConnection, :id, :ignoreError, :includeancestors
attr_reader :jht, :jsa, :key_fid, :keepData, :label, :lastAccessTime
attr_reader :lastError, :lastModifiedTime, :lastName, :lastPaymentDate, :lastRecModTime, :login
attr_reader :mgrID, :mgrName, :mode, :modify, :name
attr_reader :newappname, :newowner, :newdbdesc, :newdbid, :newdbname
attr_reader :num_fields, :numMatches, :num_records, :num_recs_added, :num_records_deleted
- attr_reader :num_recs_input, :num_recs_updated, :numadded
+ attr_reader :num_recs_input, :num_recs_updated, :numadded, :numCreated
attr_reader :numRecords, :numremoved, :oldestancestorappid, :options, :org, :page, :pages, :pagebody
- attr_reader :pageid, :pagename, :pagetype, :password, :permissions
+ attr_reader :pageid, :pagename, :pagetype, :parentrid, :password, :permissions
attr_reader :printRequestsAndResponses, :properties, :qarancestorappid, :qdbapi, :qbhost
- attr_reader :qid, :qname, :queries, :query, :record, :records, :records_csv
+ attr_reader :qid, :qname, :queries, :query, :record, :records, :records_csv, :recurse, :relfids
attr_reader :requestHeaders, :requestNextAllowedTime, :requestSucceeded, :requestTime, :requestURL, :requestXML
attr_reader :responseElement, :responseElementText, :responseElements, :responseXML
attr_reader :responseXMLdoc, :rid, :rids, :role, :roleid, :rolename, :roles, :saveviews, :screenName
attr_reader :serverStatus, :serverVersion , :serverUsers, :serverGroups, :serverDatabases, :serverUptime, :serverUpdays
- attr_reader :showAppData, :skipfirst, :slist, :standardRequestHeaders, :status, :stopOnError
+ attr_reader :showAppData, :skipfirst, :slist, :sourcerid, :standardRequestHeaders, :status, :stopOnError
attr_reader :table, :tables, :ticket, :type, :udata, :uname, :update_id, :user, :userid
attr_reader :username, :users, :value, :validFieldProperties, :validFieldTypes, :variables
attr_reader :varname, :version, :vid, :view, :withembeddedtables
attr_reader :eventSubscribers, :logger
@@ -1935,9 +1935,34 @@
@newdbid
end
# API_CloneDatabase, using the active table id.
def _cloneDatabase( *args ) cloneDatabase( @dbid, args ) end
+
+ # API_CopyMasterDetail
+ def copyMasterDetail( dbid, destrid, sourcerid, copyfid = nil, recurse = nil, relfids = nil )
+
+ raise "copyfid must be specified when destrid is 0." if destrid == "0" and copyfid.nil?
+
+ @dbid, @destrid, @sourcerid, @copyfid, @recurse, @relfids = dbid, destrid, sourcerid, copyfid, recurse, relfids
+
+ xmlRequestData = toXML( :destrid, @destrid)
+ xmlRequestData << toXML( :sourcerid, @sourcerid )
+ xmlRequestData << toXML( :copyfid, @copyfid ) if @copyfid
+ xmlRequestData << toXML( :recurse, @recurse ) if @recurse
+ xmlRequestData << toXML( :relfids, @relfids ) if @relfids
+
+ sendRequest( :copyMasterDetail, xmlRequestData )
+
+ @parentrid = getResponseValue( :parentrid )
+ @numCreated = getResponseValue( :numCreated )
+
+ return self if @chainAPIcalls
+ return @parentrid, @numCreated
+ end
+
+ # API_CopyMasterDetail, using the active table id.
+ def _copyMasterDetail( *args ) copyMasterDetail( @dbid, args ) end
# API_CreateDatabase
def createDatabase( dbname, dbdesc, createapptoken = "1" )
@dbname, @dbdesc, @createapptoken = dbname, dbdesc, createapptoken