Find list of activatable view model and add to list (3rd parameter)
@internal exported for unit testing
511193
function (navigationInstruction, callbackName, list, router) {
        if (list === void 0) { list = []; }
        var plan = navigationInstruction.plan;
        Object
            .keys(plan)
            .forEach(function (viewPortName) {
            var viewPortPlan = plan[viewPortName];
            var viewPortInstruction = navigationInstruction.viewPortInstructions[viewPortName];
            var viewPortComponent = viewPortInstruction.component;
            var viewModel = viewPortComponent.viewModel;
            if ((viewPortPlan.strategy === activationStrategy.invokeLifecycle
                || viewPortPlan.strategy === activationStrategy.replace)
                && callbackName in viewModel) {
                list.push({
                    viewModel: viewModel,
                    lifecycleArgs: viewPortInstruction.lifecycleArgs,
                    router: router
                });
            }
            var childNavInstruction = viewPortPlan.childNavigationInstruction;
            if (childNavInstruction) {
                findActivatable(childNavInstruction, callbackName, list, viewPortComponent.childRouter || router);
            }
        });
        return list;
    }
1251211
public function renderTreeToolsAction(): ViewModel
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');

        /** @var \MelisCore\Service\MelisCoreConfigService $melisAppConfig */
        $melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $melisKeys = $melisAppConfig->getMelisKeys();

        // Get the order list for ordering tools
        $appconfigpath = $melisKeys[$melisKey];

        $appsConfig = $melisAppConfig->getItem($appconfigpath);


        $orderInterface = $melisAppConfig->getOrderInterfaceConfig($melisKey);
        $tools = [];

        /** @var \MelisCore\Service\MelisCoreAuthService $melisCoreAuth */
        $melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth');

        /** @var \MelisCore\Service\MelisCoreRightsService $melisCoreRights */
        $melisCoreRights = $this->getServiceLocator()->get('MelisCoreRights');
        $xmlRights = $melisCoreAuth->getAuthRights();

        // Merge config if melisKey is "Others"
        if ($melisKey == 'melisothers_toolstree_section') {
            $appsConfig['interface'] = ArrayUtils::merge($appsConfig['interface'], $this->moveToolsToOthersCategory());
        }

        if (isset($appsConfig['interface']) && !empty($appsConfig['interface'])) {
            // Show sections first

            foreach ($appsConfig['interface'] as $key => $toolSectionName) {
                $isNavChild = false;

                if ($melisCoreRights->canAccess($key)) {

                    $tools[$key] = [
                        'toolsection_id' => $toolSectionName['conf']['id'] ?? $key,
                        'toolsection_name' => $toolSectionName['conf']['name'] ?? $key,
                        'toolsection_meliskey' => $toolSectionName['conf']['melisKey'] ?? $key,
                        'toolsection_icon' => $toolSectionName['conf']['icon'] ?? 'fa-cube',
                        'toolsection_forward' => $toolSectionName['forward'] ?? [],
                        'toolsection_children' => [],
                        'toolsection_is_tool' => isset($toolSectionName['forward']) && !empty($toolSectionName['forward']) ? true : false,
                    ];

                    // Second level, tools
                    if (isset($toolSectionName['interface'])) {
                        foreach ($toolSectionName['interface'] as $keyTool => $toolName) {
                            $isToolNavChild = false;

                            $icon = (!empty($toolName['conf']['icon'])) ? $toolName['conf']['icon'] : 'fa-cube';

                            if ($icon) {
                                $isNavChild = true;
                            }

                            if ($melisCoreRights->canAccess($keyTool)) {
                                $tools[$key]['toolsection_children'][$keyTool] = [
                                    'tool_id' => $toolName['conf']['id'] ?? $keyTool,
                                    'tool_name' => $toolName['conf']['name'] ?? "<strike>$keyTool</strike>",
                                    'tool_icon' => $icon,
                                    'tool_forward' => isset($toolName['forward']) ? $toolName['forward'] : [],
                                    'tool_melisKey' => $toolName['conf']['melisKey'] ?? $keyTool,
                                    'toolsection_is_tool' => isset($toolName['forward']) && !empty($toolName['forward']) ? true : false
                                ];
                            }

                            // add third level for tool others
                            if ($melisKey == 'melisothers_toolstree_section') {
                                if (isset($toolName['interface'])) {

                                    // third level, child tools
                                    foreach ($toolName['interface'] as $childKeyTool => $childToolname) {
                                        $icon = (!empty($childToolname['conf']['icon'])) ? $childToolname['conf']['icon'] : 'fa-cube';

                                        if ($icon) {
                                            $isToolNavChild = true;
                                        }

                                        if ($melisCoreRights->canAccess($childKeyTool)) {
                                            $tools[$key]['toolsection_children'][$keyTool]['toolsection_children'][$childKeyTool] = [
                                                'tool_id' => $childToolname['conf']['id'] ?? $keyTool,
                                                'tool_name' => $childToolname['conf']['name'] ?? "<strike>$childKeyTool</strike>",
                                                'tool_icon' => $icon,
                                                'tool_forward' => isset($childToolname['forward']) ? $childToolname['forward'] : [],
                                                'tool_melisKey' => $childToolname['conf']['melisKey'] ?? $keyTool,
                                                'toolsection_is_tool' => isset($childToolname['forward']) && !empty($childToolname['forward']) ? true : false
                                            ];
                                        }

                                    }

                                }

                            }
                            $tools[$key]['toolsection_children'][$keyTool]['toolsection_has_nav_child'] = $isToolNavChild;
                        }
                    }
                }


                $tools[$key]['toolsection_has_nav_child'] = $isNavChild;
            }
        } else {
            // for parent tool
            if (isset($appsConfig['conf']['is_parent_tool']) && $appsConfig['conf']['is_parent_tool']) {
                if ($melisCoreRights->canAccess($melisKey)) {
                    $tools[$melisKey] = $appsConfig;
                }
            }
        }

        $sections = $tools;

        // Reordering sections
        $toolsOrdered = [];
        foreach ($orderInterface as $orderKeySection => $sectionTools) {
            if (!empty($sections[$orderKeySection])) {
                if (empty($toolsOrdered[$orderKeySection])) {
                    $toolsOrdered[$orderKeySection] = [];
                }
                $toolsOrdered[$orderKeySection] = $tools[$orderKeySection];
                unset($toolsOrdered[$orderKeySection]['toolsection_children']);
                unset($sections[$orderKeySection]);
            }
        }
        foreach ($sections as $keyInterfaceSection => $childinterface) {
            if (empty($toolsOrdered[$keyInterfaceSection])) {
                $toolsOrdered[$keyInterfaceSection] = [];
            }
            $toolsOrdered[$keyInterfaceSection] = $tools[$keyInterfaceSection];
            unset($toolsOrdered[$keyInterfaceSection]['toolsection_children']);
        }

        // Reordering tools inside sections
        foreach ($toolsOrdered as $keySection => $toolsSection) {
            $sectionOrderInterface = [];
            if (!empty($orderInterface[$keySection])) {
                $sectionOrderInterface = $orderInterface[$keySection];
            }
            $toolsSectionOrdered = [];

            foreach ($sectionOrderInterface as $orderKey) {
                if (!empty($tools[$keySection]['toolsection_children'][$orderKey])) {
                    $toolsOrdered[$keySection]['toolsection_children'][$orderKey] = $tools[$keySection]['toolsection_children'][$orderKey];
                    unset($tools[$keySection]['toolsection_children'][$orderKey]);
                }
            }

            if (isset($tools[$keySection]['toolsection_children'])) {
                foreach ($tools[$keySection]['toolsection_children'] as $keyInterface => $childinterface) {
                    $toolsOrdered[$keySection]['toolsection_children'][$keyInterface] = $childinterface;
                }
            }
        }

        $view = new ViewModel();

        $view->tools = $toolsOrdered;
        $view->melisKey = $melisKey;
        return $view;
    }
