<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkMNQH49fyp7ImA9WhRbF0w.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493</id><updated>2012-02-08T17:28:11.067+01:00</updated><category term="webservice" /><category term="portlet" /><category term="flXHR" /><category term="MDA" /><category term="jquery" /><category term="SAP" /><category term="Struts2" /><category term="BAPI" /><category term="WTP" /><category term="websphere" /><category term="Spring Velocity" /><category term="Acceleo" /><category term="Sharepoint" /><category term="junit" /><category term="jetspeed" /><category term="iBATIS" /><category term="Flex" /><category term="UML" /><category term="eclipse" /><category term="Spring" /><category term="axis2" /><title>Portlets iBatis Spring Struts2 jQuery Eclipse</title><subtitle type="html">Blog about J2EE architecture - Ease of development and productivity with eclipse.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://s2o-bcn.blogspot.com/" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PortletsIbatisSpringStruts2JqueryEclipse" /><feedburner:info uri="portletsibatisspringstruts2jqueryeclipse" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUMFRH4zfCp7ImA9Wx9SGEg.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-5659923988011906361</id><published>2010-12-07T08:05:00.001+01:00</published><updated>2010-12-09T01:10:15.084+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-09T01:10:15.084+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><title>Flex: Chimp security solution (use it without metadata on source code!!!)</title><content type="html">&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px;"&gt;"&lt;a href="http://code.google.com/p/flexible-chimp/"&gt;Chimp&lt;/a&gt; is permission based filtering component for Adobe Flex and AIR. Applications implement Chimp by adding metadata within the Flex UIComponents. Based on the metadata it will remove components completely, enable/disable, and update visibility."&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;In this post I will show you an extension for the Chimp component that will provide a transparent implementation of the security for the developers. With this extension the permissions metadata&amp;nbsp;is no longer needed to be in the source code. The permissions will be loaded dynamically at runtime.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
First of all, let me give you a short view of the architecture we are using in our applications:&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;-&amp;nbsp;the main application navigation is made in a&amp;nbsp;&lt;a href="http://flexlib.googlecode.com/svn/trunk/docs/flexlib/containers/SuperTabNavigator.html"&gt;superTabNaviagtion&lt;/a&gt;:&amp;nbsp;every conversartion (screen) is loaded in a separate tab.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/__fiXBErlKIU/TPztP9Haa6I/AAAAAAAAABg/X-gvVxi1Bio/s1600/loadTab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="52" src="http://3.bp.blogspot.com/__fiXBErlKIU/TPztP9Haa6I/AAAAAAAAABg/X-gvVxi1Bio/s400/loadTab.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This is done by the core of the architecture (our framework), every developer's team only have to take care of their conversations (screens), that will be loaded by the framework in a client workbench.&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;What I will do is, before every new screen (new tab) is loaded, I will call a service that will give the&amp;nbsp;permissions (permitted actions) for that screen and then I will set those permissions to the Chimp component.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__fiXBErlKIU/TPzuKeKPrPI/AAAAAAAAABk/QkgKjqe5hbI/s1600/loadedTab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="130" src="http://2.bp.blogspot.com/__fiXBErlKIU/TPzuKeKPrPI/AAAAAAAAABk/QkgKjqe5hbI/s400/loadedTab.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;Of course, I will need a separate application to carry on those permissions actions of our components (that&amp;nbsp;otherwise must to be&amp;nbsp;written in the source code of the application as metadata), and this application will be managed by an&amp;nbsp;administrator.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;Finally, the only thing needed for working correctly is that every button or component to be securiced must have an unique id in the whole application. This could be done easily with&amp;nbsp;naming conventions.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The next code is added to&amp;nbsp;Chimp.as:&lt;/div&gt;&lt;pre class="brush:as3"&gt;/**
* Load chimp before the UIComponents are added with permission strings
*/
public static function load(permissions:ArrayCollection, metadataPermissions:Boolean=true):void {
  if(permissions != null) {
    _permissions = permissions;
    _permissions.addEventListener(CollectionEvent.COLLECTION_CHANGE, updateDisplay);
  } else {
    permissions = new ArrayCollection();
  }
  _metadataPermissions= metadataPermissions;

  //add chmip system add handler  
  FlexGlobals.topLevelApplication.addEventListener(Event.ADDED_TO_STAGE, processComponenet, true);
}

/**
 * @author s2o
 * 
 * &lt;screen id="testId"&gt;
 *  &lt;metadata name="Protected"&gt;
   &lt;arg key="permissions" value="admin"&gt;
  &lt;arg key="notInPermissionAction" value="removeFromLayout"&gt;
  &lt;arg key="componentId" value="adminButton"&gt;
 &lt;/arg&gt;&lt;/arg&gt;&lt;/arg&gt;&lt;/metadata&gt;
 * &lt;/screen&gt;
 * @param screenActions
 * 
 */
public static function addScreenPermissionActions( screenActions:XML ):void{
 var screenId:String = screenActions.@id;
 
 for each (var metadata:XML in screenActions.descendants("metadata")) {
  // the ChimpConstants.ACTION_REMOVE_CHILD is not considered
  var chimpAction:ChimpAction = getAction(metadata);
  chimpAction.parentId = screenId;
  ChimpActionCache.instance.addDelayLoadAction(chimpAction);
 }   
}

/**
 * @author s2o
 * 
 * Removes permission from cache    
 * @param screenId
 * 
 */
public static function removeScreenPermissionActions(screenId:String):void {
  ChimpActionCache.instance.freeCachedActionById(screenId);
}

//process ui object
private static function process(obj:Object):void {
 if(obj is UIComponent) {           
  if (_metadataPermissions) {
   processMetadataPermissions(obj);      
  } else {
   processDelayPermissions(obj);
  }
 }
}


/**
 * @author s2o
 *  
 * @param obj
 * 
 */
