[Ginga-argentina] Consulta NLC/LUA/HTML (Interactuando con Web Service)

Nicolas Ignacio Roldan niko_cbes at hotmail.com
Fri Apr 27 15:37:03 CEST 2012


Buenas!
Tengo una duda; nose si seria un canal de retorno lo que quiero hacer; digo, no quiero tomar valores devueltos del web service...
 Solo apunto a pasarle por medio de una url un parametro ( que eso si me lo toma y me lo refleja luego en pantalla que se incremento el resultado) y como segundo paso seria recargar la pagina ( alias " webService" , que en realidad es una html que me muestra resultados nomas).
Eso de recargar la pagina es lo que no me funciona.
Digo, seria unidireccional. Del ginga al web service nomas.
Adjunto codigo.
saludos!!!
nico
 
PD.: si hace falta, subo algun web service para que se vea mejor lo que quiero hacer =)


Date: Fri, 27 Apr 2012 10:15:01 -0300
From: marcelo.vasquez.ar at gmail.com
To: ginga-argentina at lists.ourproject.org
Subject: Re: [Ginga-argentina] Consulta NLC/LUA/HTML (Interactuando con Web	Service)

Yo creo que lo más cercano para tener un canal de retorno es usar la TVD desde un celular, porque allí casi seguramente tengas internet por gprs,3g, egde o por wifi.

El canal de retorno para los STB seguramente va a demorar si esperamos que el estado nos de todo (aunque hay un plan para que así sea).


Pero hoy en día crece todos los días el hecho de tener internet en casa, asi es que no lo veo dificil que pongamos un cable al STB para que salga/entre internet.

Saludos, Marcelo



2012/4/27 Santiago Lombardi <santiago.lombardi at gmail.com>

Nico, la verdad que aun no estoy investigando el tema del canal de retorno. En mi opinion nos falta mucho tiempo (años) para poder pensar en una aplicacion que lo use. 
Estamos enfocando nuestros esfuerzos en comprender lo mejor posible las posibilidades sin canal de retorno.



saludos.

Santiago

On Fri, Apr 27, 2012 at 9:49 AM, Nicolas Ignacio Roldan <niko_cbes at hotmail.com> wrote:











Buenas a todos!
( esta frio no? )


Bueno, es esta oportunidad he comenzado a probar como funciona HTML con Ginga
Mi objetivo es lograr interectuar a traves de Ginga con un web service.

La aplicacion funcionaria asi:
Por medio de los botones '1'/'2'/'3' del control remoto votaria algunas de las 3 opciones y reflejaria la cantidad de votos de cada opcion a traves de una pagina html.


Si presiono alguna de las 3 opciones (1 ò 2 ò 3), paso ese voto por medio del 'event.post'  al NCL ( esto hace que se incremente en 1 el valor que esta en una tabla del webService). 

Algo asi:

if     evt.key == '1' then            


     event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=A'})


     event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=A'})


