tag:blogger.com,1999:blog-3119706039531506252024-03-08T15:11:29.306-06:00Mangaya's BlogMangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-311970603953150625.post-14165765241174146202009-12-11T14:30:00.021-06:002009-12-15T10:18:22.342-06:00Place any window to the center of the screen<div style="font-family: inherit;">Placing the component in the center of the visible are of the screen. This helps to place the component to<br />
</div><div style="font-family: inherit;">the center of the screen as we scroll the page content. It supports following browsers IE 6, IE 7, FireFox, Netscape<br />
</div><div style="font-family: inherit;"></div><div style="font-family: inherit;">Below function, get the page horizontal/vertical scrolling offsets of the page.<br />
<div style="background-color: white; color: blue;"><span style="font-size: x-small;"><b>getPageScrolling</b> = function ()</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;">{</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> var scrollX = 0;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> var scrollY = 0;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> if (document.documentElement &&</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> typeof document.documentElement.scrollLeft === "number")</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> { </span><span style="color: #274e13; font-size: x-small;"> <span style="color: blue;">// IE compliant. IE compliant must be before DOM compliant since IE</span></span><br />
</div><div style="background-color: white; color: blue;"><span style="font-size: x-small;"> // always returns 0 for the DOM compliant access. IE's hack always</span><br />
</div><div style="background-color: white; color: blue;"><span style="font-size: x-small;"> // returns the correct value.</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollX = document.documentElement.scrollLeft;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollY = document.documentElement.scrollTop;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> }</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> else if (typeof window.pageYOffset === "number")</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> { </span><span style="color: #274e13; font-size: x-small;">// Netscape compliant.</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollX = window.pageXOffset;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollY = window.pageYOffset;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> }</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> else if (document.body && typeof document.body.scrollLeft === "number")</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> { </span><span style="color: #274e13; font-size: x-small;">// DOM compliant. IE will always return 0 in this case.</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollX = document.body.scrollLeft;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> scrollY = document.body.scrollTop;</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> }</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;"> return { scrollX: scrollX, scrollY: scrollY };</span><br />
</div><div style="background-color: white;"><span style="font-size: x-small;">};</span><br />
</div><div style="background-color: #fce5cd;">Get the viewport width/height of the screen. This returns the width/height of the visible area of the browser.<br />
</div><div style="background-color: white;"><div style="color: blue;"><span style="font-size: x-small;"><b>getViewportSize </b>= function ()</span><br />
</div><span style="font-size: x-small;">{</span><br />
<span style="font-size: x-small;"> var width = 0;</span><br />
<span style="font-size: x-small;"> var height = 0;</span><br />
<span style="font-size: x-small;"> if (document.documentElement &&</span><br />
<span style="font-size: x-small;"> typeof document.documentElement.clientWidth === "number")</span><br />
<span style="font-size: x-small;"> {</span><br />
<span style="font-size: x-small;"> width = document.documentElement.clientWidth;</span><br />
<span style="font-size: x-small;"> height = document.documentElement.clientHeight;</span><br />
<span style="font-size: x-small;"> }</span><br />
<span style="font-size: x-small;"> else if (document.body && typeof document.body.clientWidth === "number")</span><br />
<span style="font-size: x-small;"> {</span><br />
<span style="font-size: x-small;"> width = document.body.clientWidth;</span><br />
<span style="font-size: x-small;"> height = document.body.clientHeight;</span><br />
<span style="font-size: x-small;"> }</span><br />
<span style="font-size: x-small;"> else if (typeof window.innerWidth === "number")</span><br />
<span style="font-size: x-small;"> {</span><br />
<span style="font-size: x-small;"> width = window.innerWidth - 18;</span><br />
<span style="font-size: x-small;"> height = window.innerHeight - 18;</span><br />
<span style="font-size: x-small;"> }</span><br />
<span style="font-size: x-small;"> return { width: width, height: height };</span><br />
<span style="font-size: x-small;">};</span><br />
</div><div style="background-color: #fce5cd;">Function that is used to continuously update the component so that it is always centered in the current viewport.<br />
</div><div style="background-color: white;"><div style="color: #274e13;"><span style="font-size: x-small;">/**</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * @param component Reference to the DOM element that represents the component</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * "window" that is being centered.</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"></span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * @return Centering function for component window - creates a closure around the</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * DOM element that should be centered in the viewport.</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> */</span><br />
</div><span style="font-size: x-small;"><b style="color: blue;">getUpdateFn </b></span><span style="color: blue; font-size: x-small;">= function (component)</span><span style="font-size: x-small;"> {</span><br />
<span style="font-size: x-small;"> return function () {</span><br />
<span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"> </span><span style="color: #274e13; font-size: x-small;">// Calculate the Height/Width of the component</span><br />
<span style="font-size: x-small;"> var componentSize = getcomponentSize(component);</span><br />
<span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"> </span><span style="color: #274e13; font-size: x-small;">// Calculate the Viewport Height/Width</span><br />
<span style="font-size: x-small;"> var viewportSize = getViewportSize();</span><br />
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"> </span><span style="color: #274e13; font-size: x-small;">// Calculate the Page Scrolling</span><br />
<span style="font-size: x-small;"> var pageScroll = getPageScrolling();</span><br />
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"> </span><span style="color: blue; font-size: x-small;"> </span><span style="color: #274e13; font-size: x-small;">// Calculate the coordinates to center component</span><br />
<span style="font-size: x-small;"> var pageX =</span><br />
<span style="font-size: x-small;"> pageScroll.scrollX + ((viewportSize.width - componentSize.width) / 2);</span><br />
<span style="font-size: x-small;"> var pageY =</span><br />
<span style="font-size: x-small;"> pageScroll.scrollY + ((viewportSize.height - componentSize.height) / 2);</span><br />
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"> </span><span style="color: #274e13; font-size: x-small;"> // Update component Window coordinates</span><br />
<span style="font-size: x-small;"> component.style.top = pageY + "px";</span><br />
<span style="font-size: x-small;"> component.style.left = pageX + "px";</span><br />
<span style="font-size: x-small;"> };</span><br />
<span style="font-size: x-small;">};</span><br />
</div><div style="background-color: #fce5cd;">Get the width/height of the specified component, that needs to placed to the center of the screen. This returns the current width/height needed to display the specified component.<br />
</div><div style="background-color: white;"><div style="color: #274e13;"><span style="font-size: x-small;">/**</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * @param component The component to calculate the width/height of</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"></span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> * @return The width/height of the specified component</span><br />
</div><div style="color: #274e13;"><span style="font-size: x-small;"> */</span><br />
</div><div style="color: blue;"><span style="font-size: x-small;"><b>getcomponentSize </b>= function (component)</span><br />
</div><span style="font-size: x-small;">{</span><br />
<span style="font-size: x-small;"> return { width: component.offsetWidth, height: component.offsetHeight };</span><br />
<span style="font-size: x-small;">};</span><br />
</div></div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-17359098616004505702009-12-08T09:10:00.001-06:002009-12-08T09:11:33.565-06:00Upload file to Server<div style="font-family: inherit;"><style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style> <![endif]--> <br />
</div><div class="MsoNormal"><span style="font-size: 9pt;"><span></span><span style="font-size: small;">Upload the file to the server using the Http Connection. The File content is read as Input Stream and then uploaded to the server through the connections</span><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-size: 9pt;"><span></span><span style="font-size: x-small;">public void sendFile(final String uri, final InputStream istream)<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>throws EvoxException<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>{<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>try<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>{<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>// Setup HTTP Connection<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>final URL evoxUrl = new URL(this.evoxServer + uri);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>final HttpURLConnection connection =<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span> </span>(HttpURLConnection) evoxUrl.openConnection();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>connection.setRequestMethod(RequestType.POST.name());<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>connection.setDoInput(true);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>connection.setDoOutput(true);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>// Get Output Stream<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>final OutputStream ostream = connection.getOutputStream();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>FileUtils.copyStreams(istream, ostream);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>ostream.close();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>final PrintWriter writer =<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span> </span>new PrintWriter(connection.getOutputStream());<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>// Send File<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>writer.println(ostream);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>writer.flush();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>writer.close();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>connection.getInputStream();<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>}<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>catch (IOException exception)<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span>{<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span> </span>throw new Exception("unable to send file: " + uri,<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span> </span>exception);<o:p></o:p></span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span><span></span>}}</span></span><br />
</div><div class="MsoNormal"><span style="font-size: x-small;"><span>If the file is uploaded to the server make sure you close the connection if not needed, if not it will windup keeping lots of open connections in you applications<br />
</span></span><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span style="font-size: 9pt;"></span><br />
</div><div class="MsoNormal"><span style="font-size: 9pt;"><o:p></o:p></span><br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-16042337020252025982009-12-08T08:19:00.013-06:002009-12-08T09:02:15.424-06:00Download File From ServerWe could retrieve/ download the file from the server and save it locally in to the PC.<br />
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style> <br />
<div class="MsoNormal"><b><span style="font-family: "Courier New"; font-size: 9pt;">public</span></b><span style="font-family: "Courier New"; font-size: 9pt;"> <b>void</b> downLoadFileFromDevice() <b>throws</b> IOException<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> FacesContext ctx = FacesContext.<i>getCurrentInstance</i>();<o:p></o:p></span><br />
</div><span style="font-family: "Courier New"; font-size: 9pt;"><b>if</b> (!ctx.getResponseComplete())<o:p></o:p></span> <br />
<div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">InputStream fileFromEvox = <b>null</b>;<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>try</b><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">fileFromServer = receiveFile (“serverName/filename”);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>catch</b> (Exception e)<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">// Error Message.<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> <b>return</b>;<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> String contentType = "application/x-zip-compressed";<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> StringBuilder sbuff = <b>new</b> StringBuilder(30);<o:p></o:p></span><br />
</div><span style="font-family: "Courier New"; font-size: 9pt;">sbuff.append(<i>“newfilefromserver.xyz”</i>);</span><br />
<span style="font-family: "Courier New"; font-size: 9pt;"><o:p></o:p></span><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> HttpServletResponse response = (HttpServletResponse)ctx<o:p></o:p></span> <br />
<div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> .getExternalContext().getResponse();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">response.setContentType(contentType);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">response.setHeader("Content-Disposition",<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> "attachment;filename=\"" + sbuff.toString() + "\"");<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">ServletOutputStream out = <b>null</b>;<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">InputStream istream = <b>null</b>;<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>try</b><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">istream = <b>new</b> BufferedInputStream(fileFromServer);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">out = response.getOutputStream();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> <b>byte</b>[] buf = <b>new</b> <b>byte</b>[4096];<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>for</b> (<b>int</b> c = istream.read(buf); c != -1; c = <o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">istream.read(buf))<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">out.write(buf, 0, c);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}}<b>finally</b>{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>if</b>(istream != <b>null</b>)<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{istream.close();}<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> out.flush();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> ctx.responseComplete();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}}</span><br />
</div><o:p>Receive file helps to establish the connections to the server and receives the file in the InputStream format</o:p><br />
<br />
<div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>public</b> InputStream receiveFile(<b>final</b> String uri)<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>throws</b> EvoxException<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>try</b><o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> URL serverUrl = <b>new</b> URL(<b>this</b>.evoxServer + uri);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>final</b> HttpURLConnection connection =<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> (HttpURLConnection) serverUrl.openConnection();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">connection.setRequestMethod(RequestType.GET.name());<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">connection.setDoInput(<b>true</b>);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">connection.setDoOutput(<b>false</b>);<o:p></o:p></span><br />
</div><span style="font-family: "Courier New"; font-size: 9pt;">// Read the Response<o:p></o:p></span> <br />
<div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>return</b> connection.getInputStream();<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>catch</b> (IOException exception)<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">{<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"><b>throw</b> <b>new</b> Exception("unable to receive file: " + uri,<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;"> exception);<o:p></o:p></span><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 9pt;">}}</span><span style="font-size: 9pt;"><o:p></o:p></span><br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-62931125357294936292009-12-08T07:57:00.002-06:002009-12-08T07:58:15.566-06:00Debug JSf LifeCycleYou can use a PhaseListener to trace the phases of the JSF lifecycle and execute some processes where required. But you can also use a "dummy" PhaseListener to debug the phases to see what is happening in which phase. Here is a basic example of such a <b>LifeCycleListener</b>:<br />
<pre>package mypackage;<o:p></o:p><o:p>
</o:p></pre><pre>import javax.faces.event.PhaseEvent;<o:p></o:p></pre><pre>import javax.faces.event.PhaseId;<o:p></o:p></pre><pre>import javax.faces.event.PhaseListener;<o:p>
</o:p></pre><pre>public class LifeCycleListener implements PhaseListener {<o:p>
</o:p></pre><pre> public PhaseId getPhaseId() {<o:p></o:p></pre><pre> return PhaseId.ANY_PHASE;<o:p></o:p></pre><pre> }<o:p>
</o:p></pre><pre> public void beforePhase(PhaseEvent event) {<o:p></o:p></pre><pre> System.out.println("START PHASE " + event.getPhaseId());<o:p></o:p></pre><pre> }<o:p>
</o:p></pre><pre> public void afterPhase(PhaseEvent event) {<o:p></o:p></pre><pre> System.out.println("END PHASE " + event.getPhaseId());<o:p></o:p></pre><pre> }<o:p>
</o:p></pre><pre>}<o:p></o:p></pre>Add the following lines to the <b>faces-config.xml</b> to activate the LifeCycleListener.<o:p></o:p><br />
<pre><lifecycle></lifecycle><o:p></o:p></pre><pre> <phase-listener></phase-listener>mypackage.LifeCycleListener<o:p></o:p></pre><pre><o:p></o:p></pre>This produces like the following in the system output:<o:p></o:p><br />
<span style="color: blue; font-size: x-small;"><i><span style="color: purple;">START PHASE RESTORE_VIEW 1</span></i></span><span style="color: purple; font-size: x-small;"><i><br />
END PHASE RESTORE_VIEW 1<br />
START PHASE APPLY_REQUEST_VALUES 2<br />
END PHASE APPLY_REQUEST_VALUES 2<br />
START PHASE PROCESS_VALIDATIONS 3<br />
END PHASE PROCESS_VALIDATIONS 3<br />
START PHASE UPDATE_MODEL_VALUES 4<br />
END PHASE UPDATE_MODEL_VALUES 4<br />
START PHASE INVOKE_APPLICATION 5<br />
END PHASE INVOKE_APPLICATION 5<br />
START PHASE RENDER_RESPONSE 6<br />
END PHASE RENDER_RESPONSE 6</i></span> <o:p></o:p>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-80162637478199803382009-12-07T15:36:00.000-06:002009-12-07T15:36:48.553-06:00FireShotUnlike other extensions, this plugin provides a set of editing and annotation tools, which let users quickly modify captures and insert text and graphical annotations. Such functionality will be especially useful for web designers, testers and content reviewers.<br />
<br />
Screenshots can be saved to disk (PNG, GIF, JPEG, BMP), printed (NEW), copied to clipboard, e-mailed and sent to external editor for further processing. Works both in IE and Firefox<br />
<br />
<b>Download at :</b> <b><a href="http://screenshot-program.com/fireshot/">http://screenshot-program.com/fireshot/</a></b>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-38825672514485263282009-12-07T14:37:00.000-06:002009-12-07T14:37:29.991-06:00Page level Caching of dataInstead of making the calls repeatedly to the server which might not change, we could cache the data in the scope. By doing something similar in the controller.<br />
<pre> final FacesContext context = FacesContext.getCurrentInstance();
final HttpServletRequest request = (HttpServletRequest)
context.getExternalContext().getRequest();
String data = (String) request.getAttribute(“requestData”);
if (data == null)
{
data = Go retrieve data from the server;
request.setAttribute(“requestData”, data);
}
</pre>In the above case we cache the data "requstData" in the requestMap and retrieve them. We do make call to the server for the data if the requestMap doesn't have the persisted data in it. This helps to reduce unnecessary calls to the server.Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-80042047729442824202009-12-07T14:27:00.000-06:002009-12-07T14:27:58.104-06:00Disable Page Validation on Ajax Calls<div style="font-family: inherit;">All page validations could be disabled, while making ajax calls. In certain business logic we might need to refresh data regularly from the server, which would make repeated round trip calls to the server, which might cause the page validations to fire; when calls made to server.<br />
</div><div style="font-family: inherit;">We could handle above scenario as<br />
</div><pre style="font-family: inherit;">[a4j:support id="refreshBtnAjax" event="onclick"
onsubmit="Lifecycle.setValidateForm(false);"
oncomplete="Lifecycle.setValidateForm(true);"
actionListener="#{controller.action}"
reRender="ComponentName" immediate="true"/]
</pre><div style="font-family: inherit;">Could disable the validation on submitting the ajax request and enabling the validations when the ajax request is complete.<br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-52889473145552588892009-12-07T13:54:00.000-06:002009-12-07T13:54:23.060-06:00JSF Ajax reRender IssueWhile Re-rendering ajax region certain fields are not re-rendered properly, even though the bean/controller has the current and perfect data, that is because the component tree needs to be re-build to get that. which could be done by<br />
<b>In Page:</b><br />
<pre>[h:commandButton]
[a4j:support id="refreshBtnAjax" event="onclick"
<b>actionListener="#{Controller.clearData}"</b>
reRender="panelGroupToRefresh" immediate="true"/]
Re-Render
[/h:commandButton]
</pre><br />
<b>In Controller/ Backing Bean:</b><br />
Find the component in the page that needs to be re-rendered and clear it from the component tree so that, it could be rebuilt.<br />
<pre>public void clearData(final ActionEvent event){
<i> Place your business logic here</i>
final UIComponent component =
FacesContext.getCurrentInstance().getViewRoot()
.findComponent("form:panelGroupToRefresh");
if (component != null) {
component.getChildren().clear();
}
}
</pre>This helps to re-render or refresh the data immediately when we press the button or refresh data at regular interval of time, which ever is preferred.Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-47320462311826239452009-12-07T13:34:00.000-06:002009-12-07T13:34:00.680-06:00New Features in Struts 2.0 for AJAX<div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;">One of the useful enhancements in Struts 2.0 is the introduction of AJAX Theme<br />
</div><div style="font-family: inherit;">The Ajax theme extends the xhtml theme with AJAX features. <br />
</div><div style="font-family: inherit;">The theme uses the popular DOJO AJAX/JavaScript toolkit.<br />
</div><div style="font-family: inherit;">The new AJAX features include:<br />
</div><pre style="font-family: inherit;">• AJAX Client Side Validation
• Remote form submission support (works with the submit tag as well)
• An advanced div template that provides dynamic reloading of
partial HTML
• An advanced a template that provides the ability to
load and evaluate JavaScript remotely
• An AJAX-only tabbed Panel implementation
• A rich pub-sub event model
• Interactive auto complete tag
</pre><div style="font-family: inherit;">The framework provides a set of tags to help you ajaxify your applications, <br />
</div><div style="font-family: inherit;">on Dojo.<br />
</div><div style="font-family: inherit;">To use the Ajax tags you need to set the "theme" attribute to "Ajax".<br />
</div><div style="font-family: inherit;">Use the head tag to configure the page for the Ajax theme.<br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-85416283144894515462009-12-07T13:27:00.000-06:002009-12-07T13:27:59.659-06:00JSF Controller accessibility in other Controller<pre>
Define configuration files for the backing bean/controller as follows.
[managed-bean id="Controller"]
[managed-bean-name]Controller[/managed-bean-name]
[managed-bean-class]
Path.Controller
[/managed-bean-class]
[managed-bean-scope]request[/managed-bean-scope]
<b>[managed-property]
[property-name]injectedData[/property-name]
[value]#{InjectedController}[/value]
[/managed-property]</b>
[/managed-bean]
Then, the data need to be injected to this backing bean is define separately.
[managed-bean id="InjectedController"]
[managed-bean-name] InjectedController [/managed-bean-name]
[managed-bean-class]
Path. InjectedController
[/managed-bean-class]
[managed-bean-scope]request[/managed-bean-scope]
[/managed-bean]
Need to make sure that there should be proper getter and setter methods for the
injectedData in the Controller Class mentioned below, which helps to access the injectedData in the pages
Public class <b>Controller</b> {
...
Public getInjectedData(){
...
}
Public setInjectedData(dataTyle data){
this.injectedData = data;
}
}
</pre>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-3744608465936997082009-12-07T13:13:00.000-06:002009-12-07T13:13:21.310-06:00JSF with JavaScript<pre>Could define a composition component for as below to support the javascript in JSF and use them in normal xhtml / jsf pages.
So we would have the flexibility of rendering and not rendering the Javascript in the pages with the JSF life-cycle.
Javascript.xhtml (below, replace "[" with "<")
[ui-composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"]
[c:choose]
[c:when test="#{not empty path}"]
[script type="text/javascriptt"
srcc="#{facesContext.externalContext.requestContextPath}
#{path}"]
[/script]
[/c:when]
[c:0therwise]
[script type="text/javascript"]
[ui:insert /]
[/script]
[/c:otherwise]
[/c:ch00se]
[/ui:composition]
In JSF/xhtml page, we could render javascript functions as below.
[h:form]
[yournameSpace:javascriptt]
Function hello(){ alert(‘hello…’); }
[/yournamespace:javascript]
[yournameSpace:javascript rendered=”#{condition}”]
Function hello1(){ alert(‘hello…’); }
[/yournamespace:javascript]
[/h:form]
So we have the flexibility to render/ not-render/ re-Render by AJAX.
Handling data between the JSF & Javascript will be easy
</pre>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-20618186466572335482009-12-07T12:13:00.002-06:002009-12-07T12:21:10.219-06:00Java Vs Python<div style="font-family: inherit;">There are three main language characteristics that make programmers more productive with Python than with Java.<br />
</div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Lucida Sans Unicode";
panose-1:2 11 6 2 3 5 4 2 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-2147476737 14699 0 0 63 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style> <br />
</div><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Lucida Sans Unicode";
panose-1:2 11 6 2 3 5 4 2 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-2147476737 14699 0 0 63 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1136023299;
mso-list-type:hybrid;
mso-list-template-ids:-351006796 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1
{mso-list-id:1530797035;
mso-list-type:hybrid;
mso-list-template-ids:930249982 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style> <br />
<div class="MsoNormal" style="font-family: inherit;"><b>Java</b><b><span style="font-size: 13pt;"> <o:p></o:p></span></b><br />
</div><ol start="1" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>statically typed</u> <o:p></o:p></li>
</ol><div style="font-family: inherit;">In Java, all variable names (along with their types) must be explicitly declared. Attempting to assign an object of the wrong type to a variable name triggers a type exception. That's what it means to say that Java is a <i>statically typed</i> language. <o:p></o:p><br />
</div><div class="MsoNormal" style="font-family: inherit;">Java container objects (e.g. <i>Vector</i> and <i>ArrayList</i>) hold objects of the generic type <i>Object</i>, but cannot hold primitives such as <i>int</i>. To store an int in a Vector, you must first convert the int to an <i>Integer</i>. When you retrieve an object from a container, it doesn't remember its type, and must be explicitly cast to the desired type.<o:p></o:p><br />
</div><div class="MsoNormal" style="font-family: inherit;"><br />
</div><ol start="2" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>verbose</u> <o:p></o:p></li>
</ol><div class="MsoNormal" style="font-family: inherit;">"abounding in words; using or containing more words than are necessary"<b><span style="font-size: 13pt;"><o:p></o:p></span></b><br />
</div><div class="MsoNormal" style="font-family: inherit;"><br />
</div><ol start="3" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>not compact<o:p></o:p></u></li>
</ol><div class="MsoNormal" style="font-family: inherit;"><br />
</div><div class="MsoNormal" style="font-family: inherit;"><b>Python<o:p></o:p></b><br />
</div><ol start="1" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>dynamically typed </u><o:p></o:p></li>
</ol><div style="font-family: inherit;">In Python, you never declare anything. An assignment statement binds a name to an object, and the object can be of any type. If a name is assigned to an object of one type, it may later be assigned to an object of a different type. That's what it means to say that Python is a <i>dynamically typed</i> language. <o:p></o:p><br />
</div><div style="font-family: inherit;">Python container objects (e.g. lists and dictionaries) can hold objects of any type, including numbers and lists. When you retrieve an object from a container, it remembers its type, so no casting is required.<o:p></o:p><br />
</div><div style="font-family: inherit;"><br />
</div><ol start="2" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>concise</u> (<i>aka</i> <u>terse</u>) <o:p></o:p></li>
</ol><div style="font-family: inherit;">"expressing much in a few words. Implies clean-cut brevity, attained by excision of the superfluous"<o:p></o:p><br />
</div><div class="MsoNormal" style="font-family: inherit;"><br />
</div><ol start="3" style="font-family: inherit; margin-top: 0in;" type="1"><li class="MsoNormal"><u>compact</u> <o:p></o:p></li>
</ol><div style="font-family: inherit;">In <i>The New Hacker's Dictionary</i>, Eric S. Raymond gives the following definition for "compact": <o:p></o:p><br />
</div><div class="MsoNormal" style="font-family: inherit;">Compact adj. Of a design, describes the valuable property that it can all be apprehended at once in one's head. This generally means the thing created from the design can be used with greater facility and fewer errors than an equivalent tool that is not compact.<b><span style="font-size: 13pt;"><o:p></o:p></span></b><br />
</div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-14243306544406163542009-08-20T16:11:00.000-05:002009-08-26T20:30:09.136-05:00Evaluate Your JavaScript<span style="font-family:times new roman;">Usually people have hard time in evaluating their JavaScript code, I found a interesting tool which helps to evaluate the Javascript <span style="font-weight: bold;">JSLint</span> - The JavaScript Code Quality Tool. I</span><span style="font-family:times new roman;">ts quiet easy to use; navigate to<br /><a href="http://www.jslint.com/"><span style="font-weight: bold; font-style: italic;"> http://www.jslint.com/</span></a><br />Example:</span> <span style="font-family:times new roman;">This will help ensure our code is compatible with IE 6 and IE 7.</span><br /><br /><span style="font-family:times new roman;"></span><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> <p class="MsoNormal"><span style="color: rgb(51, 51, 51);font-family:Verdana;font-size:8.5pt;" ><input checked="checked" type="checkbox"> <span style="font-family:times new roman;">Strict white space </span><o:p></o:p></span></p> <p class="MsoNormal"><span style="color: rgb(51, 51, 51);font-family:Verdana;font-size:8.5pt;" ><input checked="checked" type="checkbox"> <span style="font-family:times new roman;">Assume a browser</span><o:p></o:p></span></p> <p class="MsoNormal"><span style="color: rgb(51, 51, 51);font-family:Verdana;font-size:8.5pt;" ><input checked="checked" type="checkbox"> <span style="font-family:times new roman;">Disallow undefined variables</span><o:p></o:p></span></p> <p class="MsoNormal"><span style="color: rgb(51, 51, 51);font-family:Verdana;font-size:8.5pt;" ><input checked="checked" type="checkbox"> <span style="font-family:times new roman;">Disallow == and !=</span></span></p> <p class="MsoNormal"><span style="color: rgb(51, 51, 51);font-family:Verdana;font-size:8.5pt;" > <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;">Alternatively, you can add this line to your javascript. This will ensure these values are "checked".<span style="color: rgb(51, 51, 51);font-size:8.5pt;" ><o:p></o:p></span></p>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-39161436564733978252009-08-20T16:01:00.001-05:002009-12-08T07:54:07.993-06:00JSF Life Cycle<div style="font-family: inherit;"><style>
<!-- /* Font Definitions */ @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:23024924; mso-list-template-ids:-628062932;} @list l0:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} -->
</style><span style="font-size: 100%;">The six phases of the JSF application lifecycle are as follows (note the event processing at each phase):</span><br />
</div><ol style="font-family: inherit;"><li><span style="font-size: 100%;">Restore View</span></li>
<li><span style="font-size: 100%;">Apply request values; process events</span></li>
<li><span style="font-size: 100%;">Process validations; process events</span></li>
<li><span style="font-size: 100%;">Update model values; process events</span></li>
<li><span style="font-size: 100%;">Invoke application; process events</span></li>
<li><span style="font-size: 100%;">Render response</span></li>
</ol><div style="font-family: inherit;"><span style="font-size: 100%;"><br />
</span><span style="font-size: 100%;">The six phases show the order in which JSF typically processes a form GUI. The list shows the phases in their likely order of execution with event processing at each phase, but the JSF lifecycle is hardly set in stone. You can change the order of execution by skipping phases or leaving the lifecycle altogether. For example, if an invalid request value were copied to a component, the current view would be redisplayed, and some of the phases might not execute. In this case, you could issue a FacesContext.responseComplete method invocation to redirect the user to a different page, then use the request dispatcher (retrieved from the request object in the FacesContext) to forward to an appropriate Web resource. Alternately, you could call FacesContext.renderResponse to re-render the original view. </span> <span style="font-size: 100%;"><br />
<br />
<a href="http://www.blogger.com/post-edit.do" name="N100F6" style="font-weight: bold;">Focusing your efforts</a></span> <br />
</div><div style="font-family: inherit;"><span style="font-size: 100%;">Some developers using JSF may never write a component or extend the framework, while others may focus on just those tasks. While the JSF lifecycle will be the same for almost any project, you'll likely tap into it at different stages based on your role in the project. If you're concentrating more on the overall application development, you'll likely be concerned with the middle phases of the request processing lifecycle:</span><br />
</div><ul style="font-family: inherit;"><li><span style="font-size: 100%;">Apply requests values</span></li>
<li><span style="font-size: 100%;">Process validations</span></li>
<li><span style="font-size: 100%;">Update model values</span></li>
<li><span style="font-size: 100%;">Invoke application</span></li>
</ul><div style="font-family: inherit;"><span style="font-size: 100%;">If you're concentrating on JSF component development, you'll probably focus on the first and last phases of the lifecycle:</span><br />
</div><ul style="font-family: inherit;"><li><span style="font-size: 100%;">Restore view</span></li>
<li><span style="font-size: 100%;">Render response</span></li>
</ul><div style="font-family: inherit;"><span style="font-size: 100%;">In the sections that follow, I'll walk you through every phase of the JSF request processing lifecycle, including event handling and validation. Once you have a basic understanding of each phase, I'll introduce a sample application that shows how they all come together. Before we get started, take a look at Figure 1, a diagram of the JSF lifecycle.</span><br />
</div><div style="font-family: inherit;"><span style="font-size: 100%; font-style: italic;">From</span><span style="font-size: 100%;"> - </span><style>
<!-- /* Font Definitions */ @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->
</style><span style="color: #333333; font-size: 100%;"><a href="http://www.ibm.com/developerworks/library/j-jsf2/"><span style="color: #d52b1e;">http://www.ibm.com/developerworks/library/j-jsf2/</span></a><span style="color: #d52b1e;"><br />
</span></span><br />
</div><div class="MsoNormal" style="font-family: inherit; margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 100%;"><br />
</span><span style="color: #333333; font-size: 100%;"><o:p></o:p></span><br />
</div><br />
<span style="color: #333333; font-size: 100%;"><o:p></o:p></span>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0tag:blogger.com,1999:blog-311970603953150625.post-14235429728214989002009-08-20T15:39:00.001-05:002009-12-17T12:39:24.530-06:00Jackson JSON Processor<style>
<!-- /* Font Definitions */ @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->
</style> <br />
<div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">The <a href="http://jackson.codehaus.org/"><span style="color: #d52b1e;">Jackson JSON Processor</span></a> is used for marshalling and unmarshaling JSON strings. It is capable of converting JSON strings into Java objects and vice versa. THis biderctional conversion simplifies passing information between java classes and javascript code. Other processors exist, such as <a href="http://xstream.codehaus.org/"><span style="color: #d52b1e;">XStream</span></a>, that marshal and unmarshal XML and JSON. The <a href="http://jackson.codehaus.org/"><span style="color: #d52b1e;">Jackson JSON Processor</span></a> is by far the fastest one out there.</span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><br />
<span style="color: #333333; font-size: 100%;"><o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="font-size: 100%;"><b><span style="color: #333333;">Using Java Beans</span></b></span><span style="color: #333333; font-size: 100%;"><o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">Code examples based ion release 0.98.<o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">When working with Java Beans, the following restrictions are used by the <a href="http://jackson.codehaus.org/"><span style="color: #d52b1e;">Jackson JSON Processor</span></a>. The bean has an empty public constructor, methods exposed follow the set/get/is construct, and the class CANNOT be an inner class.<o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="font-size: 100%;"><b><span style="color: #333333;"><br />
</span></b></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="font-size: 100%;"><b><span style="color: #333333;">Construcitng a bean and exporting it via an ObjectMapper is the preferred approach. </span></b></span><span style="color: #333333; font-size: 100%;">With proper planning, you might not even need to copy information into the target Java Bean for transformation.<o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">Code sample to generate JSON form a java bean.<o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> <o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> ObjectMapper mapper = new ObjectMapper();<br />
StringWriter sw = new StringWriter();<br />
mapper.writeValue(sw, myDS);<br />
String testStr = sw.toString();<br />
System.out.println("json Bef3 [" + testStr + "]");</span><br />
</div><div style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">Code sample to unmarshal JSON into a java bean.<o:p></o:p></span><br />
</div><div class="MsoNormal" style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;"> ObjectMapper mapper = new ObjectMapper();<br />
DailySchedule sample = mapper.readValue(testStr, DailySchedule.class);<o:p></o:p></span><br />
</div><div style="font-family: times new roman;"><span style="color: #333333; font-size: 100%;">The same ObjectMapper may be used.</span><br />
</div><div style="font-family: times new roman;"><span style="font-size: 100%;"><br />
</span><span style="color: #333333; font-size: 100%;"><o:p></o:p></span><br />
</div>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com1tag:blogger.com,1999:blog-311970603953150625.post-51488854401463963412009-08-20T13:37:00.006-05:002009-08-26T21:39:39.372-05:00Agile Unified Process<p>The Agile Unified Process (Agile UP) is a streamlined approach to software development based on IBM's Rational Unified Process (RUP). The Agile UP lifecycle is serial in the large, iterative in the small, delivering incremental releases over time.</p><span style="font-weight: bold;">Agile UP Disciplines</span><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:786702982; mso-list-template-ids:1076018028;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> <p>Disciplines are performed in an iterative manner, defining the activities which development team members perform to build, validate, and deliver working software which meets the needs of their stakeholders. The disciplines are:</p><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> <table class="MsoNormalTable" style="border: 1pt solid windowtext; width: 100%;" width="100%" border="1" cellpadding="0"> <tbody><tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;"><b>Discipline</b><o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;"><b>Overview</b><o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Model<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to understand the business of the organization, the problem domain being addressed by the project, and to identify a viable solution to address the problem domain.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Implementation<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to transform your model(s) into executable code and to perform a basic level of testing, in particular unit testing.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Test<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to perform an objective evaluation to ensure quality. This includes finding defects, validating that the system works as designed, and verifying that the requirements are met.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Deployment<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to plan for the delivery of the system and to execute the plan to make the system available to end users.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Configuration Management<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to manage access to your project work products. This includes not only tracking work product versions over time but also controlling and managing changes to them.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Project Management<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to direct the activities that takes place on the project. This includes managing risks, directing people (assigning tasks, tracking progress, etc.), and coordinating with people and systems outside the scope of the project to be sure that it is delivered on time and within budget.<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 26.88%;" width="26%"> <p class="MsoNormal"><span style="font-size:100%;">Environment<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 72.08%;" width="72%"> <p class="MsoNormal"><span style="font-size:100%;">The goal of this discipline is to support the rest of the effort by ensuring that the proper process, guidance (standards and guidelines), and tools (hardware, software, etc.) are available for the team as needed.<o:p></o:p></span></p> </td> </tr> </tbody></table> <h1 style="font-family:times new roman;"><span style="color: rgb(56, 56, 56);font-size:100%;" >AGILE UP PHASE</span></h1><p>The Agile UP is characterized as being "serial in the large", something that you can see via its four phases which you move through in a serial manner.<span style="font-size:100%;"><br /></span></p><p><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> <table class="MsoNormalTable" style="border: 1pt solid windowtext; width: 100%;" width="100%" border="1" cellpadding="0"> <tbody><tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 18.66%;" width="18%"> <p class="MsoNormal"><span style="font-size:100%;"><b>Phase</b><o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 58.6%;" width="58%"> <p class="MsoNormal"><span style="font-size:100%;"><b>Goals</b><o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 21.36%;" width="21%"> <p class="MsoNormal"><span style="font-size:100%;"><b>Milestone</b><o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 18.66%;" width="18%"> <p class="MsoNormal"><span style="font-size:100%;">1. Inception<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 58.6%;" width="58%"> <p class="MsoNormal"><span style="font-size:100%;">To identify the initial scope of the project, a potential architecture for your system, and to obtain initial project funding and stakeholder acceptance.<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 21.36%;" width="21%"> <p class="MsoNormal"><span style="font-size:100%;">Lifecycle Objectives (LCO)<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 18.66%;" width="18%"> <p class="MsoNormal"><span style="font-size:100%;">2. Elaboration<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 58.6%;" width="58%"> <p class="MsoNormal"><span style="font-size:100%;">To prove the architecture of the system.<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 21.36%;" width="21%"> <p class="MsoNormal"><span style="font-size:100%;">Lifecycle Architecture (LCA)<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 18.66%;" width="18%"> <p class="MsoNormal"><span style="font-size:100%;">3. Construction<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 58.6%;" width="58%"> <p class="MsoNormal"><span style="font-size:100%;">To build working software on a regular, incremental basis which meets the highest-priority needs of your project stakeholders.<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 21.36%;" width="21%"> <p class="MsoNormal"><span style="font-size:100%;">Initial Operational Capability (IOC)<o:p></o:p></span></p> </td> </tr> <tr style=""> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 18.66%;" width="18%"> <p class="MsoNormal"><span style="font-size:100%;">4. Transition<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 58.6%;" width="58%"> <p class="MsoNormal"><span style="font-size:100%;">To validate and deploy your system into your production environment.<o:p></o:p></span></p> </td> <td style="border: 1pt solid windowtext; padding: 0.75pt; width: 21.36%;" width="21%"> <p class="MsoNormal"><span style="font-size:100%;">Product Release (PR)<o:p></o:p></span></p> </td> </tr> </tbody></table> </p> <span style="font-size:100%;"><br /><br /></span><br /><p></p><p><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><!--[if gte mso 9]><xml> <w:worddocument> <w:view>Normal</w:View> <w:zoom>0</w:Zoom> <w:punctuationkerning/> <w:validateagainstschemas/> <w:saveifxmlinvalid>false</w:SaveIfXMLInvalid> <w:ignoremixedcontent>false</w:IgnoreMixedContent> <w:alwaysshowplaceholdertext>false</w:AlwaysShowPlaceholderText> <w:compatibility> <w:breakwrappedtables/> <w:snaptogridincell/> <w:wraptextwithpunct/> <w:useasianbreakrules/> <w:dontgrowautofit/> </w:Compatibility> <w:browserlevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:latentstyles deflockedstate="false" latentstylecount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults ext="edit" spidmax="1040"> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout ext="edit"> <o:idmap ext="edit" data="1"> </o:shapelayout></xml><![endif]--><span style=";font-family:";font-size:12pt;" ><!--[if gte vml 1]><v:group id="_x0000_s1026" style="'position:absolute;margin-left:192.6pt;margin-top:93.65pt;width:171pt;" coordorigin="315,60" coordsize="9585,4935"> <v:rect id="_x0000_s1027" href="http://www.ambysoft.com/scottAmbler.html" style="'position:absolute;left:315;top:4710;width:2430;height:285'" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1028" href="http://twc-hydra/AUP/html/environment.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1029" href="http://twc-hydra/AUP/html/projectManagement.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1030" href="http://twc-hydra/AUP/html/configurationManagement.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1031" href="http://twc-hydra/AUP/html/deployment.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1032" href="http://twc-hydra/AUP/html/test.html" style="'position:absolute;left:3000;top:2040;width:6885;height:360'" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1033" href="http://twc-hydra/AUP/html/implementation.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1034" href="http://twc-hydra/AUP/html/model.html" style="'position:absolute;left:2835;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1035" href="http://twc-hydra/AUP/html/transition.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1036" href="http://twc-hydra/AUP/html/construction.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1037" href="http://twc-hydra/AUP/html/elaboration.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1038" href="http://twc-hydra/AUP/html/inception.html" style="'position:absolute;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><v:rect id="_x0000_s1039" href="http://twc-hydra/AUP/html/phases.html" style="'position:absolute;left:5745;" button="t" filled="f" stroked="f"> <v:fill detectmouseclick="t"> </v:rect><w:anchorlock/> </v:group><span style="position: absolute; z-index: 1; margin-left: 257px; margin-top: 125px; width: 228px; height: 96px;"><map name="MicrosoftOfficeMap0"><area shape="Rect" coords="129, 0, 171, 7" href="http://twc-hydra/AUP/html/phases.html"><area shape="Rect" coords="80, 9, 108, 15" href="http://twc-hydra/AUP/html/inception.html"><area shape="Rect" coords="109, 9, 142, 15" href="http://twc-hydra/AUP/html/elaboration.html"><area shape="Rect" coords="144, 9, 185, 15" href="http://twc-hydra/AUP/html/construction.html"><area shape="Rect" coords="194, 9, 225, 15" href="http://twc-hydra/AUP/html/transition.html"><area shape="Rect" coords="60, 17, 228, 27" href="http://twc-hydra/AUP/html/model.html"><area shape="Rect" coords="34, 27, 227, 38" href="http://twc-hydra/AUP/html/implementation.html"><area shape="Rect" coords="64, 38, 227, 45" href="http://twc-hydra/AUP/html/test.html"><area shape="Rect" coords="42, 46, 228, 53" href="http://twc-hydra/AUP/html/deployment.html"><area shape="Rect" coords="2, 53, 227, 63" href="http://twc-hydra/AUP/html/configurationManagement.html"><area shape="Rect" coords="19, 63, 227, 70" href="http://twc-hydra/AUP/html/projectManagement.html"><area shape="Rect" coords="40, 70, 227, 78" href="http://twc-hydra/AUP/html/environment.html"><area shape="Rect" coords="0, 90, 58, 96" href="http://www.ambysoft.com/scottAmbler.html"></map></span><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:formulas> <v:path extrusionok="f" gradientshapeok="t" connecttype="rect"> <o:lock ext="edit" aspectratio="t"> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:507pt;"> <v:imagedata src="file:///C:\DOCUME~1\iibud\LOCALS~1\Temp\msohtml1\01\clip_image002.gif" href="http://twc-hydra/AUP/images/lifecycleAgileUP.gif"> </v:shape><![endif]--></span></p> <p></p>Mangayahttp://www.blogger.com/profile/05987702791573199467noreply@blogger.com0