private static function processDelayPermissions(obj:Object):void {  
 var comp:UIComponent = obj as UIComponent;      
 for each(var delayedChimpAction:ChimpAction in ChimpActionCache.instance.getDelayLoadActionById(comp.id)) {
  delayedChimpAction.comp = comp;
  doAction(delayedChimpAction);
  // for updates display on changes to the roles
  ChimpActionCache.instance.addAction(delayedChimpAction);                                                       
 }   
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-5659923988011906361?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gFLBp-hM205c_Ig-NhkuVcjAj9Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gFLBp-hM205c_Ig-NhkuVcjAj9Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gFLBp-hM205c_Ig-NhkuVcjAj9Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gFLBp-hM205c_Ig-NhkuVcjAj9Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/YLnjbr-yq8E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/5659923988011906361/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/12/flex-chimp-is-permission-based.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/5659923988011906361?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/5659923988011906361?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/YLnjbr-yq8E/flex-chimp-is-permission-based.html" title="Flex: Chimp security solution (use it without metadata on source code!!!)" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/__fiXBErlKIU/TPztP9Haa6I/AAAAAAAAABg/X-gvVxi1Bio/s72-c/loadTab.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/12/flex-chimp-is-permission-based.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMDQ3w_cSp7ImA9Wx5XFEo.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-5059339139991662040</id><published>2010-09-02T12:26:00.000+02:00</published><updated>2010-09-14T15:54:32.249+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-14T15:54:32.249+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML" /><category scheme="http://www.blogger.com/atom/ns#" term="Acceleo" /><category scheme="http://www.blogger.com/atom/ns#" term="MDA" /><title>AndroMDA vs Acceleo (MDA)</title><content type="html">&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Objective&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The aim of this paper is a brief introduction to MDA technology and a summary / comparison to the approachments to MDA of AndroMDA and Acceleo, intending to be a practical and understandable  summary&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Model-driven architecture&amp;nbsp;(MDA) is a&amp;nbsp;software design&amp;nbsp;approach for the development of&amp;nbsp;software systems. It provides a set of guidelines for the structuring of specifications, which are expressed as models. It was launched by the&amp;nbsp;Object Management Group&amp;nbsp;(OMG) in 2001&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The Model-Driven Architecture approach defines system functionality using a&amp;nbsp;platform-independent model&amp;nbsp;(PIM) using an appropriate&amp;nbsp;domain-specific language&amp;nbsp;(DSL).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;One of the main aims of the MDA is to separate design from architecture. As the concepts and technologies used to realize designs and the concepts and technologies used to realize architectures have changed at their own pace, decoupling them allows system developers to choose from the best and most fitting in both domains. The design addresses the functional (use case) requirements while architecture provides the infrastructure through which non-functional requirements like scalability, reliability and performance are realized. MDA envisages that the platform independent model (PIM), which represents a conceptual design realizing the functional requirements, will survive changes in realization technologies and&amp;nbsp;software architectures.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;To sum up:&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style="text-align: justify;"&gt;Models are produced at business level, and translated into code using code generation tools&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The skill to move from model to implementation reduces most of the coding efforts&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;By having the models in the first iteration of software construction, allows the possibility of obtaining an executable prototype system in early stages of project life cycle&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The transformation's rules for going from model to code are common to all similar projects, therefore the same rules apply to any project developing software allows a consistent software related to its quality and use of standards&lt;/li&gt;
&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;b&gt;Pros of MDA:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style="text-align: justify;"&gt;Focus on the business&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Updated documentation. The process is, first change the model and then, regenerate the code.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Less application errors: “The best way to avoid dangerous coding errors is to code less”&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Portability of the technology: If there's a new technology, by updating the PSM we can generate the code in the new technology&lt;/li&gt;
&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;b&gt;Cons of MDA:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style="text-align: justify;"&gt;If we don't have code generated by the MDA, we can't apply MDA.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The creation of components for the code automation is very complex&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Refactoring. A change in the model involves a change in the code, therefor the sincronization between the new code generted and the original code implemented  by the developer is always a delicate step (despite having tools that facilitate this task, this step is always delicate).&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;ANDROMDA&lt;/b&gt;&lt;/span&gt;:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Web: &lt;a href="http://www.andromda.org/index.php"&gt;http://www.andromda.org/index.php&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Creator: Matthias Bohlen&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Current state of the project:&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style="text-align: justify;"&gt;AndroMDA 3.3 (&amp;nbsp;2009-04-02) is the latest stable release (only supports UML 1.x)&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;AndroMDA 3.4 -snapshot (2010-02-14) supports UML 2.x: all the modern versions of uml tools use UML 2.x&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;AndroMDA 4: is on hold&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;AndroMDA-eclipse plugin: seems to be hold, version 1.0-M3 since 2006&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;i&gt;Features&lt;/i&gt;&lt;/b&gt;:&lt;/div&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li style="text-align: justify;"&gt;Open source framework that receives as an input a UML model that combined with suitable cartridges AndroMDA (model for technology mapping. NET, J2EE …), generates the source.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;AndroMDA cartridges are developed in velocty  template (http://velocity.apache.org/).&amp;nbsp;AndroMDA comes with a series of cartridges for the comprehensive code generation: BPM4Struts, jBPM, JSF, EJB, EJB3, Hibernate, Java, Meta, Spring, WebService and Xmlschema&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The sincronice of the model and the code generated by AndroMDA is done by taking into account that the code generated by AndroMDA consists of final classes that can't be modified by developers and abstract classes / interfaces, on which the developer implements the logic of&amp;nbsp;business.That is the strategy for code generation is the direct heritange and delegation, therefore we depend on the final language and on the language structures to be able to generate final code, complex or not.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;AndroMDA is integrated with maven, but not with eclipse.&amp;nbsp;Therefore, the management of new projects and code's generation will be done through the command line or ant task.&amp;nbsp;For implementing a project with AndroMDA, we'll subdivid into: a MDA project (where AndroMDA generates code from the model) and a&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Development Project (where development and testing take place).&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;i&gt;Community support&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;:&amp;nbsp;AndroMDA has maybe, one of biggest community of a MDA framework&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;ACCELEO&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Web: &lt;a href="http://www.eclipse.org/acceleo/"&gt;http://www.eclipse.org/acceleo/&lt;/a&gt; (for version 2 &lt;a href="http://www.acceleo.org/"&gt;http://www.acceleo.org&lt;/a&gt;)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Creator: Obeo&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Current state of the project:&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style="text-align: justify;"&gt;Acceleo 3.0.0 (&amp;nbsp;2010-06-23) is the latest stable release integrated into the eclipse release (part of the Eclipse Modeling project &lt;a href="http://www.eclipse.org/home/categories/index.php?category=modeling"&gt;http://www.eclipse.org/home/categories/index.php?category=modeling&lt;/a&gt;) . Not compatible with 2.x&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Acceleo 2.7.0 (&amp;nbsp;02/04/2010). Compatible with the last release of eclipse but not integrated into.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;i&gt;Features&lt;/i&gt;&lt;/b&gt; (Acceleo 3):&lt;/div&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li style="text-align: justify;"&gt;Acceleo is an implementation of the Object Management Group (OMG) MOF Model to Text Language (MTL) standard. This component is an entirely new development of the OMG MOF Model to Text (Mof2Text) http://www.omg.org/spec/MOFM2T/1.0/ language. The implementation will be compliant&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The development of the code generation's modules is done by acceleo type projects in eclipse.There are currently very basic examples of code generation for Python and Java.&amp;nbsp;In version 2 we can find more complex modules of generation.&amp;nbsp;Acceleo focuses on supporting the creation of code generation, so it is really easy to create new modules: preview of the final result of the generation, debug, launch generation integrated in eclipse.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;The sincronization between the model and the code generated by Acceleo is done through special  tag's (in the code generation templates) that shows the developer where to enter the specific new code.&amp;nbsp;This makes that the final code generated by Acceleo can be very complex.. It could happened as well that a non-skillfull  (clueless) developer removes special tags and then, the new code generated by Acceleo will not repect the code created by the developer.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Code generation from a model and code generation module is done through an integrated implementation task in eclipse.&amp;nbsp;And configured through a wizard of the eclipse. The implementation of an Acceleo project would be the usual with eclipse, because the generated code is integrated into the development of the developer.&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;i&gt;Community support&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;: it's not as big as AndroMDA's community, but I have to say that was  great to make a question in its forum and have a quick reponse&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;h2 style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; font-weight: normal; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;"&gt;&lt;span class="mw-headline" id="References"&gt; &lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;
&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; widows: 2;"&gt;&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;That's all folks!&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; widows: 2;"&gt;&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;Please if you see any incoherent, feel free to make corrections / suggestions.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: arial, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;div style="font-style: normal; font-weight: normal; line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: sans-serif;"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="font-size: x-small;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;a href="http://en.wikipedia.org/"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;http://en.wikipedia.org/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;a href="http://www.eclipse.org/acceleo/"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;http://www.eclipse.org/acceleo/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;a href="http://www.acceleo.org/"&gt;http://www.acceleo.org&lt;/a&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt; – forums&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;a href="http://www.andromda.org/index.php"&gt;http://www.andromda.org/index.php&lt;/a&gt; - forums&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-style: normal; font-weight: normal; line-height: 0.5cm; margin-bottom: 0cm; orphans: 2; widows: 2;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-5059339139991662040?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2GVN_TTfAp__BQtRSC_0QB8qDrs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2GVN_TTfAp__BQtRSC_0QB8qDrs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2GVN_TTfAp__BQtRSC_0QB8qDrs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2GVN_TTfAp__BQtRSC_0QB8qDrs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/TthP74avtuM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/5059339139991662040/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/09/andromda-vs-acceleo-mda.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/5059339139991662040?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/5059339139991662040?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/TthP74avtuM/andromda-vs-acceleo-mda.html" title="AndroMDA vs Acceleo (MDA)" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/09/andromda-vs-acceleo-mda.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUASHszeSp7ImA9WxFSF0g.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-1318005269467007714</id><published>2010-04-08T10:38:00.000+02:00</published><updated>2010-04-20T09:57:29.581+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-20T09:57:29.581+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Spring Velocity" /><title>email: spring + velocity</title><content type="html">One of the best ways to send e-mails is with spring and velocity template. With this technique sending an e-mail is as easy as make a jsp. &lt;br /&gt;
&lt;br /&gt;
In this sample I'm integrating the spring &amp; velocity with struts2 and portlets, but could be extrapolated to any other environment.&lt;br /&gt;
&lt;br /&gt;
The recipe consists of:&lt;br /&gt;
- applicationContextBeans.xml -&gt; the sprig config file (the glue)&lt;br /&gt;
- registrarse.vm -&gt; a velocity template of our e-mail&lt;br /&gt;
- EmailService.java &amp; EmailServiceImpl.java -&gt; the classes to apply the data to the template and send the e-mail. These classes will be the same for all the e-mails, so could be in a separate jar.&lt;br /&gt;
- RegistrarseAction.java -&gt; the struts2 action&lt;br /&gt;
&lt;br /&gt;
-applicationContextBeans.xml:&lt;br /&gt;
&lt;pre class="brush: xml"&gt;&amp;lt;bean id=&amp;quot;emaiInformacionlService&amp;quot; class=&amp;quot;es.project.miGestion.administracionDatos.service.EmailServiceImpl&amp;quot; scope=&amp;quot;prototype&amp;quot;&amp;gt;
        &amp;lt;property name=&amp;quot;velocityEngine&amp;quot; ref=&amp;quot;velocityEngine&amp;quot;&amp;gt;&amp;lt;/property&amp;gt;
        &amp;lt;property name=&amp;quot;velocityTpl&amp;quot; value=&amp;quot;es/project/velocity/solicitudInformacion.vm&amp;quot;&amp;gt;&amp;lt;/property&amp;gt;
            &amp;lt;property name=&amp;quot;inlineFiles&amp;quot;&amp;gt;   
         &amp;lt;map&amp;gt;              
             &amp;lt;entry&amp;gt;  
                 &amp;lt;key&amp;gt;  
                     &amp;lt;value&amp;gt;id001&amp;lt;/value&amp;gt;  
                 &amp;lt;/key&amp;gt;  
                 &amp;lt;value&amp;gt;classpath:es/project/velocity/logoproject.png&amp;lt;/value&amp;gt;  
             &amp;lt;/entry&amp;gt;  
         &amp;lt;/map&amp;gt;  
       &amp;lt;/property&amp;gt;  
    &amp;lt;/bean&amp;gt;
    &amp;lt;bean id=&amp;quot;emailRegistrarseService&amp;quot; class=&amp;quot;es.project.miGestion.administracionDatos.service.EmailServiceImpl&amp;quot; scope=&amp;quot;prototype&amp;quot;&amp;gt;
        &amp;lt;property name=&amp;quot;velocityEngine&amp;quot; ref=&amp;quot;velocityEngine&amp;quot;&amp;gt;&amp;lt;/property&amp;gt;
        &amp;lt;property name=&amp;quot;velocityTpl&amp;quot; value=&amp;quot;es/project/velocity/registrarse.vm&amp;quot;&amp;gt;&amp;lt;/property&amp;gt;
        &amp;lt;property name=&amp;quot;inlineFiles&amp;quot;&amp;gt;   
         &amp;lt;map&amp;gt;              
             &amp;lt;entry&amp;gt;  
                 &amp;lt;key&amp;gt;  
                     &amp;lt;value&amp;gt;id001&amp;lt;/value&amp;gt;  
                 &amp;lt;/key&amp;gt;  
                 &amp;lt;value&amp;gt;classpath:es/project/velocity/logoproject.png&amp;lt;/value&amp;gt;  
             &amp;lt;/entry&amp;gt;  
         &amp;lt;/map&amp;gt;  
       &amp;lt;/property&amp;gt;  
    &amp;lt;/bean&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
- registrarse.vm:&lt;br /&gt;
&lt;pre class="brush: xml"&gt;&amp;lt;div id=&amp;quot;logo&amp;quot;&amp;gt;
        &amp;lt;p align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;cid:id001&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div id=&amp;quot;header&amp;quot;&amp;gt;
        &amp;lt;font size=&amp;quot;2&amp;quot; style=&amp;quot;font-family: Arial; color: rgb(51, 90, 143);&amp;quot;&amp;gt;
            A la Atenci&amp;amp;oacute;n del Servicio de Atenci&amp;amp;oacute;n Telef&amp;amp;oacute;nica
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            Cliente registrado en el formulario de la web. 
            #set ($bar = &amp;quot;cliente&amp;quot;)
            #if (${cliente} == $bar)
                Ya es cliente de  project y desea que un comercial se encarge de darle de alta en la Web de  project:
            #else
                No es cliente de  project y desea que un comercial se encarge de darle de alta en la Web de  project:
            #end
        &amp;lt;/font&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;br&amp;gt;
    &amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;
        &amp;lt;font size=&amp;quot;2&amp;quot; style=&amp;quot;font-family: Arial; color: rgb(51, 90, 143);&amp;quot;&amp;gt;
            &amp;lt;table class=&amp;quot;width100&amp;quot; border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&amp;gt;    
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; width=&amp;quot;110&amp;quot;&amp;gt;Nombre&amp;lt;/td&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${nombre} ${apellidos}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;DNI&amp;lt;/td&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${dni}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;Direcci&amp;amp;oacute;n:&amp;lt;/td&amp;gt;                
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${direccion},${cp} ${poblacion} - ${pais}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;Telefono:&amp;lt;/td&amp;gt;                
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${telefono}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;Movil:&amp;lt;/td&amp;gt;                
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${movil}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;        
                &amp;lt;tr&amp;gt;
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;Email:&amp;lt;/td&amp;gt;                
                    &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${mail}&amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;    
                #if (${cliente} == $bar)        
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;N&amp;amp;uacute;mero cuenta:&amp;lt;/td&amp;gt;                
                        &amp;lt;td style=&amp;quot;font-size: 9pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot; &amp;gt;${numeroCuenta}&amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;    
                #end
            &amp;lt;/table&amp;gt;
        &amp;lt;/font&amp;gt;        
    &amp;lt;/div&amp;gt;
    &amp;lt;br&amp;gt;
    &amp;lt;hr size=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;
    &amp;lt;span style=&amp;quot;font-size: 7.5pt; font-family: Arial; color: rgb(51, 90, 143);&amp;quot;&amp;gt;
        .....
    &amp;lt;/span&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
- EmailServiceImpl.java &lt;br /&gt;
&lt;pre class="brush: java"&gt;...
    private VelocityEngine velocityEngine;    
    private JavaMailSender javaMailSender;
    private String velocityTpl;
    
    private Map&amp;lt;String,Resource&amp;gt; inlineFiles;
    
    /**
     * Creaci&amp;#65533;n y env&amp;#65533;o de e-mail.
     * @param from E-mail de origen
     * @param recipients E-mails de destino
     * @param subject Asunto del e-mail
     * @param params Par&amp;#65533;metros para la generaci&amp;#65533;n del cuerpo del e-mail
     */
    public void sendEmail(String from, String[] recipients, String subject, Map&amp;lt;String,Object&amp;gt; params) {
        log.debug(&amp;quot;sendEmail inicio&amp;quot;);
        
        final String f = from;        
        final String s = subject;
        final Map&amp;lt;String,Object&amp;gt; p = params;
        
        for(final String to : recipients){
            MimeMessagePreparator preparator = new MimeMessagePreparator(){
                public void prepare(MimeMessage mimeMessage) throws Exception{
                    MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true);
                    helper.setFrom(f);
                    helper.setTo(to);
                    helper.setSubject(MimeUtility.encodeText(s, &amp;quot;iso-8859-1&amp;quot;, &amp;quot;B&amp;quot;));                        
                    Map&amp;lt;String,Object&amp;gt; model = p;
                    String text = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,velocityTpl,model);
                    helper.setText(text, true);
                    
                    // a&amp;#241;adiendo los ficheros &amp;quot;en l&amp;#237;nea&amp;quot;
                    if (getInlineFiles() != null) {
                        for (String key :getInlineFiles().keySet()) {
                            Resource value = getInlineFiles().get(key);
                            helper.addInline(key, value);
                            if (log.isDebugEnabled()) {
                                log.debug(&amp;quot;File '&amp;quot; + value + &amp;quot;' added.&amp;quot;);
                            }
                        }
                    }
                }
            };
            javaMailSender.send(preparator);
        }
        
        log.debug(&amp;quot;sendEmail fin&amp;quot;);
    }
    
    /**
     * Create and setup the mail sender component
     *  @param mailTO

     */
    public void initializeJavaMailSender(MailTO mailTO){        
        log.debug(&amp;quot;initializeJavaMailSender inicio&amp;quot;);
        
        //Create and setup the mail sender component
        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
        mailSender.setHost(mailTO.getHostMail());
        mailSender.setPort(Integer.valueOf(mailTO.getPort()));    
        mailSender.setUsername(mailTO.getUsername());    
        mailSender.setPassword(mailTO.getPassword());
        
        //We need this setting for force Javamail to pass the login
        boolean mailSmtpAuth = mailTO.getMailSmtpAuth().equals(&amp;quot;true&amp;quot;);
        boolean starttls = mailTO.getStarttls().equals(&amp;quot;true&amp;quot;);
        
        Properties props = new Properties();
        if(mailSmtpAuth){
            log.debug(&amp;quot;mailSmtpAuth true:&amp;quot;+mailTO.getMailSmtpAuth());
            props.setProperty(&amp;quot;mail.smtp.auth&amp;quot;, mailTO.getMailSmtpAuth());
        }
        if(starttls){
            log.debug(&amp;quot;starttls true:&amp;quot; + mailTO.getStarttls());
            props.setProperty(&amp;quot;mail.smtp.starttls.enable&amp;quot;, mailTO.getStarttls());
        }
        mailSender.setJavaMailProperties(props);
        
        javaMailSender = mailSender;            
        
        log.debug(&amp;quot;initializeJavaMailSender fin&amp;quot;);
    }