elseif     evt.key == '2' then
     event.post('out',{class = "ncl", type = "attribution", name = 
'srcNuevo', action='start', 
value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=B'})



     event.post('out',{class = "ncl", type = "attribution", 
name = 'srcNuevo', action='stop', 
value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=B'})

elseif     evt.key == '2' then

     event.post('out',{class = "ncl", type = "attribution", name = 
'srcNuevo', action='start', 
value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=C'})



     event.post('out',{class = "ncl", type = "attribution", 
name = 'srcNuevo', action='stop', 
value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=C'})

end


Hasta ahi funciona perfecto.Si presiono solo una vez cada opcion se incrementa en 1 el voto del html. Mi problema esta en que si quiero volver a votar la misma opcion ya no me lo toma. 

Lo que hice.


Despues de votar una opcion; volvia a llamar al "event.post" pasandole por parametros la direccion original del webService para que actualizara los valores obtenidos y poder seguir votando... pero tampoco funciono.... ó lo mas probable es que no lo sepa hacer.


Hacia:
event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar'})


event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar'})





Este es el codigo:

-------------------------------------------main.ncl--------------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>


<ncl id="main" xmlns="http://www.ncl.org.br/NCL3.0/EDTVProfile">

    <head>
        <regionBase>
             <region id="rgWebService" width="100%" height="30%" top="0%"  zIndex="1"/>


             <region id="rgLua" width="0%" height="0%"  zIndex="1" />
             <region id="idBotonVote" width="20%" height="20%" bottom="10%" left="10%" zIndex="1"/>            


        </regionBase>
        
        <descriptorBase>
            <descriptor id="descWebService" region="rgWebService" />


            <descriptor id="descLua" region="rgLua" focusIndex="appFocusLua"/>
            <descriptor id="descBotonVote" region="idBotonVote"/>


        </descriptorBase>

        <connectorBase>
            <importBase documentURI="metodos.ncl" alias="metodo"/>
        </connectorBase>  
    </head>




    <body>                
     
         <port id="pVote" component="imgBotonVote"/>


        <media id="mediaWebService"  type="text/html" src="MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar"  descriptor="descWebService">


            <property name="src"/>    
        </media>

        <media id="mediaLua" src="luaHtml.lua"  descriptor="descLua" >


            <property name="bounds"/>
            <property name="srcNuevo"/>
        </media>
        
        <media id="imgBotonVote" src="Imagen/Botones/voto.png" descriptor="descBotonVote"/>


      
        <media id="focoLua" type="application/x-ginga-settings">
            <property name="service.currentKeyMaster" value="appFocusLua"/>


        </media>
        
        

        <link xconnector="metodo#onBeginEndMenu">
            <bind role="onSelection" component="imgBotonVote">


                <bindParam name="oSetTecla" value="ENTER"/>
            </bind>
            <bind role="abort" component="imgBotonVote"/>
            


            <bind role="set" component="mediaLua" interface="bounds">
                <bindParam name="oValor" value="0%,30%,100%,50%"/>
            </bind>


            <bind role="start" component="mediaLua"/>
            <bind role="start" component="focoLua" />


                
            <bind role="start" component="mediaWebService"/>    
        </link>
      
             
        <link xconnector="metodo#onEndAttributionSet">


            <bind component="mediaLua" interface="srcNuevo" role="onEndAttribution"/>
            <bind component="mediaLua" interface="srcNuevo" role="getValue"/>


                <linkParam name="valor" value="$getValue"/>
            <bind role="set" component="mediaWebService" interface="src"/>


        </link>
            
           
    </body>
</ncl>
-------------------------------------------------------------------------------------------------------------------------------------




--------------------- metodos.ncl------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>


<!-- Generated by NCL Eclipse -->
<ncl id="metodos" xmlns="http://www.ncl.org.br/NCL3.0/EDTVProfile">
    <head>


        <connectorBase>

                <causalConnector id="onBeginEndMenu">
                    <connectorParam name="oSetTecla"/>


                    <connectorParam name="oValor"/>
                    <simpleCondition role="onSelection" key="$oSetTecla"/>
                    <compoundAction operator="seq">


                        <simpleAction role="start" qualifier="seq"  max="unbounded"/>
                        <simpleAction role="abort" qualifier="seq"  max="unbounded"/>


                        <simpleAction role="set" qualifier="seq" max="unbounded" value="$oValor"/>
                    </compoundAction>
                </causalConnector>



                
           <causalConnector id="onEndAttributionSet">
                <connectorParam name="valor" />
                <simpleCondition role="onEndAttribution"/>


                <simpleAction role="set" value="$valor" />
            </causalConnector>
            
          
        </connectorBase>

    </head>



    <body>

    </body>
</ncl>

--------------------------------------------------------------------------------------------------------------------------------------




---------------------------------luaHtml.lua-----------------------------------------------------------------------------------------




function manejadorEventos(evt)    
        
            
    if evt.class=='key' and evt.type=='press' then 
 
        
      if     evt.key == '1' then
             


           event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=A'})


           event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=A'})


                       
      elseif     evt.key == '2' then    
                
            event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=B'})


            event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=B'})



      elseif    evt.key == '3' then
               
         event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=C'})


         event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar/?opcion=C'})       


       end    
       refrescarHTML()
 end  
        
end



function refrescarHTML()


    
    event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='start', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar'})


    event.post('out',{class = "ncl", type = "attribution", name = 'srcNuevo', action='stop', value='MailScanner has detected a possible fraud attempt from "x.x.x.x" claiming to be MailScanner warning: numerical links are often malicious: http://X.X.X.X/Ginga/Votar'})


    
end


event.register(manejadorEventos)

--------------------------------------------------------------------------------------------------------------------------------------







Esa era una opcion que intente y no paso nada. 


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


La otra opcion  que intente es por medio de NCL, modificando   <causalConnector id="onEndAttributionSet"> ( en el archivo  metodos.ncl) y agregandole un   <simpleAction role="start" />, para llamar de nuevo al "mediaWebService"cuando invoco al <link xconnector="metodo#onEndAttributionSet">( en el archivo main.ncl)... pero exploto con esa opcion... me salia algo como :


" Memory leak by 136 bytes

List of blocks: 0x93d01e0:25 @ cookies.c:179, 0x93d01a8:13 @ cookies.c:129, 0x93cec88:2 @ http.c:79, 0x93d0170:13 @ cookies.c:96, 0x93bb6d8:25 @ cookies.c:95, 0x93d0138:18 @ cookies.c:94, 0x93d00e8:40 @ cookies.c:91



Forcing core dump

"

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////






Bueno, nose que hacer ya. 

Si a alguien le funciono o intento algo parecido, me daria una gran mano
Saludos a todos!
nico

 		 	   		  

__________________________________________Lista de correo Ginga-argentina at lists.ourproject.org
cambiar suscripción: https://lists.ourproject.org/cgi-bin/mailman/listinfo/ginga-argentina
Sitio web: http://comunidad.ginga.org.ar
Wiki: http://wiki.ginga.org.ar 		 	   		  

__________________________________________Lista de correo Ginga-argentina at lists.ourproject.org

cambiar suscripción: https://lists.ourproject.org/cgi-bin/mailman/listinfo/ginga-argentina

Sitio web: http://comunidad.ginga.org.ar

Wiki: http://wiki.ginga.org.ar





__________________________________________Lista de correo Ginga-argentina at lists.ourproject.org

cambiar suscripci&#243;n: https://lists.ourproject.org/cgi-bin/mailman/listinfo/ginga-argentina

Sitio web: http://comunidad.ginga.org.ar

Wiki: http://wiki.ginga.org.ar





__________________________________________Lista de correo Ginga-argentina at lists.ourproject.org
cambiar suscripción: https://lists.ourproject.org/cgi-bin/mailman/listinfo/ginga-argentina
Sitio web: http://comunidad.ginga.org.ar
Wiki: http://wiki.ginga.org.ar 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/ginga-argentina/attachments/20120427/949aff12/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ginga[Interactuando con Web Service].rar
Type: application/octet-stream
Size: 9919 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/ginga-argentina/attachments/20120427/949aff12/attachment-0001.obj 


More information about the Ginga-argentina mailing list