1318277
def register_view(self, view):
        """"""
        super(DataPortListController, self).register_view(view)

        view['name_col'].add_attribute(view['name_text'], 'text', self.NAME_STORAGE_ID)
        view['data_type_col'].add_attribute(view['data_type_text'], 'text', self.DATA_TYPE_NAME_STORAGE_ID)
        if not isinstance(self.model.state, LibraryState) and self.model.state.get_next_upper_library_root_state() is None:
            view['name_text'].set_property("editable", True)
            view['data_type_text'].set_property("editable", True)

        # in the linkage overview the the default value is not shown
        if isinstance(view, InputPortsListView) or isinstance(view, OutputPortsListView):
            view['default_value_col'].add_attribute(view['default_value_text'], 'text', self.DEFAULT_VALUE_STORAGE_ID)
            self._apply_value_on_edited_and_focus_out(view['default_value_text'], self._apply_new_data_port_default_value)
            view['default_value_col'].set_cell_data_func(view['default_value_text'],
                                                         self._default_value_cell_data_func)
            if isinstance(self.model.state, LibraryState):
                view['default_value_col'].set_title("Used value")
            if self.model.state.get_next_upper_library_root_state() is None:  # never enabled means it is disabled
                view['default_value_text'].set_property("editable", True)

        self._apply_value_on_edited_and_focus_out(view['name_text'], self._apply_new_data_port_name)
        self._apply_value_on_edited_and_focus_out(view['data_type_text'], self._apply_new_data_port_type)

        if isinstance(self.model.state, LibraryState):
            view['use_runtime_value_toggle'] = Gtk.CellRendererToggle()
            view['use_runtime_value_col'] = Gtk.TreeViewColumn("Use Runtime Value")
            view['use_runtime_value_col'].set_property("sizing", Gtk.TreeViewColumnSizing.AUTOSIZE)
            view.get_top_widget().append_column(view['use_runtime_value_col'])
            view['use_runtime_value_col'].pack_start(view['use_runtime_value_toggle'], True)
            view['use_runtime_value_col'].add_attribute(view['use_runtime_value_toggle'], 'active',
                                                        self.USE_RUNTIME_VALUE_STORAGE_ID)
            if self.model.state.get_next_upper_library_root_state() is None:
                view['use_runtime_value_toggle'].set_property("activatable", True)
                view['use_runtime_value_toggle'].connect("toggled", self.on_use_runtime_value_toggled)

        self._reload_data_port_list_store()