...
&lt;/pre&gt;&lt;br /&gt;
- RegistrarseAction.java&lt;br /&gt;
&lt;pre class="brush: java"&gt;// Enviar los datos por mail
        emailRegistrarseService.initializeJavaMailSender(mailTO);
        
        String[] recipients = mailTO.getToMail().split(&amp;quot;;&amp;quot;);
        String[] emailUsuario = mail.split(&amp;quot;;&amp;quot;);

        Map&amp;lt;String, Object&amp;gt; params = new HashMap&amp;lt;String, Object&amp;gt;();
        params.put(&amp;quot;cliente&amp;quot;, cliente);
        params.put(&amp;quot;nombre&amp;quot;, nombre);
        params.put(&amp;quot;apellidos&amp;quot;, apellidos);
        params.put(&amp;quot;dni&amp;quot;, dni);
        params.put(&amp;quot;direccion&amp;quot;, direccion);
        params.put(&amp;quot;poblacion&amp;quot;, poblacion);
        params.put(&amp;quot;mail&amp;quot;, mail);
        params.put(&amp;quot;telefono&amp;quot;, telefono);
        params.put(&amp;quot;pais&amp;quot;, pais);
        params.put(&amp;quot;cp&amp;quot;, cp);
        params.put(&amp;quot;movil&amp;quot;, movil);
        params.put(&amp;quot;numeroCuenta&amp;quot;, numeroCuenta);

        emailRegistrarseService.sendEmail(mail, recipients, 
                mailTO.getSubject(), params);
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-1318005269467007714?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/a6DHRTVMFngXJUNRYy9dtxO78t8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/a6DHRTVMFngXJUNRYy9dtxO78t8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/a6DHRTVMFngXJUNRYy9dtxO78t8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/a6DHRTVMFngXJUNRYy9dtxO78t8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/NOWvNyxfBpo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/1318005269467007714/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/04/email-spring-velocity.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/1318005269467007714?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/1318005269467007714?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/NOWvNyxfBpo/email-spring-velocity.html" title="email: spring + velocity" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/04/email-spring-velocity.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkANQHcycCp7ImA9WxBbGU8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-7943787783233462354</id><published>2010-03-15T11:25:00.000+01:00</published><updated>2010-03-18T14:59:51.998+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-18T14:59:51.998+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="Struts2" /><category scheme="http://www.blogger.com/atom/ns#" term="portlet" /><title>Integrate struts2-jquery and portlets</title><content type="html">In this &lt;a href="http://code.google.com/p/struts2-jquery/wiki/FAQ"&gt;FAQ&lt;/a&gt; we can see how to install the struts2-jquery plugin, but we have to make some little changes  if we are developing porlets:&lt;br /&gt;
&lt;br /&gt;
1.Add the next servlet-mapping to the web.xml file:&lt;br /&gt;
&lt;pre class="brush: xml"&gt;&amp;lt;servlet&amp;gt;
        &amp;lt;servlet-name&amp;gt;struts2servlet&amp;lt;/servlet-name&amp;gt;
        &amp;lt;servlet-class&amp;gt;org.apache.struts2.dispatcher.ng.servlet.StrutsServlet&amp;lt;/servlet-class&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
        &amp;lt;servlet-name&amp;gt;struts2servlet&amp;lt;/servlet-name&amp;gt;
        &amp;lt;url-pattern&amp;gt;*.action&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt; 
&amp;lt;servlet&amp;gt;
        &amp;lt;servlet-name&amp;gt;struts2Resources&amp;lt;/servlet-name&amp;gt;
        &amp;lt;servlet-class&amp;gt;org.apache.struts2.dispatcher.ng.servlet.StrutsServlet&amp;lt;/servlet-class&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
        &amp;lt;servlet-name&amp;gt;struts2Resources&amp;lt;/servlet-name&amp;gt;
        &amp;lt;url-pattern&amp;gt;/struts/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt; 
&lt;/pre&gt;&lt;br /&gt;
This could be done by a filter-mapping too, but with filter-mapping we can have some problems in a Websphere server.&lt;br /&gt;
&lt;br /&gt;
2.Define some pakage in the struts2 config to manage the ajax request&lt;br /&gt;
&lt;pre class="brush: xml"  style="overflow: auto;"&gt;&amp;lt;package name=&amp;quot;ajax&amp;quot; extends=&amp;quot;json-default&amp;quot; namespace=&amp;quot;/ajax&amp;quot;&amp;gt;
...
&amp;lt;/package&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
3.To make a valid ajax request from the portlet, all the request must be as the next examples:&lt;br /&gt;
&lt;pre class="brush: xml" style="overflow: auto;"&gt;&amp;lt;form id=&amp;quot;compraVentaForm&amp;quot; action='&amp;lt;s:url value=&amp;quot;/ajax/compraVentaSave.action&amp;quot;/&amp;gt;'  method=&amp;quot;post&amp;quot;&amp;gt;
...
&amp;lt;/form&amp;gt;
&amp;lt;s:url id=&amp;quot;ordenesActivasResultado&amp;quot; value=&amp;quot;/ajax/ordenesActivas.action&amp;quot;/&amp;gt;
&amp;lt;sj:div href=&amp;quot;%{ordenesActivasResultado}&amp;quot; indicator=&amp;quot;indicator&amp;quot; onCompleteTopics=&amp;quot;completeDiv&amp;quot; reloadTopics=&amp;quot;reloadDiv&amp;quot;&amp;gt;
 &amp;lt;img id=&amp;quot;loading&amp;quot; src=&amp;quot;&amp;lt;s:url value='/img/ajax-loader.gif'/&amp;gt;&amp;quot; alt=&amp;quot;Loading...&amp;quot;/&amp;gt;
&amp;lt;/sj:div&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-7943787783233462354?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0ARXugKne_Y2ftQBBaWbPi5jMtU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0ARXugKne_Y2ftQBBaWbPi5jMtU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0ARXugKne_Y2ftQBBaWbPi5jMtU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0ARXugKne_Y2ftQBBaWbPi5jMtU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/jTYQ5JstLgU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/7943787783233462354/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/03/integrate-struts2-jquery-and-portlets.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/7943787783233462354?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/7943787783233462354?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/jTYQ5JstLgU/integrate-struts2-jquery-and-portlets.html" title="Integrate struts2-jquery and portlets" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/03/integrate-struts2-jquery-and-portlets.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YAQHszfyp7ImA9WxBbGU8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-8115271288223854611</id><published>2010-02-27T23:04:00.000+01:00</published><updated>2010-03-18T15:05:41.587+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-18T15:05:41.587+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SAP" /><category scheme="http://www.blogger.com/atom/ns#" term="BAPI" /><title>SAP Java Connector (SAP JCo) : sample</title><content type="html">Here's a sample code to get the currency list of the BAPI ZBAPI_GET_CURRENCY_LIST:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java;"&gt;ArrayList desMoneda = new ArrayList();
ArrayList ideMoneda = new ArrayList();

//Creamos la función de la BAPI
com.sap.mw.jco.JCO.Function funcionDivisas = repository.getFunctionTemplate("ZBAPI_GET_CURRENCY_LIST").getFunction();

//Declaramos los parámetros que se le enviarán a la BAPI
com.sap.mw.jco.JCO.ParameterList listParams = funcionDivisas.getImportParameterList();      
listParams.setValue("ES","LANGU");

//Ejecutamos la BAPI
connection.execute(funcionDivisas);

//Recuperamos la tabla de SAP
Table tablaDivisas = funcionDivisas.getTableParameterList().getTable("CURRENCYLIST");
desMoneda.add(Text.getText("language.messages", "ActividadRegistro.comboDivisa", oLocale));
ideMoneda.add("");

//Recorremos la tabla de divisas y seteamos los arrays del formulario
for (int i = 0; i &lt; tablaDivisas.getNumRows(); i++){
 ideMoneda.add(tablaDivisas.getValue("WAERS"));
 desMoneda.add(tablaDivisas.getValue("LTEXT"));  
 tablaDivisas.nextRow();
}
&lt;/pre&gt;
And here's the connectSap() and  disconnectSap() functions:

