<commit_before><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
	xmlns:px="urn:panax"
    xmlns:str="http://exslt.org/strings"
	xmlns="http://www.w3.org/TR/xhtml1/strict"
	exclude-result-prefixes="px">
	<xsl:strip-space elements="*"/>

	<xsl:template match="*[@controlType='gridView' or @controlType='cardView']" mode="Viewcontroller">
		/**
		 * 
		 * [ViewController]: GridView
		 * 
		 */
		Ext.define('Panax.viewcontroller.<xsl:apply-templates select="." mode="modelName"/>', {
		    extend: 'Ext.app.ViewController',
		    alias: 'controller.<xsl:apply-templates select="." mode="modelName"/>',

		    /**
		     * Show formView window for record
		     * @param  {Object} record Selected record
		     */
		    createPanaxWindow: function(record) {
       			var panaxCmp;

				panaxCmp = Panax.getPanaxComponent({
					prefix: "Cache.app",
					dbId: "<xsl:value-of select="@dbId "/>",
					lang: "<xsl:value-of select="@xml:lang "/>",
					catalogName: "<xsl:value-of select="@Table_Schema "/>.<xsl:value-of select="@Table_Name "/>",
					mode: ("<xsl:value-of select="@mode "/>" === "readonly") ? "readonly" : (record ? "edit" : "insert"),
					controlType: "formView"
				}, {
					idValue: record ? record.id : null
				});

				Ext.suspendLayouts();

				this.panaxWindow = new Panax.view.PanaxWindow({
					title: ("<xsl:value-of select="@mode "/>" === "readonly") ? "Ver" : (record ? "Editar" : "Nuevo"),
					items: [panaxCmp]
				});

	           	this.panaxWindow.show();

	           	Ext.resumeLayouts(true);
		    },

		    /**
		     * Edit record
		     * @param  {Object} button Clicked button
		     */
			onEditRecordClick: function(button) {
				var record = button.dataViewRecord ? button.dataViewRecord : button.getWidgetRecord();
				this.createPanaxWindow(record);
			},

			/**
			 * Add record
			 */
		    onAddRecordClick: function() {
		   		this.createPanaxWindow(null);
		    },

		    /**
		     * Remove record
		     */
		    onRemoveRecordClick: function() {
				var panaxformGrid = this.getView(),<commit_msg>Minor Fix: createPanaxWindow takes record_id only<commit_after><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
	xmlns:px="urn:panax"
    xmlns:str="http://exslt.org/strings"
	xmlns="http://www.w3.org/TR/xhtml1/strict"
	exclude-result-prefixes="px">
	<xsl:strip-space elements="*"/>

	<xsl:template match="*[@controlType='gridView' or @controlType='cardView']" mode="Viewcontroller">
		/**
		 * 
		 * [ViewController]: GridView
		 * 
		 */
		Ext.define('Panax.viewcontroller.<xsl:apply-templates select="." mode="modelName"/>', {
		    extend: 'Ext.app.ViewController',
		    alias: 'controller.<xsl:apply-templates select="." mode="modelName"/>',

		    /**
		     * Show formView window for record
		     * @param  {String} Record ID of Selected record
		     */
		    createPanaxWindow: function(record_id) {
       			var panaxCmp;

				panaxCmp = Panax.getPanaxComponent({
					prefix: "Cache.app",
					dbId: "<xsl:value-of select="@dbId "/>",
					lang: "<xsl:value-of select="@xml:lang "/>",
					catalogName: "<xsl:value-of select="@Table_Schema "/>.<xsl:value-of select="@Table_Name "/>",
					mode: ("<xsl:value-of select="@mode "/>" === "readonly") ? "readonly" : (record_id ? "edit" : "insert"),
					controlType: "formView"
				}, {
					idValue: record_id ? record_id : null
				});

				Ext.suspendLayouts();

				this.panaxWindow = new Panax.view.PanaxWindow({
					title: ("<xsl:value-of select="@mode "/>" === "readonly") ? "Ver" : (record_id ? "Editar" : "Nuevo"),
					items: [panaxCmp]
				});

	           	this.panaxWindow.show();

	           	Ext.resumeLayouts(true);
		    },

		    /**
		     * Edit record
		     * @param  {Object} button Clicked button
		     */
			onEditRecordClick: function(button) {
				debugger;
				var record = button.dataViewRecord ? button.dataViewRecord : button.getWidgetRecord();
				this.createPanaxWindow(record.data.id);
			},

			/**
			 * Add record
			 */
		    onAddRecordClick: function() {
		   		this.createPanaxWindow(null);
		    },

		    /**
		     * Remove record
		     */
		    onRemoveRecordClick: function() {
				var panaxformGrid = this.getView(),
{'fraction_non_alphanumeric': 0.17895927601809955, 'fraction_numerical': 0.007239819004524887, 'mean_word_length': 3.0045289855072466, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 2, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5988107', 'n_tokens_mistral': 1793, 'n_tokens_neox': 1449, 'n_words': 237}