<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Head in the Web</title>
	<atom:link href="http://techblog.fywservices.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.fywservices.com</link>
	<description>Building a better user experience one technology at a time</description>
	<lastBuildDate>Fri, 03 Sep 2010 16:00:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Portal Federation with WebLogic Portal WRSP Part 1: The Basics</title>
		<link>http://techblog.fywservices.com/2010/09/portal-federation-with-weblogic-portal-wrsp-part-1-the-basics/</link>
		<comments>http://techblog.fywservices.com/2010/09/portal-federation-with-weblogic-portal-wrsp-part-1-the-basics/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 15:58:26 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[WebLogic Portal]]></category>
		<category><![CDATA[WSRP]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=532</guid>
		<description><![CDATA[Originally published at developer.com WSRP stands for Web Services for Remote Portlets, a handy specification from the folks at OASIS that provides a standard for portal applications to share portlets between portals. Put another way, WSRP is the ability to produce an interface to useful functionality which can be consumed throughout your enterprise with little [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p><em>Originally published at <a href="http://www.developer.com/services/article.php/3743916" target="_blank">developer.com</a></em></p>
<p>WSRP stands for Web Services for Remote Portlets, a handy specification from the folks at OASIS that provides a standard for portal applications to share portlets between portals. Put another way, WSRP is the ability to produce an interface to useful functionality which can be consumed throughout your enterprise with little or no changes to existing code. Sound familiar?</p>
<p>Almost all of the latest versions of commercial and open source portal products support WSRP, though your mileage may vary based on the vendor.  The basic mechanism is the same as any old web service. The producer provides a WSDL that instructs the consumer on how to generate a SOAP request. The difference between web services and WSRP is that with a web service the developers of the consumer application next need to figure out how they will use the SOAP response where the WSRP consumer receives a response at the presentation level and all the consumer needs to do is decide where they will display it.  The portal frameworks abstract the heavy lifting and all that is required of developers is to configure the producer and consumer to achieve basic WSRP integration. In theory, this simplicity provides all an enterprise needs to reuse portlets across the enterprise “instamagiclly”. In practice, business requirements rarely let us get off the hook so easy.  In fact, once an enterprise begins to use WSRP, the requirements tend to get more and more complicated, which is why the WebLogic Portal (WLP) has evolved to provide more and more WSRP functionality with increasing ease of development.</p>
<h2>When WSRP Makes Sense</h2>
<p>WSRP is a technology that provides three benefits. One is reuse; another is performance, (though oftentimes using WSRP will provide only one these two benefits); and the third is the ability to release portlets asynchronously.</p>
<p>WSRP is not the only approach to achieving portlet reuse. Portlets can also be bundled into a WAR file and used as a shared library, or simply copied from one application to another.  Where reuse is the goal, WSRP is the solution of choice when the portlet is used in more than one portal.</p>
<p>Sometimes portlets are resource intensive. If a portal page contains a collection of portlets where system or network resources impact the usability of the portal, WSRP can provide a strategy where the processing is divided across servers to improve performance.</p>
<p>Portals provide the ability to aggregate access to applications. In many enterprises, these applications are owned and maintained by disparate groups where the coordination of release schedules can be difficult (if not impossible). Here, WSRP provides the advantage of allowing a portlet or group of portlets to be released independently of the main portal application.</p>
<h2>The Best Way to Consume a Remote Portlet</h2>
<p>In the WebLogic Portal, portlets are WSRP enabled by default since version 9.2, as shown below:</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image002.jpg" alt="" width="289" height="305" /></p>
<p>In fact, the notation in the .portlet file is only required if you are not offering your portlet as remote, as show by these two snippets:</p>
<blockquote><p>&lt;netuix:portlet definitionLabel=&#8221;simpleProducerA_1&#8243; title=&#8221;Simple Producer A&#8221;&gt;</p>
<p>&lt;netuix:portlet definitionLabel=&#8221;nonRemoteExample_1&#8243; offerRemote=&#8221;false&#8221; title=&#8221;Locals Only&#8221;&gt;</p></blockquote>
<p>In a WSRP implementation, the remote portal is the <em>producer</em> and the portal displaying the remote portlet is the <em>consumer</em>. The consumer gains access to the producer by registering the producer as a <em>remote producer</em> by accessing the producers WSDL. The WSDL is generated automatically by WLP and available as an address from the producers web application in the format of [server_address]/[web_application]/producer?wsdl. The example portal applications referenced in this article are named wsrpConsumer and wsrpProducer, with the portal web applications being named wsrpConsumerWEB and wsrpProducerWEB, which would make the producer’s WSDL address http://localhost:7001/wsrpProducerWEB/producer?wsdl. This WSDL simply defines key details about interacting with the producer, such as security:</p>
<p>&lt;wssp:SecurityToken TokenType=&#8221;http://docs.oasis-open.org/wss/2004/01/oasis-2004-01-saml-token-profile-1.0#SAMLAssertionID&#8221;&gt;</p>
<p>And where to find various services, such as registration:</p>
<p>&lt;s0:port binding=&#8221;s3:WSRP_v1_Registration_Binding_SOAP&#8221; name=&#8221;WSRPRegistrationService&#8221;&gt;</p>
<p>&lt;s4:address location=&#8221;https://localhost:7002/wsrpProducerWEB/producer/wsrp-1.0/registration&#8221; /&gt;</p>
<p>&lt;/s0:port&gt;</p>
<p>While the most basic of WSRP producers require 60+ lines of XML to define the WSDL, even the most complicated WLP applications will generate a WSDL for you. The only hand editing you may need to do is with simpler files such as wsrp-producer-config.xml and wsrp-producer-registry.xml.</p>
<p>Remote portlets are consumed in the producer with a proxy portlet, and WLP provides two ways to create a proxy portlet. One method is through the WebLogic Workshop IDE at design time. Defining a proxy portlet at design time requires providing an address to the producer in a .portlet file, which cannot be changed at runtime. Due to this drawback, this approach is not recommended in this article. If you want to see how it works in detail, you can follow the tutorial included in the WLP documentation.</p>
<p>The other method to define a proxy portlet is through the WLP Portal Administration Tool (PAT). To define proxy portlets in the PAT, you must first create a streaming portal. Streaming portals are database-driven rather than file-based (where users access the portal through a .portal file defined in Workshop). There are many considerations outside of WSRP in choosing between a file-based versus a streaming portal and are beyond the scope of this article.</p>
<p>To quickly illustrate the steps of creating a streaming portal and consuming a WSRP portlet we will use the naming conventions from our example applications as well as the existing assets in the example. For simplicity we will have both portal applications deployed to the same domain. With this in mind, here is the process to create a streaming portal and consuming a simple remote portlet:</p>
<p>With portal server running, navigate to <a href="http://localhost:7001/wsrpConsumerAdmin">http://localhost:7001/wsrpConsumerAdmin</a> for your consumer portal’s administration console (or, with the Portal perspective open in Workshop, select Run\Open Portal Administration Console) and log in with the admin credentials. From the Portal Management page, create a streaming portal and a desktop based on the .portal file you created in Workshop. In the screen shot below, we’ve created a portal named “wsrp” with desktop named “default”.</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image004.jpg" alt="" width="420" height="310" /></p>
<p>Next, add your producer portal to your library by expanding Library and Remote Producers, then click on the Add Producer button. In the wizard, enter</p>
<p>http://localhost:7001/wsrpProducerWEB/producer?wsdl and click Search. Click on the Remote Producer in the search results, then follow the self-explanatory prompts to complete registration.</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image006.jpg" alt="" width="306" height="224" /></p>
<p>With your remote producer registered, click on the producers’ name, then Selected Portlets to access the Add Portlets button. The Add Portlets button will start a straight-forward wizard to add your remote portlets.</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image008.jpg" alt="" width="354" height="251" /></p>
<p>Finally, add the Hello Producer to your Consumer Desktop using the intuitive PAT, which will display as follows once completed:</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image010.jpg" alt="" width="420"  /></p>
<p>In WLP 9.2, the process of placing your remote portlets must be repeated manually for each environment (typically, with varying names and number of environments, Test, Staging, and Production). Beginning in WLP 10.0, WSRP portlets can be included in propagation as other portal configurations are in earlier versions of WSRP (see <a href="http://www.developer.com/java/data/article.php/3634841">Propagating Weblogic 8.x Portals</a> for an introduction to portal propagation).</p>
<p>If you followed the naming examples in this article you can browse to <a href="http://localhost:7001/wsrpConsumerWEB/appmanager/wsrp/default">http://localhost:7001/wsrpConsumerWEB/appmanager/wsrp/default</a> to see the results.</p>
<p><img class="aligncenter" src="http://www.fywservices.com/articleArchives/wlp_wsrp_1/wlp_wsrp_1_files/image012.jpg" alt="" width="420"  /></p>
<p>Congratulations, you have achieved portal federation with WSRP!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/09/portal-federation-with-weblogic-portal-wrsp-part-1-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;No Global.app was found&#8221; error when starting a WLP Application</title>
		<link>http://techblog.fywservices.com/2010/09/no-global-app-was-found-error-when-starting-a-wlp-application/</link>
		<comments>http://techblog.fywservices.com/2010/09/no-global-app-was-found-error-when-starting-a-wlp-application/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 15:54:40 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[WebLogic Portal]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=528</guid>
		<description><![CDATA[You&#8217;d think this would be a bad file error, but it wasn&#8217;t. Turned out the portalDataSource connection pool had gone bad, preventing the desktop from being found or loaded.  Again, you&#8217;d think that a restart of the server would fix that, but it didn&#8217;t. I had to un-deploy and re-deploy the connection pool before things [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>You&#8217;d think this would be a bad file error, but it wasn&#8217;t. Turned out the <em>portalDataSource </em>connection pool had gone bad, preventing the desktop from being found or loaded.  Again, you&#8217;d think that a restart of the server would fix that, but it didn&#8217;t. I had to un-deploy and re-deploy the connection pool before things started working again.</p>
<p>This was on WebLogic Portal 10.3.2. I haven&#8217;t seen it before, but that doesn&#8217;t necessarily mean it is restricted to that version.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/09/no-global-app-was-found-error-when-starting-a-wlp-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Note on the WLP Content Presenter Portlet</title>
		<link>http://techblog.fywservices.com/2010/08/another-note-on-the-wlp-content-presenter-portlet/</link>
		<comments>http://techblog.fywservices.com/2010/08/another-note-on-the-wlp-content-presenter-portlet/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 15:57:31 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[WebLogic Portal]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=524</guid>
		<description><![CDATA[Using the Content Presenter Portlet to add content will be unreliable if server affinity is not configured for the cluster. The portlet will reset itself mid-task. This may not be the case if session replication is turned on, though, as I ran across this in the early stage of the project. Still, something useful to [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>Using the Content Presenter Portlet to add content will be unreliable if server affinity is not configured for the cluster. The portlet will reset itself mid-task. This may not be the case if session replication is turned on, though, as I ran across this in the early stage of the project. Still, something useful to be aware of.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/08/another-note-on-the-wlp-content-presenter-portlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good Post on WLS 10.3 Start Up</title>
		<link>http://techblog.fywservices.com/2010/08/good-post-on-wls-10-3-start-up/</link>
		<comments>http://techblog.fywservices.com/2010/08/good-post-on-wls-10-3-start-up/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 17:55:17 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[WebLogic Server]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=521</guid>
		<description><![CDATA[I ran across a thread on LinkedIn that pointed me to an excellent article on IT on Guard dealing with a slow WLS start up issue.]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>I ran across a thread on LinkedIn that pointed me to an excellent <a href="http://www.itonguard.com/20090313/weblogic-starts-slow/" target="_blank">article on IT on Guard</a> dealing with a slow WLS start up issue.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/08/good-post-on-wls-10-3-start-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Techie Humor</title>
		<link>http://techblog.fywservices.com/2010/08/more-techie-humor/</link>
		<comments>http://techblog.fywservices.com/2010/08/more-techie-humor/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 10:32:03 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Tech Humor]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=517</guid>
		<description><![CDATA[http://humor.fywservices.com/2010/08/milking-technology/]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p><a href="http://humor.fywservices.com/2010/08/milking-technology/">http://humor.fywservices.com/2010/08/milking-technology/</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/08/more-techie-humor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ID Ten T Error</title>
		<link>http://techblog.fywservices.com/2010/07/id-ten-t-error/</link>
		<comments>http://techblog.fywservices.com/2010/07/id-ten-t-error/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 10:13:42 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Tech Humor]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=512</guid>
		<description><![CDATA[Today&#8217;s post on my joke blog should strike home with readers of this blog.]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p><a href="http://humor.fywservices.com/2010/07/computer-trouble/" target="_blank">Today&#8217;s post on my joke blog</a> should strike home with readers of this blog.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/07/id-ten-t-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LinkedIn Thread About Consulting Rates</title>
		<link>http://techblog.fywservices.com/2010/07/linkedin-thread-about-consulting-rates/</link>
		<comments>http://techblog.fywservices.com/2010/07/linkedin-thread-about-consulting-rates/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 09:08:08 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[Random Musings]]></category>
		<category><![CDATA[Searching for Work]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=509</guid>
		<description><![CDATA[This thread is a must-read if you are a consultant or ever thought of being one. Free LinkedIn membership required.]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p><a href="http://www.linkedin.com/answers/technology/software-development/TCH_SFT/608599-18685503" target="_blank">This thread</a> is a must-read if you are a consultant or ever thought of being one. Free LinkedIn membership required.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/07/linkedin-thread-about-consulting-rates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One More Think About Inline Editing with WLP 10.3.2 Content Templates</title>
		<link>http://techblog.fywservices.com/2010/06/one-more-think-about-inline-editing-with-wlp-10-3-2-content-templates/</link>
		<comments>http://techblog.fywservices.com/2010/06/one-more-think-about-inline-editing-with-wlp-10-3-2-content-templates/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 17:31:07 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[WebLogic Portal]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=506</guid>
		<description><![CDATA[In Inline Editing with WLP 10.3.2 Content Templates, I concluded that if something else came up I would blog it. Well, it did, so I will. The shared library part went nice and smooth. To note the (semi-)obvious, the wlp-template-config.xml changes noted in the post must be done in the consuming application, not the shared [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>In <a href="http://techblog.fywservices.com/2010/06/inline-editing-with-wlp-10-3-2-content-templates/" target="_blank"><em>Inline Editing with WLP 10.3.2 Content Templates,</em></a> I concluded that if something else came up I would blog it. Well, it did, so I will.</p>
<p>The shared library part went nice and smooth. To note the (semi-)obvious, the wlp-template-config.xml changes noted in the post must be done in the consuming application, not the shared application, as the consuming application always over-rides.</p>
<p>The part I forgot about was that you must create a role for editing the content or else only Admins will be able to do the inline editing.  I created an enterprise role named &#8220;homePageContentAdmin&#8221; for my first test, then granted that role update privelages on the content item. Once I did that, it worked properly.</p>
<p>As another sort-of-obvious note, this requires granting view privelages for anonymous or authenticated roles for other users to view the content.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/06/one-more-think-about-inline-editing-with-wlp-10-3-2-content-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catching the Un-Catchable</title>
		<link>http://techblog.fywservices.com/2010/06/catching-the-un-catchable/</link>
		<comments>http://techblog.fywservices.com/2010/06/catching-the-un-catchable/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 16:21:04 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[NoClassDefFoundError]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=503</guid>
		<description><![CDATA[I know it is bad practice to catch java.lang.NoClassDefFoundError.  Today, however, I did need a way to deal with it because I have this annoying habit of wanting everything else to work even when some non-critical piece is broken. This case was a matter of a third-party security jar that would throw up rather than [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>I know it is bad practice to catch java.lang.NoClassDefFoundError.  Today, however, I did need a way to deal with it because I have this annoying habit of wanting everything else to work even when some non-critical piece is broken.</p>
<p>This case was a matter of a third-party security jar that would throw up rather than out when it could not find its properties file. No matter how many catches I had wrapped around the call to the method in the jar, the java.lang.NoClassDefFoundError would bubble up as a big render issue in the JSP.  I am only using this jar to get the user display name, so it isn&#8217;t like my application is not secure if I don&#8217;t have their name to make them feel special.</p>
<p>After several annoying an pointless approaches, I came up with the following (ugly-but-effective) solution:</p>
<blockquote><p>try//the Security class relies on this property file but pukes if not found, so we test for it here<br />
{<br />
FileInputStream in = new FileInputStream(&#8220;security.properties&#8221;);<br />
in.close();<br />
}<br />
catch(Exception e)<br />
{<br />
System.out.println(&#8220;security.properties is missing from classpath&#8221;);<br />
return personInfo;<br />
}<br />
&#8230;go use the third-party class that depends on the file having proven it is there</p></blockquote>
<p>This allowed the application to continue running and not falling apart at the header just because one file was missing. It is one thing to have a bug that is minor, another when that bug becomes something that users pick up the phone about.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/06/catching-the-un-catchable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inline Editing with WLP 10.3.2 Content Templates</title>
		<link>http://techblog.fywservices.com/2010/06/inline-editing-with-wlp-10-3-2-content-templates/</link>
		<comments>http://techblog.fywservices.com/2010/06/inline-editing-with-wlp-10-3-2-content-templates/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 21:05:00 +0000</pubDate>
		<dc:creator>Scott Nelson</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[WebLogic Portal]]></category>

		<guid isPermaLink="false">http://techblog.fywservices.com/?p=494</guid>
		<description><![CDATA[Carrying on from WLP Content Presenter Portlet Simplified, the next goal is to get the in-line editing from the sample application running because most clients think that is a cool feature and don&#8217;t understand why it isn&#8217;t available by default. Right now I am almost done, and wanted to blog the progress to date, even [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1fdcc5aa84fd409b74de32bfd26699ba&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><p>Carrying on from <a href="http://techblog.fywservices.com/2010/05/wlp-content-presenter-portlet-simplified/" target="_self">WLP Content Presenter Portlet Simplified</a>, the next goal is to get the in-line editing from the sample application running because most clients think that is a cool feature and don&#8217;t understand why it isn&#8217;t available by default. Right now I am almost done, and wanted to blog the progress to date, even if the most important part won&#8217;t be done until Monday&#8230;</p>
<p>There is a really (really, really) brief instruction in the official documentation to do this <a href="http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/development.html" target="_blank">here</a>.  I&#8217;m sure if you have been building content templates for years that document will be enough, just as I&#8217;m sure that if that were the case you won&#8217;t be reading this (unless to make tsk-tsk noises at my ignorance). The files to import can be taken straight from there, which is:</p>
<blockquote>
<div>
<ol type="1">
<li><a name="wp1037471"> </a>Display Template (Outer Template) – <code> </code>&lt;WLPORTAL_HOME&gt;<code>\samples\applications\portalApp\  contentPresenterSampleWeb\samplePresenterTemplates\  inlineEditExamplePresenterTemplate.jsp</code></li>
<li><a name="wp1037594"> </a>CM Display Template (Inner Template) That  Displays the Content –  &lt;WLPORTAL_HOME&gt;<code>\samples\applications\portalApp\contentPresenterSampleWeb\sampleCMTemplates\inlineEditExampleCMTemplate.jsp</code></li>
<li><a name="wp1037568"> </a>JSP File that Performs Other Work –   &lt;WLPORTAL_HOME&gt;<code>\samples\applications\portalApp\contentPresenterSampleWeb\sampleCMTemplates\saveNode.jsp</code></li>
</ol>
</div>
</blockquote>
<p>Now, the first time I tried this, I wanted my own paths and renamed everything. It didn&#8217;t work. I&#8217;m sure I can rename them now, but at this stage the important thing is to get it working, with re-branding to the custom project being secondary.</p>
<p>The next step is to add these to the wlp-template-config.xml. Where the manual tells you to make your own, I find it much easier to simply go to the merged view and copy in the one from the shared install. While this may make a little more work for future WLP upgrading, it is worth it to me to save the time. With the file now in my project, I get the copy from the sample application and added the nodes to my own application that reference the files imported earlier. The relevant parts of the resulting file are below:</p>
<blockquote><p><em>Under &lt;content-name-space&gt;&lt;name&gt;wlp-content-presenter-single&lt;/name&gt;</em><em>:</em></p>
<p>&lt;content-resource&gt;<br />
&lt;name&gt;htmlContent&lt;/name&gt;<br />
&lt;default-template-uri&gt;/portlets/wlp-content-publisher/templates/wlp-default/cm/wlp-default-resourceDefault.jsp&lt;/default-template-uri&gt;<br />
&lt;view&gt;<br />
&lt;name&gt;Show&lt;/name&gt;<br />
&lt;description&gt;This is the detailed node view for simple HTML content in the Avitek Financial Intranet sample.&lt;/description&gt;<br />
&lt;uri&gt;/sampleCMTemplates/simpleShowView.jsp&lt;/uri&gt;<br />
&lt;/view&gt;<br />
&lt;view&gt;<br />
&lt;name&gt;ShowEdit&lt;/name&gt;<br />
&lt;description&gt;This is the detailed node view with inline<br />
editing for simple HTML content in the Avitek Financial<br />
Intranet sample.<br />
&lt;/description&gt;<br />
&lt;uri&gt;/sampleCMTemplates/inlineEditExampleCMTemplate.jsp&lt;/uri&gt;<br />
&lt;/view&gt;<br />
&lt;/content-resource&gt;</p>
<p><em>Under &lt;template-name-space&gt;&lt;name&gt;wlp-content-presenter-single&lt;/name&gt;:</em></p>
<p>&lt;view&gt;<br />
&lt;name&gt;Sample Single Item View with Inline Edit&lt;/name&gt;<br />
&lt;description&gt;This is the sample Content Presenter Display Template view for a single item that provides inline HTML editing.&lt;/description&gt;<br />
&lt;uri&gt;/samplePresenterTemplates/inlineEditExamplePresenterTemplate.jsp&lt;/uri&gt;<br />
&lt;/view&gt;</p></blockquote>
<p>Now, for this to work, you have to create a content type of named &#8220;htmlContent&#8221;. I created this type with no parent and a primary property named &#8220;content&#8221; of data type binary.</p>
<p>I&#8217;m still testing to find out if the content needs to include &#8220;.html&#8221; as a suffix to the name.  And, yes, you can by-pass much of this &#8220;have to&#8221; stuff if you re-write everything, but the goal here is to get it deployed and have business users editing content today <img src='http://techblog.fywservices.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I thought I had it with that, as I could then set the content in an instance of the Content Presenter portlet as a piece of content of the type htmlContent and see the Edit HTML button, but nothing happened on clicking it. Dang! Running it in FireFox (the project was targeted at IE, otherwise I would have started in FireFox), I found the disconcerting message &#8220;wlp dojo is not defined&#8221;.</p>
<p>Ok, I haven&#8217;t used the Dojo tookit yet. I have been building stuff by hand for so long, I just haven&#8217;t had the need to use a pre-built JS framework, even one that is as highly praised as Dojo. So I&#8217;m not sure if I went about it the best way to get this fixed, but it was the fastest. I searched through the sample directory until I found dojo.js (in Windows, it was located at [WEBLOGIC_HOME]\wlportal_10.3\samples\domains\portal\servers\portalServer\tmp\_WL_user\portalApp\4ycmg9\beaext\dojo-0.4.3-ajax ). I also found that in inlineEditExampleCMTemplate.jsp, the path it was looking for was ${pageContext.request.contextPath}/dojo-0.4.3-ajax/dojo.js. I tried importing it directly to my project from OPOE, but it must be compressed or the path is too long, so I did a copy/paste to a temp directory and imported it from there.</p>
<p>And, viola! It worked.</p>
<p>Now all that is left is to make the web project into a shared library so that I don&#8217;t have to turn off validation is my &#8220;real&#8221; project. If there is anything out of the ordinary with that process I will blog about it here.  Otherwise, go forth and edit.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://techblog.fywservices.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://techblog.fywservices.com/2010/06/inline-editing-with-wlp-10-3-2-content-templates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