&lt;pre class="brush: java;"&gt;/** Conexion */
protected JCO.Client connection;   // Connection con SAP
/** Repositorio */
protected IRepository repository;   // Repostorio de funciones SAP

/**
 * Iniciamos la conexion y el repositorio con el SAP
 *
 */
public void connectSap(String client, String user, String pass, String lang, String host, String nSystem, String name) {
 try {
  /** Creamos la conexion con el SAP   */  
  connection = JCO.createClient(client, user, pass, lang, host, nSystem);
  connection.connect();

  /** Creamos el repositorio con el SAP   */
  repository = new JCO.Repository(name, connection);
 } catch(Exception e) {
  log.error("Error -&gt; connectSAP: " + e.getMessage(),e); 
 }
}

public void disconnectSap() {
 if(connection != null) {
  try {
   connection.disconnect();
  }catch(Exception e) {
  log.error("Error -&gt; disconnectSap: " + e.getMessage(),e);
  }
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-8115271288223854611?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BCsVZ-PhF-s3T7_nDySgZv_shb8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCsVZ-PhF-s3T7_nDySgZv_shb8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BCsVZ-PhF-s3T7_nDySgZv_shb8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCsVZ-PhF-s3T7_nDySgZv_shb8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/oQHUEcaWriQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/8115271288223854611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/02/sap-java-connector-sap-jco-sample.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/8115271288223854611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/8115271288223854611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/oQHUEcaWriQ/sap-java-connector-sap-jco-sample.html" title="SAP Java Connector (SAP JCo) : sample" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/02/sap-java-connector-sap-jco-sample.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcGRHk8cSp7ImA9WxBaEE8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-7060101781852305339</id><published>2010-01-18T19:17:00.000+01:00</published><updated>2010-03-19T20:47:05.779+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-19T20:47:05.779+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="axis2" /><category scheme="http://www.blogger.com/atom/ns#" term="webservice" /><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint" /><title>WebService client: automate the generation of all java classes</title><content type="html">The problem: &lt;br /&gt;
Sometimes when we have to make a webservice client, we have the wsdl definition file and we have to choose some tecnique to generate the java client classes. But after all the code generated automatically by the framework we have an xmlStream to treat with... So finally, we have to implement the model classes of the part of the xml that we're interested in.&lt;br /&gt;
&lt;br /&gt;
To automate this final step we can generate the java classes to unmarshall the xml into java classes that matches data.&lt;br /&gt;
&lt;br /&gt;
In my last project I had the requirement to do this with axis (&lt;a href="http://ws.apache.org/axis2/"&gt;Axis2&lt;/a&gt;) and xmlbeans (&lt;a href="http://xmlbeans.apache.org/"&gt;XMLBeans&lt;/a&gt;). The webService was a Sharepoint service: lists.asmx. &lt;br /&gt;
&lt;br /&gt;
The solution: &lt;br /&gt;
Create an xml ant to transform the wsdl to java: wsdl2java-SharepointList.xml. And create another xml ant to transform the xml returned by the webService: buildSharepointListItems.xml&lt;br /&gt;
&lt;br /&gt;
1.-wsdl2java-SharepointList.xml:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;!DOCTYPE project&amp;gt;

&amp;lt;project name=&amp;quot;wsdl2java-WebXXXX_Service&amp;quot; default=&amp;quot;usage&amp;quot; basedir=&amp;quot;.&amp;quot;&amp;gt;

&amp;lt;property name=&amp;quot;project-name&amp;quot; value=&amp;quot;XXXX.ws.XXXXNet&amp;quot;/&amp;gt;
&amp;lt;property name=&amp;quot;definicionDelWebService&amp;quot; value=&amp;quot;input/webXXXX_Service.wsdl&amp;quot;/&amp;gt;
&amp;lt;property name=&amp;quot;packageDestino&amp;quot; value=&amp;quot;es.XXXX.ws.XXXXNet&amp;quot;/&amp;gt;
&amp;lt;property file=&amp;quot;build.properties&amp;quot;/&amp;gt;

&amp;lt;property name=&amp;quot;build&amp;quot; value=&amp;quot;build&amp;quot;/&amp;gt;
&amp;lt;property name=&amp;quot;src&amp;quot; value=&amp;quot;src&amp;quot;/&amp;gt;
&amp;lt;property name=&amp;quot;build.classes&amp;quot; value=&amp;quot;build/classes&amp;quot; /&amp;gt;

&amp;lt;path id=&amp;quot;axis.classpath&amp;quot;&amp;gt;
&amp;lt;pathelement location=&amp;quot;build/classes&amp;quot; /&amp;gt;
&amp;lt;fileset dir=&amp;quot;${axis.home}/lib&amp;quot;&amp;gt;
&amp;lt;include name=&amp;quot;**/*.jar&amp;quot; /&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;fileset dir=&amp;quot;${xmlBeans.home}/lib&amp;quot;&amp;gt;
&amp;lt;include name=&amp;quot;**/*.jar&amp;quot; /&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;pathelement location=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
&amp;lt;/path&amp;gt;

&amp;lt;path id=&amp;quot;axis_client.classpath&amp;quot;&amp;gt;
&amp;lt;pathelement location=&amp;quot;build/classes&amp;quot; /&amp;gt;
&amp;lt;fileset dir=&amp;quot;${axis.home}&amp;quot;&amp;gt;
&amp;lt;include name=&amp;quot;**/*.jar&amp;quot; /&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;fileset dir=&amp;quot;lib&amp;quot;&amp;gt;
&amp;lt;include name=&amp;quot;*.jar&amp;quot; /&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;pathelement location=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
&amp;lt;/path&amp;gt;

&amp;lt;target name=&amp;quot;usage&amp;quot; description=&amp;quot;Build file usage info (default task)&amp;quot;&amp;gt;
&amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;${project-name} &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;-------------------------------------------------------&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;Available Targets:&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; Cleaning up:&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;  clean             - Delete class files&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; WSDL:&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;  wsdl2java         - Generate source from WSDL&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; Compiling:&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;  compile           - Compiles the WSDL2Java source code&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot; jar final:&amp;quot; /&amp;gt;
&amp;lt;echo message=&amp;quot;  jar_wsdl          - Generate the jar from WSDL2Java source code&amp;quot; /&amp;gt;
&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;prepare&amp;quot; &amp;gt;
&amp;lt;mkdir dir=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;clean&amp;quot; &amp;gt;
&amp;lt;delete dir=&amp;quot;${build}&amp;quot; /&amp;gt;
&amp;lt;delete dir=&amp;quot;output&amp;quot; /&amp;gt;
&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;wsdl2java&amp;quot; depends=&amp;quot;clean,prepare&amp;quot;&amp;gt;
&amp;lt;java classname=&amp;quot;org.apache.axis2.wsdl.WSDL2Java&amp;quot; fork=&amp;quot;true&amp;quot;&amp;gt;
&amp;lt;classpath refid=&amp;quot;axis.classpath&amp;quot;/&amp;gt;          
&amp;lt;arg value=&amp;quot;-uri&amp;quot;/&amp;gt;
&amp;lt;arg file=&amp;quot;${definicionDelWebService}&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;-o&amp;quot;/&amp;gt;
&amp;lt;arg file=&amp;quot;output&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;-d&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;xmlbeans&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;-p&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;${packageDestino}&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;-s&amp;quot;/&amp;gt;
&amp;lt;arg value=&amp;quot;-u&amp;quot;/&amp;gt;
&amp;lt;/java&amp;gt;

&amp;lt;!-- Move the schema folder to classpath--&amp;gt;
&amp;lt;move todir=&amp;quot;${build.classes}&amp;quot;&amp;gt;
&amp;lt;fileset dir=&amp;quot;output/resources&amp;quot;&amp;gt;
&amp;lt;include name=&amp;quot;**/*schema*/**/*.class&amp;quot;/&amp;gt;
&amp;lt;include name=&amp;quot;**/*schema*/**/*.xsb&amp;quot;/&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;/move&amp;gt;

&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;compile&amp;quot;&amp;gt;
&amp;lt;echo message=&amp;quot;Compiling wsdl2 files&amp;quot;/&amp;gt;
&amp;lt;javac
       srcdir=&amp;quot;output&amp;quot;
       destdir=&amp;quot;${build.classes}&amp;quot;
       deprecation=&amp;quot;true&amp;quot;
      source=&amp;quot;1.5&amp;quot;
          target=&amp;quot;1.5&amp;quot;
    failonerror=&amp;quot;true&amp;quot; debug=&amp;quot;false&amp;quot;&amp;gt;
&amp;lt;classpath refid=&amp;quot;axis.classpath&amp;quot;/&amp;gt; 
&amp;lt;/javac&amp;gt;
&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;jar_wsdl&amp;quot; depends=&amp;quot;compile&amp;quot;&amp;gt;
&amp;lt;jar jarfile=&amp;quot;lib/${project-name}.jar&amp;quot; &amp;gt;
&amp;lt;fileset dir=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
&amp;lt;/jar&amp;gt;
&amp;lt;/target&amp;gt;

&amp;lt;target name=&amp;quot;all&amp;quot; depends=&amp;quot;wsdl2java,jar_wsdl&amp;quot;&amp;gt;
&amp;lt;echo message=&amp;quot;Generando el jar desde el wsdl&amp;quot;/&amp;gt;
&amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
2.-buildSharepointListItems.xml:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;!DOCTYPE project&amp;gt;

&amp;lt;project name=&amp;quot;buildSharepointListItems&amp;quot; default=&amp;quot;usage&amp;quot; basedir=&amp;quot;.&amp;quot;&amp;gt;

 &amp;lt;property name=&amp;quot;project-name&amp;quot; value=&amp;quot;torres.ws.shareponint.listItems&amp;quot;/&amp;gt;
 &amp;lt;property name=&amp;quot;xmlDeDatosInput&amp;quot; value=&amp;quot;input/listItemsRetorn.xml&amp;quot;/&amp;gt;
 &amp;lt;property name=&amp;quot;xmlDeDatos&amp;quot; value=&amp;quot;listItemsRetorn&amp;quot;/&amp;gt;
 &amp;lt;property file=&amp;quot;build.properties&amp;quot;/&amp;gt;

 &amp;lt;property name=&amp;quot;build&amp;quot; value=&amp;quot;build&amp;quot;/&amp;gt;
 &amp;lt;property name=&amp;quot;src&amp;quot; value=&amp;quot;src&amp;quot;/&amp;gt;
 &amp;lt;property name=&amp;quot;build.classes&amp;quot; value=&amp;quot;build/classes&amp;quot; /&amp;gt;

 &amp;lt;path id=&amp;quot;xmlBean.classpath&amp;quot;&amp;gt;
  &amp;lt;pathelement location=&amp;quot;build/classes&amp;quot; /&amp;gt;
  &amp;lt;fileset dir=&amp;quot;${xmlBeans.home}/lib&amp;quot;&amp;gt;
   &amp;lt;include name=&amp;quot;**/*.jar&amp;quot; /&amp;gt;
  &amp;lt;/fileset&amp;gt;
  &amp;lt;pathelement location=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
 &amp;lt;/path&amp;gt;

 &amp;lt;target name=&amp;quot;usage&amp;quot; description=&amp;quot;Build file usage info (default task)&amp;quot;&amp;gt;
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;${project-name} &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;-------------------------------------------------------&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;Available Targets:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; Cleaning up:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;  clean             - Delete class files&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; returned XML:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;  xml2xsd               - Generate xsd from xml&amp;quot; /&amp;gt;  
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; generate java binding:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;  xsd2java           - Generate java from xsd&amp;quot; /&amp;gt;  
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; Compiling:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;  compile           - Compiles the xsd2java source code&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; &amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot; jar final:&amp;quot; /&amp;gt;
  &amp;lt;echo message=&amp;quot;  exportJar               - Generate the from WSDL2Java source code&amp;quot; /&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;prepare&amp;quot; &amp;gt;
  &amp;lt;mkdir dir=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
  &amp;lt;mkdir dir=&amp;quot;output&amp;quot; /&amp;gt;
  &amp;lt;mkdir dir=&amp;quot;src&amp;quot; /&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;clean&amp;quot; &amp;gt;
  &amp;lt;delete dir=&amp;quot;${build}&amp;quot; /&amp;gt;
  &amp;lt;delete dir=&amp;quot;output&amp;quot; /&amp;gt;
  &amp;lt;delete dir=&amp;quot;src&amp;quot; /&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;xml2xsd&amp;quot; depends=&amp;quot;clean,prepare&amp;quot;&amp;gt;
  &amp;lt;java classname=&amp;quot;org.apache.xmlbeans.impl.inst2xsd.Inst2Xsd&amp;quot; fork=&amp;quot;true&amp;quot;&amp;gt;
   &amp;lt;classpath refid=&amp;quot;xmlBean.classpath&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-design&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;rd&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-outDir&amp;quot;/&amp;gt;
   &amp;lt;arg file=&amp;quot;src&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-outPrefix&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;${xmlDeDatos}&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;${xmlDeDatosInput}&amp;quot;/&amp;gt;
  &amp;lt;/java&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;xsd2java&amp;quot;&amp;gt;
  &amp;lt;java classname=&amp;quot;org.apache.xmlbeans.impl.tool.SchemaCompiler&amp;quot; fork=&amp;quot;true&amp;quot;&amp;gt;
   &amp;lt;classpath refid=&amp;quot;xmlBean.classpath&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-d&amp;quot;/&amp;gt;
   &amp;lt;arg file=&amp;quot;output&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-javasource&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;1.5&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;-srconly&amp;quot;/&amp;gt;
   &amp;lt;arg file=&amp;quot;src&amp;quot;/&amp;gt;
   &amp;lt;arg value=&amp;quot;input/${xmlDeDatos}.xsdconfig&amp;quot;/&amp;gt;
  &amp;lt;/java&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;compile&amp;quot; depends=&amp;quot;xsd2java&amp;quot;&amp;gt;
  &amp;lt;echo message=&amp;quot;Compiling files&amp;quot;/&amp;gt;
  &amp;lt;javac
       srcdir=&amp;quot;output&amp;quot;
       destdir=&amp;quot;${build.classes}&amp;quot;
       deprecation=&amp;quot;true&amp;quot;
      source=&amp;quot;1.5&amp;quot;
          target=&amp;quot;1.5&amp;quot;
    failonerror=&amp;quot;true&amp;quot; debug=&amp;quot;false&amp;quot;&amp;gt;
   &amp;lt;classpath refid=&amp;quot;xmlBean.classpath&amp;quot;/&amp;gt;
  &amp;lt;/javac&amp;gt;
   &amp;lt;!-- Move the schema folder to classpath--&amp;gt;
       &amp;lt;move todir=&amp;quot;${build.classes}&amp;quot;&amp;gt;
           &amp;lt;fileset dir=&amp;quot;output&amp;quot;&amp;gt;
               &amp;lt;include name=&amp;quot;**/*schema*/**/*.class&amp;quot;/&amp;gt;
               &amp;lt;include name=&amp;quot;**/*schema*/**/*.xsb&amp;quot;/&amp;gt;
           &amp;lt;/fileset&amp;gt;
       &amp;lt;/move&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;exportJar&amp;quot; depends=&amp;quot;compile&amp;quot;&amp;gt;
  &amp;lt;jar jarfile=&amp;quot;lib/${project-name}.jar&amp;quot; &amp;gt;
   &amp;lt;fileset dir=&amp;quot;${build.classes}&amp;quot; /&amp;gt;
  &amp;lt;/jar&amp;gt;
 &amp;lt;/target&amp;gt;

 &amp;lt;target name=&amp;quot;all&amp;quot; depends=&amp;quot;xml2xsd,exportJar&amp;quot;&amp;gt;
  &amp;lt;echo message=&amp;quot;Generando el jar desde el wsdl&amp;quot;/&amp;gt;
 &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
3. And finally, the java that call the sharepoint service:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: java;"&gt;HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername(username);
auth.setPassword(password);
auth.setDomain(domain);
auth.setHost(host);
auth.setRealm(realm);

// Ensure NTLM authentication used
List&lt;string&gt; authPrefs = new ArrayList&lt;string&gt;(1);
authPrefs.add(AuthPolicy.NTLM);
auth.setAuthSchemes(authPrefs);

// Get stub
ListsStub stub = new ListsStub(sharepoinService  + "_vti_bin/lists.asmx");

// Set authenticator
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth);
// Get request and execute

com.microsoft.schemas.sharepoint.soap.GetListItemsDocument getListItems112 =com.microsoft.schemas.sharepoint.soap.GetListItemsDocument.Factory.newInstance();
GetListItems listaInput = GetListItems.Factory.newInstance();
listaInput.setListName(laguajeList[0]);
getListItems112.setGetListItems(listaInput );

GetListItemsResponseDocument listaResultado = stub.getListItems(getListItems112);
GetListItemsResult result = listaResultado.getGetListItemsResponse().getGetListItemsResult();
String resultString = result.xmlText();
log.debug(resultString);

resultString = resultString.replaceFirst("http://schemas.microsoft.com/sharepoint/soap/", "http://XXXXX/sharepoint/listItems");      
ListitemsDocument root= ListitemsDocument.Factory.parse(resultString);
List&lt;row&gt; lista = root.getListitems().getData().getRowList();
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-7060101781852305339?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/we6MSvk1zKaE72XF8M3_pMNA5Y8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/we6MSvk1zKaE72XF8M3_pMNA5Y8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/we6MSvk1zKaE72XF8M3_pMNA5Y8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/we6MSvk1zKaE72XF8M3_pMNA5Y8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/ulk6EysJEg8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/7060101781852305339/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2010/02/automate-generation-of-all-java-classes.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/7060101781852305339?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/7060101781852305339?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/ulk6EysJEg8/automate-generation-of-all-java-classes.html" title="WebService client: automate the generation of all java classes" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2010/02/automate-generation-of-all-java-classes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MMRnY9eyp7ImA9WxBbGU8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-6991761657654843491</id><published>2009-12-12T23:56:00.000+01:00</published><updated>2010-03-18T15:11:27.863+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-18T15:11:27.863+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><category scheme="http://www.blogger.com/atom/ns#" term="iBATIS" /><title>Spring + ibatis: calling a sql procedure</title><content type="html">This post is a sample of a procedure call from ibatis, when we're under the spring influence!&lt;br /&gt;
&lt;br /&gt;
This is the &lt;a href="http://ibatis.apache.org/ibator.html"&gt;ibator generator xml&lt;/a&gt;. Used with the eclipse plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;
&amp;lt;!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" &amp;gt;
&amp;lt;ibatorConfiguration &amp;gt;
 &amp;lt;classPathEntry location="C:\eclipse\extra\BDD\SQLServer\sqljdbc_2.0\esn\sqljdbc4.jar" /&amp;gt;
 &amp;lt;ibatorContext id="test" &amp;gt;
     &amp;lt;jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://...:1433;databaseName=...." userId="..." password="..."/&amp;gt;
     &amp;lt;javaModelGenerator targetPackage="es.test.model.WebProd" targetProject="test.negocio" /&amp;gt;
     &amp;lt;sqlMapGenerator targetPackage="es.test.dao.WebProd.sqlMap" targetProject="test.negocio" /&amp;gt;
 &amp;lt;daoGenerator targetPackage="es.test.dao.WebProd" targetProject="test.negocio" type="SPRING" /&amp;gt;
 &amp;lt;table schema="dbo" catalog="WebProd" tableName="aliasCuentas"&amp;gt;
   &amp;lt;property name="useActualColumnNames" value="true"/&amp;gt;
 &amp;lt;/table&amp;gt;    
  &amp;lt;/ibatorContext&amp;gt;
&amp;lt;/ibatorConfiguration&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h3&gt;To the generated code of ibator, just add the next items:&lt;/h3&gt;&lt;br /&gt;
&lt;b&gt;In WebProd_dbo_aliasCuentas_SqlMap.xml&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;parameterMap id="getAccountsCall" class="map"&amp;gt;
 &amp;lt;parameter property="titular" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/&amp;gt;
 &amp;lt;parameter property="permiso" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/&amp;gt;
&amp;lt;/parameterMap&amp;gt;
&amp;lt;resultMap id="cuentaAlias" class="es.test.model.WebProd.Aliascuentas"&amp;gt;
 &amp;lt;result property="aliasCuenta" column="aliasCuenta" /&amp;gt;
 &amp;lt;result property="idCuenta" column="idCuenta" /&amp;gt;
&amp;lt;/resultMap&amp;gt;
&amp;lt;procedure id="getAccounts" resultMap="cuentaAlias" parameterMap="getAccountsCall"&amp;gt;
 {call WebProd.dbo.sp_web_getCuenstasUsuarioAlias(?, ?)}
&amp;lt;/procedure&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;In AliascuentasDAO&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush: java;"&gt;List&amp;lt;es.test.model.WebProd.Aliascuentas&amp;gt; selectCuentas(Map example);&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;In AliascuentasDAOImpl&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush: java;"&gt;public List&amp;lt;es.test.model.WebProd.Aliascuentas&amp;gt; selectCuentas(Map example) {
 List&amp;lt;es.test.model.WebProd.Aliascuentas&amp;gt; list = getSqlMapClientTemplate().queryForList("WebProd_dbo_aliasCuentas.getAccounts", example);
 return list;
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Now, the configurations files of spring and the java source of the call.&lt;/h3&gt;&lt;br /&gt;
&lt;b&gt;In applicationContext*.xml&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;bean id=&amp;quot;aliascuentasDAO&amp;quot; class=&amp;quot;es.test.dao.WebProd.AliascuentasDAOImpl&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;sqlMapClient&amp;quot;&amp;gt;
  &amp;lt;ref bean=&amp;quot;sqlMapWebProd&amp;quot;/&amp;gt;
 &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;bean id=&amp;quot;aliasServicio&amp;quot; class=&amp;quot;es.test.miGestion.administracionDatos.service.AliasCuentasServiceImpl&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;aliascuentasDAO&amp;quot;&amp;gt;
  &amp;lt;ref bean=&amp;quot;aliascuentasDAO&amp;quot;/&amp;gt;
 &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;And finally the AliasCuentasServiceImpl.java&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush: java;"&gt;public List&amp;lt;Aliascuentas&amp;gt; getCuentas(String usuario) {
 log.debug(&amp;quot;getCuentas: inicio. usuario:&amp;quot; + usuario);
 List&amp;lt;Aliascuentas&amp;gt; cuentasList;

 Map&amp;lt;String, String&amp;gt; map = new HashMap&amp;lt;String, String&amp;gt;();
 map.put(&amp;quot;titular&amp;quot;, usuario);
 map.put(&amp;quot;permiso&amp;quot;, &amp;quot;Consultas&amp;quot;);
 cuentasList = aliascuentasDAO.selectCuentas(map);
 log.debug(&amp;quot;getCuentas: fin&amp;quot;);
 return cuentasList;
}&lt;/pre&gt;&lt;br /&gt;
That's all!.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-6991761657654843491?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lbX-DnSGilbgkNm4FUgPaXaDmpY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lbX-DnSGilbgkNm4FUgPaXaDmpY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lbX-DnSGilbgkNm4FUgPaXaDmpY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lbX-DnSGilbgkNm4FUgPaXaDmpY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/46XbSnJAwLc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/6991761657654843491/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/10/ibatis-call-procedure-sample.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/6991761657654843491?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/6991761657654843491?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/46XbSnJAwLc/ibatis-call-procedure-sample.html" title="Spring + ibatis: calling a sql procedure" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/10/ibatis-call-procedure-sample.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIDRXg5eSp7ImA9WxBUFE0.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-3568994263017635692</id><published>2009-11-13T23:51:00.000+01:00</published><updated>2010-03-01T00:42:54.621+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-01T00:42:54.621+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="flXHR" /><title>Ajax Cross-domain</title><content type="html">We have a web project that the 90% of the data it's taken from an outer domain. As the client forced us to make the queries directly to the other domain, we decided to use flXHR.&lt;br /&gt;
&lt;br /&gt;
“&lt;a href="http://flxhr.flensed.com/"&gt;flXHR&lt;/a&gt; is a *client-based* cross-browser, XHR-compatible tool for cross-domain Ajax (Flash) communication.”&lt;br /&gt;
&lt;br /&gt;
As we used &lt;a href="http://jquery.com/"&gt;jquery&lt;/a&gt; for build the tables, the right solution seems to use the flXHR jQuery plugin. And all seems right while we were testing in firefox and IE 8, but when we began to test it in IE7 we saw that "sometimes" after the refresh of the page... we had the CPU up to 100% and the IE7 blocked.&lt;br /&gt;
&lt;br /&gt;
After a refactorization and finally a total simplification of the page, we saw that the only way to use safely flXHR was putting the include of the flXHR.js file at the end of the page, or at least the last one of all the js includes of the page.&lt;br /&gt;
&lt;br /&gt;
The next simple example ends with 100% CPU if you refresh the page quickly so many times (&lt;a href="http://www.sacristan.com.es/blog/ie2.html"&gt;source&lt;/a&gt;):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/__fiXBErlKIU/Sq1pW4VYpnI/AAAAAAAAAA4/isXIhIgVvaM/s1600-h/flXHR.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/__fiXBErlKIU/Sq1pW4VYpnI/AAAAAAAAAA4/isXIhIgVvaM/s320/flXHR.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href="http:///"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-3568994263017635692?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DMcKurw0eW37y-X5C8SneMAokhQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DMcKurw0eW37y-X5C8SneMAokhQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DMcKurw0eW37y-X5C8SneMAokhQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DMcKurw0eW37y-X5C8SneMAokhQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/8fpe0ssilu0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/3568994263017635692/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/09/we-have-web-project-that-90-of-data-its.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/3568994263017635692?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/3568994263017635692?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/8fpe0ssilu0/we-have-web-project-that-90-of-data-its.html" title="Ajax Cross-domain" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/__fiXBErlKIU/Sq1pW4VYpnI/AAAAAAAAAA4/isXIhIgVvaM/s72-c/flXHR.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/09/we-have-web-project-that-90-of-data-its.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EGQH09eCp7ImA9WxBbGU8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-197169041398986419</id><published>2009-10-04T23:48:00.000+02:00</published><updated>2010-03-18T15:13:41.360+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-18T15:13:41.360+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><category scheme="http://www.blogger.com/atom/ns#" term="jetspeed" /><category scheme="http://www.blogger.com/atom/ns#" term="iBATIS" /><title /><content type="html">&lt;h3 class="post-title entry-title"&gt;&lt;a href="http://s2o-bcn.blogspot.com/2009/08/developing-portlets-using-eclipse-part.html"&gt;Developing Portlets using Eclipse. Part II&lt;/a&gt;&lt;/h3&gt;&lt;br /&gt;
As I told you, the architecture that I use for these post, has iBATIS for it's persistence layer. &lt;br /&gt;
&lt;br /&gt;
The main reason for use this framework was that iBatis give you the flexibility of write your own optimized sql code, and an easy way to call directly to a sql procedure. Not to mention, the existence of iBator, the code generator for iBatis :)&lt;br /&gt;
&lt;br /&gt;
Spring will be a pivotal piece for the application, the reason for use of this framework it's as simple as I want to sleep as a baby. Some of the things that I want accomplish with spring is to have transparency over my data-source connection, jms..,, to make uncouple implementations from each other...&lt;br /&gt;
&lt;br /&gt;
Well, the first interaction between ibatis and spring it's done in the configuration files, the next example show you how to make a configuration that also makes the application container independent.&lt;br /&gt;
&lt;br /&gt;
Extract from applicationContext.xml:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;!-- obtain datasource  --&amp;gt;   
&amp;lt;jee:jndi-lookup id=&amp;quot;dataSourceWebProd&amp;quot; jndi-name=&amp;quot;jdbc/webProd&amp;quot; cache=&amp;quot;true&amp;quot; resource-ref=&amp;quot;true&amp;quot; lookup-on-startup=&amp;quot;false&amp;quot; proxy-interface=&amp;quot;javax.sql.DataSource&amp;quot;/&amp;gt;

