1. #11
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    same problem with SDK 2, with files in local mode, not under webserver
    It does nothing, just few blank lines

    Code:
    sencha create jsb -a ./index.php -p ./app.jsb3 -v
    index.php
    Code:
    <?php 
    
        // Control errores PHP
        ini_set('error_reporting', E_ALL);             // E_ALL = todos
        ini_set('display_errors', 1);                // 1 = si, 0 = no mostrar errores PHP 
        ini_set('log_errors', 0);                    // 1 = si, 0 = no registrar log errores del servidor PHP
    
        // Obligar a que las urls sean HTTPS
        if($_SERVER['HTTPS']!="on")
        {
         $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
         header("Location:$redirect");
        }
    
        // Incluir el autocargador de clases
        require_once("autocargadorClases.class.php");
        $cargadorClases = autocargadorClases::getInstancia();
        // Asignar carpetas de búsqueda para las clases del namespace esicontrol
        //$cargadorClases->agregarCarpeta("eSicontrol",dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."app_clases");
        $cargadorClases->agregarCarpeta("eSicontrol",dirname(__FILE__).DIRECTORY_SEPARATOR."app_clases");
    
        // Abrir siempre la sesion
        // Esto debe ir siempre despues del autocagador.
        session_start();    
    
        // asignar algunas carpetas al path del include automatico.
        set_include_path( eSicontrol_carpetas::getInstancia()->libs
                          .PATH_SEPARATOR .get_include_path()  
                         );
    
        // Libreria de funciones CESI
        require_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."cesi".DIRECTORY_SEPARATOR."LibreriaCESI.inc.php");
    
        // Constantes 
        require_once(eSicontrol_carpetas::getInstancia()->data .DIRECTORY_SEPARATOR."constantes.inc.php");
    
        // Control de l'idioma
        if(isSet($_GET['lang'])) {
            $lang = $_GET['lang'];
            // register the session and set the cookie
            $_SESSION['eSicontrolLang'] = $lang;
            setcookie("eSicontrolLang", $lang, time() + (3600 * 24 * 30));
        } else if(isSet($_SESSION['eSicontrolLang'])) {
            $lang = $_SESSION['eSicontrolLang'];
        } else if(isSet($_COOKIE['eSicontrolLang'])) {
            $lang = $_COOKIE['eSicontrolLang'];
        } else {
            $lang = 'esp';
        }
    
        // Catalogo del idioma seleccionado para la parte PHP (Gettext integrado en PHP)
        setlocale(LC_MESSAGES, ($lang == 'cat' ? 'ca_ES' : 'es_ES' ).'.UTF-8');
        bindtextdomain("eSicontrol", eSicontrol_carpetas::getInstancia()->idiomas);
        bind_textdomain_codeset("eSicontrol", "UTF-8");
        
        // Incluir clases para mandar mails (phpmailer)
        include_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."phpmailer".DIRECTORY_SEPARATOR."class.phpmailer.php");
        include_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."phpmailer".DIRECTORY_SEPARATOR."language".DIRECTORY_SEPARATOR."phpmailer.lang-".($lang == 'cat' ? 'ca' : 'es' ).".php");
            
        // Marcar que el usuario ha entrado por index.php
        define("_ENTRADA_POR_INDEX_OK",true);
    
        
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >-->
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><?php echo dgettext("eSicontrol","eSicontrol - Gestión de usuarios y aplicaciones"); ?></title>
    
        <!-- Estilos -->
        <link href="<?php echo eSicontrol_carpetas::getInstancia()->urlEstilos; ?>/estilo.css" rel="stylesheet" type="text/css" />
    
        <!-- Google maps API v3 -->
        <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
    
        <!-- Librerias js jQuery -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/jquery/jquery-1.6.min.js"></script>
        
        <!-- Librerias js Sencha Extjs -->
        <link rel="stylesheet" type="text/css" href="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/resources/css/ext-all.css">
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/bootstrap.js"></script>
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/locale/ext-lang-<?php echo ($lang == 'cat' ? 'ca' : 'es' ); ?>.js"></script>
    
        <!-- Librerias js gettext - Gestor idiomas y traducciones -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/Gettext/Gettext.js"></script>
        <script type="text/javascript">
            // Cargar el gestor de traducciones javascript
            var gt = new Gettext();
        </script>
        <!-- Catalogo del idioma seleccionado para la parte javascript-->
        <link type="application/x-po" rel="gettext" href="<?php echo eSicontrol_carpetas::getInstancia()->urlIdiomas; ?>/<?php echo ($lang == 'cat' ? 'ca_ES' : 'es_ES' ); ?>/LC_MESSAGES/eSicontrol.mo">
    
        <!-- Librerias js Tinymce -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php"></script>
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/langs/<?php echo ($lang == 'cat' ? 'ca' : 'es' ); ?>.js"></script>
    
        <!-- 
            Apliacion eSicontrol js compilada (obfuscated i minimized) 
            Antes de compilar hay que comentar el script app.js para que no se duplique el proceso de busqueda
            de librerias js utilizadas
        -->
        <script type="text/javascript" src="app_js/app.js"></script>
    
    
        <script type="text/javascript">
    
            // Variable global con el objecto Ext.app.Application
            var eSicontrolApp = null;
            
            Ext.onReady(function() {
    
                Ext.require('eSicontrol.app');
    
                Ext.Loader.setConfig({        
                    enabled: true
                });
                    
                // Carpetas donde localizar las clases js
                Ext.Loader.setPath({
                    'Cesi.ux':             '<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs_cesi',
                    'Ext.ux':             '<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs_cesi',
                    'eSicontrol':         'app_js',
                });
        
                Ext.QuickTips.init();
                Ext.tip.QuickTipManager.init();    
                
                Ext.util.Format.decimalSeparator = '.';
                Ext.util.Format.thousandSeparator = ',';            
        
    
                // Crear la aplicacion principal
                eSicontrolApp = Ext.create('eSicontrol.app');            
    
            });
    
        </script>
    
    </head>
    <body>
    </body>
    </html>
    app.js
    Code:
    Ext.require('Ext.app.Application');
    
    Ext.define('eSicontrol.app', {
        extend: 'Ext.app.Application',
        
        name: 'eSicontrolApp',
        appFolder: 'app_js',
        autoCreateViewport: false,
    
           // Nombre y versión de la aplicación  (Podria estar en php-config con una consulta Direct)
        nombreComercial: gt.dgettext('eSicontrol','eSicontrol'),
        versionComercial: '1.0.0 Beta',
        
        // Controladores definidos
        controllers: [
            'eSicontrol.controller.escritorio'
        ],
    
        // Metodo para lanzar la aplicacion.             
        launch: function() {
             // Mostrar escritorio del programa
             this.escritorio = Ext.create('eSicontrol.view.escritorio');
        }
    
    });

  2. #12
    Sencha User aw1zard2's Avatar
    Join Date
    Sep 2009
    Location
    Dallas, Texas
    Posts
    577
    Vote Rating
    32
    aw1zard2 has a spectacular aura about aw1zard2 has a spectacular aura about

      0  

    Default


    @malejin

    Don't use bootstrap.js put ext.js in there instead.
    You need everything to be loaded by Ext.Loader.
    Also turn the loader on inside your app.js file not in the onReady.
    If you have everything aligned correctly you can load everything before anything is ran.

    PHP Code:
    Ext.Loader.setConfig({
        
    enabledtrue,
        
    paths: {
            
    'MYAPP''.',
            
    'Ext.ux.form''./js-4.0.7/plugin',
            
    'Ext.ux''./js-4.0.7/plugin'
        
    }
    }); 

  3. #13
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    thanks i hope i understand the changes you said:

    but i obtain the same blank lines

    index.php
    Code:
    <?php 
    
        // Control errores PHP
        ini_set('error_reporting', E_ALL);             // E_ALL = todos
        ini_set('display_errors', 1);                // 1 = si, 0 = no mostrar errores PHP 
        ini_set('log_errors', 0);                    // 1 = si, 0 = no registrar log errores del servidor PHP
    
        // Obligar a que las urls sean HTTPS
    //    if($_SERVER['HTTPS']!="on")
    //    {
    //     $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    //     header("Location:$redirect");
    //    }
    
        // Incluir el autocargador de clases
        require_once("autocargadorClases.class.php");
        $cargadorClases = autocargadorClases::getInstancia();
        // Asignar carpetas de búsqueda para las clases del namespace esicontrol
        //$cargadorClases->agregarCarpeta("eSicontrol",dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."app_clases");
        $cargadorClases->agregarCarpeta("eSicontrol",dirname(__FILE__).DIRECTORY_SEPARATOR."app_clases");
    
        // Abrir siempre la sesion
        // Esto debe ir siempre despues del autocagador.
        session_start();    
    
        // asignar algunas carpetas al path del include automatico.
        set_include_path( eSicontrol_carpetas::getInstancia()->libs
                          .PATH_SEPARATOR .get_include_path()  
                         );
    
        // Libreria de funciones CESI
        require_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."cesi".DIRECTORY_SEPARATOR."LibreriaCESI.inc.php");
    
        // Constantes 
        require_once(eSicontrol_carpetas::getInstancia()->data .DIRECTORY_SEPARATOR."constantes.inc.php");
    
        // Control de l'idioma
        if(isSet($_GET['lang'])) {
            $lang = $_GET['lang'];
            // register the session and set the cookie
            $_SESSION['eSicontrolLang'] = $lang;
            setcookie("eSicontrolLang", $lang, time() + (3600 * 24 * 30));
        } else if(isSet($_SESSION['eSicontrolLang'])) {
            $lang = $_SESSION['eSicontrolLang'];
        } else if(isSet($_COOKIE['eSicontrolLang'])) {
            $lang = $_COOKIE['eSicontrolLang'];
        } else {
            $lang = 'esp';
        }
    
        // Catalogo del idioma seleccionado para la parte PHP (Gettext integrado en PHP)
        setlocale(LC_MESSAGES, ($lang == 'cat' ? 'ca_ES' : 'es_ES' ).'.UTF-8');
        bindtextdomain("eSicontrol", eSicontrol_carpetas::getInstancia()->idiomas);
        bind_textdomain_codeset("eSicontrol", "UTF-8");
        
        // Incluir clases para mandar mails (phpmailer)
        include_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."phpmailer".DIRECTORY_SEPARATOR."class.phpmailer.php");
        include_once(eSicontrol_carpetas::getInstancia()->libs .DIRECTORY_SEPARATOR."phpmailer".DIRECTORY_SEPARATOR."language".DIRECTORY_SEPARATOR."phpmailer.lang-".($lang == 'cat' ? 'ca' : 'es' ).".php");
            
        // Marcar que el usuario ha entrado por index.php
        define("_ENTRADA_POR_INDEX_OK",true);
    
        
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >-->
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><?php echo dgettext("eSicontrol","eSicontrol - Gestión de usuarios y aplicaciones"); ?></title>
    
        <!-- Estilos -->
        <link href="<?php echo eSicontrol_carpetas::getInstancia()->urlEstilos; ?>/estilo.css" rel="stylesheet" type="text/css" />
    
        <!-- Google maps API v3 -->
        <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
    
        <!-- Librerias js jQuery -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/jquery/jquery-1.6.min.js"></script>
        
        <!-- Librerias js Sencha Extjs -->
        <link rel="stylesheet" type="text/css" href="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/resources/css/ext-all.css">
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/ext.js"></script>
    
        <!-- Librerias js gettext - Gestor idiomas y traducciones -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/Gettext/Gettext.js"></script>
        <script type="text/javascript">
            // Cargar el gestor de traducciones javascript
            var gt = new Gettext();
        </script>
        <!-- Catalogo del idioma seleccionado para la parte javascript-->
        <link type="application/x-po" rel="gettext" href="<?php echo eSicontrol_carpetas::getInstancia()->urlIdiomas; ?>/<?php echo ($lang == 'cat' ? 'ca_ES' : 'es_ES' ); ?>/LC_MESSAGES/eSicontrol.mo">
    
        <!-- Librerias js Tinymce -->
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php"></script>
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/tiny_mce/langs/<?php echo ($lang == 'cat' ? 'ca' : 'es' ); ?>.js"></script>
    
        <script type="text/javascript" src="app_js/app.js"></script>
    
        <script type="text/javascript">
    
            // Variable global con el objecto Ext.app.Application
            var eSicontrolApp = null;
            
            Ext.onReady(function() {
    
                Ext.require('eSicontrol.app');
                Ext.require('Ext.picker.*');
    
                Ext.QuickTips.init();
                Ext.tip.QuickTipManager.init();    
                
                Ext.util.Format.decimalSeparator = '.';
                Ext.util.Format.thousandSeparator = ',';            
       
                // Crear la aplicacion principal
                eSicontrolApp = Ext.create('eSicontrol.app');            
    
            });
    
        </script>
    
        <script type="text/javascript" src="<?php echo eSicontrol_carpetas::getInstancia()->urlLibs; ?>/extjs/locale/ext-lang-<?php echo ($lang == 'cat' ? 'ca' : 'es' ); ?>.js"></script>
    
    </head>
    <body>
    </body>
    </html>
    and app.js
    Code:
    // Carpetas donde localizar las clases js
    Ext.Loader.setConfig({        
        enabled: true,
        paths: {
            'Ext':                 '../libs/extjs/src',
            'Ext.ux':             '../libs/extjs_cesi',
            'Cesi.ux':             '../libs/extjs_cesi',
            'eSicontrol':         'app_js'
        }
    });                
    
    Ext.require('Ext.app.Application');
    
    Ext.define('eSicontrol.app', {
        extend: 'Ext.app.Application',
        
        name: 'eSicontrol',
        appFolder: 'app_js',
        autoCreateViewport: false,
    
        // Nombre y versión de la aplicación  (Podria estar en php-config con una consulta Direct)
        nombreComercial: gt.dgettext('eSicontrol','eSicontrol'),
        versionComercial: '1.0.0 Beta',
        
        // Controladores definidos
        controllers: [
            'escritorio'
        ],
    
        // Metodo para lanzar la aplicacion.             
        launch: function() {
                    // Mostrar escritorio del programa
                    this.escritorio = Ext.create('eSicontrol.view.escritorio');
        }
    
    });

  4. #14
    Sencha User aw1zard2's Avatar
    Join Date
    Sep 2009
    Location
    Dallas, Texas
    Posts
    577
    Vote Rating
    32
    aw1zard2 has a spectacular aura about aw1zard2 has a spectacular aura about

      0  

    Default


    You need to goto the url for php/jsp files cause the sencha program doesn't understand the php commands.
    Below is how you should be running yours.
    Code:
    sencha create jsb -a http://localhost/index.php -p ./app.jsb3 -v
    If you still don't get the jsb3 file created then something isn't right in your files. On defining an application.
    I'll reply to this post with an example of how I am doing a EXT JS 4.0.7 app.

  5. #15
    Sencha User aw1zard2's Avatar
    Join Date
    Sep 2009
    Location
    Dallas, Texas
    Posts
    577
    Vote Rating
    32
    aw1zard2 has a spectacular aura about aw1zard2 has a spectacular aura about

      0  

    Default


    Check out this thread it explains how I am structuring my apps.
    If your not extending components you can skip the MYAPP.arch.* requires. And use the common as an example.

    http://www.sencha.com/forum/showthre...l=1#post747688

  6. #16
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    thanks aw1zard2 , but i think its impossible to do this to work.
    I have tried lots of things and changes.
    The lasts ones. (with this environment: windows 7 x86 32 bits, extjs v4.0.7)

    Install java v1.7.0_03-b05
    reinstall sencha sdk tools 2.0.0 beta in C:\SenchaSDKTools2Beta folder to avoid 'spaces' in path
    execute CMD with administrator mode and without
    create a simple index.html file like this
    Code:
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <link rel="stylesheet" type="text/css" href="../libs/extjs/resources/css/ext-all.css">
            <script type="text/javascript" src="../libs/extjs/ext.js"></script>
            <script type="text/javascript" src="./app_js/app.js"></script>
        </head>
        <body>
        </body>
    </html>
    I think there are many problems with this tools, or my science is appoaching to the end. :-(

    Manel

  7. #17
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    i found a poor solution.

    Simply work with old sencha command v.1.2.2 (uninstall v2.0.0 beta it takes lots of problems for me)

    Manel

  8. #18
    Sencha User aw1zard2's Avatar
    Join Date
    Sep 2009
    Location
    Dallas, Texas
    Posts
    577
    Vote Rating
    32
    aw1zard2 has a spectacular aura about aw1zard2 has a spectacular aura about

      0  

    Default


    I renamed my 1.2.2 tools to sencha1 command so I could have both installed.
    Have you downloaded the recently announced Sencha SDK Tools Beta 2 they made a lot of fixes for backward compat.

    Look in the Sencha Touch 2.0 forums.

    Even though it says use with Sencha Touch 2.0 I got the backward compat to work for me as well.

  9. #19
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    I have the same issue as everyone else in this forum; trying to create a .jsb3 file silently fails.

    Being an Enterprise developer who has written several command-line tools in my day, might I say that it's a cardinal, inexcusable sin to not output meaningful error messages to the console.

    I realize the SDK Tool is listed as a 'beta', but the lack of diagnostic error messages borders on pathetic...

  10. #20
    Ext JS Premium Member Ron Howard's Avatar
    Join Date
    May 2011
    Posts
    115
    Vote Rating
    3
    Ron Howard is on a distinguished road

      0  

    Default


    Everyone reading this go get the Beta 2 of Sencha SDK Tools.
    They fixed a lot.
    Sencha Tools 1.2.2 jsb3 file size =37k
    Sencha Tools 2.0.0 Beta 2 jsb3 file size = 52k

    Try the new tools Beta2.