Class: Twb::Connection

Inherits:
Object
  • Object
show all
Includes:
TabTool
Defined in:
lib/twb/connection.rb

Instance Attribute Summary collapse

Attributes included from TabTool

#alerts, #docDir, #docfiles, #funcdoc, #id, #licensed, #logfilename, #logger, #loglevel, #metrics, #properties, #ttdocdir, #type, #uuid

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TabTool

#addDocFile, #alert, #closeDocFiles, #config, #docFile, #docFileMaxNameLen, #docfilesdoc, #docfilesdocto_s, #emit, #emitCSV, #finis, #hasConfig, #init, #initCSV, #initDocDir, #initLogger, #license=, #licensed?, #loadConfig

Constructor Details

#initialize(node) ⇒ Connection

node: XML element


89
90
91
92
93
94
95
# File 'lib/twb/connection.rb', line 89

def initialize node
    @node    = node
    @xmlType = node.type
    @path    = node.path.gsub(/\[[0-9]+\]/,'')  
    @pathNum = /(\d+)/.match(@path)
    @name    = nil
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes


86
87
88
# File 'lib/twb/connection.rb', line 86

def attributes
  @attributes
end

#nodeObject (readonly)

Returns the value of attribute node


86
87
88
# File 'lib/twb/connection.rb', line 86

def node
  @node
end

#xmlTypeObject (readonly)

Returns the value of attribute xmlType


86
87
88
# File 'lib/twb/connection.rb', line 86

def xmlType
  @xmlType
end

Class Method Details

.attributeNamesObject


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/twb/connection.rb', line 24

def self.attributeNames
    @@attributeNames ||= [
                            'authentication',
                            'authentication-type',
                            'auto-extract',
                            'channel',
                            'character-set',
                            'class',
                            'cleaning',
                            'compat',
                            'compressed-responses',
                            'compressed-responses-bulk',
                            'compressed-responses-rest',
                            'compressed-responses-soap',
                            'connection-type',
                            'dataRefreshTime',
                            'dbname',
                            'directory',
                            'disable-unicode',
                            'driver',
                            'enum-with-permissions',
                            'expected-driver-version',
                            'filename',
                            'force-character-set',
                            'force-header',
                            'force-separator',
                            'header',
                            'imex',
                            'interpretationMode',
                            'maxfieldlength',
                            'mdwpath',
                            'odbc-connect-string-extras',
                            'odbc-native-protocol',
                            'one-time-sql',
                            'pagesize',
                            'password',
                            'port',
                            'prefer-ind-semantics',
                            'query-band-spec',
                            'REDIRECT_URI',
                            'salesforce-api-version',
                            'schema',
                            'SCOPE',
                            'separator',
                            'server',
                            'server-oauth',
                            'service',
                            'sf-total-requestor-buffer-size-in-mb',
                            'show',
                            'tableau-ri',
                            'tablename',
                            'temporary',
                            'update-time',
                            'updated-database',
                            'use-nonemptycrossjoin',
                            'userLanguage',
                            'username',
                            'validate',
                            'workgroup-auth-mode'
                         ]
end

Instance Method Details

#processConnection(path) ⇒ Object


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twb/connection.rb', line 97

def processConnection path
    conns = @node.xpath(path)
    conns.each do |connNode|
        connClass = @dsclass
        cpath     = conn.path
        connPath  = cpath.
        connPNum  = 
        # puts cpath, connPath
        # puts "CPATH: #{cpath}"
        conn.attributes.each do |name,value|
            # puts  "\n\t\t - %-15s -> %-s" % [name, value]
            $csvFile << [ $recCount += 1,
                          $twbName,  $dir,     $build,    $version,
                          $dsName,   $dstype,  $dsuiname, connClass, 
                          connPath,  connPNum,
                          name,      value.value
                        ]
        end
    end
end