&amp;lt;!-- map iBatis to datasource  --&amp;gt;   
&amp;lt;bean id=&amp;quot;sqlMapBaseWeb&amp;quot; class=&amp;quot;org.springframework.orm.ibatis.SqlMapClientFactoryBean&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;configLocation&amp;quot;&amp;gt;&amp;lt;value&amp;gt;classpath:/config/sqlmap-configWebProd.xml&amp;lt;/value&amp;gt;&amp;lt;/property&amp;gt;
 &amp;lt;property name=&amp;quot;dataSource&amp;quot;&amp;gt;&amp;lt;ref bean=&amp;quot;dataSourceWebProd&amp;quot; /&amp;gt;&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt; 

&amp;lt;bean id=&amp;quot;aliascuentasDAO&amp;quot; class=&amp;quot;es.struts2PortletTemplate.dao.WebProd.AliascuentasDAOImpl&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;sqlMapClient&amp;quot;&amp;gt;
  &amp;lt;ref bean=&amp;quot;sqlMapWebProd&amp;quot;/&amp;gt;
 &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;bean id=&amp;quot;informesServicio&amp;quot; class=&amp;quot;es.struts2PortletTemplate.miGestion.informes.service.InformesServiceImpl&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;aliascuentasDAO&amp;quot;&amp;gt;
  &amp;lt;ref bean=&amp;quot;aliascuentasDAO&amp;quot;/&amp;gt;
 &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
