
\subsubsection{OpenLaszlo y los dataset}
\begin{itemize}
 \item En la documentación de OpenLaszlo hay un \href{http://labs.openlaszlo.org/legals-nightly/docs/guide/data.html}{capítulo dedicado a datos y databinding}.
 \item Además de una pequeña \href{http://labs.openlaszlo.org/legals-nightly/docs/guide/data-tutorial.html}{introducción a Databinding}.
\end{itemize}

\subsubsection{Aplicaciones con despliegue SOLO o con el servidor de OpenLazlo}
\begin{itemize}
 \item Hay más documentación sobre ello en la sección del manual para ingenieros del software de OpenLazlo, \href{http://labs.openlaszlo.org/legals-nightly/docs/guide/proxied.html}{capítulo 25.}
\end{itemize}

 
\newpage
\subsubsection{OpenLaszlo y servicios web}
 
 \begin{itemize}
  \item \href{http://www.openlaszlo.org/lps4/docs/guide/rpc-soap.html}{Documentación sobre SOAP-RPC} en OpenLaszlo.
  \item Un ejemplo: OpenLaszlo y SOAP
      \begin{itemize}
          \item Es importante ser limpio y separar el código de la IU con el código propio de los servicios web.
          \item Un controlador (clase controladora) por cada caso de uso (por ejemplo, caso de uso de registro del usuario).
          \item {Dentro del controlador, indicar la url donde se encuentran los servicios.
              \begin{lstlisting}[language=XML]
<soap name="zisplanetWrapper" id="tema"
wsdl="http://zisplanet.deusto.es:8080/axis/services/ZisplaNetWS?wsdl">
              \end{lstlisting}
          }
          \item Por cada método del servicio a invocar, crear un método en el controlador para atender las respuestas y realizar las llamadas a SOAP.
          \item Dentro del wrapper de servicios SOAP creado (en este caso zisplanetWrapper) se definen los métodos de los servicios web remotos, con la sintaxis correcta.
      \end{itemize}
 \end{itemize}
  
 \begin{itemize}
	\item Ejemplo:
\end{itemize}

\begin{lstlisting}[language=XML]
<?xml version="1.0" encoding="UTF-8" ?>
 <library>
   <attribute name="user" />

	<!--   * * * * * * * * * * * * * * * * *
		
			DataSets
    
	* * * * * * * * * * * * * * * * * -->
    
        <dataset name="lastposts">
    		<lastposts>
    		</lastposts>
        </dataset>
        
    
         <!--   * * * * * * * * * * * * * * * * *

                Login Controller

        * * * * * * * * * * * * * * * * * -->

        <class name="LoginController">
                <!-- Client session -->
                <attribute name="currentLogin" type="string" />
                <attribute name="currentPassword"  type="string" />
                <attribute name="currentUser" />
                
                <method name="logIn">
                 	var login = this.getAttribute("currentLogin");	
                	var password = this.getAttribute("currentPassword");
                        zisplanetWrapper.logIn.invoke([login,password]);
                </method>

                <method name="logInResponse" args="userDTO">
                	Debug.inspect(userDTO);
                	this.currentUser = userDTO;
                </method>
         </class>
         
          <!--   * * * * * * * * * * * * * * * * *

                Last news Controller

          * * * * * * * * * * * * * * * * * -->

         <class name="LastNewsController">
        	<method name="getLatestPost">
        		zisplanetWrapper.getLatestPost.invoke();                              
        	</method>
                
        	<method name="getLatestPostResponse" args="obtainedPosts">
                <![CDATA[
                     var cp = lastposts.getPointer();
                     cp.setXPath('lastposts');
                     clearNodeChilds(cp);
                     var cf = null;
                     cf = lastposts.getPointer();
                     cf.setXPath('lastposts');
                     Debug.write(obtainedPosts);
                     Debug.write(obtainedPosts.length);
                     for(i = 0; i < obtainedPosts.length; ++i){
                        cf = obtainedPosts[i];
                        cp.addNode('post',null,{
                              title : cf.title,
                              title_abr: title_a,
                              autor : cf.author,
                              date : cf.datestr,
                              hour: cf.hourstr
                        });
                     }
                 ]]>
            </method>
            
            
            <!-- * * * * * * * * * * * * * * * * *

                Zisplanet Wrapper

            * * * * * * * * * * * * * * * * * -->
            <alert id="remoteCallError" name="remoteCallError">
                There was a remote call error!
            </alert>
        
            <soap name="zisplanetWrapper" id="tema"
         wsdl="http://zisplanet.deusto.es:8080/axis/services/ZisplaNetWS?wsdl"
            >
             
             <handler name="onload">
        	Debug.write("onload");
             </handler>

             <handler name="ontimeout" args="error">
                Debug.write('timeout:', error);
             </handler>
        
             <handler name="onerror" args="error">
        	Debug.write(error);
                remoteCallError.open();
             </handler>
             
             <remotecall funcname="logIn">
                        <handler name="ondata" args="value">
                                controllerLogin.logInResponse(value);
                        </handler>
                        <handler name="onerror" args="value">
                        <![CDATA[
                        	Debug.write("onerror!");
                        	Debug.inspect(value);                    
                                remoteCallError.open(); 
                         ]]>
                        </handler>
             </remotecall>
             
             <remotecall funcname="getLatestPost">
			<handler name="ondata" args="value">
                            controllerLastNews.getLatestPostResponse(value);
                        </handler>
                        <handler name="onerror" args="value">
        			Debug.write("onerror!");
                        	Debug.write(value);
                        	Debug.inspect(value);      
                                remoteCallError.open();
                        </handler>
             </remotecall>
            </soap>
	 
\end{lstlisting}

\newpage

\subsubsection{Scripting dinámico}

\begin{itemize}
\item Un pequeño ejemplo creando un botón dinámicamente:
\end{itemize}
\begin{lstlisting}[language=XML]
<canvas debug="true">
	<view layout="spacing: 10; axis:y">
       <text>hola mundo</text>
       <button text="pulsame">
               <method event="onclick">
                       var boton = new button(this,{y: "30", text : "lalala"});
               </method>
       </button>
       </view>
</canvas>
\end{lstlisting}


\begin{itemize}
 \item En OpenLaszlo, un $<button>$ es \emph{igual} en Flash que en DHTML
 \item Hay un trozo de código en DHTML y otro trozo de código en Flash
 \item Por tanto \emph{puede} ser más lento que un botón nativo de Flash y un botón nativo de DHTML
 \item De hecho, en general, es más lento cuando compilas a DHTML que cuando compilas a
Flash, aunque esto pueda depender de qué intérprete de JavaScript
uses.
\end{itemize}

\newpage

\subsection{OpenLaszlo en plataformas móviles}


\subsubsection{Proyecto Orbit}

\begin{itemize}
  \item Gracias al \href{http://www.openlaszlo.org/orbit/}{proyecto Orbit} en el que participan Sun Microsystems y Laszlo Systems las aplicaciones desarrolladas mediante OpenLaszlo podrán ser ejecutadas en dispositivos que soporten la plataforma  Java Micro Edition (Java ME).
\end{itemize}
\begin{center}
\includegraphics[scale=0.8]{img/openlaszlo/proyectoOrbit.jpg} \\
\small{\href{http://weblog.openlaszlo.org/files/clockonphone.jpg}{Copyright OpenLaszlo}}
\end{center}
  
\subsubsection{OpenLaszlo en el iPhone}
\begin{itemize}
\item Este lunes dos desarrolladores de OpenLaszlo han realizado la primera aplicación para el iPhone, como puede leerse en el \href{http://weblog.openlaszlo.org/archives/2007/07/our-first-iphone-app/}{blog de OpenLaszlo}.
\item Han demostrado así que gracias a que las aplicaciones desarrolladas mediante esta plataforma pueden compilarse a DHTML, que funciona bien en la mayoría de los navegadores, las aplicaciones OpenLaszlo también se pueden ver en el navegador Safari del iPhone.
\item Para ello secillamente han utilizado el 'wizard' del modo de despliegue SOLO para crear un conjunto de ficheros que puedan colgarse en la web, para verlos desde el iPhone. El wizard del despliegue SOLO te devuelve un wrapper html, main.lzx.html, en el que sencillamente han añadido una línea "metadata".
\item \href{http://labs.openlaszlo.org/ipdc/newsmatch06/}{Ejemplo} de aplicación para OpenLaszlo en el iPhone
\end{itemize}


