<?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>blog.watashii &#187; Web</title>
	<atom:link href="http://blog.watashii.com/category/programming/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.watashii.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 07:15:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</title>
		<link>http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/</link>
		<comments>http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 02:18:05 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[streaming desktop]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=433</guid>
		<description><![CDATA[
Got the following error when (re)creating a streaming desktop from an updated .portal file, using the Create Desktop Wizard on Portal Admin Console.
javax.ejb.EJBException: SQL Error while trying to createPageDefinition: SQL [insert into PF_PAGE_DEFINITION ( PAGE_DEFINITION_ID, MARKUP_DEFINITION_ID, IS_PUBLIC, IS_HIDDEN, INTERSECTION_ID, PAGE_LABEL, WEBAPP_NAME) values (?,?,?,?,?,?,?)] database error code [25,222] SQL state [22028] .; nested exception is: java.sql.SQLException: [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/08/portaldesktop.png"><img class="alignnone size-full wp-image-434" title="portaldesktop" src="http://blog.watashii.com/wp-content/uploads/2010/08/portaldesktop.png" alt="" width="450" height="333" /></a></p>
<p>Got the following error when (re)creating a streaming desktop from an updated .portal file, using the <em>Create Desktop Wizard</em> on <em>Portal Admin Console</em>.<br />
<code>javax.ejb.EJBException: SQL Error while trying to createPageDefinition: SQL [insert into PF_PAGE_DEFINITION ( PAGE_DEFINITION_ID, MARKUP_DEFINITION_ID, IS_PUBLIC, IS_HIDDEN, INTERSECTION_ID, PAGE_LABEL, WEBAPP_NAME) values (?,?,?,?,?,?,?)] database error code [25,222] SQL state [22028] .; nested exception is: java.sql.SQLException: Data exception -- row already exist in index AX1_PAGE_DEF on table PF_PAGE_DEFINITION.</code><br />
To temporarily bypass this error this so the streaming desktop can be created with the wizard, remove all the Pages manually from the <em>Library</em>.</p>
<p>The problem is one of the Page definition(s) in the .portal file is corrupted which prevents the library page resource from being refreshed.  You will need to work out which page is causing the problem, then the redo the page in the .portal file via Weblogic Portal Workshop.</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Send Email (In a Jar)</title>
		<link>http://blog.watashii.com/2010/06/java-send-email-in-a-jar/</link>
		<comments>http://blog.watashii.com/2010/06/java-send-email-in-a-jar/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 05:20:34 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[classpath]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=404</guid>
		<description><![CDATA[
Step 1
Download the JavaMail and Activation Framework library .jar files
• If using Java SE, you&#8217;ll need to download JavaMail, eg mail-1.4.3.jar
• If using below Java SE 6, you&#8217;ll need to download and include Activation Framework, eg activation-1.1.1.jar

Step 2
In the same directory, create the following java source code and save it as Send.java, with class named [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="http://blog.watashii.com/wp-content/uploads/2010/06/javamail.png"><img class="alignnone size-full wp-image-405" title="javamail" src="http://blog.watashii.com/wp-content/uploads/2010/06/javamail.png" alt="" width="311" height="311" /></a></h3>
<h3>Step 1</h3>
<p>Download the JavaMail and Activation Framework library .jar files</p>
<p>• If using Java SE, you&#8217;ll need to download <a href="http://java.sun.com/products/javamail/downloads/index.html" target="_blank">JavaMail</a>, eg <em>mail-1.4.3.jar</em></p>
<p>• If using below Java SE 6, you&#8217;ll need to download and include <a href="http://java.sun.com/javase/technologies/desktop/javabeans/jaf/downloads/index.html" target="_blank">Activation Framework</a>, eg <em>activation-1.1.1.jar</em><br />
<span id="more-404"></span></p>
<h3>Step 2</h3>
<p>In the same directory, create the following java source code and save it as <em>Send.java</em>, with class named Send.  You will need to customise the host/port/to/from entries to your own SMTP mail server settings.</p>
<pre name="code" class="java">
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*; 

public class Send { 

    public static void main(String args[]) throws Exception { 

        String host = "smtp.domain.com";
        String port = "25";
        String from = "sender@domain.com";
        String to = "recipient@domain.com";

        // Get system properties
        Properties properties = System.getProperties(); 

        // Setup mail server
        properties.setProperty("mail.smtp.host", host);
        properties.setProperty("mail.smtp.port", port); 

        // Get the default Session object.
        Session session = Session.getDefaultInstance(properties); 

        // Create a default MimeMessage object.
        MimeMessage message = new MimeMessage(session); 

        // Set the RFC 822 "From" header field using the
        // value of the InternetAddress.getLocalAddress method.
        message.setFrom(new InternetAddress(from));

        // Add the given addresses to the specified recipient type.
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

        // Set the "Subject" header field.
        message.setSubject("This is the subject"); 

        // Sets the given String as this part's content,
        // with a MIME type of "text/plain".
        message.setText("This is the email body."); 

        // Send message
        Transport.send(message);
        System.out.println("Message Sent.....");
    }
}
</pre>
<h3>Step 3</h3>
<p>Compile the <em>Send.java</em>, which will create a <em>Send.class</em> file.  Note we must also specify the classpath of our downloaded jar libraries when we compile, otherwise it would not know how to find external JavaMail classes.</p>
<p><code>$ javac -classpath activation-1.1.1.jar;mail-1.4.3.jar Send.java</code></p>
<h3>Step 4</h3>
<p>Create a manifest plaintext file: <em>MANIFEST.MF</em>, containing the class name with the main-method, and the classpath of the jar files from step 1. Note the jars are in the same directory (relative) as our <em>Send.class</em> file.  Also make sure the last line of this file must be emtpy, since it is always rejected.</p>
<p><code>Manifest-Version: 1.0<br />
Main-Class: Send<br />
Class-Path: activation-1.1.1.jar mail-1.4.3.jar</code></p>
<h3>Step 5</h3>
<p>Combining our class and manifest file, we create a jar file named <em>SendEmail.jar</em> using the following command:</p>
<p><code>$ jar cmf MANIFEST.MF SendEmail.jar Send.class</code></p>
<h3>Step 6</h3>
<p>To run our send-email program, we only need the following 3 files: <em>SendEmail.jar</em>,<em> activation-1.1.1.jar</em>, and <em>mail-1.4.3.jar</em>.  Place them together in the same directory and run the following command:</p>
<p><code>$ java -jar SendEmail.jar</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/java-send-email-in-a-jar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start &amp; Stop Weblogic Without Username &amp; Password</title>
		<link>http://blog.watashii.com/2010/06/start-stop-weblogic-without-username-password/</link>
		<comments>http://blog.watashii.com/2010/06/start-stop-weblogic-without-username-password/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 07:40:07 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=385</guid>
		<description><![CDATA[
In a Weblogic Server domain running in production mode, username and password is always prompted during startup and shutdown (admin server and managed servers).  To bypass this manual step, we can store the username and password credentials in the boot.properties file (although this is somewhat the same as development mode)&#8230;
1) Locate (or otherwise create) the [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/' rel='bookmark' title='Permanent Link: Encrypt Passwords With Weblogic Server'>Encrypt Passwords With Weblogic Server</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/05/weblogic_password.png"><img class="alignnone size-full wp-image-341" title="weblogic_password" src="http://blog.watashii.com/wp-content/uploads/2010/05/weblogic_password.png" alt="" width="373" height="259" /></a></p>
<p>In a Weblogic Server domain running in <em>production </em>mode, username and password is always prompted during startup and shutdown (admin server and managed servers).  To bypass this manual step, we can store the username and password credentials in the <em>boot.properties</em> file (although this is somewhat the same as <em>development </em>mode)&#8230;</p>
<p><span id="more-385"></span>1) Locate (or otherwise create) the security directory within the domain servers path, eg on the admin server:</p>
<p><code>$ cd /opt/bea/user_projects/domains/mydomain/servers/AdminServer/<br />
$ mkdir security</code></p>
<p>2) Create a <em>boot.properties</em> file containing the username and password plaintext entries:</p>
<p><code>username=bob<br />
password=smith</code></p>
<p>3) You can now start the server without input prompt.</p>
<p>Note this can be repeated on any of your managed servers.  The plaintext entries in the <em>boot.properties</em> will automatically update to an encrypted value upon server startup.  The same encrypted value can be generated using the <a href="http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/" target="_blank"><em>weblogic.security.Encrypt</em></a> utility.</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/' rel='bookmark' title='Permanent Link: Encrypt Passwords With Weblogic Server'>Encrypt Passwords With Weblogic Server</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/start-stop-weblogic-without-username-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</title>
		<link>http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/</link>
		<comments>http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 05:57:32 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[roles]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=364</guid>
		<description><![CDATA[
The Authorization class provides runtime methods for security policies and roles checks.  The following code fragment obtains the set of roles the logged-in user belongs to.  Note the user must be authenticated first, see Authentication class.
String entAppName = ApplicationHelper.getNonVersionedAppName();
String webAppName = ApplicationHelper.getWebAppName(request);
EnterpriseRoleResource resource = new EnterpriseRoleResource(entAppName,webAppName,EntitlementConstants.P13N_ROLE_POLICY_POOL,"");
Map userRoles = Authorization.getRoles((P13nResource) resource);
if (Authorization.isUserInRole("Admin", userRoles)) {
	return true;
}

Global and [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png"><img class="size-full wp-image-373 aligncenter" title="code-icon" src="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png" alt="" width="150" height="150" /></a></p>
<p style="text-align: left;">The <a href="http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadoc_1031_patch/com/bea/p13n/entitlements/Authorization.html" target="_blank">Authorization</a> class provides runtime methods for security policies and roles checks.  The following code fragment obtains the set of roles the logged-in user belongs to.  Note the user must be authenticated first, see <a href="com.bea.p13n.security.Authentication" target="_blank">Authentication</a> class.</p>
<pre name="code" class="java">String entAppName = ApplicationHelper.getNonVersionedAppName();
String webAppName = ApplicationHelper.getWebAppName(request);
EnterpriseRoleResource resource = new EnterpriseRoleResource(entAppName,webAppName,EntitlementConstants.P13N_ROLE_POLICY_POOL,"");
Map userRoles = Authorization.getRoles((P13nResource) resource);
if (Authorization.isUserInRole("Admin", userRoles)) {
	return true;
}
</pre>
<p>Global and Enterprise Application roles are obtained using <em>EnterpriseRoleResource</em>.   For Global, Enterprise, and Web Application roles, use <em>WebappRoleResource</em>.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<pre><strong>com.bea.p13n.security.Authentication</strong>
</pre>
</div>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the HttpServletRequest from PortletRequest Object</title>
		<link>http://blog.watashii.com/2010/06/getting-the-httpservletrequest-from-portletrequest-object/</link>
		<comments>http://blog.watashii.com/2010/06/getting-the-httpservletrequest-from-portletrequest-object/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 02:11:24 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[javax]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[portlet]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[response]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[weblogic portal]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=366</guid>
		<description><![CDATA[
In my JSF / icefaces based portlet running on Weblogic Portal, I got the following error:
com.icesoft.faces.webapp.http.portlet.PortletExternalContext cannot be cast to javax.servlet.http.HttpServletRequest
It turned out I cannot simply obtain the HTTPServletRequest object like this:
FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest portletRequest = (HttpServletRequest) ctx.getCurrentInstance().getExternalContext().getRequest();
In a portlet environment, to get the request/response objects, we must obtain the javax.portlet.PortletRequest/PortletResponse objects instead (which [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png"><img class="align-none size-full wp-image-373 aligncenter" title="code-icon" src="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png" alt="" width="150" height="150" /></a></p>
<p>In my JSF / icefaces based portlet running on Weblogic Portal, I got the following error:<br />
<code>com.icesoft.faces.webapp.http.portlet.PortletExternalContext cannot be cast to javax.servlet.http.HttpServletRequest</code></p>
<p>It turned out I cannot simply obtain the HTTPServletRequest object like this:</p>
<pre class="java" name="code">FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest portletRequest = (HttpServletRequest) ctx.getCurrentInstance().getExternalContext().getRequest();</pre>
<p>In a portlet environment, to get the request/response objects, we must obtain the javax.portlet.PortletRequest/PortletResponse objects instead (which inherits methods from java.servlet.HTTPServletRequest/HTTPServletResponse):</p>
<pre class="java" name="code">FacesContext ctx = FacesContext.getCurrentInstance();
PortletRequest portletReq = (PortletRequest) ctx.getExternalContext().getRequest();</pre>
<p>However sometimes we may require the HttpServletRequest / HttpServletResponse object.  To obtain this, we must extract an attribute from the PortletRequest / PortletResponse object:</p>
<pre class="java" name="code">FacesContext ctx = FacesContext.getCurrentInstance();
PortletRequest portletReq = (PortletRequest) ctx.getExternalContext().getRequest();
HttpServletRequest httpServletReq = (HttpServletRequest) portletReq.getAttribute("javax.servlet.request");</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/getting-the-httpservletrequest-from-portletrequest-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading Portlet Preferences in Weblogic Portal</title>
		<link>http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/</link>
		<comments>http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 07:22:28 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[portlets]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=352</guid>
		<description><![CDATA[
Portlet preferences enables portlets to be associated with external application data.  This data should generally be used to store (or update) configuration data in a portlet.  For example, to store/update dynamic stock codes in a stock quotes portlet.  A portlet preference is basically a name-value pair data structure.
Portlet preferences can be added/updated in the following [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/06/portletprefs.png"><img class="alignnone size-full wp-image-353" title="portletprefs" src="http://blog.watashii.com/wp-content/uploads/2010/06/portletprefs.png" alt="" width="351" height="360" /></a></p>
<p>Portlet preferences enables portlets to be associated with external application data.  This data should generally be used to store (or update) configuration data in a portlet.  For example, to store/update dynamic stock codes in a stock quotes portlet.  A portlet preference is basically a name-value pair data structure.</p>
<p>Portlet preferences can be <strong>added/updated </strong>in the following ways:</p>
<ol>
<li>During design-time on Workshop for Weblogic Portal (screenshot above)</li>
<li>Invoked programmatically at request-time using javax.portlet.* API</li>
<li>Manually during run-time of a portal (via Portal Administration Console when a portal desktop is created)</li>
</ol>
<p>When we have added our preferences, we can <strong>read </strong>them using using the Weblogic Portal API&#8217;s.  The following sample code fragments are for JSP Portlets, and JSF Portlets:</p>
<p><span id="more-352"></span><span style="text-decoration: underline;">JSP Portlets using JSP tag library:</span></p>
<pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
&lt;%@ taglib uri="http://www.bea.com/servers/portal/tags/netuix/preferences" prefix="preferences" %&gt;
&lt;preferences:getPreference name="stockcode" var="mycode"/&gt;
&lt;c:out value="${mycode}"/&gt;
</code></pre>
<p><span style="text-decoration: underline;">JSF Portlets using Preferences API (in backing bean):</span></p>
<pre><code>FacesContext fc = FacesContext.getCurrentInstance();
PortletRequest portletRequest = (PortletRequest)fc.getExternalContext().getRequest();
PortletPreferences prefs = portletRequest.getPreferences();
System.out.println(prefs.getValue("stockcode", "default_value_if_pref_not_found"));</code></pre>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/' rel='bookmark' title='Permanent Link: Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)'>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypt Passwords With Weblogic Server</title>
		<link>http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/</link>
		<comments>http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/#comments</comments>
		<pubDate>Tue, 04 May 2010 02:19:29 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=340</guid>
		<description><![CDATA[
In a Weblogic Server environment, sometimes passwords must be unavoidably stored in text files, for example database connection details within JDBC configuration files.  When running Weblogic in production mode, only encrypted password is accepted to ensure that the password is never exposed as clear text.  To generate the encrypted password, the weblogic.security.Encrypt utility can be [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/start-stop-weblogic-without-username-password/' rel='bookmark' title='Permanent Link: Start &#038; Stop Weblogic Without Username &#038; Password'>Start &#038; Stop Weblogic Without Username &#038; Password</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/05/weblogic_password.png"><img class="alignnone size-full wp-image-341" title="weblogic_password" src="http://blog.watashii.com/wp-content/uploads/2010/05/weblogic_password.png" alt="" width="373" height="259" /></a></p>
<p>In a Weblogic Server environment, sometimes passwords must be unavoidably stored in text files, for example database connection details within JDBC configuration files.  When running Weblogic in production mode, only encrypted password is accepted to ensure that the password is never exposed as clear text.  To generate the encrypted password, the <em>weblogic.security.Encrypt</em> utility can be used, which generates a hashed password with a &#8220;{3DES}&#8221; prepended.</p>
<p>In Unix environment:</p>
<p><code>$ cd /opt/bea/user_projects/domains/mydomain/bin<br />
$ . setDomainEnv.sh<br />
$ java weblogic.security.Encrypt <em>mycleartextpasswordhere</em><br />
{3DES}xLLwrOm7asb4imZOYYwxz5TcBqDBEe6S</code></p>
<p>In Windows environment:</p>
<p><code>C:\&gt;cd c:\bea\domains\mydomain\bin<br />
C:\bea\domains\mydomain\bin&gt;setDomainEnv.cmd<br />
C:\bea\domains\mydomain\bin&gt;java weblogic.security.Encrypt <em>mycleartextpasswordhere</em><br />
{3DES}lieJgIkTqg1xSBBoy3YxnHbPuz+tMxhY</code></p>
<p>Note that running the same command on different environment (or different Weblogic server installation) will produce a different password.</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/start-stop-weblogic-without-username-password/' rel='bookmark' title='Permanent Link: Start &#038; Stop Weblogic Without Username &#038; Password'>Start &#038; Stop Weblogic Without Username &#038; Password</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/05/encrypt-passwords-with-weblogic-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable Google Reader&#8217;s Social Features (Antisocial Mode)</title>
		<link>http://blog.watashii.com/2010/05/disable-google-readers-social-features-antisocial-mode/</link>
		<comments>http://blog.watashii.com/2010/05/disable-google-readers-social-features-antisocial-mode/#comments</comments>
		<pubDate>Sun, 02 May 2010 06:19:29 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=331</guid>
		<description><![CDATA[
If you like reading your feeds on Google Reader however dont use the social features (eg sharing items and following other people), there is a way to turn off this feature.
1) Go to Google Reader.
2) Type this in the address bar and let the page reload:
javascript:antisocial('true')
3) The reader will now remove the &#8220;People you follow&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/05/googlereader01.png"><img class="alignnone size-full wp-image-337" title="googlereader01" src="http://blog.watashii.com/wp-content/uploads/2010/05/googlereader01.png" alt="" width="290" height="206" /></a></p>
<p>If you like reading your feeds on Google Reader however dont use the social features (eg sharing items and following other people), there is a way to turn off this feature.</p>
<p><span id="more-331"></span>1) Go to <a href="http://www.google.com/reader" target="_blank">Google Reader</a>.</p>
<p>2) Type this in the address bar and let the page reload:</p>
<p><code>javascript:antisocial('true')</code></p>
<p>3) The reader will now remove the &#8220;People you follow&#8221; section and any shared items from your friends.</p>
<p><a href="http://blog.watashii.com/wp-content/uploads/2010/05/googlereader02.png"><img class="alignnone size-full wp-image-335" title="googlereader02" src="http://blog.watashii.com/wp-content/uploads/2010/05/googlereader02.png" alt="" width="289" height="179" /></a></p>
<p>4) This setting is saved on your Reader account, so to enable it back, just undo it:</p>
<p><code>javascript:antisocial('false')</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/05/disable-google-readers-social-features-antisocial-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Content Repository Search Example</title>
		<link>http://blog.watashii.com/2010/03/simple-content-repository-search-example/</link>
		<comments>http://blog.watashii.com/2010/03/simple-content-repository-search-example/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 07:12:15 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=323</guid>
		<description><![CDATA[
Here is a simple code fragment to perform search on the Weblogic Portal 10 Content Repository using the search api.  The important part is the query string to extract the content, and the sort order. Some examples here.


String contentQuery = "cm_path like 'WLP Repository/*'";
ISortableFilterablePagedList&#60;Node&#62; nodes = null;
ISearchManager searchManager = ContentManagerFactory.getSearchManager();
ContentContext context = new ContentContext();
Search search [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/03/wlportal.gif"><img src="http://blog.watashii.com/wp-content/uploads/2010/03/wlportal.gif" alt="" title="wlportal" width="400" height="356" class="alignnone size-full wp-image-328" /></a><br />
Here is a simple code fragment to perform search on the Weblogic Portal 10 Content Repository using the <a href="http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadoc/com/bea/content/expression/Search.html" target="_blank">search api</a>.  The important part is the query string to extract the content, and the sort order. Some examples <a href="http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/search/metadata.html" target="_blank">here</a>.<br />
<span id="more-323"></span></p>
<pre name="code" class="java">
String contentQuery = "cm_path like 'WLP Repository/*'";
ISortableFilterablePagedList&lt;Node&gt; nodes = null;
ISearchManager searchManager = ContentManagerFactory.getSearchManager();
ContentContext context = new ContentContext();
Search search = new Search(contentQuery);
search.setSortCriteria("cm_nodeName");
try
{
   nodes = searchManager.search(context, search);
}
catch (RepositoryException message)
{
   System.out.println(message);
}

for (Node node : nodes)
{
   /*
     process each node
   */
   Property[] props = null;
   try
   {
      props = node.getProperties();
   }
   catch (AuthorizationException message)
   {
      System.out.println(message);
   }
   for (Property property : props)
   {
      /*
        process each node property
      */
   }
}
</pre>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/03/simple-content-repository-search-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)</title>
		<link>http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/</link>
		<comments>http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 03:13:07 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[facets]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[jstl]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=306</guid>
		<description><![CDATA[
When choosing facets during the creation of a new portal web project, the built-in Sun RI JSF 1.2 (together with JSTL 1.2)  facets cannot be selected.  Here are the recommended (by Oracle) steps to get around this problem.  Note that this is because Apache Beehive Page Flow has a dependecy with  JSF 1.2, therefore only [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf01.png"><img class="alignnone size-full wp-image-307" title="wlp_jsf01" src="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf01.png" alt="" width="443" height="489" /></a></p>
<p>When choosing facets during the creation of a new portal web project, the built-in Sun RI JSF 1.2 (together with JSTL 1.2)  facets cannot be selected.  Here are the recommended (by Oracle) steps to get around this problem.  Note that this is because Apache Beehive Page Flow has a dependecy with  JSF 1.2, therefore only follow this if not using the page flow integration components provided by Beehive.</p>
<p><span id="more-306"></span>1)  Select JSF 1.1 (together with JSTL 1.1) first, and create the portal web project, making sure the other dependencies with other facets are valid.</p>
<p>2) Open the web projects properties, under the Java Build Path, and locate the the Libraries tab.  Find the &#8220;<em>jsf-ri</em>&#8221; shared library containing JSF 1.1 jar files and remove it.</p>
<p><a href="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf02.png"><img class="alignnone size-full wp-image-308" title="wlp_jsf02" src="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf02.png" alt="" width="524" height="380" /></a></p>
<p>3) Next, Add Library, add a Weblogic Shared Library, Next, then Browse and select jsf 1.2.  Press OK and Finish.</p>
<p><a href="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf03.png"><img class="alignnone size-full wp-image-309" title="wlp_jsf03" src="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf03.png" alt="" width="525" height="496" /></a></p>
<p>4) Edit the &#8220;<em>jstl</em>&#8221; shared library and change the Specification Version from 1.1 to 1.2. Press OK to close the properties.</p>
<p><a href="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf04.png"><img class="alignnone size-full wp-image-310" title="wlp_jsf04" src="http://blog.watashii.com/wp-content/uploads/2010/03/wlp_jsf04.png" alt="" width="460" height="386" /></a></p>
<p>4) The last step is to modify the<em> weblogic.xml </em>file under the <em>WEB-INF</em> directory depending on where you set your <em>WebContent </em>directory:</p>
<p>- Find the library entry containing <em>jstl </em>and update the version from 1.1 to 1.2<br />
- Delete the library entry containing <em>jsf-ri<br />
</em>- Add a new library entry containing <em>jsf </em>and make sure the version is 1.2</p>
<p>5) Clean, build and redeploy your EAR and WAR projects.</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/08/weblogic-portal-create-streaming-desktop-page-definition-error/' rel='bookmark' title='Permanent Link: Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error'>Weblogic Portal &#8211; Create Streaming Desktop Page Definition Error</a></li>
<li><a href='http://blog.watashii.com/2010/06/reading-portlet-preferences-in-weblogic-portal/' rel='bookmark' title='Permanent Link: Reading Portlet Preferences in Weblogic Portal'>Reading Portlet Preferences in Weblogic Portal</a></li>
<li><a href='http://blog.watashii.com/2010/06/weblogic-portal-authorization-get-and-check-users-roles/' rel='bookmark' title='Permanent Link: Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles'>Weblogic Portal Authorization &#8211; Get and Check User&#8217;s Roles</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/03/using-jsf-1-2-on-oracle-workshop-for-weblogic-portal-10-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