sqlmap-configWebProd.xml:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;settings cachemodelsenabled=&amp;quot;true&amp;quot; enhancementenabled=&amp;quot;true&amp;quot; usestatementnamespaces=&amp;quot;true&amp;quot;&amp;gt;
    &amp;lt;sqlmap resource=&amp;quot;es/struts2PortletTemplate/dao/WebProd/sqlMap/WebProd_dbo_aliasCuentas_SqlMap.xml&amp;quot;&amp;gt;
&amp;lt;/sqlmap&amp;gt;&amp;lt;/settings&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
And of course, you may well decide to use the Spring Framework's declarative transactions offer...&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;bean id=&amp;quot;txManagerWebProd&amp;quot; class=&amp;quot;org.springframework.jdbc.datasource.DataSourceTransactionManager&amp;quot;&amp;gt;
 &amp;lt;property name=&amp;quot;dataSource&amp;quot; ref=&amp;quot;dataSourceWebProd&amp;quot;/&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;tx:advice id=&amp;quot;txAdviceWebProd&amp;quot; transaction-manager=&amp;quot;txManagerWebProd&amp;quot;&amp;gt;
 &amp;lt;tx:attributes&amp;gt;
  &amp;lt;tx:method name=&amp;quot;get*&amp;quot; read-only=&amp;quot;true&amp;quot;/&amp;gt;
  &amp;lt;tx:method name=&amp;quot;find*&amp;quot; read-only=&amp;quot;true&amp;quot;/&amp;gt;
  &amp;lt;tx:method name=&amp;quot;view*&amp;quot; read-only=&amp;quot;true&amp;quot;/&amp;gt;
  &amp;lt;tx:method name=&amp;quot;save*&amp;quot; propagation=&amp;quot;REQUIRED&amp;quot;/&amp;gt;
  &amp;lt;tx:method name=&amp;quot;*&amp;quot; propagation=&amp;quot;REQUIRED&amp;quot;/&amp;gt;
 &amp;lt;/tx:attributes&amp;gt;