921473
function getTemplateModel(prefix, resource, appName) {
    var methods = {};

    // if no api or browser apiclient, then return null since we will skip
    if (!resource.api || resource.adapters.browser !== 'apiclient') {
        return null;
    }

    // loop through API routes and create method objects for the template
    _.each(resource.api, function (urlMappings, httpMethod) {
        _.each(urlMappings, function (methodName, url) {
            methods[methodName] = {
                httpMethod: httpMethod,
                url: url
            };
        });
    });

    return {
        resourceName:   resource.name,
        appName:        this.getAppModuleName(prefix, appName),
        serviceName:    this.pancakes.utils.getCamelCase(resource.name + '.service'),
        modelName:      this.pancakes.utils.getPascalCase(resource.name),
        methods:        JSON.stringify(methods)
    };
}
1096944
function onMvcErrorInjectViewModel($e)
    {
        $result = $e->getResult();
        if (!$result instanceof ModelInterface)
            return;

        $model = $e->getViewModel();

        if ($result->terminate()) {
            $e->setViewModel($result);
            return;
        }

        if ($e->getError() && $model instanceof ClearableModelInterface) {
            $model->clearChildren();
        }

        $model->addChild($result);
    }
880541
private void visitActionFieldList(ActionInsertFact afl) {
        String factType = afl.getFactType();
        for (ActionFieldValue afv : afl.getFieldValues()) {
            InterpolationVariable var = new InterpolationVariable(afv.getValue(),
                                                                  afv.getType(),
                                                                  factType,
                                                                  afv.getField());
            if (afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.containsKey(var)) {
                vars.put(var,
                         vars.size());
            }
        }
    }
222007
function(view)
	{
		if (arguments.length > 1)
		{
			conbo.forEach(arguments, function(view, index, list) 
			{
				this.prependView(view);
			}, 
			this);
			
			return this;
		}
	
		if (typeof view === 'function')
		{
			view = new view(this.context);
		}
		
		if (!(view instanceof conbo.View))
		{
			throw new Error('Parameter must be conbo.View class or instance of it');
		}
		
		var firstChild = this.body.firstChild;
		
		firstChild
			? this.body.insertBefore(view.el, firstChild)
			: this.appendView(view);
		
		return this;
	}
1085651
function(view, target) {

		var result = [];

		for (var i = 0, count = target.arguments.length; i < count; i++) {

			if (target.arguments[i].type == Lava.TARGET_ARGUMENT_TYPES.VALUE) {

				result.push(target.arguments[i].data);

			} else {

				if (target.arguments[i].type != Lava.TARGET_ARGUMENT_TYPES.BIND) Lava.t();

				result.push(view.evalPathConfig(target.arguments[i].data));

			}

		}

		return result;

	}
