Class: HooplaSalesforce::Rake::RetrieveTask

Inherits:
BaseTask
  • Object
show all
Defined in:
lib/hoopla_salesforce/rake/retrieve_task.rb

Instance Attribute Summary collapse

Attributes inherited from BaseTask

#enterprise_wsdl, #metadata_wsdl, #name, #password, #token, #username

Instance Method Summary collapse

Constructor Details

#initialize(name = :retrieve) ⇒ RetrieveTask

Returns a new instance of RetrieveTask.



20
21
22
23
24
25
# File 'lib/hoopla_salesforce/rake/retrieve_task.rb', line 20

def initialize(name=:retrieve)
  @request = { "wsdl:unpackaged" => { "wsdl:types" =>
               [{ "wsdl:members" => "*", "wsdl:name" => "ApexClass" }]
             }}
  super
end

Instance Attribute Details

#requestObject

The format of the retrieve request. Defaults to:

{ "wsdl:apiVersion" => "18.0",
  "wsdl:unpackaged" => { "wsdl:types" =>
    [{ "wsdl:members" => "*", "wsdl:name" => "ApexClass" }]
  }
}

If your code is in a salesforce package, you can specify:

{ "wsdl:packageNames" => ["Your Package Name"] }

NOTE: Some components will only be available in higher API versions, so

make sure to set your apiVersion accordingly.


18
19
20
# File 'lib/hoopla_salesforce/rake/retrieve_task.rb', line 18

def request
  @request
end

Instance Method Details

#defineObject



27
28
29
30
31
32
33
34
35
# File 'lib/hoopla_salesforce/rake/retrieve_task.rb', line 27

def define
  namespace :hsf do
    desc "Retrieve all apex classes from salesforce.com"
    task name do
      require 'hoopla_salesforce/deployer'
      HooplaSalesforce::Deployer.new(username, password, token, enterprise_wsdl, ).retrieve(request)
    end
  end
end