GAE y Maven

Generar el proyecto con:

mvn archetype:generate -DarchetypeGroupId=net.kindleit -DarchetypeArtifactId=gae-archetype-jsp -DarchetypeVersion=0.8.0 -DgroupId=com.example -DartifactId=test

definir la variable en el pom. o settings.xml:

<gae.home>C:\desarrollo\sts-2.3.2.RELEASE\plugins\com.google.appengine.eclipse.sdkbundle_1.5.0.r35v201105191506\appengine-java-sdk-1.5.0.1</gae.home>

Para que se le solicite email/pass dirante el deploy

		<plugin>
				<groupId>net.kindleit</groupId>
				<artifactId>maven-gae-plugin</artifactId>
				<version>0.9.2</version>
				<configuration>
 <passIn>true</passIn>
 </configuration>
				<dependencies>
					<dependency>
						<groupId>net.kindleit</groupId>
						<artifactId>gae-runtime</artifactId>
						<version>${gae.version}</version>
						<type>pom</type>
					</dependency>
				</dependencies>
			</plugin>

Ejecutar
mvn gae:deploy

Publicado en maven | Etiquetado , | Deja un comentario

Dumbster: Fake SMTP Server

El viernes tuvimos un mini-quilombo porque unos test de java mandaron miles de mails… el sabado recordé de una libreria para evitar este tipo de problema en entorno de desarrollo/test/IC:
Dumbster: Fake SMTP Server:
http://quintanasoft.com/dumbster/

Dependencia de maven:

<dependency>
<groupId>dumbster</groupId>
<artifactId>dumbster</artifactId>
<version>1.6</version>

Muy facil de usar

Dumbster – Fake SMTP Server
http://quintanasoft.com/dumbster/

The Dumbster is a very simple fake SMTP server designed for unit and system testing applications that send email messages. It responds to all standard SMTP commands but does not deliver messages to the user. The messages are stored within the Dumbster for later extraction and verification.

Publicado en Uncategorized | Etiquetado | Deja un comentario

TodoList Mobile 0.1

Luego de un poco de trabajo acomode la version mobile para que quede mas decente. Ahora las tareas se crean con una prioridad y aparecen en la lista con un icono correspondiente. Al dar click en la tarea se puede modificar o terminar… entonces el icono aparece el de done.

Agregue un modelo para el TodoForm y con eso puedo injectarle desde el manager la tarea a editar o una tarea nueva.

Le puse un poco de estilos, para que no se vea blanco y negro…

Codigo completo en:

http://code.google.com/p/todolistexample/

Publicado en Uncategorized | Etiquetado , , , , , , , , , , | Deja un comentario

todolist-flex-air-mobile-mate done!

Acabo de subi la primera version de todolist-flex-air-mobile-mate.
Hay cosas que no me gustaron mucho… pero funca.

Publicado en Uncategorized | Etiquetado , , , , , | Deja un comentario

web vs air… channelSet sigue jodiendo

Ahora al probar web tuve que meter un if y buscar la configuracion del servidor. Para el caso AIR funciona como estaba…


private var channel:AMFChannel;

[Bindable]
private var channelSet:ChannelSet;

private function setupChannelSet():void
{
if( url )
{
channelSet = new ChannelSet();
channel = new AMFChannel("my-amf", url);
channelSet.addChannel(channel);
} else {
channelSet = ServerConfig.getChannelSet("my-amf");
}
}

Publicado en Uncategorized | Deja un comentario

todolist-flex-air-desktop-mate done

Acabo de terminar la version AIR, que no resulto tan obvio como creia.

Resulta que AIR no conoce la url de los servicios y por eso hay que definirsela. La modificación que habia pensado era solo pasarle la url al TodoListHandlerMap. Pero resulta que el ChannelSet y los servicios de remoting necesitan de esa url.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
xmlns:common="library://ns.cubikalabs.todolist.common"
xmlns:view="org.cubikalabs.todolist.common.view.*">
<fx:Declarations>
<common:TodoListHandlerMap url="http://localhost:8080/todolist-blazeds-web/messagebroker/amf" />
</fx:Declarations>

Para salvar el tema de inicialización hice la asignación de la url asi:


<?xml version="1.0" encoding="utf-8"?>
<mate:EventMap xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:mate="http://mate.asfusion.com/"
>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
import mx.messaging.config.ServerConfig;
import mx.rpc.Fault;

import org.cubikalabs.todolist.common.events.SecurityEvent;
import org.cubikalabs.todolist.common.events.TodoListEvent;
import org.cubikalabs.todolist.common.model.*;
import org.cubikalabs.todolist.common.view.*;

[Bindable]
public var url:String = null;

private function log(msg:String):void
{
trace(msg);
}

private function alert(msg:String, fault:Fault):void
{
Alert.show( fault.faultString, msg + ": " + fault.faultCode );
trace(msg);
}

private    var channel:AMFChannel;

[Bindable]
private    var channelSet:ChannelSet = new ChannelSet();

private function setupChannelSet():void
{
channel = new AMFChannel("my-amf", url);
channelSet.addChannel(channel);
}

]]>
</fx:Script>
<fx:Declarations>
<mate:Debugger level="{Debugger.ALL}" />
<mate:EventHandlers type="{ FlexEvent.INITIALIZE }">
<mate:InlineInvoker method="setupChannelSet" />
<mate:ObjectBuilder generator="{ TodoListManager }" cache="global" />
<mate:ObjectBuilder generator="{ LoginPanelModel }" cache="global" />
<mate:ObjectBuilder generator="{ TodoListPanelModel }" cache="global" />
</mate:EventHandlers>