1275719
public void addApiOptions(AbstractParam param) {
		// Add option parameter getters and setters via reflection
		this.param = param;
		Method[] methods = param.getClass().getDeclaredMethods();
		Arrays.sort(methods, METHOD_NAME_COMPARATOR);
		List<String> addedActions = new ArrayList<>();
		// Check for string setters (which take precedence)
		for (Method method : methods) {
			if (isIgnored(method)) {
				continue;
			}

			boolean deprecated = method.getAnnotation(Deprecated.class) != null;

			if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) {
				ApiView view = new ApiView(GET_OPTION_PREFIX + method.getName().substring(3));
				setApiOptionDeprecated(view, deprecated);
				addApiView(view);
			}
			if (method.getName().startsWith("is") && method.getParameterTypes().length == 0) {
				ApiView view = new ApiView(GET_OPTION_PREFIX + method.getName().substring(2));
				setApiOptionDeprecated(view, deprecated);
				addApiView(view);
			}
			if (method.getName().startsWith("set") && method.getParameterTypes().length == 1 && 
					method.getParameterTypes()[0].equals(String.class)) {
				ApiAction action = new ApiAction(SET_OPTION_PREFIX + method.getName().substring(3), 
						new String[]{"String"});
				setApiOptionDeprecated(action, deprecated);
				this.addApiAction(action);
				addedActions.add(method.getName());
			}
			if (method.getName().startsWith("add") && method.getParameterTypes().length == 1 && 
					method.getParameterTypes()[0].equals(String.class)) {
				ApiAction action = new ApiAction(ADD_OPTION_PREFIX + method.getName().substring(3), 
						new String[]{"String"});
				setApiOptionDeprecated(action, deprecated);
				this.addApiAction(action);
				addedActions.add(method.getName());
			}
			if (method.getName().startsWith("remove") && method.getParameterTypes().length == 1 && 
					method.getParameterTypes()[0].equals(String.class)) {
				ApiAction action = new ApiAction(REMOVE_OPTION_PREFIX + method.getName().substring(6), 
						new String[]{"String"});
				setApiOptionDeprecated(action, deprecated);
				this.addApiAction(action);
				addedActions.add(method.getName());
			}
		}
		// Now check for non string setters
		for (Method method : methods) {
			if (isIgnored(method)) {
				continue;
			}

			boolean deprecated = method.getAnnotation(Deprecated.class) != null;

			if (method.getName().startsWith("set") && method.getParameterTypes().length == 1 && ! addedActions.contains(method.getName())) {
				// Non String setter
				if (method.getParameterTypes()[0].equals(Integer.class) || method.getParameterTypes()[0].equals(int.class)) {
					ApiAction action = new ApiAction(SET_OPTION_PREFIX + method.getName().substring(3),
							new String[]{"Integer"});
					setApiOptionDeprecated(action, deprecated);
					this.addApiAction(action);
					addedActions.add(method.getName());	// Just in case there are more overloads
				} else if (method.getParameterTypes()[0].equals(Boolean.class) || method.getParameterTypes()[0].equals(boolean.class)) {
					ApiAction action = new ApiAction(SET_OPTION_PREFIX + method.getName().substring(3),
							new String[]{"Boolean"});
					setApiOptionDeprecated(action, deprecated);
					this.addApiAction(action);
					addedActions.add(method.getName());	// Just in case there are more overloads
				}
			}
		}
		
	}
