<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6401947770236962726</id><updated>2011-11-27T19:54:20.989-05:00</updated><category term='SAP'/><category term='Spring MVC'/><category term='groovy'/><category term='Portal'/><category term='QuickPoll'/><category term='Sso'/><category term='decompile'/><category term='webdynpro'/><category term='external'/><category term='Spring'/><category term='Java'/><category term='jad'/><category term='Transaction'/><category term='Ajax'/><category term='pdf'/><category term='roadmap'/><title type='text'>Talking about JAVA and more</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-5166938998316874002</id><published>2011-11-03T23:23:00.048-05:00</published><updated>2011-11-04T01:19:28.765-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='decompile'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='jad'/><category scheme='http://www.blogger.com/atom/ns#' term='external'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>My first serious Groovy class ..... decompiling  java classes with closures</title><content type='html'>After I read the chapter 6 "closures" of the book Groovy and Grails Recipe, and I decided to use the power of closures of Groovy for resource (files) with other problem that I had, decompile in one step every class of jar library.&lt;br /&gt;&lt;br /&gt;Well, the purpose of this class is call an external java decompiler (jad) from a Groovy class and execute the command into directory where the jar file was decompressed. And by using the power of closures executes recursively into this directory until find the classes.&lt;br /&gt;&lt;br /&gt;Well, no more words, here the class&lt;br /&gt;&lt;pre name="code" class="brush:groovy"&gt;&lt;br /&gt;package demo&lt;br /&gt;&lt;br /&gt;class Executor {&lt;br /&gt; // directory where the library(jar) was decompressed&lt;br /&gt; def path&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Execute the decompilation of the classes into the directory defined in the path&lt;br /&gt;  * @return&lt;br /&gt;  */&lt;br /&gt; def decompileClasses(){&lt;br /&gt;  def directory = new File(path)&lt;br /&gt;  //make use of closures defined in the Object class&lt;br /&gt;  directory.eachFileRecurse {&lt;br /&gt;   def name = it.absolutePath&lt;br /&gt;   //if the current resource hasn't a .class extension continues with next one&lt;br /&gt;   if (name.indexOf(".class") &lt; 0)&lt;br /&gt;    return&lt;br /&gt;   println "Processing ..." + it&lt;br /&gt;   //getting the name of the class with the absolute path&lt;br /&gt;   name = name.substring(0, name.indexOf( ".class")) + ".java"&lt;br /&gt;   //defining the external command in order to be executed for every class file &lt;br /&gt;   def command = "D:\\Jad.exe -r -d " +  path +" -sjava " + it&lt;br /&gt;   //execute the command&lt;br /&gt;   def proc = command.execute()&lt;br /&gt;&lt;br /&gt;   // Wait for the command to finish&lt;br /&gt;   proc.waitFor()&lt;br /&gt;   // Obtain status and output&lt;br /&gt;   println "return code: ${ proc.exitValue()}"http://www.blogger.com/img/blank.gif&lt;br /&gt;   println "stderr: ${proc.err.text}"&lt;br /&gt;   // *out* from the external program is *in* for groovy&lt;br /&gt;   println "stdout: ${proc.in.text}" &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def executor = new Executor(path:"D:\\myfolder\\my_jar")&lt;br /&gt;executor.decompileClasses()&lt;br /&gt;http://www.blogger.com/img/blank.gif&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can find more about "executing external processes" &lt;a href="http://groovy.codehaus.org/Executing+External+Processes+From+Groovy" target="_blank"&gt;here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;The Jad decompile executable file is located in this &lt;a href="http://www.varaneckas.com/jad" target="_blank"&gt;link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, it is really useful the use of closures in Groovy. So you can see that I didn't use an static void main like java, here the point, I have created a groovy file named Decompiler.groovy, it contains the groovy class and the groovy script, so when the groovy file is compiled the Decompiler groovy class is created, and it contains the calling to the Executor class and the decompileClasses() method.&lt;br /&gt;&lt;br /&gt;Well, I hope to follow posting about Groovy in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-5166938998316874002?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/5166938998316874002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=5166938998316874002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/5166938998316874002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/5166938998316874002'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2011/11/my-first-serious-groovy-class.html' title='My first serious Groovy class ..... decompiling  java classes with closures'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-7265347347450577421</id><published>2011-06-29T10:23:00.003-05:00</published><updated>2011-11-04T00:32:51.786-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='roadmap'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='webdynpro'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>WebDynpro for Java: Tutorial of the Basic Usage of RoadMap Component</title><content type='html'>&lt;p&gt;We will create a local Development component project of the type Web Dynpro as follow&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image1.jpg" alt="" /&gt; &lt;/p&gt;&lt;p&gt;Our project will contain only 3 views with the purpose of show the basic usage of the roadMap object. &lt;/p&gt;&lt;p&gt;After, we create our component controller RoadMap and the RoadMapView view as follow&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image2.jpg" alt="" width="376" height="399" /&gt;&lt;/p&gt;&lt;p&gt;Now, we will create the 2 views more, the previous one will contain only the RoadMap Object (RoadMapView) used in all the project, the other ones show the flow between screens.&lt;/p&gt;&lt;p&gt;Here the list of the 3 views: RoadMapView,&amp;nbsp; InitView, and ConfirmView.&lt;/p&gt;&lt;p&gt;Now, we will add the component RoadMap object (it is on the Standar Complex Group) to the RoadMapView view, but first delete the default object added to the view, after we will need to add two steps (it could be more, depends of your logic) to our roadmap object. In order to do that we will use the Outline view of the NWDS. We add the two steps as follow&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image3.jpg" alt="" width="194" height="227" /&gt; &lt;/p&gt;&lt;p&gt;The type steps to add at the RoadMap object will be ot the "RoadMapStep" type. The name of the steps are: InitStep and ConfirmStep and the properties to change in these objects are: description and name. The values "Init" and "1" to InitStep, and "Confirm" and "2" to ConfirmStep. Please, see the next picture.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image4.jpg" alt="" width="326" height="182" /&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;Finally, we have the RoadMapView as the next picture:&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image5.jpg" alt="" width="415" height="369" /&gt; &lt;/p&gt;&lt;p&gt;We will modify the context of the Component Controller, we are going to add two "property values" named fullName and processStep to the current context, both of them are strings. And also, we bind these properties in the others views, with the exception in the RoadMapView, we only map the processStep property value. See the next picture.&lt;/p&gt;&lt;p&gt;Now, we are going to add the ViewContainerUIElement object at the top on the InitView and ConfirmView views (previously delete the default object added to the view). This is important because this object will contain the RoadMapView view.&lt;/p&gt;&lt;p&gt;Before, we are going to modify the RoadMap Window in the diagram View, first we delete the RoadMapView, and add the InitView and set up it as default view. See the next picture.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image7.jpg" alt="" width="383" height="373" /&gt; &lt;/p&gt;&lt;p&gt;Second, we are going to embed the RoadView view on the InitView view. &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image8.jpg" alt="" width="560" height="359" /&gt; &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image9.jpg" alt="" width="325" height="386" /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Also, add the ConfirmView view on the Window and do the same. &lt;/p&gt;&lt;p&gt;Next, we define in the views the inbound and outbound plugs on the RoadMap Window object. &lt;/p&gt;&lt;p&gt;In the&amp;nbsp; InitView:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Inbound ---&amp;gt; fromConfirmView&lt;/li&gt;&lt;li&gt;Outboud ---&amp;gt; toConfirmView&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In the ConfirmView&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Inbound ---&amp;gt; fromInitView&lt;/li&gt;&lt;li&gt;Outboud ---&amp;gt; toInitView&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Finally, after you link the inbound with the respective outbounf you will have the next result:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image10.jpg" alt="" width="469" height="151" /&gt;&lt;/p&gt;&lt;p&gt;Now, we are going to add functionality and design to our views.&lt;/p&gt;&lt;p&gt;The RoadMapView view, we select the RoadMap object and modify the selectedStep property, we put the property value on the context named processStep. See the next picture.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image12.jpg" alt="" width="524" height="212" /&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;After, the InitView view could look like the follow picture.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image11.jpg" alt="" width="290" height="230" /&gt;&lt;/p&gt;&lt;p&gt;We need to add some lines of code in the next methods: &lt;strong&gt;&lt;em&gt;wdDoInit, &lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;strong&gt;onActionNext, and&amp;nbsp; &lt;/strong&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;onPlugfromConfirmView&lt;/strong&gt;&lt;/em&gt; as follow: &lt;/p&gt;&lt;p&gt;&amp;nbsp; public void &lt;strong&gt;&lt;em&gt;wdDoInit&lt;/em&gt;&lt;/strong&gt;()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@begin wdDoInit()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;wdContext.currentContextElement().setProcessStep(STEP_INIT);&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@end&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; public void &lt;em&gt;&lt;strong&gt;onActionNext&lt;/strong&gt;&lt;/em&gt;(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@begin onActionNext(ServerEvent)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt; wdThis.wdFirePlugToConfirmView();&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@end&lt;br /&gt;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; public void &lt;em&gt;&lt;strong&gt;onPlugfromConfirmView&lt;/strong&gt;&lt;/em&gt;(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@begin onPlugfromConfirmView(ServerEvent)&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;wdContext.currentContextElement().setProcessStep(STEP_INIT);&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@end&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;And, at the end of the view controller add the next line:&lt;/p&gt;&lt;p&gt;&amp;nbsp; //@@begin others&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String STEP_INIT = "InitStep";&lt;/strong&gt;&lt;br /&gt;&amp;nbsp; //@@end&lt;/p&gt;&lt;p&gt;Also, the method &lt;em&gt;&lt;strong&gt;onActionNext &lt;/strong&gt;&lt;/em&gt;is used on the ClickOn event on the next button on the view&lt;em&gt;&lt;strong&gt; InitView.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Finally, the ConfirmView view could look like the follow picture.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/image13.jpg" alt="" width="454" height="177" /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;We need to add some lines of code in the next methods: &lt;strong&gt;&lt;em&gt;wdDoInit,onActionBack &lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;strong&gt;, and&amp;nbsp; onPlugfromInitView &lt;/strong&gt;&lt;/em&gt;as follow: &lt;/p&gt;&lt;p&gt;&amp;nbsp; public void &lt;strong&gt;&lt;em&gt;wdDoInit&lt;/em&gt;&lt;/strong&gt;()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;//@@begin wdDoInit()&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;strong&gt; wdContext.currentContextElement().setProcessStep(STEP_CONFIRM);&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt; //@@end&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; public void &lt;strong&gt;&lt;em&gt;onActionBack &lt;/em&gt;&lt;/strong&gt;(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent&lt;br /&gt; wdEvent )&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@begin onActionNext(ServerEvent)&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdThis.wdFirePlugToInitView();&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@end&lt;br /&gt;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;public void &lt;em&gt;&lt;strong&gt;onPlugfromInitView&lt;/strong&gt;&lt;/em&gt;(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent&lt;br /&gt; wdEvent )&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //@@begin onPlugfromConfirmView(ServerEvent)&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdContext.currentContextElement().setProcessStep(STEP_CONFIRM);&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt; //@@end&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;And, at the end of the view controller add the &lt;br /&gt;next line:&lt;/p&gt;&lt;p&gt;&amp;nbsp; //@@begin others&lt;br /&gt;&lt;strong&gt;&amp;nbsp; private String STEP_CONFIRM = "ConfirmStep";&lt;/strong&gt;&lt;br /&gt;&amp;nbsp; //@@end&lt;/p&gt;&lt;p&gt;Also, the method &lt;strong&gt;&lt;em&gt;onActionBack &lt;/em&gt;&lt;/strong&gt;is&lt;br /&gt; used on the ClickOn event on the back button on the view&lt;em&gt;&lt;strong&gt; ConfirmView &lt;/strong&gt;&lt;/em&gt;view&lt;em&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/em&gt; The private instance variables defined at the end of the view controllers must have the same value defined on the property "id" of every RoadMapStep of the RoadMap object in the RoadMapView view.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Finally, we need to try our web dynpro application, we need to create an application object. It will look like the final picture.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/imageFinal.jpg" alt="" width="407" height="137" /&gt; &lt;/p&gt;&lt;p&gt;You can find the source code &lt;a href="http://www.4shared.com/file/E8FXudKW/roadmap1.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-7265347347450577421?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/7265347347450577421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=7265347347450577421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/7265347347450577421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/7265347347450577421'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2011/06/webdynpro-for-java-tutorial-of-basic.html' title='WebDynpro for Java: Tutorial of the Basic Usage of RoadMap Component'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-1552969187264394318</id><published>2009-10-30T14:06:00.005-05:00</published><updated>2009-10-30T14:16:31.193-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Sso'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 2</title><content type='html'>&lt;p&gt;After we have configured our portal object, we must install the gateway application and modified the target application. &lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;1. Deployment of the Gateway Web J2EE Application&lt;/strong&gt;&lt;/u&gt;&lt;/em&gt;:&lt;/p&gt;&lt;p&gt;We must  to create an j2ee web application with the purpose to be a gateway from every application that want to validate the SAP Ticket Logon. I have created this application because of the problem with the sapssoext library provied from SAP, it can't be loaded from more than one classloader, then this new web application will be the unque application on the server that can load this library. &lt;/p&gt;&lt;p&gt;This application could expose 2 or more services, it depends of you. I will mention 2 services:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;/SsoGatewayWeb/ssojson.dtx &lt;/strong&gt; :  under this URI will happen the vaidation of the SAP Ticket Logon sent by the SAP Portal, it returns a JSON string with the information retrieved from the ticket. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;/SsoGatewayWeb/sendsso2cookietest&lt;/strong&gt;  :  this URI generates HTML content, it generates the string ACL of the certificate file.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Both only accept calls from HTTP POST method &lt;/p&gt;&lt;p&gt;The source code of the application can download from &lt;a href="http://www.4shared.com/file/143889124/e38eeabe/SsoGatewayWeb.html" target="_top"&gt;here&lt;/a&gt;. This application was developed with Spring MVC  2.0.8 and Json-Lib. Also it uses servelet technology.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This project also exports a client library that should be used for projects to integrate, this is called myssoext.jar. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; To test the latter URI(/SsoGatewayWeb/sendsso2cookietest ), an iView must be created as we seen in the first part of this blog, the only difference is that when you edit the iView should get in the attribute "URL Template" will have to go as follow:  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;&amp;lt;System.protocol&amp;gt;: / / &amp;lt;System.server&amp;gt;: &amp;lt;System.port&amp;gt;&lt;br /&gt;&amp;lt;System.uri&amp;gt;? &amp;lt;Authentication&amp;gt; &amp;amp; X509 = /my_path/on/destination_server/verify.pse&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Where x509 is the name of the parameter, by example, here is a file&lt;br /&gt;system path of the Unix platform. Another point to mention is that the file to test must be test into the SAP Portal that generated it, namely whether&lt;br /&gt;the file "verify.pse" was created on myserverX portal, then the iView must be in myserverX SAP Portal. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;2. Changing the Target Application &lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This integration involves changing&lt;br /&gt;the destination of the application code. In our case is a Struts J2EE web&lt;br /&gt;applications using Spring Framework and Strut Framework. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;This will import the library "myssoext.jar". Which contains the following claes and interfaces:&lt;br /&gt;&lt;br /&gt;com.mysap.sso.ILogonConstants&lt;br /&gt;com.mysap.sso.LogonTicketException&lt;br /&gt;&lt;br /&gt;pe.com.mydomain.ssoenablerapp.integration.ISso2TicketClient&lt;br /&gt;pe.com.mydomain.ssoenablerapp.integration.IValidateMySapTicketSso&lt;br /&gt;pe.com.mydomain.ssoenablerapp.integration.Sso2TicketHttpClient &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Based as it is developed the target applicaton is able to identify the URL to&lt;br /&gt;which you pass the SAP Logon Ticket, and this is where it performs&lt;br /&gt;the authentication of the application, the uri is:&lt;br /&gt;&lt;br /&gt;/strutsdemoweb/autentificar.do&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It will be directed by URI org.apache.struts.action.ActionServlet class&lt;br /&gt;of Struts Framework, and what direction, according to the&lt;br /&gt;struts-config.xml file, I have modified my customized class. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;I haved followed the next steps to fit my application with the gateway web application. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;1. Within base web.xml file, i have added a filter, i have used it for&lt;br /&gt;verification, it implements the interface pe.com.mydomain.ssoenablerapp.integration.IValidateMySapTicketSso.&lt;/em&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;The&lt;br /&gt;method "isValidateMySapSsoTicket", once implemented, should be called&lt;br /&gt;before any sentence in the filter class. This will validate the existence of the parameter&lt;br /&gt;"MYSAPSSO2" in the received implementation of the HttpServletRequest interface.&lt;br /&gt;If successful, will put two variables in session: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;IlogonConstants.TICKET_SESSION&lt;/strong&gt;&lt;/em&gt;: it defines that the SAP Logon Ticket, in the request, was read and achieved successfully&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;IlogonConstants.PORTAL_USER: &lt;/strong&gt;&lt;/em&gt;attachment containing the user in the SAP&lt;br /&gt;Logon Ticket, this should be the id of the user logged into the SAP&lt;br /&gt;Portal and will be used for validation against the target application. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Both constants are in the package "com.mysap.sso" within the library above.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;For this case must include the following libraries and their dependencies.&lt;br /&gt;a. &lt;em&gt;&lt;strong&gt;Json-lib&lt;/strong&gt;&lt;/em&gt;, in its version 2.2.3 (json-lib-2.2.3-jdk13.jar) and its dependencies&lt;br /&gt;  1.Jakarta commons-lang 2.4&lt;br /&gt;  2.Jakarta commons-beanutils 1.7.0 or higher&lt;br /&gt;  3.Jakarta commons-collections 3.2&lt;br /&gt;  4.Jakarta commons-logging 1.1.1&lt;br /&gt;  5.Ezmorph 1.0.6 &lt;/p&gt;&lt;p&gt;b.&lt;em&gt;&lt;strong&gt;Jakarta Commons Http Client in version 3.1&lt;/strong&gt;&lt;/em&gt; (HTTPClient-commons-3.1.jar) and its dependencies&lt;br /&gt;   1.Jakarta commons-codec 1.3.&lt;br /&gt;  2.Jakarta commons-logging 1.1.1 &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;br /&gt;2. After, we need to modify the customized struts action class. The most important&lt;br /&gt;thing here is to validate the presence of 2 previous variables in the scope&lt;br /&gt;"session" and executes the log-in of the user into the target application.&lt;/em&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;3. I have modified the application-context file of the spring framework to inject the HttpClient class.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;bean name = "httpClient"  class =&lt;br /&gt;"pe.com.mydomain.ssoenablerapp.integration.Sso2TicketHttpClient"&amp;gt;&lt;br /&gt;&amp;lt;property name="strUri" value="${sso2ticket.verifier.uri}"/&amp;gt;&lt;br /&gt;&amp;lt;property name="strScheme" value=&lt;br /&gt;        "${sso2ticket.authentication.scheme}" /&amp;gt;&lt;br /&gt;&amp;lt;property name="strCharacterEncoding" value =&lt;br /&gt;        "${sso2ticket.url.character.encoding}" /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;the propertyConfigurer bean.&lt;/p&gt;&lt;p&gt;    &amp;lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&amp;gt;&lt;br /&gt;    &amp;lt;property name="locations"&amp;gt;&lt;br /&gt;        &amp;lt;list&amp;gt;&amp;lt;value&amp;gt;classpath:configuration.properties&amp;lt;/value&amp;gt;&amp;lt;/list&amp;gt;&lt;br /&gt;    &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;4.We need to add configuration.properties at the  root of the classpath. It contains the following lines :&lt;/em&gt;&lt;/p&gt;&lt;p&gt;sso2ticket.url.character.encoding = UTF-8&lt;br /&gt;sso2ticket.authentication.scheme = basicauthentication&lt;br /&gt;sso2ticket.verifier.uri = /SsoGatewayWeb/ssojson.dtx&lt;br /&gt;&lt;br /&gt;the variable &lt;em&gt;sso2ticket.verifier.uri&lt;/em&gt; contains the URI of the gateway application that validate the SAP Logon Ticket.&lt;/p&gt;&lt;p&gt;the variable  sso2ticket.authentication.scheme is used by the UME API.&lt;/p&gt;&lt;p&gt;the variable  sso2ticket.url.character.encoding is used to create the cookie.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;. The most important in the code is after you have retrieved the user from the JSON string in the target application we must authenticate with the UME API like that:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Subject objSubject = UMFactory.getLogonAuthenticator().logon(request, response, strSchemeAux);&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;This code line allows to bypass the default login screen.&lt;/p&gt;&lt;p&gt;You can download &lt;a href="http://www.4shared.com/file/143879951/50e64e9f/ValidaSesionFilter.html" target="_top"&gt;here&lt;/a&gt; the java code with the mentioned previous code.&lt;/p&gt;&lt;p&gt;I hope than you can find useful the information on this blog.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Bye, see you later. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p style="margin-left: 2.54cm; margin-top: 0.42cm; line-height: 115%; widows: 2; orphans: 2;" align="JUSTIFY"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-1552969187264394318?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/1552969187264394318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=1552969187264394318' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/1552969187264394318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/1552969187264394318'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/10/how-to-integration-non-sap-j2ee-based_30.html' title='How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 2'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-8511650624230756056</id><published>2009-10-30T14:03:00.005-05:00</published><updated>2009-11-03T02:01:56.360-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Sso'/><title type='text'>How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 1</title><content type='html'>&lt;span style="font-style: italic;"&gt;We are going to integrate Non-SAP J2EE-based Web Applications into the SAP Portal with Application Integrator and SSO.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;In this part, I will discuss the overall of these posts and configure the iView with Application Integrator&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Overview of Integration.&lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To perform this integration must take into account the following steps:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;  Deployment of the portal application for the creation of the system portal object&lt;/li&gt;&lt;li&gt;Create and set the type of Application Integrator iView that will contain the applications to integrate.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Installing SAPSSOEXT and SAPSECU libraries&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Deployment of the application gateway called SsoGatewayWeb&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Changing the target application.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;This integration has the following restrictions:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; It applies only for web applications based on J2EE Servlet. &lt;/li&gt;&lt;li&gt; Depend exclusively on the sucessful load of the libraries supported by SAP (sapssoext and sapsecu) in both Windows and UNIX environments. &lt;/li&gt;&lt;li&gt;&lt;br /&gt;The target application must have created a profile for the user id&lt;br /&gt;logged to the SAP portal, this should be equal to the id with which the logged user is&lt;br /&gt;in the portal.&lt;/li&gt;&lt;li&gt;It must have well-defined a web resource in the&lt;br /&gt;target application that allows the "login" to be used by iView of type&lt;br /&gt;"Application Integrator". &lt;/li&gt;&lt;li&gt;This solution is only applied to a SAP NetWeaver Portal 7.0. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;These steps are broadly outlined below each of these steps.&lt;/p&gt;&lt;p&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;Detailed Description. &lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;1. &lt;/strong&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Deployment of the application for establishment of portal partner. &lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;We will need to  deploy the application of type "Portal Application" on the portal. The name of such applications is:&lt;br /&gt;&lt;br /&gt;com.cts.portal.appintegrator.webapp.par  (link)&lt;br /&gt;&lt;br /&gt;To install this applied to the portal will use the iView prescribed in:&lt;br /&gt;&lt;br /&gt;"System Administration"&amp;gt; "Support"&amp;gt; Link "Portal Runtime"&amp;gt; "Administration Console".&lt;br /&gt;&lt;br /&gt;To perform the action "Upload" ont "com.cts.portal.appintegrator.webapp.par" file as shown in Figure 1. &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura1.gif" alt="" height="500" width="700" /&gt; &lt;/p&gt;&lt;p&gt;Figura 1. Admnistration console - “Portal Anywhere Admin Tools” &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;The purpose of this portal application is to define an object of the type "system" that will use with the Application Integrator component.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now create the system  object type in the PCD, based on the deployed file.&lt;br /&gt;&lt;br /&gt;For this we must go to the iView "System Landscape Editor":&lt;br /&gt;"System Administration"&amp;gt; "System Configuration"&amp;gt; "System Landscape. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Next, we will create a template system that use to create system objects to be&lt;br /&gt;used individually by each iView of this type, as discussed below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;2.Template Creation System.&lt;br /&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;we will need to create a folder within "Portal Content" /&lt;br /&gt;"My Personal Content" with the same name of the application to integrate.&lt;br /&gt;Within it we'll create the folders: iView, Role and System. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;a. Inside the folder "system" will create an object "system" by making  use the option "System from PAR", see the Figure 2.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura2.gif" alt="" /&gt;  Figure 2. Creation of the System Template&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;b. Choose the option "com.cts.portal.appintegrator.webapp" associated with the portal application already deployed.  &lt;/p&gt;&lt;p&gt;c. In Step 2, choose the unique option shown: WebApplicationIntegrator&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;d. In the step 3, complete the following information:&lt;br /&gt;&lt;br /&gt; System Name: Web Application&lt;br /&gt;&lt;br /&gt; System ID: WebApplicationIntegrator&lt;br /&gt;&lt;br /&gt; System ID Prefix: com.cts.portal.appintegrator.webapp.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then we click on the button "Finish" and choose to open the object&lt;br /&gt;for editing, where you choose "Yes" in the attribute "Is a Template".&lt;br /&gt;See Figure 3.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura3.gif" alt="" /&gt;&lt;br /&gt;Figure 3. Edit Object "Template System.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, we must save the changes. And we have created a template system that&lt;br /&gt;will be used for any type SSO integracción using the Application&lt;br /&gt;Integrator.&lt;br /&gt;&lt;br /&gt;Next, we are going to detail the steps to integrate any web J2EE applications in the&lt;br /&gt;SAP Portal using SSO. In this case we show the integration of the&lt;br /&gt;application "My Struts Demo Web" which is deployed in an&lt;br /&gt;application server instance (SAP&lt;br /&gt;Netweaver Application Server 7.0).&lt;br /&gt;&lt;br /&gt;Before proceeding we should have in mind:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Must be configured Single Sign-On between both servers.&lt;/li&gt;&lt;li&gt;The target server must accept SAP Logon Ticket.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The servers to integrate must be in the same domain, in this special case: mydomain.com.pe&lt;/li&gt;&lt;li&gt;Every communication must be using the POST method and possibly&lt;br /&gt;encrypted communications using SSL, HTTPS could be configured on both&lt;br /&gt;servers&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;3. Creation of System "MyCustomizeStrutsSSO"&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;Now we will create an object system from the previously created template. Shown in Figure 4.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura4.gif" alt="" /&gt;&lt;/p&gt;&lt;p&gt; Figure 4. Creation of system&lt;br /&gt;MyCustomizeStrutsSSO&lt;/p&gt;&lt;p&gt; 1. First, we will choose the option "Web Application", as in Figure 5.&lt;/p&gt;&lt;p&gt; &lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura5.gif" alt="" /&gt;&lt;/p&gt;&lt;p&gt; Figure 5. Template Selection&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. In Step 2, fill the following information:&lt;br /&gt;&lt;br /&gt;System Name: Talking to Management&lt;br /&gt;&lt;br /&gt;System ID: MyPersonalSystem.&lt;br /&gt;&lt;br /&gt;System ID Prefix: pe.com.mydomain.ssointegration&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then we click on the button "Finish" and open the object for editing.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Within the "Property Editor", choose  from the attribute "Property Category" (the drop down component) the option: "Show All by Category".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. In the group "System Definition" adds the following values.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Name of Server: myserver1.mydomain.com.pe&lt;br /&gt;&lt;br /&gt;Port Number: 50100&lt;br /&gt;&lt;br /&gt;Protocol of the Target system: http&lt;br /&gt;URI of the web application: /strutsdemoweb/autentificar.do&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here the values that could vary, for this demonstration&lt;br /&gt;applications would be the server name, port number and perhaps the&lt;br /&gt;protocol of the target system.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. In the group of attributes "UserManagment, put the following values:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Logon Method: SAPLOGONTICKET&lt;br /&gt;&lt;br /&gt;User Mapping Type: User&lt;br /&gt;&lt;/p&gt;&lt;p&gt;      See Figure 6.&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura6.gif" alt="" /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Figure 6. Property Editor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. We ensure that not  be a template within the group properties "Info", and save our changes.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;7. Finally, we create an alias to our system. We choose from the drop down list of&lt;br /&gt;attribute "Display" under "System Aliases". And add the alias called&lt;br /&gt;"myStrutsAlias.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since the created system specifically for our target application, we will create the iView of "Application Integrator" type .&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;4.Creating iView  “MyStrutsWebSSO”. &lt;/strong&gt;&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;We need to go to the iView "Portal Content Studio" and choose the folder "iView" "we have created previously under the following path:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"Portal Content" / "My Personal Content" / "MyStrutsWebApplication"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Newxt, we'll  create a new iView in the selected folder, and we follow the following steps:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. First, we choose the type of iView to create: "Portal Component".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. In the first step select "com.sap.portal.appintegrator.sap.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. In the second step, selection of the portal component, choose "Generic".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. In Step 3, General Propeiedades we enter our View details for this case as follows:&lt;br /&gt;&lt;br /&gt;   iView Name: Talking to Management&lt;br /&gt;&lt;br /&gt;   iView ID: strutssso&lt;br /&gt;   iView ID Prefix: pe.com.mydomain.ssointegration&lt;br /&gt;&lt;br /&gt;   Master Language: English&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, make click on the "Finish" button and open the iView for editing, after we choose the property to be viewed by category.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the section "Content - Generic Launcher", configure the following attributes:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt; HTTP Request Method: POST&lt;br /&gt;&lt;/li&gt;&lt;li&gt; System: myStrutsAlias&lt;/li&gt;&lt;li&gt; URL Template:&lt;em&gt; &amp;lt;System.protocol&amp;gt;: / / &amp;lt;System.server&amp;gt;:&lt;br /&gt;&amp;lt;System.port&amp;gt; &amp;lt;System.uri&amp;gt;? &amp;lt;Authentication&amp;gt;&lt;/em&gt; &lt;/li&gt;&lt;li&gt; Template URL Fragment for Single Sign-On: MYSAPSSO2 = &lt;em&gt;&amp;lt;Request.SSO2Ticket&amp;gt; &lt;/em&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Finally save the changes.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This would be all we need about portal configuration worth&lt;br /&gt;mentioning that this iView must be assigned to an existing role or&lt;br /&gt;create a new one and assign the role to a existing portal user to&lt;br /&gt;visualize the result of the integration.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt; &lt;u&gt;5. Installing Libraries SAPSSOEXT and SAPSECU&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Having identified the operating system where our target&lt;br /&gt;application is deployed, we need to download  the libraries from  the SAP&lt;br /&gt;market place.&lt;br /&gt;&lt;br /&gt;In the following link, these components are mentioned.&lt;br /&gt;&lt;br /&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/12/9f244183bb8639e10000000a1550b0/frameset.htm&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Within the section "Dynamic Link Library SAPSSOEXT", we find the following:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;"....&lt;br /&gt;&lt;em&gt; Download&lt;br /&gt;&lt;br /&gt;From SAP Service Marketplace at service.sap.com / patches ®&lt;br /&gt;(Downloads tab) ® SAP Support Packages ® Support Packages and Patches ®&lt;br /&gt;Entry by Application Group ® Additional Components ® SAPSSOEXT ®&lt;br /&gt;&amp;lt;platform&amp;gt; ® SAPSSOEXT lib for SAP logon ticket &lt;/em&gt;&lt;/p&gt;&lt;p&gt;..."&lt;/p&gt;&lt;p&gt;We  must copy these libraries into the target server's file system. In case of Windows, should be under the system folder&lt;br /&gt;called "Windows" or any directory within the% PATH% directory. In the case of&lt;br /&gt;Unix or Linux, we must copy them into the folder $ LD_LIBRARY_PATH or $&lt;br /&gt;LIBPATH, depending on the platform.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt; &lt;u&gt;Please observe the following notes:&lt;br /&gt;&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;sapssoext (SAP note 1040335)&lt;br /&gt;&lt;br /&gt;sapsecu (SAP note 870138)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;br /&gt;6. &lt;u&gt;Recovery and Installation of SAP Portal Digital Certificate&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;We will recover the certificate file installed on the SAP Portal through the iView "Key Store Administration, under the following path:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"System Administration"&amp;gt; "System Configuration"&amp;gt; "Keystore Administration.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once inside the iView select "SAPLogonTicketKeypar-cert" from the&lt;br /&gt;drop down list, then click the button "Download file verify.pse. As&lt;br /&gt;shown in Figure 7. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/figura7.gif" alt="" /&gt;&lt;/p&gt;&lt;p&gt; Figure 7. Keystore Administration&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; The obtained file is copied into the file system folder of target application server. This location (URL) will be used later in the java coding.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Another important aspect is the ACL string we must have to generate,&lt;br /&gt;which also will be used in coding. This value is generated by following the next sintasis template:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt; "the id of the issuing system" + "|" + "the client of the issuing&lt;br /&gt;system" + "|" + "certification subject" + "|" + "certification issue" +&lt;br /&gt;"|" + "serial number certification"&lt;br /&gt;&lt;/em&gt;    &lt;br /&gt;&lt;br /&gt;For our case will be:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PNW | 000 | OU = J2EE, CN = PNW | OU = J2EE, CN = PNW | 00&lt;br /&gt;&lt;/p&gt;&lt;p&gt; Where:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the id of the issuing system: PNW&lt;br /&gt;&lt;br /&gt;the client of the issuing system: 000&lt;br /&gt;&lt;br /&gt;certification subject: OU = J2EE, CN = PNW&lt;br /&gt;&lt;br /&gt;certification issuer: OU = J2EE, CN = PNW&lt;br /&gt;&lt;br /&gt;certification serial number: 00&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Almost all this information is found in the previous picture. &lt;/p&gt;&lt;p&gt;In the second part of this blog, we will review to the code.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-8511650624230756056?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/8511650624230756056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=8511650624230756056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/8511650624230756056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/8511650624230756056'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/10/how-to-integration-non-sap-j2ee-based.html' title='How to .. Integration Non-SAP J2EE-based Web Applications into SAP Portal with SSO Part 1'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-1851264612895528187</id><published>2009-09-16T15:57:00.007-05:00</published><updated>2009-09-16T22:44:46.642-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QuickPoll'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 3rd part</title><content type='html'>&lt;p&gt;In this part, only we will focus in Flex client, also there are others parts, such as J2EE components, but here we don't consider here because they are out of scope of this blog. It includes  to consider the following parts:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create J2EE Web  Proyect, it will contain the flex client created with Flex Builder or &lt;a href="http://www.flashdevelop.org/" target="_blank"&gt;Flash Develop IDE&lt;/a&gt;. &lt;/li&gt;&lt;li&gt;Create EJB Project , it references to the java project  created in the 2nd part of this blog. Here, you'll need to create a stateless session bean, and after to expose some method as Web Service. The NWDS has a wizard to do this taskes. Also, you could create a Web Services directly of the Java project by making use of the NWDS wizards.&lt;/li&gt;&lt;li&gt; Create Flex Builder Project or FlashDevelop IDE, you create a flex client to consume the previuosly web services. &lt;/li&gt;&lt;li&gt; Create Enterprise Project; finally we will add the web and ejb project modules, previously created, to this kind project for deployment our ear file on SAP Netweaver AS 7.0+. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Now, you will review the MXML file of our flex client (we will name FlexWebService.mxml). The  main aspects of this file are the web services consumation, the treating of xml response from back end, and the datagrid flex component to show the data.&lt;/p&gt;&lt;p&gt;1. The web services part:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;    &amp;lt;mx:WebService id="myWebService"&lt;br /&gt;                   wsdl="http://myserver:50200/SimpleSearchPollWS/sspollconfigws?wsdl"&amp;gt;&lt;br /&gt;        &amp;lt;mx:operation name="getVotesPerCampaingXmlResponse"&lt;br /&gt;                      resultFormat="object"&lt;br /&gt;                      result="resultHandler(event)"&lt;br /&gt;                      fault="faultHandler(event)"&amp;gt;&lt;br /&gt;        &amp;lt;/mx:operation&amp;gt;&lt;br /&gt;    &amp;lt;/mx:WebService&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;In the wsdl attribute of the mx:WebService tag, we will put the wsdl url of the previously deployed web service.Also, in the tag mx:operation we mention the name of the method to call.&lt;/p&gt;&lt;p&gt;Note: We could consider to make use of the mx:HTTPService component with Servletes, but I have problems with the login sesion. SAP Netweaver AS has using the JASS login (user/password) module by default, then the Flex Client doesn't save the jsession variable of the current logged user and therefore the HTTPService doesn't work. May be by making use of flashvars we could integrate the SSO session on flex client (here some link of possible useful &lt;a href="http://www.thecelentanos.com/joe/flex/2008/02/getting-jsessionid-into-your-flex-app.html" target="_blank"&gt;resource &lt;/a&gt;). &lt;/p&gt;&lt;p&gt;2.  The treating of xml response from back end.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The response of the back-end need to be treat, then we write the actionscript method named &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;            private function resultHandler(event:ResultEvent):void&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This name is put on the "result" attribute of the mx:WebService attribute. Optionally, also we put on the "fault"attribute the name of the "faultHandler" function, in case of some error happen.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;            private function faultHandler(event:FaultEvent):void&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;3. The datagrid flex component to show the data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;We will create an ArrayColletion variable   (it needs to be Bindable) for to be used in the datagrid component.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;            [Bindable]&lt;br /&gt;           private var myData:ArrayCollection=new ArrayCollection;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;This collection will containt the DTO (data transfer object) objects. this kind of object   store the information from xml response. This collection containing the dto objects willbe used as data provider of the mx:Datagrid flex component.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;            &amp;lt;mx:DataGrid id="campaignGrid"&lt;br /&gt;                         dataProvider="{myData}"&lt;br /&gt;                         width="100%"&amp;gt;&lt;br /&gt;                &amp;lt;mx:columns&amp;gt;&lt;br /&gt;                    &amp;lt;mx:DataGridColumn dataField="name"&lt;br /&gt;                                       headerText="Nombre del Usuario"&lt;br /&gt;                                       width="220"/&amp;gt;&lt;br /&gt;                    &amp;lt;mx:DataGridColumn dataField="id"&lt;br /&gt;                                       headerText="Id de Usuario"/&amp;gt;&lt;br /&gt;                    &amp;lt;mx:DataGridColumn dataField="email"&lt;br /&gt;                                       headerText="Email"&lt;br /&gt;                                       width="200"/&amp;gt;&lt;br /&gt;                    &amp;lt;mx:DataGridColumn dataField="area"&lt;br /&gt;                                       headerText="Area/Departamento"&lt;br /&gt;                                       width="120"/&amp;gt;&lt;br /&gt;                    &amp;lt;mx:DataGridColumn dataField="response"&lt;br /&gt;                                       headerText="Contesto"&lt;br /&gt;                                       width="120"/&amp;gt;&lt;br /&gt;                &amp;lt;/mx:columns&amp;gt;&lt;br /&gt;            &amp;lt;/mx:DataGrid&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Once compiled and released the flex client, it will be integrated on the previously web project module.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Next, a screenshot of the  flex client.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/flex_client_qp.gif" alt="Flex Client" border="0" align="middle" height="245" width="699" /&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;You can download the Flex Builder project from &lt;a href="http://www.4shared.com/file/133170105/742d3820/FlexWebService.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-1851264612895528187?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/1851264612895528187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=1851264612895528187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/1851264612895528187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/1851264612895528187'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/09/show-user-data-of-every-response-for_16.html' title='Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 3rd part'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-3040249493305870084</id><published>2009-09-09T10:15:00.000-05:00</published><updated>2009-09-16T22:37:32.786-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QuickPoll'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 2nd part</title><content type='html'>&lt;p&gt;Only we'll review the main part of the method "getVotesPerCampaingResponse(Map map)" in the SearchService class. &lt;/p&gt;&lt;p&gt;Before to begin we need to consider the following items:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;com.sapportals.wcm.control.quickpoll.extension.QPResourceManager. &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;com.sapportals.wcm.repository.IResourceContext. &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;com.sap.security.api.IUser.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;In this operation we must take into account that the quick polls will be processed in according to the quick poll state: current and historical. Therefore, first we need to process the current quick poll and after to process the historical rapid quick polls of the requested campaign.&lt;br /&gt;&lt;br /&gt; &lt;p&gt;The main class is "&lt;b&gt;QPResourceManager&lt;/b&gt;", internally  it works with the &lt;i&gt;com.sapportals.wcm.control.quickpoll.extension.QPBaseService&lt;/i&gt; class. For to get one instance of the &lt;b&gt;QPResourceManager &lt;/b&gt;class, previously we need to get an instance of the com.sapportals.portal.security.usermanagement.IUser class, it'll reference to the portal service user "&lt;i&gt;cmadmin_service&lt;/i&gt;" and then get reference to the ResourceContext class.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Bellow I show the java code :&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;IUser objNwUser = UMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");&lt;br /&gt;com.sapportals.portal.security.usermanagement.IUser sapUser = WPUMFactory.getUserFactory().getEP5User(objNwUser);&lt;br /&gt;objResourceCtx = &lt;b&gt;new&lt;/b&gt; ResourceContext(sapUser);&lt;br /&gt;QPResourceManager objResourceManager = &lt;b&gt;new&lt;/b&gt; QPResourceManager(objResourceCtx);&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;We'll put the rigth value of the repository path of the Quick Poll Service (in our case  the value of  "/documents/QuickPoll"):&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;i&gt;      objResourceManager.setRepositoryPath(strRepositoryPath);&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Previously, the instance variable must be defined, as I show bellow:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt;            &lt;i&gt;private&lt;/i&gt;&lt;/b&gt;&lt;i&gt; String strRepositoryPath = "/documents/QuickPoll";&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Next, I write the code to retrieve and process the data of the current quick poll for the requested campaign.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;IPropertyName objP = PropertyName.getPN(strNamespace, "quickpollvote");&lt;br /&gt;ReportQuickPoll report = &lt;b&gt;new&lt;/b&gt; ReportQuickPoll();&lt;br /&gt;List lstResponses = &lt;b&gt;new&lt;/b&gt; ArrayList();&lt;br /&gt;Quickpoll objQP = objResourceManager.getCurrentQuickpoll(strCampaign);&lt;br /&gt;report.setNameCampaing(strCampaign);&lt;br /&gt;List lstQuickPolls = &lt;b&gt;new&lt;/b&gt; ArrayList();&lt;br /&gt;reporte.setListPolls(lstQuickPolls);&lt;br /&gt;&lt;b&gt;if&lt;/b&gt; (objQP != &lt;b&gt;null&lt;/b&gt;)&lt;br /&gt;{&lt;br /&gt;   QuickpollResponse objQPR = &lt;b&gt;null;&lt;br /&gt;    &lt;/b&gt;String strNameResource = strRepositoryPath + "/" + strCampaign + "/" + "qp.xml";&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt;(!existsResource(objResourceCtx, RID.getRID(strNameResource)))&lt;b&gt;&lt;br /&gt;        throw&lt;/b&gt; &lt;b&gt;new&lt;/b&gt; ApplicationException("Doesn't exist a current poll  in the KM for the requested campaign");&lt;br /&gt;   LineQuickPoll lineQP = &lt;b&gt;new&lt;/b&gt; LineQuickPoll();&lt;br /&gt;   lineQP.setNamePoll(objQP.getName());&lt;br /&gt;   lineQP.setQuestion(objQP.getQuestion());&lt;br /&gt;   lineQP.setStatePoll(IQuickPollConstants.STATUS_QP_OPENED_AT);&lt;br /&gt;   lineQP.setNameResourceKM(strNameResource);&lt;br /&gt;   List lstLineResponses = &lt;b&gt;new&lt;/b&gt; ArrayList();&lt;br /&gt;   //&lt;br /&gt;   // Create an ordered list with every options of the quick poll&lt;br /&gt;   //&lt;br /&gt;   &lt;b&gt;for&lt;/b&gt; (Iterator ite = objQP.getResponses().iterator(); ite.hasNext();) {&lt;br /&gt;       objQPR = (QuickpollResponse) ite.next();&lt;br /&gt;       lstResponses.add(objQPR.getText());&lt;br /&gt;    }&lt;br /&gt;    processLineResponses(objP, strNameResource, lineQP, lstResponses, lstQuickPolls);&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;After, into the methods processLineResponses and processProperty is the core of the service class because it retrieves the information from the quick poll engine, the user who made the vote of the current quick poll.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;private&lt;/b&gt; &lt;b&gt;void&lt;/b&gt; processLineResponses(IPropertyName objP, String strRIDResource, LineQuickPoll lineQP, List lstResponses, List lstQuickPolls )&lt;br /&gt;&lt;b&gt;throws&lt;/b&gt; WcmException, ResourceException{&lt;br /&gt;   lineQP.setNameResourceKM(strRIDResource);&lt;br /&gt;   RID objRID = RID.getRID(strRIDResource, &lt;b&gt;null&lt;/b&gt;);&lt;br /&gt;   resource = ResourceFactory.getInstance().getResource(objRID, objResourceCtx);&lt;/p&gt;&lt;p&gt;//&lt;br /&gt;// Getting the instance of the repository service that allow us to&lt;br /&gt;// extract the information about the related resource to the&lt;br /&gt;// current quick poll&lt;br /&gt;//&lt;br /&gt;   IApplicationProperties appProps = (IApplicationProperties) ResourceFactory.getInstance().getServiceFactory().getRepositoryService(resource.getRepositoryManager(), strRepositoryService);&lt;br /&gt;    IAppPropertyCollection collProp = appProps.getProperties(objP, resource);&lt;br /&gt;   LineResponse lineResponse = &lt;b&gt;null&lt;/b&gt;;&lt;br /&gt;   &lt;b&gt;int&lt;/b&gt; totVotes = 0;&lt;br /&gt;   IAppProperty objX = &lt;b&gt;null&lt;/b&gt;;&lt;br /&gt;   List listLineResponses = &lt;b&gt;new&lt;/b&gt; ArrayList();&lt;br /&gt;   &lt;b&gt;for&lt;/b&gt; (IAppPropertyIterator ite= collProp.iterator();ite.hasNext();){&lt;br /&gt;      objX = ite.next();&lt;br /&gt;      lineResponse = &lt;b&gt;new&lt;/b&gt; LineResponse();&lt;br /&gt;      //&lt;br /&gt;      // Process the quick poll response and get the user information&lt;br /&gt;      //&lt;br /&gt;      processProperty(lineResponse, objX, lstResponses);&lt;br /&gt;      listLineResponses.add(lineResponse);&lt;br /&gt;      totVotes++;&lt;br /&gt;   }&lt;br /&gt;   lineQP.setListUserResponses(listLineResponses);&lt;br /&gt;   lineQP.setTotalVotes(Integer.valueOf(String.valueOf(totVotes)));&lt;br /&gt;   lstQuickPolls.add(lineQP);&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;b&gt;private&lt;/b&gt; &lt;b&gt;void&lt;/b&gt; processProperty(LineResponse objLine, IAppProperty objAppProperty, List lstResponses) {&lt;br /&gt;   //&lt;br /&gt;   // Getting the user who response the quick poll.&lt;br /&gt;   //&lt;br /&gt;   String strUserId = objAppProperty.getUserID();&lt;br /&gt;   &lt;b&gt;try&lt;/b&gt; {&lt;br /&gt;      IUser objUser = UMFactory.getUserFactory().getUserByLogonID(strUserId);&lt;br /&gt;      objLine.setEmail(objUser.getEmail());&lt;br /&gt;      objLine.setUserName(objUser.getFirstName() + " " + objUser.getLastName());&lt;br /&gt;      objLine.setUserId(strUserId);&lt;br /&gt;      objLine.setArea(objUser.getDepartment());&lt;br /&gt;      String strValue = objAppProperty.getStringValue().replaceAll(";", "");&lt;br /&gt;      objLine.setResponse((String) lstResponses.get(Integer.parseInt(strValue)));&lt;br /&gt;   } &lt;b&gt;catch&lt;/b&gt; (UMException e) {&lt;br /&gt;     makeLogException(e);&lt;br /&gt;   }&lt;br /&gt;}&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Our most important statement in the above code is the sentence: &lt;/p&gt;&lt;p&gt;     &lt;i&gt;String strUserId = objAppProperty.getUserID();&lt;/i&gt;&lt;/p&gt;&lt;p&gt;It retrieves the user of current vote. Also we must remind that we have created a list named "lstResponses", it contains the names of every QuickpollResponse object of the quick poll. This list is ordered in according to the definition in the management iview of Quick Polls.&lt;/p&gt;&lt;p&gt;For to convert  java objects into the XML document we'll use an utility class. (you can find the source &lt;a href="http://www.topxml.com/rbnews/XML/re-2909_A-simple-class-for-converting-any-Java-object-to-XML-string.aspx" mce_href="http://www.topxml.com/rbnews/XML/re-2909_A-simple-class-for-converting-any-Java-object-to-XML-string.aspx" target="_blank"&gt;here&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;&lt;i&gt;     String strRet = OptimizedReflectionMarshaller.marshal(getVotesPerCampaingXmlResponse(map));&lt;/i&gt;&lt;/p&gt;&lt;p&gt;In the last part, we will review the RIA Flex client to show the final web report.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.4shared.com/file/131246623/d9f7af99/SimpleSearchJava.html" mce_href="http://www.4shared.com/file/131246623/d9f7af99/SimpleSearchJava.html" target="_blank"&gt;Here&lt;/a&gt; you can download the java project.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-3040249493305870084?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/3040249493305870084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=3040249493305870084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/3040249493305870084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/3040249493305870084'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/09/show-user-data-of-every-response-for_7714.html' title='Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 2nd part'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-2668610818381055481</id><published>2009-09-09T10:14:00.000-05:00</published><updated>2009-09-16T22:37:32.786-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QuickPoll'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 1st part</title><content type='html'>&lt;p&gt;In this first part, we will learn the basic about the SAP portal KM library km.appl.ui.quickpoll_api.jar and its configuration for our development environment.&lt;/p&gt;&lt;p&gt;The application that we are going to create will have:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;input: the name of campaign to review.&lt;/li&gt;&lt;li&gt;output: every user vote of the current quick poll with detail information of the user. As the figure 2.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;Before to begin we must take in account that the following things:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;The repository path for the quick poll is "/document/QuickPoll".&lt;/li&gt;&lt;li&gt;The name of the Quick Poll resource is qp.xml. It is for the current quick poll of the campaign. For the previous and closed quick poll they are located in the  history directory of the campaign.&lt;/li&gt;&lt;li&gt;The namespace of the quick poll service is "&lt;a href="http://sapportals.com/xmlns/cm:service.quickpoll.QPService" mce_href="http://sapportals.com/xmlns/cm:service.quickpoll.QPService" target="_top"&gt;http://sapportals.com/xmlns/cm:service.quickpoll.QPService&lt;/a&gt;".&lt;/li&gt;&lt;li&gt;The name of the portal service for quick poll is "AppPropertiesRepositoryService".&lt;/li&gt;&lt;li&gt;The name of the property is "quickpollvote" (&lt;a href="http://help.sap.com/javadocs/NW04S/current/km/com/sapportals/wcm/repository/PropertyName.html#getPN%28java.lang.String,%20java.lang.String%29" mce_href="http://help.sap.com/javadocs/NW04S/current/km/com/sapportals/wcm/repository/PropertyName.html#getPN(java.lang.String,%20java.lang.String)" target="_blank"&gt;link&lt;/a&gt;). This is the most important item because it contains all the info that we will need.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;Our final RIA web report will contain information about the every response of current quick poll for the requested campaign, data as full name of the user, email, organization, and finally the vote.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;We will create an xml document with the structure as the figure 1.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/qp_1.gif" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/qp_1.gif" alt="" border="0" height="493" width="317" /&gt;&lt;/p&gt;&lt;p&gt;Figure 1.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;The  design of the RIA client is shown in the figure 2.&lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/flex_qp.gif" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/flex_qp.gif" alt="" align="middle" border="0" height="240" width="693" /&gt;&lt;/p&gt;&lt;p&gt;Figure 2&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;We will create a simple Java project, after we are going to create our pojos entities with the similar structure  to the xml structure.&lt;/p&gt;&lt;p&gt;LineQuickPoll.java&lt;br /&gt;LineResponse.java&lt;br /&gt;ReportQuickPoll.java&lt;/p&gt;&lt;p&gt; &lt;/p&gt;These classes contain the following attributes with its setter and getter methods. Also  they are Serializable, but it is not necessary.&lt;b&gt; &lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;--  LineQuickPoll.java&lt;b&gt; --&lt;/b&gt;&lt;/p&gt;&lt;/b&gt;&lt;p&gt;&lt;b&gt;private &lt;/b&gt;String namePoll;&lt;br /&gt;&lt;b&gt;private &lt;/b&gt;String question;&lt;br /&gt;&lt;b&gt;private &lt;/b&gt;String statePoll;&lt;br /&gt;&lt;b&gt;private &lt;/b&gt;String nameResourceKM;&lt;br /&gt;&lt;b&gt;private &lt;/b&gt;Integer totalVotes;&lt;br /&gt;&lt;b&gt;private &lt;/b&gt;List listUserResponses;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;-- LineResponse.java --&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String userId;&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String userName;&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String email;&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String area;&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String response; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;-- ReportQuickPoll.java --&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; String nameCampaing;&lt;br /&gt;&lt;b&gt;private&lt;/b&gt; List listPolls;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Now, we are going to create our aplication service class, I will name it "SearchService" and it implements the ISearchService interface as I show in the following code.&lt;/p&gt;&lt;b&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;public interface ISearchService {&lt;br /&gt;   &lt;br /&gt;    /**&lt;br /&gt;     * Get the votes per user for the campaign in the current quick poll, the returned text is in an XML Format&lt;br /&gt;     * @param map&lt;br /&gt;     * @return         Return an XML text&lt;br /&gt;     * @throws ApplicationException&lt;br /&gt;     */&lt;br /&gt;    String getVotesPerCampaingXmlResponse(Map map) throws ApplicationException;&lt;br /&gt;   &lt;br /&gt;    /**&lt;br /&gt;     * Get the votes per user for the campaign in the current quick poll&lt;br /&gt;     * @param map&lt;br /&gt;     * @return        Return a ReportQuickPoll object&lt;br /&gt;     * @throws ApplicationException&lt;br /&gt;     */&lt;br /&gt;    ReportQuickPoll getVotesPerCampaingResponse(Map map) throws ApplicationException;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/b&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Also I have created a J2EE Server Component Library Project with the purpose to contain all SAP KMC libraries need by the java project, it is only to compilation time, because this libraries are part of the SAP Portal in runtime.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;In the next part we are going to review this service class in detail.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-2668610818381055481?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/2668610818381055481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=2668610818381055481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/2668610818381055481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/2668610818381055481'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/09/show-user-data-of-every-response-for_09.html' title='Show the user data of every response for the current Quick Poll in the campaign in a Flex Client, 1st part'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-4142888691598197324</id><published>2009-08-18T08:24:00.002-05:00</published><updated>2009-09-16T22:38:22.862-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Transaction'/><title type='text'>How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in J2EE Applications, Part 2</title><content type='html'>&lt;p&gt;In the previous part (&lt;a href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14040" mce_href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14040" target="_top"&gt;&lt;/a&gt; &lt;a href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14040" mce_href="http://mloayzagahona.blogspot.com/2009/05/how-to-use-global-transactions-and-data.html" target="_top"&gt;1st&lt;/a&gt;) , we saw how to configure SAP JTA Transaction into the Spring Context, now we are going to review the SAP J2EE Datasources. &lt;/p&gt;&lt;p&gt;We need to review two parts:&lt;/p&gt;&lt;p&gt;1. Configuration of the JEE datasources in the  data-sources.xml file (in according to the SAP AS Platform).&lt;/p&gt;&lt;p&gt; In the next picture, you can see the last file that I used in my project  &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_1.GIF" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_1.GIF" alt="data-sources.xml" border="0" /&gt;&lt;/p&gt;&lt;p&gt;In this image you can see the definition of the Driver JDBC (2nd box), it needs to be set-up in the Visual Administrator. After, you see the sql-engine tag, it allows us to define the SQL type support (&lt;a href="http://help.sap.com/saphelp_nw04s/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/frameset.htm" mce_href="http://help.sap.com/saphelp_nw04s/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/frameset.htm" target="_top"&gt;help&lt;/a&gt;). The valid values are (&lt;a href="http://help.sap.com/saphelp_nw04s/helpdata/en/64/0bee3da7138e5be10000000a114084/frameset.htm" mce_href="http://help.sap.com/saphelp_nw04s/helpdata/en/64/0bee3da7138e5be10000000a114084/frameset.htm" target="_top"&gt;link&lt;/a&gt;): &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Open_SQL: the system returns a DBI CommonConnection&lt;/li&gt;&lt;li&gt;Native_SQL: the system returns a DBI DirectConnection&lt;/li&gt;&lt;li&gt;Vendor_SQL: the system returns a standard connection from JDBC driver (not using DBI at all)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; In this case, I have used the value of Vendor_SQL because I have used iBatis in my persistence layer and not the persistence engines of SAP NW AS (jdo or entity beans). &lt;/p&gt;&lt;p&gt; Finally, you need to define the connection parameters as user, password, driver class name, and url parameters. &lt;/p&gt;&lt;p&gt;2. The configuration of Spring Application context. &lt;/p&gt;&lt;p&gt;In the first picture (in the 1st box on the picture), you can see the name of the datasource, we will use this name  in the spring application contexte file, with the standard prefix "jdbc/" how the following picture shows &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_2.GIF" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_2.GIF" alt="spring application context  file" border="0" height="294" width="655" /&gt;&lt;/p&gt;&lt;p&gt; We need to create 2 beans to able the j2ee datasources in our development. The first bean is named "serviceLocator" and the 2nd the bean dataSource.&lt;/p&gt;&lt;p&gt;The bean serviceLocator is a bean factory to the dataSource bean, where the factory method "getDataSource" is defined in the class implementation of the bean serviceLocator.The implementation of this bean complais with the singleton pattern and in the bean definition also its scope is singleton. You could use obly the scope spring definition of the beans. &lt;/p&gt;&lt;p&gt;You ask yourself why you don't use "org.springframework.jndi.JndiObjectFactoryBean" or &lt;jee:jndi-lookup&gt; tag. &lt;/jee:jndi-lookup&gt;&lt;/p&gt; &lt;pre class="programlisting"&gt;&lt;bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;&lt;br /&gt;&lt;property name="jndiName" value="jdbc/MyDataSource"&gt;&lt;br /&gt;&lt;/property&gt;&lt;/bean&gt;&lt;/pre&gt;&lt;pre class="programlisting"&gt;&lt;jee:jndi-lookup id="simple" name="jdbc/MyDataSource"&gt;&lt;/jee:jndi-lookup&gt;&lt;/pre&gt; Well, I have tried them, but I didn't have success. &lt;p&gt;Finally, the name of the j2ee datasource is defined as parameter constructor for the dataSource bean. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.4shared.com/get/125080233/5253015f/classes.html" mce_href="http://www.4shared.com/get/125080233/5253015f/classes.html" target="_top"&gt;Here the related source  files.&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-4142888691598197324?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/4142888691598197324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=4142888691598197324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/4142888691598197324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/4142888691598197324'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/08/how-to-use-global-transactions-and-data_18.html' title='How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in J2EE Applications, Part 2'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-8839989916045322385</id><published>2009-08-18T08:24:00.001-05:00</published><updated>2009-09-16T22:38:22.862-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Transaction'/><title type='text'>How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in J2EE Applications, Part 2</title><content type='html'>&lt;p&gt;In the previous part (&lt;a href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14040" mce_href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14040" target="_top"&gt;1st&lt;/a&gt;), we saw how to configure SAP JTA Transaction into the Spring Context, now we are going to review the SAP J2EE Datasources. &lt;/p&gt;&lt;p&gt;We need to review two parts:&lt;/p&gt;&lt;p&gt;1. Configuration of the JEE datasources in the  data-sources.xml file (in according to the SAP AS Platform).&lt;/p&gt;&lt;p&gt; In the next picture, you can see the last file that I used in my project  &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_1.GIF" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_1.GIF" alt="data-sources.xml" border="0" /&gt;&lt;/p&gt;&lt;p&gt;In this image you can see the definition of the Driver JDBC (2nd box), it needs to be set-up in the Visual Administrator. After, you see the sql-engine tag, it allows us to define the SQL type support (&lt;a href="http://help.sap.com/saphelp_nw04s/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/frameset.htm" mce_href="http://help.sap.com/saphelp_nw04s/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/frameset.htm" target="_top"&gt;help&lt;/a&gt;). The valid values are (&lt;a href="http://help.sap.com/saphelp_nw04s/helpdata/en/64/0bee3da7138e5be10000000a114084/frameset.htm" mce_href="http://help.sap.com/saphelp_nw04s/helpdata/en/64/0bee3da7138e5be10000000a114084/frameset.htm" target="_top"&gt;link&lt;/a&gt;): &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Open_SQL: the system returns a DBI CommonConnection&lt;/li&gt;&lt;li&gt;Native_SQL: the system returns a DBI DirectConnection&lt;/li&gt;&lt;li&gt;Vendor_SQL: the system returns a standard connection from JDBC driver (not using DBI at all)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; In this case, I have used the value of Vendor_SQL because I have used iBatis in my persistence layer and not the persistence engines of SAP NW AS (jdo or entity beans). &lt;/p&gt;&lt;p&gt; Finally, you need to define the connection parameters as user, password, driver class name, and url parameters. &lt;/p&gt;&lt;p&gt;2. The configuration of Spring Application context. &lt;/p&gt;&lt;p&gt;In the first picture (in the 1st box on the picture), you can see the name of the datasource, we will use this name  in the spring application contexte file, with the standard prefix "jdbc/" how the following picture shows &lt;/p&gt;&lt;p&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_2.GIF" mce_src="https://weblogs.sdn.sap.com/weblogs/images/251962319/2nd_2.GIF" alt="spring application context  file" border="0" height="294" width="655" /&gt;&lt;/p&gt;&lt;p&gt; We need to create 2 beans to able the j2ee datasources in our development. The first bean is named "serviceLocator" and the 2nd the bean dataSource.&lt;/p&gt;&lt;p&gt;The bean serviceLocator is a bean factory to the dataSource bean, where the factory method "getDataSource" is defined in the class implementation of the bean serviceLocator.The implementation of this bean complais with the singleton pattern and in the bean definition also its scope is singleton. You could use obly the scope spring definition of the beans. &lt;/p&gt;&lt;p&gt;You ask yourself why you don't use "org.springframework.jndi.JndiObjectFactoryBean" or &lt;jee:jndi-lookup&gt; tag. &lt;/jee:jndi-lookup&gt;&lt;/p&gt; &lt;pre class="programlisting"&gt;&lt;bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;&lt;br /&gt;  &lt;property name="jndiName" value="jdbc/MyDataSource"&gt;&lt;br /&gt;&lt;/property&gt;&lt;/bean&gt;&lt;/pre&gt;&lt;pre class="programlisting"&gt;&lt;jee:jndi-lookup id="simple" name="jdbc/MyDataSource"&gt;&lt;/jee:jndi-lookup&gt;&lt;/pre&gt; Well, I have tried them, but I didn't have success. &lt;p&gt;Finally, the name of the j2ee datasource is defined as parameter constructor for the dataSource bean. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.4shared.com/get/125080233/5253015f/classes.html" mce_href="http://www.4shared.com/get/125080233/5253015f/classes.html" target="_top"&gt;Here the related source  files.&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-8839989916045322385?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/8839989916045322385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=8839989916045322385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/8839989916045322385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/8839989916045322385'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/08/how-to-use-global-transactions-and-data.html' title='How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in J2EE Applications, Part 2'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-2954332718507325218</id><published>2009-05-26T10:20:00.001-05:00</published><updated>2009-09-16T22:38:22.862-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Portal'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Transaction'/><title type='text'>How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in SAP Netweaver Aplication Server 7.0, Part 1</title><content type='html'>&lt;p&gt;For this part, we will create, build and deploy a J2EE Application on SAP AS 7.0 with J2SE 1.4, and the version of &lt;a href="http://www.springsource.org/about" target="_top"&gt;Spring Framework&lt;/a&gt; is &lt;a href="http://www.springsource.org/download" target="_top"&gt;2.0.8&lt;/a&gt; because it is the last one that can be supported by J2SE 1.4. &lt;/p&gt;&lt;p&gt;For the Spring XML configuration we will use the XML configuration syntax based on XML Schema, also we could use syntax based on XML DTD for backward compatibility. Because of we are using J2SE 1.4, we will need a parser that supports XML Schema like &lt;a href="http://xerces.apache.org/xerces-j/" target="_blank"&gt;Xerces.&lt;/a&gt;&lt;/p&gt;&lt;p&gt; We need to remind that when you create an application with transaction support, we could use 2 type of transaction:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Local Transaction&lt;/em&gt; are     resource-specific (by example when only we work with one resource that needs transaction support like jdbc connection).&lt;/li&gt;&lt;li&gt;&lt;em&gt;Global Transaction &lt;/em&gt;are managed by the application server using JTA, it provide the ability to work with multiple transactional resources (by example when we work atleast two resources that need transaction support like jdbc connection, and jca connection).&lt;/li&gt;&lt;/ul&gt;Now, we must follow the next steps:&lt;br /&gt;&lt;p&gt;1. Create a Java Project and add the Spring Libraries and its dependence libraries, and Xerces library too. Here, we will create the Spring XML Configuration file like Figure 1. &lt;/p&gt;&lt;table align="center" border="0" cellpadding="0" cellspacing="0" height="30" width="68"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/first_1.gif" alt="" border="0" height="465" width="652" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center" valign="middle"&gt;&lt;td&gt; Figure 1&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt; Here, we are using the new Spring AOP Tags to use transaction in our application. The most important thing related to this blog is the transaction-manager attribute of the tx:advice tag.&lt;/p&gt;&lt;p&gt;2. We will create the Spring bean to control the transaction.  It is the transaction manager bean like the figure 2.&lt;/p&gt;&lt;table align="center" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/second.gif" alt="transaction manager" align="texttop" border="0" height="245" hspace="0" vspace="0" width="581" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center" valign="middle"&gt;&lt;td&gt; Figure 2&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt; In this part, we are using the default name for the transaction manager bean. Also, we are declaring 2 properties: &lt;strong&gt;&lt;em&gt;userTransactionName &lt;/em&gt;&lt;/strong&gt;and &lt;strong&gt;&lt;em&gt;transactionManagerName. &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The default JNDI location for the JTA UserTransaction is java:comp/UserTransaction, but in the SAP AS the JNDI Name for it is "&lt;strong&gt;&lt;em&gt;UserTransaction&lt;/em&gt;&lt;/strong&gt;", it is reason because we will use it on the &lt;em&gt;userTransactionName &lt;/em&gt;property of the "transactionManager" Spring bean. The other property, transactionManagerName, is necessary for suspending and resuming transactions, as this not supported by the UserTransaction interface. The TransactionManager will be autodetected if the JTA UserTransaction object implements the JTA TransactionManager interface too, but how we don't know the exactly implementation of the JTA UserTransaction interface, it is better to use the right JNDI value on the SAP AS ("ts"). &lt;/p&gt;&lt;p&gt;This Spring bean "transactionManager" is used in the advice with id "&lt;em&gt;myServiceTxAdvice&lt;/em&gt;". It give us the posibility to use global transactions in our code. It together with pointcut named "&lt;em&gt;serviceOperation&lt;/em&gt;" allows to wrap every method on the class MyService that follow the expression "&lt;em&gt;&lt;strong&gt;execution(* *..service.MyService.*(..))&lt;/strong&gt;&lt;/em&gt;".&lt;/p&gt;&lt;p&gt; The Spring XML configuration file could be used in Spring MVC proyect,  or Java project with some class to load the Spring Xml file (by example using the  org.springframework.context.support.ClassPathXmlApplicationContext class as Figure 3). &lt;/p&gt;&lt;table align="center" border="0" cellpadding="0" cellspacing="0" height="312" width="565"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="https://weblogs.sdn.sap.com/weblogs/images/251962319/third.gif" alt="" border="0" height="294" hspace="0" vspace="0" width="561" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center" valign="middle"&gt;&lt;td&gt; Figure 3&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;The next part of this blog we learn about how to use J2EE Data sources on J2EE Application with Spring Framework on SAP AS 7.0&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-2954332718507325218?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/2954332718507325218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=2954332718507325218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/2954332718507325218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/2954332718507325218'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2009/05/how-to-use-global-transactions-and-data.html' title='How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in SAP Netweaver Aplication Server 7.0, Part 1'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-3438218219887354515</id><published>2007-07-22T05:32:00.002-05:00</published><updated>2009-09-26T12:02:45.080-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><title type='text'>Convert HTML Content to PDF format using Java</title><content type='html'>&lt;span style="font-size:100%;"&gt;I have researched about to convert HTML to PDF.&lt;br /&gt;I got 2 approaches.&lt;br /&gt;&lt;br /&gt;1. Using Tidy and XSL-FO.&lt;br /&gt;2. Using the project xhtmlrenderer&lt;br /&gt;&lt;br /&gt;Basically the  1st approach is :&lt;br /&gt;&lt;br /&gt;1. Your HTML will need to be validate in according to XHTML, for this you could use &lt;a href="http://tidy.sourceforge.net/"&gt;Tidy&lt;/a&gt;.&lt;br /&gt;2. After you will need to transform this new XHTML document in XLS-FO, you can review this &lt;a href="http://www.antennahouse.com/XSLsample/XSLsample.htm"&gt;link&lt;/a&gt;  to find the stylesheet resource (&lt;span style="font-style:italic;"&gt;XHMTL to XLS-FO&lt;/span&gt;).&lt;br /&gt;3. Finally, convert your XLS-FO document in a PDF document.&lt;br /&gt;&lt;br /&gt;There are 2 links that could help with this approach:&lt;br /&gt;&lt;br /&gt;http://www.onjava.com/lpt/a/3924&lt;br /&gt;http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html&lt;br /&gt;&lt;br /&gt;The 2nd approach is using the project xhtmlrenderer &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;(https://xhtmlrenderer.dev.java.net/)&lt;br /&gt;This is easier than 1st approach. This tool hides the steps mentioned in the 1st approach and use CSS.&lt;br /&gt;This project uses a CSS parser (http://sourceforge.net/projects/cssparser/).&lt;br /&gt;the unique problem the I found out was when you want to use external CSS file in your HTML file.&lt;br /&gt;&lt;br /&gt;In the example used in the project I had modified (red highlighted) :&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;    &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; String css = "../webapps/myContext/PDFservlet.css";&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;     // put in some style&lt;br /&gt;     buf.append("&amp;lt;head&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;link rel='stylesheet' type='text/css' "+&lt;br /&gt;             "href='"+css+"' media='print'/&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;/head&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;");&lt;br /&gt;....&lt;br /&gt;         Document doc = builder.parse( input );&lt;br /&gt;         ITextRenderer renderer = new ITextRenderer();&lt;br /&gt;        &lt;span style="color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;renderer.setDocument(doc, null);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I have  deployed the project in Tomcat 5.5. The  problem was related to find the  css file by the renderer (URI and BASE URL). &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;Too, If your HTML is not validate in according to XHTML you should use Tidy(Jtidy).&lt;br /&gt;Both approach made use of iText library(&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="a"&gt;www.lowagie.com/&lt;b&gt;iText&lt;/b&gt;/ &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-3438218219887354515?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/3438218219887354515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=3438218219887354515' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/3438218219887354515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/3438218219887354515'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2007/07/convert-html-to-pdf-online.html' title='Convert HTML Content to PDF format using Java'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6401947770236962726.post-4822791657471027648</id><published>2007-07-01T12:59:00.000-05:00</published><updated>2009-09-16T22:38:03.457-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>How to use Static resource in shale for remoting access enhanced with AJAX</title><content type='html'>Yesterday I have found out how to use static resource in Shale framework.&lt;br /&gt;&lt;br /&gt;I wanted to enhance the Use Case example of Shale using Prototype for AJAX support. Then  I found out my problem with static resources in Shale framework was resolved with the next steps&lt;br /&gt;&lt;br /&gt;1. In the web file descriptor (web.xml)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;&amp;lt;param-name&amp;gt;&lt;br /&gt;org.apache.shale.remoting.CLASS_RESOURCES&lt;br /&gt;&amp;lt;/param-name&amp;gt;&lt;br /&gt;&amp;lt;param-value&amp;gt;&lt;br /&gt;/static/*:org.apache.shale.remoting.impl.ClassResourceProcessor&lt;br /&gt;&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;&amp;lt;param-name&amp;gt;&lt;br /&gt;org.apache.shale.remoting.DYNAMIC_RESOURCES&lt;br /&gt;&amp;lt;/param-name&amp;gt;&lt;br /&gt;&amp;lt;param-value&amp;gt;&lt;br /&gt;/dynamic/*:org.apache.shale.remoting.impl.MethodBindingProcessor&lt;br /&gt;&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;&amp;lt;param-name&amp;gt;&lt;br /&gt;&lt;br /&gt;org.apache.shale.remoting.WEBAPP_RESOURCES&lt;br /&gt;&amp;lt;/param-name&amp;gt;&lt;br /&gt;&amp;lt;param-value&amp;gt;&lt;br /&gt;/webapp/*:org.apache.shale.remoting.impl.WebResourceProcessor&lt;br /&gt;&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. In your jsp files:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;     &amp;lt;script type="text/javascript" language="Javascript1.1"&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;src="&amp;lt;%= request.getContextPath() %&amp;gt;/webapp/resource/js/prototype-1.4.0.js.faces" &gt;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &amp;lt;script type="text/javascript" language="Javascript1.1"&amp;gt;&lt;br /&gt;       // zipChanged(zip) is called when a selection is made&lt;br /&gt;       // from the zip code menu.&lt;br /&gt;&lt;br /&gt;       function zipChanged(zip) {&lt;br /&gt;          var url = '&lt;%= request.getContextPath() %&gt;' +&lt;br /&gt;'/dynamic/remoting$business/objetoAjaxForZip.faces';&lt;br /&gt;&lt;br /&gt;           // Use Prototype's Ajax.Request for remoting&lt;br /&gt;           var pars = "zip=" + escape(zip);&lt;br /&gt;&lt;br /&gt;           var myAjax = new Ajax.Request(&lt;br /&gt;                       url,&lt;br /&gt;                       {&lt;br /&gt;                        method: 'get',&lt;br /&gt;                        parameters: pars,&lt;br /&gt;                        onComplete: processZipCodeSelection&lt;br /&gt;                       }&lt;br /&gt;                      );&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;...&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;These step was based the next uri:&lt;br /&gt;&lt;br /&gt;&lt;a target="new" href="http://shale.apache.org/shale-remoting/apidocs/org/apache/shale/remoting/package-summary.html"&gt;Click here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6401947770236962726-4822791657471027648?l=mloayzagahona.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mloayzagahona.blogspot.com/feeds/4822791657471027648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6401947770236962726&amp;postID=4822791657471027648' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/4822791657471027648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6401947770236962726/posts/default/4822791657471027648'/><link rel='alternate' type='text/html' href='http://mloayzagahona.blogspot.com/2007/07/how-to-use-static-resource-in-shale-for.html' title='How to use Static resource in shale for remoting access enhanced with AJAX'/><author><name>Manuel Enrique</name><uri>http://www.blogger.com/profile/02934461591457080475</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_Gx4E_9epLNg/St_ZplZpM2I/AAAAAAAAABM/lL3qdWuL39s/S220/manuel_3.jpg'/></author><thr:total>1</thr:total></entry></feed>
