Sha256: cdc57d28aa3a1043226f1271ea5629a6b990c3c76e3663d648160a277ff6c22a

Contents?: true

Size: 1.56 KB

Versions: 35

Compression:

Stored size: 1.56 KB

Contents

class <%=class_name%> < SourceAdapter
  def initialize(source) 
    super(source)
  end
 
  def login
    # TODO: Login to your data source here if necessary
  end
 
  def query(params=nil)
    # TODO: Query your backend data source and assign the records 
    # to a nested hash structure called @result. For example:
    # @result = { 
    #   "1"=>{"name"=>"Acme", "industry"=>"Electronics"},
    #   "2"=>{"name"=>"Best", "industry"=>"Software"}
    # }
    raise SourceAdapterException.new("Please provide some code to read records from the backend data source")
  end
 
  def sync
    # Manipulate @result before it is saved, or save it 
    # yourself using the Rhoconnect::Store interface.
    # By default, super is called below which simply saves @result
    super
  end
 
  def create(create_hash)
    # TODO: Create a new record in your backend data source
    raise "Please provide some code to create a single record in the backend data source using the create_hash"
  end
 
  def update(update_hash)
    # TODO: Update an existing record in your backend data source
    raise "Please provide some code to update a single record in the backend data source using the update_hash"
  end
 
  def delete(delete_hash)
    # TODO: write some code here if applicable
    # be sure to have a hash key and value for "object"
    # for now, we'll say that its OK to not have a delete operation
    # raise "Please provide some code to delete a single object in the backend application using the object_id"
  end
 
  def logoff
    # TODO: Logout from the data source if necessary
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rhoconnect-3.4.5 generators/templates/source/source_adapter.rb
rhoconnect-3.4.4 generators/templates/source/source_adapter.rb
rhoconnect-3.4.3 generators/templates/source/source_adapter.rb
rhoconnect-3.4.2 generators/templates/source/source_adapter.rb
rhoconnect-3.3.6 generators/templates/source/source_adapter.rb
rhoconnect-3.3.5 generators/templates/source/source_adapter.rb
rhoconnect-3.3.4 generators/templates/source/source_adapter.rb
rhoconnect-3.3.3 generators/templates/source/source_adapter.rb
rhoconnect-3.3.2 generators/templates/source/source_adapter.rb
rhoconnect-3.3.1 generators/templates/source/source_adapter.rb
rhoconnect-3.3.1.beta4 generators/templates/source/source_adapter.rb
rhoconnect-3.3.1.beta3 generators/templates/source/source_adapter.rb
rhoconnect-3.3.1.beta2 generators/templates/source/source_adapter.rb
rhoconnect-3.2.1 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0.beta5 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0.beta4 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0.beta3 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0.beta2 generators/templates/source/source_adapter.rb
rhoconnect-3.2.0.beta1 generators/templates/source/source_adapter.rb