1306735
function resolveModelViewName (modelViews, modelViewName, resolved) {
    // map of names resolved - this is needed to detect infinite loops
    if (!resolved) {
        resolved = {}
    }
    // throw error if name has already been resolved - infinite loop
    assert.ok(!resolved[modelViewName], 'views error: '+modelViewName+' cannot be resolved to model view object')
    // set flag that current name has been seen
    resolved[modelViewName] = true
    // get specified model view - this has already been tested to exist
    var modelView = modelViews[modelViewName]
    // return resolved value(s)
    return Array.isArray(modelView)
        ? _.map(modelView, modelView => requireValidModelView(modelView, modelViews, true, resolved))
        : requireValidModelView(modelView, modelViews, true, resolved)
}
482733
function action_list()
    {
        $_model = $this->model;
        $gets = $this->gets;
        $gets['page'] = empty($_REQUEST[self::$page_key]) ? 1 : $_REQUEST[self::$page_key];
        $gets['pagesize'] = empty($_REQUEST[self::$pagesize_key]) ? self::$pagesize_default : $_REQUEST[self::$pagesize_key];

        /**
         * @var Pager
         */
        $pager = null;
        $this->vars['list'] = $this->model->gets($gets, $pager);
        $this->vars['pager'] = array(
            'total' => $pager->total,
            'render' => $pager->render(),
            'pagesize' => $pager->pagesize,
            'totalpage' => $pager->totalpage,
            'nowpage' => $pager->page
        );
        $this->swoole->tpl->ref('pager', $this->vars['pager']);
        $this->swoole->tpl->ref('list', $this->vars['list']);
    }
552039
private void doList() throws PageException, SearchException {
	required("collection", action, "name", name);
	// if(StringUtil.isEmpty(name))throw new ApplicationException("for action list attribute name is
	// required");
	pageContext.setVariable(name, getSearchEngine().getCollectionsAsQuery());
    }
590613
function getJavaScriptParameterList(parameters, returnType) {
    var result = []

    result.push("<table>")
    parameters.forEach(function(parameter){
        result.push("<tr>")
        result.push("<td>" + Indent2 + "<span class='parameterName'>" + parameter.name + ",</span>")
        result.push("<td><span class='tdIndent'>// " + getIdlType(parameter.type) + "</span>")
    })

    result.push("<tr>")
    result.push("<td>" + Indent2 + "<span class='parameterName'>callback</span>")
    result.push("<td><span class='tdIndent'>// function(error, " + getIdlType(returnType) + ")</span>")

    result.push("</table>")
    return result.join("\n") + Indent
}
809777
private void updateInstructionList(InstructionModel model) {
    RouteProgress routeProgress = model.retrieveProgress();
    boolean isListShowing = instructionListLayout.getVisibility() == VISIBLE;
    rvInstructions.stopScroll();
    instructionListAdapter.updateBannerListWith(routeProgress, isListShowing);
  }
988625
function joinCurrentModelActivity(method, stateName, modelOrCollection, context, force) {
        var xhrActivity = modelOrCollection[xhrModelLoadingAttribute];
        if (xhrActivity) {
            _.each(xhrActivity, function(xhrEvent) {
                if (!method || method === ALL_XHR_ACTIVITY || xhrEvent.method === method) {
                    // this is one that is applicable
                    pushLoadingState(xhrEvent, stateName, modelOrCollection, context, force);
                }
            });
        }
    }
964437
def determine_actions(self, request, view):
        """"""
        from rest_framework.generics import GenericAPIView
        actions = {}
        excluded_methods = {'HEAD', 'OPTIONS', 'PATCH', 'DELETE'}
        for method in set(view.allowed_methods) - excluded_methods:
            view.request = clone_request(request, method)
            try:
                if isinstance(view, GenericAPIView):
                    has_object = view.lookup_url_kwarg or view.lookup_field in view.kwargs
                elif method in {'PUT', 'POST'}:
                    has_object = method in {'PUT'}
                else:
                    continue
                # Test global permissions
                if hasattr(view, 'check_permissions'):
                    view.check_permissions(view.request)
                # Test object permissions
                if has_object and hasattr(view, 'get_object'):
                    view.get_object()
            except (exceptions.APIException, PermissionDenied, Http404):
                pass
            else:
                # If user has appropriate permissions for the view, include
                # appropriate metadata about the fields that should be supplied.
                serializer = view.get_serializer()
                actions[method] = self.get_serializer_info(serializer)
            finally:
                view.request = request

        return actions
611068
def _list_view(self, model, **kwargs):
        
        from uliweb import request

        #add download fields process
        fields = kwargs.pop('fields', None)
        meta = kwargs.pop('meta', 'Table')
        if 'download' in request.GET:
            if 'download_fields' in kwargs:
                fields = kwargs.pop('download_fields', fields)
            if 'download_meta' in kwargs:
                meta = kwargs.pop('download_meta')
            else:
                if hasattr(model, 'Download'):
                    meta = 'Download'
                else:
                    meta = meta

        view = functions.ListView(model, fields=fields, meta=meta, **kwargs)
        return view