&amp;lt;/tx:advice&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-197169041398986419?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rrKkhXOYZ9ekAeSrLYQdw7CyseI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rrKkhXOYZ9ekAeSrLYQdw7CyseI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rrKkhXOYZ9ekAeSrLYQdw7CyseI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rrKkhXOYZ9ekAeSrLYQdw7CyseI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/nSFGYUmKgY8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/197169041398986419/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/10/developing-portlets-using-eclipse.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/197169041398986419?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/197169041398986419?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/nSFGYUmKgY8/developing-portlets-using-eclipse.html" title="" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/10/developing-portlets-using-eclipse.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUANRHY4eyp7ImA9WxNRF0w.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-2127916423505137726</id><published>2009-09-12T01:59:00.000+02:00</published><updated>2009-09-12T02:03:15.833+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-12T02:03:15.833+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="jetspeed" /><category scheme="http://www.blogger.com/atom/ns#" term="WTP" /><title>Easy developing and debuging portlets with eclipse WTP</title><content type="html">This little entry is just to show you how quickly I have my new environment up and running. As I told you in &lt;a href="http://s2o-bcn.blogspot.com/2009/08/developing-portlets-using-eclipse-part.html"&gt;my firt pos&lt;/a&gt;t, I develop the portlets with:&lt;br /&gt;
&lt;br /&gt;
Eclipse with WTP&lt;br /&gt;
JetSpeed 2.2.0&lt;br /&gt;
&lt;br /&gt;
And I will use Struts2 (Struts 2.1.7) portltes (JSR 168)...&lt;br /&gt;
&lt;br /&gt;
The next log it's from a start up of the jetSpeed in debug mode.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: attemping to start Portlet Application at: /Struts2PortletTemplate&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:02 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: started Portlet Application at: /Struts2PortletTemplate&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:03 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: Initializing Spring root WebApplicationContext&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:04 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: starting initialization of Portlet Application at: j2-admin&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;JetspeedContainerServlet: starting initialization of Portlet Application at: j2-admin12-Sep-2009 01:49:04 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: Could not yet start portlet application at: j2-admin. Starting back ground thread to start when the portal comes online.&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:04 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: initialization done for Portlet Application at: j2-admin&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;JetspeedContainerServlet: initialization done for Portlet Application at: j2-admin&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:04 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: attemping to start Portlet Application at: /j2-admin&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:05 org.apache.coyote.http11.Http11Protocol start&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: Starting Coyote HTTP/1.1 on http-8080&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:05 org.apache.jk.common.ChannelSocket init&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JK: ajp13 listening on /0.0.0.0:8009&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:05 org.apache.jk.server.JkMain start&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: Jk running ID=0 time=0/267&amp;nbsp; config=null&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:05 org.apache.catalina.startup.Catalina start&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: Server startup in 14474 ms&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;12-Sep-2009 01:49:06 org.apache.catalina.core.ApplicationContext log&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;INFO: JetspeedContainerServlet: started Portlet Application at: /j2-admin&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It takes only &lt;span style="color: red;"&gt;14474 ms&lt;/span&gt;&lt;br /&gt;
can you do this with websphere?? ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-2127916423505137726?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IJCvna0pdYgS7VYbuGUMER3zEks/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IJCvna0pdYgS7VYbuGUMER3zEks/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IJCvna0pdYgS7VYbuGUMER3zEks/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IJCvna0pdYgS7VYbuGUMER3zEks/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/FZ5tCVJsZFs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/2127916423505137726/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/09/easy-developing-and-debuging-portlets.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/2127916423505137726?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/2127916423505137726?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/FZ5tCVJsZFs/easy-developing-and-debuging-portlets.html" title="Easy developing and debuging portlets with eclipse WTP" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/09/easy-developing-and-debuging-portlets.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEHR3o_eCp7ImA9WxNTFkQ.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-748742649288716500</id><published>2009-08-19T10:09:00.001+02:00</published><updated>2009-08-19T17:43:56.440+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-19T17:43:56.440+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="websphere" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="Struts2" /><category scheme="http://www.blogger.com/atom/ns#" term="portlet" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><category scheme="http://www.blogger.com/atom/ns#" term="jetspeed" /><title>Developing Portlets using Eclipse. Part I</title><content type="html">On this entries I will show you how to develop portlets, create and debug portlets, in Eclipse with the WTP plugin and &lt;a href="http://portals.apache.org/jetspeed-2/"&gt;Jetspeed-2&lt;/a&gt; . Lately I will deploy those portlets for the Websphere Portal 6.1.&lt;br /&gt;&lt;br /&gt;Some frameworks that I will use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://ibatis.apache.org/index.html"&gt;iBatis&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springsource.org/"&gt;Spring &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://struts.apache.org/2.x/"&gt;Struts2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:180%;"&gt;The environment&lt;/span&gt;&lt;span style="font-size:180%;"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Eclipse: download the last "&lt;a href="http://www.eclipse.org/downloads/"&gt;Eclipse IDE for Java EE Developers&lt;/a&gt;".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Jetspeed-2: download the last version "&lt;a href="http://portals.apache.org/jetspeed-2/download.html"&gt;Standard (Minimal) Installer&lt;/a&gt;". I use the Derby (default) BDD.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Locations that I use to use with Linux:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;/data/eclipse/eclipseWTP -&gt; here's the eclipse.exe&lt;/li&gt;&lt;li&gt;/data/eclipse/eXtra/Jetspeed-2.2.0 -&gt; for Jetspeed&lt;/li&gt;&lt;li&gt;/data/workspace/groupA -&gt; for development&lt;/li&gt;&lt;/ul&gt;Locations that I use to use with Windows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;c:\eclipse\eclipseWTP -&gt; here's the eclipse.exe&lt;/li&gt;&lt;li&gt;c:\eclipse\eXtra\Jetspeed-2.2.0 -&gt; for Jetspeed&lt;/li&gt;&lt;li&gt;c:\apps\workspace\groupA -&gt; for developement&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;OK, now it's time to configure our eclipse:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Add a new server runtime. In eclipse "Preferences/Sever/Runtime Enviroment", add "Apache Tomcat v6.0" and use the installation of the Jetspeed as "Tomcat installation directory "/data/eclipse/eXtra/Jetspeed-2.2.0".&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__fiXBErlKIU/SowN2jPVhdI/AAAAAAAAAAU/cPs328C4rdc/s1600-h/jetspeed.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 327px;" src="http://2.bp.blogspot.com/__fiXBErlKIU/SowN2jPVhdI/AAAAAAAAAAU/cPs328C4rdc/s400/jetspeed.jpg" alt="" id="BLOGGER_PHOTO_ID_5371683686369822162" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__fiXBErlKIU/SowL1WoqKII/AAAAAAAAAAM/oj6nIb-9m3c/s1600-h/jetspeed.jpg"&gt;&lt;/a&gt;&lt;ul&gt;&lt;li&gt;Configure the new server. Here's the most important thing, just after we create the new server, we have to edit the server configuration and then "use Tomcat installation" (the default could be "use workspace") and change the "deploy path" to point where we had the "webapps" in our Jetspeed installation "&lt;span style="font-style: italic;"&gt;/data/eclipse/eXtra/Jetspeed-2.2.0/webapps&lt;/span&gt;". Also we have to change the timeout to start the server.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__fiXBErlKIU/SowN_TLLrxI/AAAAAAAAAAc/pOIdFXjgfUw/s1600-h/server.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 176px;" src="http://3.bp.blogspot.com/__fiXBErlKIU/SowN_TLLrxI/AAAAAAAAAAc/pOIdFXjgfUw/s400/server.jpg" alt="" id="BLOGGER_PHOTO_ID_5371683836676255506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;The portlet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In eclipse, create a new Dynamic Web Project with target runtime: "Jetspeed 2.2.0". Project name: Struts2PortletTemplate :)&lt;br /&gt;OK, now change the project properties, in "Java build path"... I like this "Struts2PortletTemplate/WebContent/WEB-INF/classes" as the output folder.&lt;br /&gt;&lt;br /&gt;This will be the web.xml:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__fiXBErlKIU/SowXR-YZN9I/AAAAAAAAAAk/jTHSwGrV0s8/s1600-h/webX.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 396px; height: 400px;" src="http://3.bp.blogspot.com/__fiXBErlKIU/SowXR-YZN9I/AAAAAAAAAAk/jTHSwGrV0s8/s400/webX.jpg" alt="" id="BLOGGER_PHOTO_ID_5371694053116688338" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-748742649288716500?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UX4JMQVSmFEU4xaRQ_pNlJtgbow/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UX4JMQVSmFEU4xaRQ_pNlJtgbow/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UX4JMQVSmFEU4xaRQ_pNlJtgbow/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UX4JMQVSmFEU4xaRQ_pNlJtgbow/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/sRYJPvkOiWE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/748742649288716500/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/08/developing-portlets-using-eclipse-part.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/748742649288716500?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/748742649288716500?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/sRYJPvkOiWE/developing-portlets-using-eclipse-part.html" title="Developing Portlets using Eclipse. Part I" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/__fiXBErlKIU/SowN2jPVhdI/AAAAAAAAAAU/cPs328C4rdc/s72-c/jetspeed.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/08/developing-portlets-using-eclipse-part.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AGSXw4eSp7ImA9WxBbGU8.&quot;"><id>tag:blogger.com,1999:blog-3321514629934017493.post-1237166889664394498</id><published>2009-06-16T05:54:00.000+02:00</published><updated>2010-03-18T15:15:28.231+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-18T15:15:28.231+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML" /><category scheme="http://www.blogger.com/atom/ns#" term="MDA" /><category scheme="http://www.blogger.com/atom/ns#" term="junit" /><title>MDA: the practical uml with Acceleo</title><content type="html">Maybe one of the best things of the MDA is that with a good template you can have all the test classes builded from just one click. Not to comment, the fact that the project will allways keep well documented with detailed uml :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/__fiXBErlKIU/S58D6NJ-KMI/AAAAAAAAABI/LiI4TEVpnZI/s1600-h/uml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" src="http://4.bp.blogspot.com/__fiXBErlKIU/S58D6NJ-KMI/AAAAAAAAABI/LiI4TEVpnZI/s400/uml.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I used &lt;a href="http://www.topcased.org/"&gt;topcased&lt;/a&gt; as modeling tool and &lt;a href="http://www.acceleo.org/pages/home/en"&gt;Acceleo&lt;/a&gt; as code generator.&lt;br /&gt;
&lt;br /&gt;
It's very easy to extend the &lt;a href="http://www.acceleo.org/pages/modules-repository/en"&gt;JEE Hibernate/Struts&lt;/a&gt; module of Acceleo.&lt;br /&gt;
&lt;br /&gt;
A&lt;span class="long_text" id="result_box"&gt;&lt;span title="Como punto de partida, el módulo XXL ya trae de serie la generación de componentes básicos junit y html-unit."&gt;s a starting point, this module ships with a basic generation of junit-unit and html-unit components. &lt;/span&gt;&lt;span title="Pero no cuesta mucho extender estos componentes para obtener unos clases de prueba base más precisas."&gt;But it's not hard to extend these components for generate more precise classes for testing. &lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Que nos ahorrará gran parte de la tediosa tarea de generación de clases de prueba"&gt;That will save us much of the tedious task of generating test classes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here is a sample:&lt;br /&gt;
&lt;br /&gt;
&lt;pre  class="brush: java;"&gt;&amp;lt;%--
  sso 03-2008
--%&amp;gt;
&amp;lt;%
metamodel http://www.eclipse.org/uml2/2.0.0/UML
import es.sso.uml21.common.common
import es.sso.uml21.common.specifics
import es.sso.uml21.common.dataTypes
import es.sso.uml21.common.structure
import es.sso.uml21.common.services.StringServices
import es.sso.uml21.common.services.ListServices
import es.sso.uml21.common.services.Uml2Services
%&amp;gt;


&amp;lt;%script type=&amp;quot;Class&amp;quot; name=&amp;quot;fullFilePath&amp;quot;%&amp;gt;
&amp;lt;%if (hasStereotype(getProperty(&amp;quot;Entity&amp;quot;))){%&amp;gt;
/&amp;lt;%daoTestPackage.toPath()%&amp;gt;/&amp;lt;%name%&amp;gt;DaoTest.java
&amp;lt;%}%&amp;gt;

&amp;lt;%script type=&amp;quot;Class&amp;quot; name=&amp;quot;generate&amp;quot; file=&amp;quot;&amp;lt;%fullFilePath%&amp;gt;&amp;quot;%&amp;gt;
package &amp;lt;%daoTestPackage%&amp;gt;;

// &amp;lt;%startUserCode%&amp;gt; for import
&amp;lt;%if (attribute.select(&amp;quot;type.name == 'Date'&amp;quot;)){%&amp;gt;
import java.util.Date;
&amp;lt;%}%&amp;gt;

import junit.framework.Assert;
import junit.framework.TestCase;

import java.sql.SQLException;

import org.apache.commons.beanutils.DynaBean;

import com.mockrunner.jdbc.StatementResultSetHandler;
import com.mockrunner.mock.jdbc.MockResultSet;

