######## ####### ######## ####### ######## ######## ## / / / / License \ \ \ \ ## Copyleft culture, Copyright (C) is prohibited here ## This work is licensed under a CC BY-SA 4.0 ## Creative Commons Attribution-ShareAlike 4.0 License ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/ ######## ####### ######## ####### ######## ######## ## / / / / Code Climate \ \ \ \ ## Language = ruby ## Indent = space; 4 chars; ######## ####### ######## ####### ######## ######## module ArchestryLookup module Lookup class << self def dialog_lookup_main(args, state) dialog_lookup_main_constructor(args, state) end def dialog_lookup_main_constructor(args, state) args[:stages][state[:dialectFolder]] = {codegenGlobal: {}, codegenPerView: {}, x: {}, panView: {lookup: {}}, perView: {}, constructor: {}} ###_constructors views folderId = state[:dbhandler].execute("select id from folders where name in ('_constructors')")[0][0] state[:dbhandler].execute("select folder_id, folder_version, model_version from folders_in_model where parent_folder_id in ('#{folderId}') and model_version = (select max(model_version) from folders_in_model where parent_folder_id in ('#{folderId}')) and folder_version = (select max(folder_version) from folders_in_model where parent_folder_id in ('#{folderId}'))").each do |conFolder| state[:dbhandler].execute("select view_id as view_id2, view_version, model_version from views_in_model where parent_folder_id in ('#{conFolder[0]}') and model_version = (select max(model_version) from views_in_model where view_id in (view_id2))") do |row| viewAtr = state[:dbhandler].execute("select name, version from views where id in ('#{row[0]}') and version = (select max(version) from views where id in ('#{row[0]}'))") id = row[0].tr("-", "_") args[:con_views][id] ||= {} args[:con_views][id][:version] = row[1] args[:con_views][id][:name] = state[:dialectFolder] Dialog.logger.info "ArchestryLookup constructor view '#{viewAtr[0][0]}' (id #{id}, view ver.#{row[1]}, model ver.#{row[2]}) suits for me!" end end end def dialog_lookup_post(args, state) args[:con_views].each do |viewId, _viewProps| viewType = :constructors lookup_constructors_DockedGroupings2AppFunctions(args, state, viewId, viewType) lookup_constructors_Element2ModSend(args, state, viewId, viewType) lookup_constructors_ElementsInElements(args, state, viewId, viewType) end args[:views].each do |viewId, viewProps| viewType = :perView ArchestryLookup.logger.debug "ArchestryLookup_lookup RUN instance '#{state[:dialectFolder]}' view '#{viewProps[:name]}' ver.#{viewProps[:version]}" ###functional lookupStruct = {'functional' => [ 'Expect2Events', 'Events2AppEvent', 'Events2ModReceive', 'ModReceive2AppEvent', 'Appevent2EventBus', 'AppEvent2Elements', 'Elements2AppEvent', 'Element2ModElements', 'Element2ModSend', 'ModElementsSpecs', 'ElementChains']} #1 lookup_run(args, lookupStruct, state, viewId, viewType) ###data lookupStruct = {'data' => [ 'ModReceive2GetData', 'GetData2Elements', 'GenData2Dest', 'Results2GenData']} #1 lookup_run(args, lookupStruct, state, viewId, viewType) ### end end end end end