<mate:Injectors target="{ LoginPanel }">
<mate:PropertyInjector source="{ LoginPanelModel }"
targetKey="model" />
</mate:Injectors>

<mate:Injectors target="{ TodoListPanel }">
<mate:PropertyInjector source="{ TodoListPanelModel }"
targetKey="model" />
</mate:Injectors>

<mate:Injectors target="{ LoginPanelModel }">
<mate:PropertyInjector source="{ TodoListManager }"
sourceKey="loginState"
targetKey="loginState" />
</mate:Injectors>

<mate:Injectors target="{ TodoListPanelModel }">
<mate:PropertyInjector source="{ TodoListManager }"
sourceKey="todoList"
targetKey="todoList" />
</mate:Injectors>

<s:RemoteObject
id="roTodoService"
endpoint="http://localhost:8080/todolist-blazeds-web/messagebroker/amf"
destination="todoService" />

<mate:EventHandlers type="{ SecurityEvent.LOGIN }">
<mate:InlineInvoker method="log" arguments="{ [ 'Login in progress' ]}" />
<mate:ChannelSetLoginInvoker username="{ event.username }" password="{ event.password }"
channelSet="{ channelSet }"    channelSetName="my-amf" >
<mate:resultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'Login Succes' ]}" />
<mate:MethodInvoker generator="{ TodoListManager }"
method="setLoginState"
arguments="{ [ TodoListConstants.LOGIN_STATE_SECURE ] }" />
<mate:EventAnnouncer type="{ TodoListEvent.GET_TODOLIST }" />
</mate:resultHandlers>
<mate:faultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'Login error: TODO!' ]}" />
</mate:faultHandlers>
</mate:ChannelSetLoginInvoker>
</mate:EventHandlers>

<mate:EventHandlers type="{ SecurityEvent.LOGOUT }">
<mate:InlineInvoker method="log" arguments="{ [ 'Logout in progress' ]}" />
<mate:ChannelSetLogoutInvoker channelSet="{ channelSet }" >
<mate:resultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'Logout Ok' ]}" />
<mate:MethodInvoker generator="{ TodoListManager }"
method="setLoginState"
arguments="{ [ TodoListConstants.LOGIN_STATE_INSECURE ] }" />
<mate:EventAnnouncer type="{ TodoListEvent.CLEAN_TODOLIST }" />
</mate:resultHandlers>
<mate:faultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'Error en Logout' ]}" />
</mate:faultHandlers>
</mate:ChannelSetLogoutInvoker>
</mate:EventHandlers>

<mate:EventHandlers type="{ TodoListEvent.GET_TODOLIST }">
<mate:InlineInvoker method="log" arguments="{ [ 'Getting TodoList' ]}" />
<mate:RemoteObjectInvoker destination="todoService" method="getTodoList"
channelSet="{ channelSet }">
<mate:resultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'TodoList OK' ]}" />
<mate:MethodInvoker generator="{ TodoListManager }"
method="setTodoList"
arguments="{ [ resultObject ] }" />
</mate:resultHandlers>
<mate:faultHandlers>
<mate:InlineInvoker method="log" arguments="{ [ 'TodoList Error' ]}" />
</mate:faultHandlers>
</mate:RemoteObjectInvoker>
</mate:EventHandlers>

<mate:EventHandlers type="{ TodoListEvent.CLEAN_TODOLIST }">
<mate:InlineInvoker method="log" arguments="{ [ 'Cleanning TodoList' ]}" />
<mate:MethodInvoker generator="{ TodoListManager }"
method="setTodoList"
arguments="{ [ null ] }" />
</mate:EventHandlers>

<mate:EventHandlers type="{ TodoListEvent.SAVE_TODO }">
<mate:InlineInvoker method="log" arguments="{ [ 'Saving TodoList' ]}" />
<mate:RemoteObjectInvoker destination="todoService"
method="saveTodo"
arguments="{ [ event.todo ] }"
channelSet="{ channelSet }" >
<mate:resultHandlers>
<mate:EventAnnouncer type="{ TodoListEvent.GET_TODOLIST }" />
</mate:resultHandlers>
<mate:faultHandlers>
<mate:InlineInvoker method="alert" arguments="{ [ 'Save Todo Error', fault ]}" />
</mate:faultHandlers>
</mate:RemoteObjectInvoker>
</mate:EventHandlers>

</fx:Declarations>

</mate:EventMap>

Publicado en Uncategorized | Etiquetado , , , , , , , , , | Deja un comentario

todolist-flex-web-mate done!

Ya commitie una primera version del proyecto flex-mate-web. Si se hace la prueba de tratar de grabar una tarea sin loggearse, el server dispara un error de seguridad. Como se puede ver la lista de tareas y el usuario asignado a una tarea nueva se obtienen en el servidor de la sesion activa, lo cual es mas seguro que obtenerlo de los datos del servicio.

Pensando en la reutilización casi todo el codigo esta en el proyecto todolist-flex-mate-common.

Generar la version desktop supone una estupidez…

Publicado en Uncategorized | Etiquetado , , , , , , | Deja un comentario