import es.lacaixa.intranet.commons.beanutils.LazyDynaBean;
import es.lacaixa.intranet.test.BasicDAOTest;
import &amp;lt;%daoPackage%&amp;gt;.&amp;lt;%name%&amp;gt;Dao;

// &amp;lt;%endUserCode%&amp;gt; for import

public class &amp;lt;%name%&amp;gt;DaoTest extends BasicDAOTest {
    
    
    /**
     * Test the insert of the entity &amp;lt;%name%&amp;gt;.&amp;lt;br/&amp;gt;
     * &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Step 1 : Create an entity&amp;lt;/li&amp;gt;
     * &amp;lt;li&amp;gt;Step 2 : Verificar datos insert&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;
     */
      public void testInsert() {        
        &amp;lt;%name%&amp;gt;Dao &amp;lt;%name.toLowerCase()%&amp;gt;Dao= new &amp;lt;%name%&amp;gt;Dao();
        DynaBean dynaBean = new LazyDynaBean();
        // &amp;lt;%startUserCode%&amp;gt; 
        &amp;lt;%for (attribute){%&amp;gt;
            &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
            &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;    
            &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;
       
        &amp;lt;%name.toLowerCase()%&amp;gt;Dao.insert(dynaBean);
        String sqlQuery = &amp;quot;INSERT INTO &amp;lt;%tablaBDD%&amp;gt;&amp;quot;;
        verifySQLStatementExecuted(sqlQuery+&amp;quot; (&amp;lt;%attribute.name.sep(&amp;quot;, &amp;quot;)%&amp;gt;) VALUES (&amp;lt;%paramInserts.substring(0,paramInserts.length()-2)%&amp;gt;)&amp;quot;);
        verifySQLStatementNotExecuted(&amp;quot;UPDATE INTO &amp;lt;%tablaBDD%&amp;gt;a&amp;quot;);
        int numDeParametr=1;
        &amp;lt;%for (attribute){%&amp;gt;
            &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, numDeParametr, &amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);
        numDeParametr++; 
            &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
        &amp;lt;%-- numDeParametr++; --%&amp;gt; 
            &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, numDeParametr, new Integer(&amp;lt;%i()+1%&amp;gt;));
        numDeParametr++;             
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        verifyNotCommitted();        
        verifyAllResultSetsClosed();
        verifyAllStatementsClosed();
        //verifyConnectionClosed();
    }

    /**
     * Test the update of the entity &amp;lt;%name%&amp;gt;.&amp;lt;br/&amp;gt;
     * &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Step 1 : Create an entity&amp;lt;/li&amp;gt;
     * &amp;lt;li&amp;gt;Step 2 : Verificar datos update&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;
     */
    public final void testUpdate() {
       &amp;lt;%name%&amp;gt;Dao &amp;lt;%name.toLowerCase()%&amp;gt;Dao= new &amp;lt;%name%&amp;gt;Dao();
        DynaBean dynaBean = new LazyDynaBean();
        // &amp;lt;%startUserCode%&amp;gt;         
        &amp;lt;%for (attribute){%&amp;gt;                
            &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
            &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
            &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
            &amp;lt;%}%&amp;gt;                    
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;
       
        &amp;lt;%name.toLowerCase()%&amp;gt;Dao.update(dynaBean);
        String sqlQuery = &amp;quot;UPDATE &amp;lt;%tablaBDD%&amp;gt; SET &amp;lt;%attribute.genComparator.sep(&amp;quot;, &amp;quot;)%&amp;gt;&amp;quot;;
        verifySQLStatementExecuted(sqlQuery);
        verifySQLStatementNotExecuted(&amp;quot;UPDATE INTO &amp;lt;%tablaBDD%&amp;gt;a&amp;quot;);
        int numDeParametr=1;
        &amp;lt;%for (attribute){%&amp;gt;
        &amp;lt;%if (isUnique){%&amp;gt;
            &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, numDeParametr, String.valueOf(numDeParametr));
        numDeParametr++; 
            &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
        &amp;lt;%-- numDeParametr++; --%&amp;gt;
            &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, numDeParametr, new Integer(numDeParametr));
        numDeParametr++;            
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        verifyNotCommitted();        
        verifyAllResultSetsClosed();
        verifyAllStatementsClosed();
        //verifyConnectionClosed();
    }
    
    /**
     * Test the update of the entity &amp;lt;%name%&amp;gt;.&amp;lt;br/&amp;gt;
     * &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Step 1 : Create an entity&amp;lt;/li&amp;gt;
     * &amp;lt;li&amp;gt;Step 2 : Verificar datos update&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;
     */
    public final void testDelete() {
       &amp;lt;%name%&amp;gt;Dao &amp;lt;%name.toLowerCase()%&amp;gt;Dao= new &amp;lt;%name%&amp;gt;Dao();
        DynaBean dynaBean = new LazyDynaBean();
        // &amp;lt;%startUserCode%&amp;gt;         
        &amp;lt;%for (attribute){%&amp;gt;    
            &amp;lt;%if (isUnique){%&amp;gt;            
                &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
                &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
                &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
                &amp;lt;%}%&amp;gt;                    
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;
       
        &amp;lt;%name.toLowerCase()%&amp;gt;Dao.delete(dynaBean);
        String sqlQuery = &amp;quot;DELETE FROM &amp;lt;%tablaBDD%&amp;gt; WHERE &amp;quot;;
        verifySQLStatementExecuted(sqlQuery);
        verifySQLStatementNotExecuted(&amp;quot;UPDATE INTO &amp;lt;%tablaBDD%&amp;gt;a&amp;quot;);
        // &amp;lt;%startUserCode%&amp;gt;         
        &amp;lt;%for (attribute){%&amp;gt;    
            &amp;lt;%if (isUnique){%&amp;gt;            
                &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0,&amp;lt;%i()+1%&amp;gt;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
                &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
                &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, &amp;lt;%i()+1%&amp;gt;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
                &amp;lt;%}%&amp;gt;                    
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;     
        verifyNotCommitted();        
        verifyAllResultSetsClosed();
        verifyAllStatementsClosed();
        //verifyConnectionClosed();
    }

    /**
     * Test the search by id para &amp;lt;%name%&amp;gt;.&amp;lt;br/&amp;gt;
     */
    public final void testFindById() {
        &amp;lt;%name%&amp;gt;Dao &amp;lt;%name.toLowerCase()%&amp;gt;Dao= new &amp;lt;%name%&amp;gt;Dao();
        DynaBean dynaBean = new LazyDynaBean();
        // &amp;lt;%startUserCode%&amp;gt;         
        &amp;lt;%for (attribute){%&amp;gt;    
            &amp;lt;%if (isUnique){%&amp;gt;            
                &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
                &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
                &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        dynaBean.set(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
                &amp;lt;%}%&amp;gt;                    
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;
       
        &amp;lt;%name.toLowerCase()%&amp;gt;Dao.findById(dynaBean);
        String sqlQuery = &amp;quot;SELECT &amp;lt;%attribute.name.sep(&amp;quot;, &amp;quot;)%&amp;gt; FROM &amp;lt;%tablaBDD%&amp;gt; WHERE &amp;quot;;
        verifySQLStatementExecuted(sqlQuery);
        verifySQLStatementNotExecuted(&amp;quot;UPDATE INTO &amp;lt;%tablaBDD%&amp;gt;&amp;quot;);
        // &amp;lt;%startUserCode%&amp;gt;         
        &amp;lt;%for (attribute){%&amp;gt;    
            &amp;lt;%if (isUnique){%&amp;gt;            
                &amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0,&amp;lt;%i()+1%&amp;gt;,&amp;quot;&amp;lt;%i()+1%&amp;gt;&amp;quot;);    
                &amp;lt;%}else if(type.name == &amp;quot;Date&amp;quot;){%&amp;gt;
        &amp;lt;%-- pValues.setDate(&amp;lt;%i()+1%&amp;gt;, new Date((String)dynaBean.get(&amp;quot;&amp;lt;%name%&amp;gt;&amp;quot;)); --%&amp;gt;
                &amp;lt;%}else if(type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;
        verifySQLStatementParameter(sqlQuery, 0, &amp;lt;%i()+1%&amp;gt;,new Integer(&amp;lt;%i()+1%&amp;gt;));            
                &amp;lt;%}%&amp;gt;                    
            &amp;lt;%}%&amp;gt;
        &amp;lt;%}%&amp;gt;
        // &amp;lt;%endUserCode%&amp;gt;     
        verifyNotCommitted();        
        verifyAllResultSetsClosed();
        verifyAllStatementsClosed();
        //verifyConnectionClosed();
    }

}


&amp;lt;%script type=&amp;quot;Property&amp;quot; name=&amp;quot;exempleValues&amp;quot;%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;&amp;lt;%name.uniqueCode()%&amp;gt;&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;&amp;quot;my&amp;lt;%name.firstUpper()%&amp;gt;&amp;quot;&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Boolean&amp;quot;){%&amp;gt;true&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Date&amp;quot;){%&amp;gt;new Date(0)&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Float&amp;quot;){%&amp;gt;&amp;lt;%name.uniqueCode()%&amp;gt;.0&amp;lt;%}else{%&amp;gt;
new &amp;lt;%type.name%&amp;gt;()&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;

&amp;lt;%script type=&amp;quot;Property&amp;quot; name=&amp;quot;exempleValues2&amp;quot;%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Integer&amp;quot;){%&amp;gt;&amp;lt;%name.uniqueCode()%&amp;gt;&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;String&amp;quot;){%&amp;gt;&amp;quot;second&amp;lt;%name.firstUpper()%&amp;gt;&amp;quot;&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Boolean&amp;quot;){%&amp;gt;false&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Date&amp;quot;){%&amp;gt;new Date(1)&amp;lt;%}else{%&amp;gt;
&amp;lt;%if (type.name == &amp;quot;Float&amp;quot;){%&amp;gt;&amp;lt;%name.uniqueCode()%&amp;gt;.0&amp;lt;%}else{%&amp;gt;
new &amp;lt;%type.name%&amp;gt;()&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;&amp;lt;%}%&amp;gt;

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3321514629934017493-1237166889664394498?l=s2o-bcn.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FmjRRqTxvHDR5rTisY9DAugRqeU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FmjRRqTxvHDR5rTisY9DAugRqeU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FmjRRqTxvHDR5rTisY9DAugRqeU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FmjRRqTxvHDR5rTisY9DAugRqeU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~4/MLjJIZpccCU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://s2o-bcn.blogspot.com/feeds/1237166889664394498/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://s2o-bcn.blogspot.com/2009/06/mda-practical-uml-with-acceleo.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/1237166889664394498?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3321514629934017493/posts/default/1237166889664394498?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PortletsIbatisSpringStruts2JqueryEclipse/~3/MLjJIZpccCU/mda-practical-uml-with-acceleo.html" title="MDA: the practical uml with Acceleo" /><author><name>s2o</name><uri>http://www.blogger.com/profile/00886579875089628198</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/__fiXBErlKIU/S58D6NJ-KMI/AAAAAAAAABI/LiI4TEVpnZI/s72-c/uml.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://s2o-bcn.blogspot.com/2009/06/mda-practical-uml-with-acceleo.html</feedburner:origLink></entry></feed>

