Class: KeytechKit::Layouts

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/keytechKit/classes/layouts.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url, username, password) ⇒ Layouts

Returns a new instance of Layouts.



9
10
11
12
# File 'lib/keytechKit/classes/layouts.rb', line 9

def initialize(base_url, username, password)
  self.class.base_uri(base_url)
  @auth = { username: username, password: password }
end

Instance Method Details

#bom_lister_layoutObject

Loads the bom lister layout



32
33
34
35
# File 'lib/keytechKit/classes/layouts.rb', line 32

def bom_lister_layout
  # /bom/listerlayout
  load_lister_layout("bom")
end

#explorer_layout(classkey) ⇒ Object



23
24
25
# File 'lib/keytechKit/classes/layouts.rb', line 23

def explorer_layout(classkey)
    load_layout(classkey, {layoutType: "ExplorerLayout"})
end

#global_lister_layoutObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/keytechKit/classes/layouts.rb', line 37

def global_lister_layout
  # type, displaytext, name, status, created_at, created_by
  Layout.new('DesignerControls' => [
               { 'AttributeName' => 'classname',
                 'Displayname' => 'Klasse' },
               { 'AttributeName' => 'displayname',
                 'Displayname' => 'Bezeichnung' },
               { 'AttributeName' => 'status',
                 'Displayname' => 'Status' },
               { 'AttributeName' => 'created_by',
                 'Displayname' => 'Angelegt von' },
               { 'AttributeName' => 'created_at',
                 'Displayname' => 'Angelegt am' }
             ])
end

#header_layout(classkey) ⇒ Object



14
15
16
17
# File 'lib/keytechKit/classes/layouts.rb', line 14

def header_layout(classkey)
    # Ab keytedch 14!
    load_layout(classkey, {layoutType: "HeaderLayout"})
end

#lister_layout(classkey) ⇒ Object



27
28
29
# File 'lib/keytechKit/classes/layouts.rb', line 27

def lister_layout(classkey)
    load_lister_layout(classkey)
end

#main_layout(classkey) ⇒ Object



19
20
21
# File 'lib/keytechKit/classes/layouts.rb', line 19

def main_layout(classkey)
    load_layout(classkey, {layoutType: "DefaultLayout"})
end