<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MrTextminer's Weblog</title>
	<atom:link href="http://mrtextminer.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mrtextminer.wordpress.com</link>
	<description>All about text mining research and computing stuffs</description>
	<lastBuildDate>Sat, 19 Nov 2011 16:41:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mrtextminer.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>MrTextminer's Weblog</title>
		<link>http://mrtextminer.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mrtextminer.wordpress.com/osd.xml" title="MrTextminer&#039;s Weblog" />
	<atom:link rel='hub' href='http://mrtextminer.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hide/show a Save button in Netbeans Platform 7</title>
		<link>http://mrtextminer.wordpress.com/2011/08/29/hideshow-a-save-button-in-netbeans-platform-7/</link>
		<comments>http://mrtextminer.wordpress.com/2011/08/29/hideshow-a-save-button-in-netbeans-platform-7/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 13:48:57 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=713</guid>
		<description><![CDATA[When we incorporate NetBEANS Platform 7 into our application, we usually employ Action Annotations rather than layer.xml file for registering actions into a system. For example, the code below is an implementation of closing a TopComponent. (Notes: we create a &#8230; <a href="http://mrtextminer.wordpress.com/2011/08/29/hideshow-a-save-button-in-netbeans-platform-7/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=713&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When we incorporate NetBEANS Platform 7 into our application, we usually employ Action Annotations rather than layer.xml file for registering actions into a system.</p>
<p>For example, the code below is an implementation of closing a TopComponent. (Notes: we create a PaymentEditorTopComponent.class in org/editor/payment package, and CloseWindowAction.class in the org/action/payment package.)</p>
<p><code><br />
@ActionID(category = "MyPaymentEditorToolbars_WindowActions",<br />
id = "org.action.payment.CloseWindowAction")<br />
@ActionRegistration(iconBase = "org/action/payment/cross.png",<br />
displayName = "#CTL_CloseWindowAction")<br />
@ActionReferences({<br />
    @ActionReference(path = "Toolbars/MyPaymentEditorToolbars_WindowActions", position = 300)<br />
})<br />
@Messages("CTL_CloseWindowAction=Close Window")<br />
public final class CloseWindowAction implements ActionListener {</p>
<p>    @Override<br />
    public void actionPerformed(ActionEvent e) {<br />
        // TODO implement action body<br />
        PaymentEditorTopComponent tc = (PaymentEditorTopComponent)WindowManager.getDefault().findTopComponent("PaymentEditorTopComponent");<br />
        if (tc.canClose()) {<br />
            tc.close();<br />
        }<br />
    }<br />
}<br />
</code></p>
<p>Then, we add the following code snippets into componentActivated() and componentDeactivated() of the PaymentEditorTopComponent class.</p>
<p><code><br />
@Override<br />
    protected void componentActivated() {<br />
        Toolbar toolbar = ToolbarPool.getDefault().findToolbar("MyPaymentEditorToolbars_WindowActions");<br />
        if (!toolbar.isVisible()) {<br />
            toolbar.setVisible(true);<br />
        }<br />
    }</p>
<p>    @Override<br />
    protected void componentDeactivated() {<br />
        Toolbar toolbar = ToolbarPool.getDefault().findToolbar("MyPaymentEditorToolbars_WindowActions");<br />
        if (toolbar.isVisible()) {<br />
            toolbar.setVisible(false);<br />
        }<br />
    }<br />
</code></p>
<p>By the above means, the Close Window toolbar will be displayed when the PaymentEditorTopComponent is active, and hidden when the PaymentEditorTopComponent is not active.</p>
<p>There is catch. From my understanding, to be able to have Action Annotation as above, the action class must implement ActionListener.</p>
<p>However, the Save button implements SaveCookie, not ActionListener. So, what could we do to hide and show the Save button?</p>
<p>What I have done is to go back to the layer.xml approach.</p>
<ol>
<li>I create a class file named MySavePaymentCookieImpl which implements SaveCookie as usual.</li>
<li>I have InstanceContent, and fire(boolean){} as shown in the CRUD tutorial</li>
<li>I add the following code into layer.xml</li>
<p><code><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd"&gt;<br />
&lt;filesystem&gt;<br />
    &lt;folder name="Toolbars"&gt;<br />
        &lt;folder name="MyPaymentEditorToolbars_WindowActions"&gt;<br />
            &lt;file name="org-openide-actions-SaveAction.shadow"&gt;<br />
                &lt;attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAction.instance"/&gt;<br />
                &lt;attr name="position" intvalue="300"/&gt;<br />
            &lt;/file&gt;</p>
<p>            &lt;file name="org-openide-actions-SaveAllAction.shadow_hidden"/&gt;<br />
        &lt;/folder&gt;<br />
    &lt;/folder&gt;<br />
&lt;/filesystem&gt;</p>
<li><strong>Now, the key step is to inform the system to use layer.xml file by adding the following line into Module Manifest file</strong><br />
<code><br />
OpenIDE-Module-Layer: org/editor/payment/layer.xml<br />
</code>
</li>
<p></code>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/713/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=713&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2011/08/29/hideshow-a-save-button-in-netbeans-platform-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>Store image into and load image from JavaDB using EclipseLink</title>
		<link>http://mrtextminer.wordpress.com/2011/05/24/store-image-into-and-load-image-from-javadb-using-eclipselink/</link>
		<comments>http://mrtextminer.wordpress.com/2011/05/24/store-image-into-and-load-image-from-javadb-using-eclipselink/#comments</comments>
		<pubDate>Tue, 24 May 2011 11:49:44 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=648</guid>
		<description><![CDATA[My successful experience on how to store and load an image (.jpg) using JavaDB+EclipseLink+Java 1.6.0_25 and NetBeans 7.0 is as follows. A table named, Customer, is used as an illustrating example. There are three attributes in this table: CustomerId, Name, &#8230; <a href="http://mrtextminer.wordpress.com/2011/05/24/store-image-into-and-load-image-from-javadb-using-eclipselink/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=648&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My successful experience on how to store and load an image (.jpg) using JavaDB+EclipseLink+Java 1.6.0_25 and NetBeans 7.0 is as follows.</p>
<ol>
<li>A table named, Customer, is used as an illustrating example. There are three attributes in this table: CustomerId, Name, and Photo. </li>
<li>An SQL script of this table is shown below:
<p><code><br />
create table APP.Customer<br />
(<br />
	CUSTOMER_ID INTEGER not null primary key generated always as identity (start with 1, increment by 1),<br />
        FIRST_NAME VARCHAR(255),<br />
        PHOTO BLOB(2147483647)<br />
)<br />
</code></p>
</li>
<li>Create a database named, CustDB, through the Services tab of NetBeans IDE.
<ol>
<li>In NetBeans IDE 7.0, click on the Services tab.</li>
<li>Right-click on the JavaDB node, and then click on Create Database&#8230;</li>
<li>Enter the database name, user name and password in the provided text boxes. Use &#8220;mydb&#8221; for the user name and password.</li>
</ol>
</li>
<li>Create a new connection to the newly-created database.
<ol>
<li>On the &#8220;Services&#8221; tab, right-click on the &#8220;Databases&#8221; node, and then click on &#8220;New Connection&#8230;&#8221;</li>
<li>We will use JavaDB Network for this tutorial, so select &#8220;JavaDB (Network)&#8221; for the driver. Then, click Next.</li>
<li>Enter Host Name: localhost, Port: 1527, Database: CustDB, User name: mydb, and Password: mydb.</li>
<li>Click Next</li>
<li>Select &#8220;APP&#8221; as the schema name</li>
<li>Click Finish</li>
<li>A new connection node: jdbc:derby:localhost:1527/CustDB [myapp on APP]</li>
</ol>
</li>
<li>Create a new table in CustDB
<ol>
<li>Expand the CustDB connection node</li>
<li>Expand the APP node under CustDB node</li>
<li>Right-click on the &#8220;Table&#8221; node under the CustDB/APP node, and click on &#8220;Execute Command&#8230;&#8221; to open an SQL window</li>
<li>Copy the SQL script shown above into the SQL window, and click &#8220;Execute&#8221; icon.</li>
</ol>
</li>
<li>Create Java Library Project
<ol>
<li>On the Netbeans IDE 7.0 menu, File &#8211;&gt; New Project</li>
<li>Categories: Java and Projects: Java Class Library</li>
<li>Click Next</li>
<li>Project Name: MyCustomerLibraryProject</li>
<li>Click Finish</li>
<li>On the Project tab, right-click on the MyCustomerLibraryProject node &#8211;&gt; New &#8211;&gt; Entity Classes from Databases &#8230;</li>
<li>Select the CustDB connection that is just created above for the Database Connection. Then, there should be only one available table, named Customer.</li>
<li>Click &#8220;Add All&#8221; and then click &#8220;Next&#8221;</li>
<li>Put &#8220;demo&#8221; as the package name, and then click &#8220;Finish&#8221;</li>
</ol>
</li>
<li>Modify the generated Customer.class file in the MyCustomerJavaLibraryProject
<ol>
<li>Click the &#8220;demo&#8221; node to expand the node, there will be one Java file named, &#8220;Customer.java&#8221;.</li>
<li>Click the file to open it in the NetBeans IDE editor.</li>
<li>Since we use &#8220;mydb&#8221; as user name and password, we need to use a fully-qualified name for the table name. So, change:
<p><code><br />
@Table(name = "CUSTOMER")<br />
</code></p>
<p>to</p>
<p><code><br />
@Table(name = "APP.CUSTOMER")<br />
</code></p>
<p>The reason is that JavaDB will presume that the user name, in this case &#8220;mydb&#8221;,  is the schema name, however, we create the Customer table in &#8220;APP&#8221; schema. As a result, we need to use a fully-qualified name for the Customer table which is &#8220;APP.CUSTOMER&#8221;.
</li>
<li>In JavaDB, EclipseLink maps &#8220;BLOB&#8221; SQL data type into &#8220;Serializable&#8221; Java SQL data type. However, to store an image, we need to use &#8220;byte[]&#8221; Java SQL data type. Accordingly, we need to change:
<ul>
<li>The data type of &#8220;photo&#8221; variable definition from Serializable to byte[].<br />
<code><br />
 @Lob<br />
    @Column(name = "PHOTO")<br />
    private Serializable photo;<br />
</code><br />
to<br />
<code><br />
 @Lob<br />
    @Column(name = "PHOTO")<br />
    private byte[] photo;<br />
</code>
</li>
<li> The returned data type of getPhoto() method from Serializable to byte[]<br />
<code><br />
public Serializable getPhoto() {<br />
        return photo;<br />
    }<br />
</code><br />
to<br />
<code><br />
public byte[] getPhoto() {<br />
        return photo;<br />
    }<br />
</code>
</li>
<li>The parameter data type of setPhoto() from Serializable to byte[]<br />
<code><br />
public void setPhoto(Serializable photo) {<br />
        this.photo = photo;<br />
    }<br />
</code><br />
to<br />
<code><br />
public void setPhoto(byte[] photo) {<br />
        this.photo = photo;<br />
    }<br />
</code></p>
</li>
</ul>
</li>
<li>Now, we are ready to generate MyCustomerLibrary.jar by right-clicking on the &#8220;MyCustomerLibraryProject&#8221; and then click &#8220;Clean and Build&#8221;</li>
</ol>
</li>
<li>Create a Library Wrapper module containing &#8220;MyCustomerLibraryProject.jar&#8221; created above. Then, set the dependencies of this module to DerbyClient and EclipseLink library wrapper modules. Assume that these two modules are created beforehand.</li>
<li>Now, in a Java code where we need to save an image from JLabel into our CustDB database in JavaDB, use the following code snippet.
<p><code><br />
//Store image from jLabel into JavaDB<br />
                Customer newCustomer = new Customer();<br />
                ImageIcon imgIcon = (ImageIcon) jLabelImage.getIcon();</p>
<p>                if (imgIcon != null) {</p>
<p>                    Image img = imgIcon.getImage();<br />
                    byte[] imgByte = getByteArrayFromImage(img);</p>
<p>                    newCustomer.setPhoto(imgByte);</p>
<p></code></p>
</li>
<li>The getByteArrayFromImage() method is defined as follows.
<p><code><br />
private byte[] getByteArrayFromImage(Image img) {</p>
<p>        byte[] imgByte = null;</p>
<p>        try {<br />
            int imgWidth = img.getWidth(null);<br />
            int imgHeight = img.getHeight(null);<br />
            int imgType = BufferedImage.TYPE_INT_ARGB; // you can experiment with this one<br />
            BufferedImage bi = new BufferedImage(imgWidth, imgHeight, imgType);<br />
            Graphics2D g2 = bi.createGraphics();<br />
            g2.drawImage(img, 0, 0, null);<br />
            g2.dispose();</p>
<p>            ByteArrayOutputStream baos = new ByteArrayOutputStream();<br />
            if (ImageIO.write(bi, "JPEG", baos)) {<br />
                imgByte = baos.toByteArray();<br />
            }</p>
<p>        } catch (IOException ex) {<br />
            Exceptions.printStackTrace(ex);<br />
        }</p>
<p>        return imgByte;</p>
<p>    }</p>
<p></code></p>
</li>
<li>In addition, for the Java code where an image is loaded from CustDB and displayed in JLabel, use the following code snippet:
<p><code><br />
        //For image from database to jLabel<br />
        Customer existingCustomer = getCustomerFromDB(customerID);//load a Customer object from database<br />
        byte[] imageByte = existingCustomer.getPhoto();<br />
        if (imageByte != null) {</p>
<p>            ImageIcon imageIcon = new ImageIcon(imageByte);<br />
            java.awt.Image img = imageIcon.getImage();</p>
<p>            this.jLabelImage.setIcon(imageIcon);<br />
            this.jLabelImage.setText(null);</p>
<p>}<br />
</code></p>
</li>
<li>That&#8217;s pretty much all we need to do. However, you may need to specify allowable image file types, and scale an image before putting in a JLabel.</li>
<li>The methods in steps #9, #10 and #11 can be used for MySQL database. The thing is that MySQL maps BLOB SQL data type into byte[] Java SQL data type. Therefore, we do not need to do step #7.</li>
<li>The most important steps are #7, #9, #10 and #11 that we need to modify Customer.java file and define save/load methods.</li>
</ol>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/648/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=648&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2011/05/24/store-image-into-and-load-image-from-javadb-using-eclipselink/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>CRUD NetBeans Platform Application with Embedded JavaDB</title>
		<link>http://mrtextminer.wordpress.com/2011/05/22/crud-netbeans-platform-application-with-embedded-javadb/</link>
		<comments>http://mrtextminer.wordpress.com/2011/05/22/crud-netbeans-platform-application-with-embedded-javadb/#comments</comments>
		<pubDate>Sun, 22 May 2011 09:42:56 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=609</guid>
		<description><![CDATA[If you guys have followed this tutorial: CRUD tutorial for NetBeans Platform 7.0, and tried to make it an Embedded JavaDB application based on the following tutorial: Embedded Database for NetBeans Platform CRUD, and you receive this &#8220;Table/View does not &#8230; <a href="http://mrtextminer.wordpress.com/2011/05/22/crud-netbeans-platform-application-with-embedded-javadb/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=609&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you guys have followed this tutorial: <a title="CRUD Tutorial for NetBeans 7.0" href="http://platform.netbeans.org/tutorials/nbm-crud.html" target="_blank">CRUD tutorial for NetBeans Platform 7.0</a>, and tried to make it an Embedded JavaDB application based on the following tutorial: <a title="Embedded JavaDB" href="http://blogs.oracle.com/geertjan/entry/embedded_database_for_netbeans_platform" target="_blank">Embedded Database for NetBeans Platform CRUD</a>, and you receive this <strong>&#8220;<code>Table/View does not exist.</code>&#8220;</strong> error message, you need to edit a <code>persistence.xml</code> file as follows.</p>
<p>After creating entity classes from database, edit a <code>persistence.xml</code> file by adding:<br />
<code><br />
&lt;property name="eclipselink.ddl-generation" value="drop-and-create-tables"/&gt;<br />
</code></p>
<p>into the file within the existing <code>&lt;properties&gt;&lt;/properties&gt;</code> tags as shown below. (Notes: add the above line to <code>persistence.xml</code> before you create a <code>dist</code> folder).</p>
<p><code><br />
&lt;properties&gt;<br />
            &lt;property name="javax.persistence.jdbc.url" value="jdbc:derby:CustDB;create=true"/&gt;<br />
            &lt;property name="javax.persistence.jdbc.password" value="app"/&gt;<br />
            &lt;property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/&gt;<br />
            &lt;property name="javax.persistence.jdbc.user" value="app"/&gt;<br />
           <strong> &lt;property name="eclipselink.ddl-generation" value="drop-and-create-tables"/&gt;</strong><br />
            &lt;property name="eclipselink.logging.level" value="INFO"/&gt;<br />
        &lt;/properties&gt;<br />
</code></p>
<p>Next, you just do the &#8220;<code>Clean and Build All</code>&#8221; to create a &#8220;<code>dist</code>&#8221; folder containing a &#8220;<code>.jar</code>&#8221; file. The <code>.jar</code> file will then be used for the <code>CustomerLibrary</code> wrapper module.</p>
<p>In my understanding, the reason is that the <code>create=true</code> property in the connection string URL, <code>jdbc:derby:CustDB;create=true</code>,  will only create a new database, but does not create tables.</p>
<p>In addition, when making a connection using Services tab, a new database is created in <code>$NetBeans_Home/.netbeans/7.0/derby</code>. However, when creating a database from running the application, the database is created in <code>$Project_Home</code> or <code>DBManager</code> folder (Click the Files tab to see a newly-created database).</p>
<p>That&#8217;s why we still see tables existed when using Services tab, but the application issues &#8220;<code>Table/View does not exist.</code>&#8221; error message.</p>
<p>Cheers&#8230;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/609/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=609&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2011/05/22/crud-netbeans-platform-application-with-embedded-javadb/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>My Drupal for Fun: Customize Acquia Marina to Be Similar to Its Screenshot</title>
		<link>http://mrtextminer.wordpress.com/2010/12/20/my-drupal-for-fun-customize-acquia-marina-to-be-similar-to-its-screenshot/</link>
		<comments>http://mrtextminer.wordpress.com/2010/12/20/my-drupal-for-fun-customize-acquia-marina-to-be-similar-to-its-screenshot/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 16:22:38 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=519</guid>
		<description><![CDATA[I consider myself as a newbie on CMSs, particularly Drupal. In other words, I am in a middle of the high slope part of Drupal&#8217;s steep-learning curve. Based on my personal experience, the best way of learning a new thing &#8230; <a href="http://mrtextminer.wordpress.com/2010/12/20/my-drupal-for-fun-customize-acquia-marina-to-be-similar-to-its-screenshot/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=519&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I consider myself as a newbie on CMSs, particularly Drupal. In other words, I am in a middle of the high slope part of Drupal&#8217;s steep-learning curve. Based on my personal experience, the best way of learning a new thing is by doing and getting through it. So, I set up Drupal environment which consists of Apache HTTP server 2.2.17, MySQL 5.1.53, PHP 5.3.4, phpMyAdmin 3.3.8.1, and Drupal 6.19 with Acquia Marina 6.x-3.1, Fusion 6.x-1.0 themes and Skinr 6.x-1.6. My goal is to customize Acquia Marina from its default installation to be similar to its live demo. In other words, change from Figure 1 to Figure 2. <div id="attachment_524" class="wp-caption aligncenter" style="width: 310px"><a href="http://mrtextminer.files.wordpress.com/2010/12/sub_acquia_marina011.png"><img src="http://mrtextminer.files.wordpress.com/2010/12/sub_acquia_marina011.png?w=300&#038;h=180" alt="" title="sub_acquia_marina01" width="300" height="180" class="size-medium wp-image-524" /></a><p class="wp-caption-text">Figure 1: Default installation of Acquia Marina</p></div> <div id="attachment_526" class="wp-caption aligncenter" style="width: 310px"><a href="http://mrtextminer.files.wordpress.com/2010/12/acquia_marina1.png"><img src="http://mrtextminer.files.wordpress.com/2010/12/acquia_marina1.png?w=300&#038;h=227" alt="" title="acquia_marina" width="300" height="227" class="size-medium wp-image-526" /></a><p class="wp-caption-text">Figure 2: The live demo version of Acquia Marina</p></div> </p>
<p><strong>Notes:</strong> For people who are looking for a way to have texts wrapping around the Recent comment block, I still cannot figure out how to do it. </p>
<ol>
<li><strong>Set up necessary themes and modules. </strong>
<ol>
<li>Install Drupal into <code>$Apache_Home/htdocs</code> directory, where the <code>$Apache_Home</code> is the installation directory of the HTTP Server.</li>
<li>Rename the drupal installation directory to <code>$Apache_Home/htdocs/drupal6</code>. This directory will be known as <code>$Drupal_Home</code>.</li>
<li>Create a new directory named &#8220;<code>themes" in the </code><code>$Drupal_Home/sites/all</code> folder, resulting in <code>$Drupal_Home/sites/all/themes</code></li>
<li>Create a new directory named &#8220;<code>modules" in the </code><code>$Drupal_Home/sites/all folder, resulting in </code><code>$Drupal_Home/sites/all/modules</code></li>
<li>Install <code>Acquia Marina</code> and <code>Fusion themes in your </code><code>$Drupal_Home/sites/all/themes</code>. </li>
<li>Install <code>Skinr</code> module in your <code>$Drupal_Home/sites/all/modules</code></li>
</ol>
</li>
<li><strong>Set up a subtheme of Acquia Marina called Sub Acquia Marina</strong>. (Note: The subtheming approach described here is definitely <strong>NOT</strong> the correct way.)
<ol>
<li>Create a directory named <code>sub_acquia_marina</code> in the <code>$Drupal_Home/sites/all/themes</code> folder, which is the same directory level as the original <code>acquia_marina</code></li>
<li>Copy and paste everything in the original <code>acquia_marina</code> directory into your <code>sub_acquia_marina</code> folder.</li>
<li>Rename the <code>acquia_marina.info</code> file in the <code>sub_acquia_marina</code> folder to <code>sub_acquia_marina.info</code></li>
<li>Edit the <code>sub_acquia_marina.info</code> by replacing <code>name = Acquia Marina</code> with <code>name = Sub Acquia Marina</code></li>
</ol>
</li>
<li><strong>Access your Drupal homepage.</strong>
<ol>
<li>Start HTTP server.</li>
<li>Start MySQL server. (Assume that you already create a new database for your Drupal web site, and run the installation script.)</li>
<li>Open a web browser and point to the address: <code>http://localhost/drupal6/</code>. (Note: &#8220;<code>drupal6</code>&#8221; is your Drupal installation directory.)</li>
</ol>
</li>
<li><strong>Change the default theme to your Sub Acquia Marina, and activate all necessary themes and modules.</strong>
<ol>
<li>On your Drupal homepage, log in as administrator.</li>
<li>Administer -&gt; Site building -&gt; Themes</li>
<li>Check the <code>Enabled</code> checkbox for <code>Acquia Marina</code> theme.</li>
<li>Check the <code>Enabled</code> checkbox for <code>Fusion Core</code> theme.</li>
<li>Check the <code>Enabled</code> checkbox and <code>default</code> radio button for <code>Sub Acquia Marina</code> theme.</li>
<li>Click on the &#8220;<code>Save Configuration</code>&#8221; button.</li>
<li>Administer -&gt; Site building -&gt; Modules</li>
<li>Check the <code>Enabled</code> checkbox in front of the <code>Skinr</code> module.</li>
</ol>
</li>
<li><strong>Activate the Site Slogan and Search form box. </strong>
<ol>
<li>Administer -&gt; Themes -&gt; Configure -&gt; Check the checkboxes for Site slogan and Search box</li>
<li>Click on the &#8220;Save Configuration&#8221; button.</li>
</ol>
</li>
<li><strong>Enter the Site slogan.</strong>
<ol>
<li>Administer -&gt; Site configuration -&gt; Site information</li>
<li>Enter your slogan in the Slogan textfield.</li>
<li>Click on the &#8220;Save Configuration&#8221; button</li>
</ol>
</li>
<li><strong>Put the Search form, Who&#8217;s new, and Navigator blocks in the Sidebar first region, and put the Recent comments block in the Sidebar last region. </strong>
<ol>
<li>Administer -&gt; Site building -&gt; Blocks</li>
<li>Move the Search form, Who&#8217;s new and Navigator to the Sidebar first region by putting the Search above the Who&#8217;s new and Who&#8217;s new above the Navigator blocks, respectively.</li>
<li>Click on the &#8220;Save Configuration&#8221; button</li>
</ol>
</li>
<li><strong>Configure the Search box </strong>
<ol>
<li>On your drupal homepage, move your mouse over the Search box. A configuration icon, a gear icon, will be visible or shown up.</li>
<li>Click on the gear icon to go to the configuration page for the Search box.</li>
<li>Acquia Marina &#8212; General theme styles: <code>Rounded corners</code></li>
<li>Acquia Marina &#8212; Block title styles: <code>Green rounded title background with white text</code></li>
<li>Acquia Marina &#8212; Block title icon styles: <code>Search</code></li>
</ol>
</li>
<li><strong>Configure the Who&#8217;s New block</strong>
<ol>
<li>Similar to the Search box, move mouse over the Who&#8217;s new area, and click on the gear icon to go to the configuration page for the Search box.</li>
<li>Acquia Marina &#8212; General theme styles: <code>Rounded corners</code></li>
<li>Acquia Marina &#8212; Block title styles: <code>Green rounded title background with white text</code></li>
<li>Acquia Marina &#8212; Block title icon styles: <code>Star</code></li>
</ol>
</li>
<li><strong>Configure the Navigator block </strong>
<ol>
<li>Use the same configuration as the Who&#8217;s new block.</li>
</ol>
</li>
<li><strong>Configure the Recent comments block</strong>
<ol>
<li>Similar to the Search box, move mouse over the Recent comments block, and click on the gear icon to go to the configuration page for the Search box.</li>
<li>Acquia Marina &#8212; General theme styles: <code>Rounded corners</code></li>
<li>Acquia Marina &#8212; Block title styles: <code>Green rounded title background with white text</code></li>
<li>Acquia Marina &#8212; Block title icon styles: <code>Bubble</code></li>
</ol>
</li>
<li><strong>Add primary and secondary links </strong>
<ol>
<li>Administer -&gt; Site building -&gt; Menus -&gt; Primary links.</li>
<li>ADD ITEM, Path: <code>&lt;front&gt;</code>, Menu link title: <code>Home</code>, Enabled: <code>Checked</code>, Expanded: <code>Unchecked</code>, Parent item: <code>&lt;Primary links&gt;</code>, and Weight: <code>0</code></li>
<li>ADD ITEM, Path: <code>&lt;front&gt;</code>, Menu link title: <code>About Us</code>, Enabled: <code>Checked</code>, Expanded: <code>Unchecked</code>, Parent item: <code>&lt;Primary links&gt;</code>, and Weight: <code>1</code></li>
<li>ADD ITEM, Path: <code>&lt;front&gt;</code>, Menu link title: <code>Our Services</code>, Enabled: <code>Checked</code>, Expanded: <code>Checked</code>, Parent item: <code>&lt;Primary links&gt;</code>, and Weight: <code>2</code></li>
<li>ADD ITEM, Path: <code>&lt;front&gt;</code>, Menu link title: <code>Drupal theming</code>, Enabled: <code>Checked</code>, Expanded: <code>Unchecked</code>, Parent item: <code>Our Services</code>, and Weight: <code>0</code></li>
<li>ADD ITEM, Path: <code>&lt;front&gt;</code>, Menu link title: <code>Web design</code>, Enabled: <code>Checked</code>, Expanded: <code>Unchecked</code>, Parent item: <code>Our Services</code>, and Weight: <code>1</code></li>
</ol>
</li>
<li><strong>Remove an underline from each secondary link</strong>
<ol>
<li>Edit the <code>fusion-acquia-marina-style.css</code> file in your <code>sub_acquia_marina</code> folder.</li>
<li>Search for the following definition in the file<br />
<code><br />
#primary-menu ul.menu li ul.menu li a.active {<br />
text-decoration: underline;<br />
}<br />
</code><br />
 </li>
<li>Replace the word &#8220;<code>underline</code>&#8221; with &#8220;<code>none</code>&#8220;.</li>
</ol>
</li>
<li><strong>Divide the <code>Preface Top</code> region into <code>Preface Top Left</code> region and <code>Preface Top Right</code> region. </strong>
<ol>
<li>Edit your <code>sub_acquia_marina.info</code> file, and replace<br />
<code><br />
regions[preface_top] = preface top<br />
</code><br />
with<br />
<code><br />
regions[preface_top_left] = preface top left<br />
regions[preface_top_right] = preface top right<br />
</code><br />
 </li>
</ol>
</li>
<li><strong>Define the Preface Top Left and Preface Top Right regions in the front page.</strong>
<ol>
<li>Copy and paste the <code>page.tpl.php</code> file into the same directory.</li>
<li>Rename the pasted file into <code>page-front.tpl.php</code>. This file will be served as a template for your front page.</li>
<li>Find the following line in the <code>page-front.tpl.php</code> file:<br />
<code><br />
&lt;div id="preface-top-inner" class="preface-top-inner inner clearfix"&gt;<br />
</code><br />
 </li>
<li>Insert the following section of code right below the above line.<br />
<code><br />
&lt;div id="mypreface" class="mypreface"&gt;<br />
&lt;?php if ($preface_top_left): ?&gt;<br />
&lt;div id="preface-top-left"&gt;<br />
&lt;?php print $preface_top_left; ?&gt;<br />
&lt;/div&gt; &lt;?php endif; ?&gt;<br />
&lt;?php if ($preface_top_right): ?&gt;<br />
&lt;div id="preface-top-right"&gt;<br />
&lt;?php print $preface_top_right; ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/div&gt;<br />
</code><br />
 </li>
</ol>
<p> </li>
<li><strong>Define styles for Preface Top Left and Preface Top Right regions.</strong>
<ol>
<li>Edit the <code>fusion-acquia-marina-style.css</code> in your <code>sub_acquia_marina/css</code> folder</li>
<li>Add the following section of code right after the definition of <code>.preface-top-wrapper{...}</code>.<br />
<code><br />
#mypreface{<br />
margin: 0 auto;<br />
}<br />
#preface-top-left {<br />
width: 50%; float: left;<br />
}<br />
#preface-top-right {<br />
width: 50%; margin-left: 50%;<br />
} </code>
</li>
</ol>
<p> </li>
<li><strong>Add a new custom blocks into the Preface Top Left region.</strong>
<ol>
<li>On your Drupal homepage, Administer -&gt; Site building -&gt; Blocks</li>
<li>ADD BLOCK</li>
<li>Acquia Marina &#8212; List styles: <code>Large text list with green checkmarks (for Preface Top region)</code></li>
<li>Acquia Marina &#8211; Block title styles: <code>Green title</code></li>
<li>Block description: <code>my_left_block</code></li>
<li>Block title: <code>UNORDERED LIST</code></li>
<li>Block body:<br />
<code><br />
&lt;ul&gt;<br />
&lt;li&gt;List Item 1&lt;/li&gt;<br />
&lt;li&gt;List Item 2&lt;/li&gt;<br />
&lt;li&gt;List Item 3&lt;/li&gt;<br />
&lt;li&gt;List Item 4&lt;/li&gt;<br />
&lt;/ul&gt; </code>
</li>
</ol>
<p> 
</li>
<li><strong>Add another custom block to the Preface Top Right region. </strong>
<ol>
<li>On your Drupal homepage, Administer -&gt; Site building -&gt; Blocks</li>
<li>ADD BLOCK</li>
<li>Acquia Marina &#8212; List styles: <code>&lt;none&gt;</code></li>
<li>Acquia Marina &#8211; Block title styles: <code>Green title</code></li>
<li>Block description: <code>my_right_block</code></li>
<li>Block title: <code>This part is for a text paragraph</code></li>
<li>Block body:<br />
<code><br />
&lt;font size="3" face="'Myriad Pro', 'Myriad Web Pro Regular', 'Lucida Grande', Geneva, Trebuchet MS, sans-serif"&gt;Put whatever text that you'd like to in the Block body.&lt;/font&gt;<br />
</code><br />
 </li>
<li>The font face inside the &lt;font&gt; tag is derived from the font-family definition of <code>Marina - List - Green arrow</code> in the <code>fusion-acquia-marina-style.css</code> file.</li>
<li>To incorporate the &lt;font&gt; tag, set the Input format to: <code>Full HTML.</code></li>
</ol>
<p> </li>
<li><strong>Decrease the font size of list items for Acquia Marina &#8212; List styles. </strong>
<ol>
<li>Search the following definition in the <code>fusion-acquia-marina-style.css</code> file of your <code>sub_acquia_marina</code> folder.<br />
<code><br />
/* Marina - List - Green arrow */<br />
.marina-list-arrow-green ul li {<br />
background: url(../images/green-checkmark.png) no-repeat 0 5px;<br />
font-family: "Myriad Pro", "Myriad Web Pro Regular", "Lucida Grande", Geneva, Trebuchet MS, sans-serif; font-size: 120%; /* 18px/12px */<br />
line-height: 100%;<br />
list-style-image: none;<br />
list-style-type: none;<br />
padding: 10px 0 15px 40px; }<br />
</code><br />
 </li>
<li>Change the font-size from <code>150%</code> to <code>120%</code>.</li>
</ol>
</li>
<li><strong>Add a new content node.</strong>
<ol>
<li>On your Drupal homepage, click on &#8220;Create content&#8221; -&gt; Story</li>
<li>Put your own text in the Title and Body.</li>
<li>Click on the &#8220;Save&#8221; button and add some comments to the story.</li>
</ol>
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/519/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=519&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/12/20/my-drupal-for-fun-customize-acquia-marina-to-be-similar-to-its-screenshot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>

		<media:content url="http://mrtextminer.files.wordpress.com/2010/12/sub_acquia_marina011.png?w=300" medium="image">
			<media:title type="html">sub_acquia_marina01</media:title>
		</media:content>

		<media:content url="http://mrtextminer.files.wordpress.com/2010/12/acquia_marina1.png?w=300" medium="image">
			<media:title type="html">acquia_marina</media:title>
		</media:content>
	</item>
		<item>
		<title>Intermodule Communications in NetBeans Platform: Open a TopComponent in one module from another TopComponent in another module through the use of Lookup API</title>
		<link>http://mrtextminer.wordpress.com/2010/12/14/intermodule-communications-in-netbeans-platform-open-a-topcomponent-in-one-module-from-another-topcomponent-in-another-module-through-the-use-of-lookup-api/</link>
		<comments>http://mrtextminer.wordpress.com/2010/12/14/intermodule-communications-in-netbeans-platform-open-a-topcomponent-in-one-module-from-another-topcomponent-in-another-module-through-the-use-of-lookup-api/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 15:00:07 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=316</guid>
		<description><![CDATA[In this blog, I&#8217;d like to share my experience on an implementation of a NetBeans Platform application. The content below is mostly based on the CRUD tutorial with some of my own modifications. The key idea is on how to &#8230; <a href="http://mrtextminer.wordpress.com/2010/12/14/intermodule-communications-in-netbeans-platform-open-a-topcomponent-in-one-module-from-another-topcomponent-in-another-module-through-the-use-of-lookup-api/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=316&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this blog, I&#8217;d like to share my experience on an implementation of a NetBeans Platform application. The content below is mostly based on <a href="http://platform.netbeans.org/tutorials/nbm-crud.html">the CRUD tutorial</a> with some of my own modifications. The key idea is on how to use Lookup API for intermodule communications, specifically, for opening a TopComponent in one module from within another TopComponent in another different module without setting up a direct dependency between two of them. Observe the differences of how the Lookup API is used in the ContractTC and in the ContractSummaryTC. So, have fun!</p>
<p><strong>The scenario for this blog is that:</strong></p>
<ul>
<li>I am developing a NetBeans Platform application containing one data class called Contract and three user-interface (UI) windows named: MainTC, ContractTC and ContractSummaryTC.
<ul>
<li>Contract is a POJO class that contains methods and a number of attributes describing a contract such as contract_number, contract_date, and so on. It is created in its own module named Contract module.</li>
<li>MainTC is an entry point of an application. Here, a user can specify whether to create a new contract, or to display information of an existing contract.</li>
<li>ContractTC is a user-interface window that contains Form fields (JTextFields) for a user to enter information of a new contract.</li>
<li>ContractSummaryTC is a user-interface window that contains Swing components (JTextFields) displaying information of an existing contract. </li>
</ul>
</li>
<li>Each UI window is created as a TopComponent in its own module. In other words, MainTC is created in main_editor module, ContractTC is created in contract_editor module, and ContractSummaryTC is created in contract_summary_editor module.</li>
<li>A user can go from
<ul>
<li><strong>MainTC to ContractTC</strong> for entering contract information to create a new contract.</li>
<li><strong>MainTC to ContractSummaryTC</strong> for displaying an existing contract information including its payment plan based on contract_number provided by a user.</li>
<li><strong>ContractTC to ContractSummaryTC</strong> for displaying information of the newly-created contract such as the contract itself and its payment plan.</li>
</ul>
</li>
<li>ContractTC requires the last contract number from MainTC in order to generating a new contract number.</li>
<li>ContractSummaryTC requires a Contract class object from MainTC. The Contract class object is retrieved from a database by using the contract number specified by a user at the MainTC.</li>
<li>ContractSummaryTC requires a Contract class object from ContractTC. The Contract class object is a new contract created from information provided by a user in ContractTC.</li>
</ul>
<p><strong>Use Case #1:</strong> Create a new contract.</p>
<ol>
<li>In MainTC, a user clicks on the &#8220;Create a new contract&#8221; button.</li>
<li>The system finds the last contract number in a database.</li>
<li>The system generates a new contract number based on the last contract number found.</li>
<li>The system opens the ContractTC window with a new contract number.</li>
<li>In ContractTC window, the user enters all necessary information for a new contract.</li>
<li>The user clicks on the &#8220;Save&#8221; button.</li>
<li>Go To Use Case #2</li>
</ol>
<p><strong>Use Case #2:</strong> Display information of a newly-created contract.</p>
<ol>
<li>Continued from Use Case #1.</li>
<li>The system derives a payment plan for the new contract based on user-provided information.</li>
<li>The system opens the ContractSummaryTC window with contract information and its derived payment plan.</li>
</ol>
<p><strong>Use Case #3:</strong> Display information of an existing contract.</p>
<ol>
<li>In MainTC, a user provides a contract number, and click on the &#8220;Find contract&#8221; button.</li>
<li>The system searches for a contract in a database based on the contract number.</li>
<li>The system opens the ContractSummaryTC window with information of the contract retrieved from the database.</li>
</ol>
<p><strong>Implementation guidelines:</strong></p>
<ul>
<li>MainTC, ContractTC, and ContractSummaryTC are in separate modules. For a loosely-coupling reason, we will not set dependency on any pair of these modules. However, all of them have direct dependencies on the Contract module.</li>
<li>When creating a new contract, MainTC will add a new contract number into its lookup, and open the ContractTC window. Then, the ContractTC window has to look for the new contract number in the lookup of the MainTC, when it is opened.</li>
<li>When displaying an existing contract, MainTC will add a contract class object into its lookup, and open the ContractSummary window. In addition, the ContractSummary window will have to look for a contract class object in the lookup of the MainTC, when it is opened.</li>
<li>When displaying a newly-created contract, ContractTC will add a newly-created contract class into its lookup, and open the ContractSummary window. Moreover, the ContractSummary window will look for a contract class object in the lookup of the ContractTC, when it is opened.</li>
</ul>
<p><strong>MainTC implementation:</strong></p>
<ol>
<li>Declare InstanceContent variable as an instance variable. The InstanceContent is a dynamic object class that allows modifications of the content in a lookup.<br />
              <code><br />
private InstanceContent content;<br />
</code><br />

        </li>
<li>Instantiate the InstanceContent variable in the MainTC constructor.<br />
              <code><br />
content = new InstanceContent();<br />
</code><br />

        </li>
<li>Put the InstanceContent variable into the lookup of the MainTC by adding the following line after the line above in the MainTC constructor.<br />
<code><br />
associateLookup(new AbstractLookup(content));<br />
</code><br />

       </li>
<li>In a method in MainTC class that contains a new contract number, add the following lines to add the new contract number to the dynamic object in the lookup and to open the ContractTC window.<br />
<code><br />
String contractNumber = generateANewContractNumber();<br />
//Open the ContractTC window where "ContractTC" is its Preferrred_ID.<br />
TopComponent tc = WindowManager.getDefault().findTopComponent("ContractTC");<br />
this.content.add(contractNumber);<br />
if (tc != null) {<br />
&nbsp;&nbsp;&nbsp;tc.open();<br />
&nbsp;&nbsp;&nbsp;tc.requestActive();<br />
}<br />
this.content.remove(contractNumber);<br />
</code><br />

</li>
<li>In a method in MainTC that contains an existing contract class object, add the following lines to add the object to the lookup of MainTC and to open the ContractSummaryTC window.<br />
<code><br />
Contract contractObj = retrieveContractFromDatabase(contractNumber);<br />
TopComponent tc = WindowManager.getDefault().findTopComponent("ContractSummaryTC");<br />
if (tc != null) {<br />
&nbsp;&nbsp;&nbsp;tc.open();<br />
&nbsp;&nbsp;&nbsp;tc.requestActive();<br />
}<br />
this.content.add(contractObj);<br />
this.content.remove(contractObj);<br />
</code><br />
<br />
<strong>Note #1:</strong> I add the contract class object to the lookup of MainTC after I open the ContractSummaryTC window, and then remove the object from the lookup of MainTC. I do not know the reason, but if I add the contract class object to the lookup of MainTC before I open the ContractSummaryTC window, it does not work.<br />
<strong>Note #2:</strong> The above implementations are pretty much what we need to do for adding things to the lookup of a TopComponent (MainTC) in one module. So, other modules can use them.<br />
<strong>Note #3:</strong> In summary, we add a contract number as String data type and a contract object as Contract class type to the lookup of MainTC. The first is for ContractTC and the later is for ContractSummaryTC.
</li>
</ol>
<p><strong>ContractTC implementation:</strong></p>
<ol>
<li>Modify the ContractTC class signature to implement LookupListener as shown below.
<p><code><br />
public final class ContractTC extends TopComponent implements LookupListener {<br />
...<br />
...<br />
}<br />
</code><br />

</li>
<li>Declare a Contract object as an instance variable.<br />
<code><br />
Contract contractObj=null;<br />
</code><br />

</li>
<li>Declare a Lookup.Result variable as an instance variable.<br />
<code><br />
private Lookup.Result result = null;<br />
</code><br />

</li>
<li>Declare an InstanceContent variable as an instance variable.<br />
<code><br />
private InstanceContent content = null;<br />
</code><br />

</li>
<li>Add DocumentListener to JTextFields for save functionality in the constructor.<br />
<code><br />
this.jTextFieldContractNumber.getDocument().addDocumentListener(new DocumentListener(){<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;public void insertUpdate(DocumentEvent e) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;fire(true);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;public void removeUpdate(DocumentEvent e) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;fire(true);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;public void changedUpdate(DocumentEvent e) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;fire(true);<br />
&nbsp;&nbsp;}<br />
});<br />
</code><br />

</li>
<li>Declare a SaveCookie variable as an instance variable.<br />
<code><br />
 private SaveCookie impl = null;<br />
</code><br />

</li>
<li>Instantiate the SaveCookie<br />
<code><br />
 impl = new SaveCookieImpl();<br />
</code><br />

</li>
<li>Instantiate the InstanceContent variable in the constructor<br />
<code><br />
content = new InstanceContent();<br />
</code><br />

</li>
<li>Put the InstanceContent object into the lookup of the ContractTC.<br />
<code><br />
associateLookup(new AbstractLookup(content));<br />
</code><br />

</li>
<li>Define an inner private class named SaveCookieImpl that implements SaveCookie interface.
<p><code><br />
private class SaveCookieImpl implements SaveCookie {<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;@SuppressWarnings("unchecked")<br />
&nbsp;&nbsp;public void save() throws IOException {<br />
&nbsp;&nbsp;//Implement this method.<br />
&nbsp;&nbsp;}<br />
</code><br />

</li>
<li>Implement the save() method in the SaveCookieImpl class.
<p><code><br />
@Override<br />
@SuppressWarnings("unchecked")<br />
public void save() throws IOException {<br />
&nbsp;&nbsp;Confirmation message = new NotifyDescriptor.Confirmation("Do you want to save changes?",<br />
NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE);<br />
&nbsp;&nbsp;Object result = DialogDisplayer.getDefault().notify(message);<br />
&nbsp;&nbsp;if (NotifyDescriptor.YES_OPTION.equals(result)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;fire(false);<br />
&nbsp;&nbsp;&nbsp;&nbsp;//Obtain contract information from user interface such as JTextFields.<br />
&nbsp;&nbsp;&nbsp;&nbsp;//Create a contract class object from the obtained information.<br />
&nbsp;&nbsp;&nbsp;&nbsp;contractObj=createContractObjFromObtainedData();<br />
&nbsp;&nbsp;&nbsp;&nbsp;//May save the contract class object into a database.<br />
&nbsp;&nbsp;&nbsp;&nbsp;//Open the ContractSummaryTC window below.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TopComponent tc = WindowManager.getDefault().findTopComponent("ContractSummaryTC");<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (tc != null) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tc.open();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tc.requestActive();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;content.add(contractObj);<br />
&nbsp;&nbsp;&nbsp;&nbsp;content.remove(contractObj);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;else<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;javax.swing.JOptionPane.showMessageDialog(null, "Unsuccessfully add a new contract.");<br />
&nbsp;&nbsp;}<br />
}<br />
</code><br />

</li>
<li>Implement the fire() method that is called in the save() method above.<br />
<code><br />
 public void fire(boolean modified) {<br />
 &nbsp;&nbsp;if (modified) {<br />
 &nbsp;&nbsp;&nbsp;&nbsp;//If the text is modified,<br />
 &nbsp;&nbsp;&nbsp;&nbsp;//we add SaveCookie impl to Lookup<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content.add(impl);<br />
 &nbsp;&nbsp;&nbsp;&nbsp;} else {<br />
 &nbsp;&nbsp;&nbsp;&nbsp;//Otherwise, we remove the SaveCookie impl from the lookup<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content.remove(impl);<br />
 &nbsp;&nbsp;&nbsp;&nbsp;}<br />
 &nbsp;&nbsp;}<br />
}</p>
<p></code></p>
</li>
<li>Override the componentOpened() method as follows.<br />
<code><br />
result = WindowManager.getDefault().findTopComponent("MainTC").getLookup().lookupResult(String.class);<br />
result.addLookupListener(this);<br />
resultChanged(new LookupEvent(result));<br />
</code><br />

</li>
<li>Override the componentClosed() method as follows.<br />
<code><br />
result.removeLookupListener(this);<br />
result = null;<br />
</code><br />

</li>
<li>Override the componentDeactivated() method as follows.<br />
<code><br />
@Override<br />
protected void componentDeactivated() {<br />
&nbsp;&nbsp;this.content.remove(contractObj);<br />
}<br />
</code><br />

</li>
<li>Override the resultChanged() method as follows.<br />
<code><br />
@Override<br />
@SuppressWarnings("unchecked")<br />
public void resultChanged(LookupEvent le) {<br />
&nbsp;&nbsp;Lookup.Result r = (Lookup.Result) le.getSource();<br />
&nbsp;&nbsp;Collection col = r.allInstances();<br />
&nbsp;&nbsp;if (!col.isEmpty()) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;for (String contractNumber : col) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.jTextFieldContractNumber.setText(contractNumber);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Do anything that you would like to.<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
}<br />
</code><br />

</li>
</ol>
<p><strong>ContractSummaryTC implementation:</strong></p>
<ol>
<li>Define two LookupListener classes as private inner classes. These two custom classes are used to detect changes of the content in the lookups of MainTC and ContractTC, respectively.
<p><code><br />
private class MyMainTCLookupListener implements LookupListener {<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;@SuppressWarnings("unchecked")<br />
&nbsp;&nbsp;public void resultChanged(LookupEvent le) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Lookup.Result r = (Lookup.Result) le.getSource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;Collection col = r.allInstances();<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!col.isEmpty()) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (ContractT cont : col) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jTextFieldContractNumber.setText(cont.getContractNumber());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jTextFieldContractDate.setText(cont.getContractDate());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Retrieve payment history, or<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Do something else as you would like to.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p><code><br />
 private class MyContractTCLookupListener implements LookupListener {<br />
&nbsp;&nbsp;@Override<br />
&nbsp;&nbsp;@SuppressWarnings("unchecked")<br />
&nbsp;&nbsp;public void resultChanged(LookupEvent le) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Lookup.Result r = (Lookup.Result) le.getSource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;Collection col = r.allInstances();<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!col.isEmpty()) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (ContractT cont : col) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jTextFieldContractNumber.setText(cont.getContractNumber());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jTextFieldContractDate.setText(cont.getContractDate());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Generate a payment plan, or<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Do something else as you would like to.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p>
<strong>Note: </strong>The reason I define two separate LookupListener classes is that I can differentiate where or which class the Contract object is coming from. For example, if a contract object is from MainTC, I know that the contract is retrieved from the database. Accordingly, I can further retrieve payment history for this contract. In contrary, if a contract object is from ContractTC, I know that it is a newly-created contract. So, I can further implement a generation of payment plan for this contract.<br />
<br />&nbsp;
</li>
<li>Declare two LookupListener variables as instance variables.<br />
<code><br />
 private MyMainTCLookupListener mainTCLookupListener;<br />
    private MyContractTCLookupListener contractTCLookupListener;<br />
</code><br />

</li>
<li>Declare two Lookup.Result variables as instance variables.<br />
        <code><br />
private Lookup.Result mainTCLookupResult;<br />
    private Lookup.Result contractTCLookupResult;<br />
</code><br />

</li>
<li>Instantiate LookupListener variables in the constructor.
<p><code><br />
mainTCLookupListener = new MyMainTCLookupListener();<br />
contractTCLookupListener = new MyContractTCLookupListener();<br />
</code><br />

</li>
<li>Override the componentOpened() method as follows.<br />
<code><br />
mainTCLookupResult = WindowManager.getDefault().findTopComponent("MainTC").getLookup().lookupResult(ContractT.class);<br />
mainTCLookupResult.addLookupListener(mainTCLookupListener);<br />
contractTCLookupResult = WindowManager.getDefault().findTopComponent("ContractTC").getLookup().lookupResult(ContractT.class);<br />
contractTCLookupResult.addLookupListener(contractTCLookupListener);<br />
</code><br />

</li>
<li>Override the componentClosed() method as follows.<br />
<code><br />
 mainTCLookupResult.removeLookupListener(mainTCLookupListener);<br />
 mainTCLookupResult = null;<br />
contractTCLookupResult.removeLookupListener(contractTCLookupListener);<br />
contractTCLookupResult = null;<br />
</code><br />

</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=316&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/12/14/intermodule-communications-in-netbeans-platform-open-a-topcomponent-in-one-module-from-another-topcomponent-in-another-module-through-the-use-of-lookup-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 (RC2): How to create a customized front page.</title>
		<link>http://mrtextminer.wordpress.com/2010/12/13/drupal-7-rc2-how-to-create-a-customized-front-page/</link>
		<comments>http://mrtextminer.wordpress.com/2010/12/13/drupal-7-rc2-how-to-create-a-customized-front-page/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 14:08:38 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=338</guid>
		<description><![CDATA[In this blog, I briefly describe a procedure for creating a customized Drupal front page. It&#8217;s just a series of steps of what to do, not a detailed how-to. Get into the theme directory: $Drupal7_Home/sites/all/themes/danland, where &#8220;danland&#8221; is the theme &#8230; <a href="http://mrtextminer.wordpress.com/2010/12/13/drupal-7-rc2-how-to-create-a-customized-front-page/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=338&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this blog, I briefly describe a procedure for creating a customized Drupal front page. It&#8217;s just a series of steps of what to do, not a detailed how-to.</p>
<ol>
<li>Get into the theme directory: <code>$Drupal7_Home/sites/all/themes/danland</code>, where &#8220;danland&#8221; is the theme name.</li>
<li>Copy and paste <code>page.tpl.php</code> into the same directory as it already is. </li>
<li>Rename the copied file to <code>page--front.tpl.php</code>. Notice that there are two dashes.</li>
<li>Change whatever you&#8217;d like to do for your customization in the <code>page--front.tpl.php</code>. For example, for a testing purpose, I change the phrase &#8220;Theme by&#8221; at the bottom of the page to &#8220;Developed by&#8221;.</li>
<li>Clear Drupal caches:
<ol>
<li>Open a web browser and point the address to your Drupal homepage such as <code>http://localhost/drupal7</code></li>
<li>Log into your Drupal homepage as administrator.</li>
<li>Click on &#8220;Configuration&#8221;</li>
<li>Then, under the &#8220;Development&#8221; section, click on &#8220;Performance&#8221;</li>
<li>Finally, click on &#8220;Clear all caches&#8221;.</li>
</ol>
</li>
<li>Refresh your Drupal homepage, the &#8220;Theme by&#8221; at the button of the homepage should be changed to &#8220;Developed by&#8221;.</li>
</ol>
<p>Let&#8217;s try to customize Acquia Marina theme as I explain in <a href="http://mrtextminer.wordpress.com/2010/12/20/my-drupal-for-fun-customize-acquia-marina-to-be-similar-to-its-screenshot/">this blog</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=338&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/12/13/drupal-7-rc2-how-to-create-a-customized-front-page/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix incorrectly-displayed column names when creating a custom JTableModel that extends AbstractTableModel.</title>
		<link>http://mrtextminer.wordpress.com/2010/10/07/fix-the-incorrectly-displayed-column-names-when-creating-a-custom-jtable-that-extends-abstracttablemodel/</link>
		<comments>http://mrtextminer.wordpress.com/2010/10/07/fix-the-incorrectly-displayed-column-names-when-creating-a-custom-jtable-that-extends-abstracttablemodel/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 11:59:35 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=235</guid>
		<description><![CDATA[When we write a custom JTable that extends AbstractTableModel, its column names may not be displayed correctly if we forget to override a particular method. By the &#8220;incorrect display&#8221;, I mean that instead of showing names of the columns specified &#8230; <a href="http://mrtextminer.wordpress.com/2010/10/07/fix-the-incorrectly-displayed-column-names-when-creating-a-custom-jtable-that-extends-abstracttablemodel/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=235&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When we write a custom JTable that extends AbstractTableModel, its column names may not be displayed correctly if we forget to override a particular method. By the &#8220;incorrect display&#8221;, I mean that instead of showing names of the columns specified in the custom class, the column names were displayed as &#8220;A&#8221;, &#8220;B&#8221;, &#8220;C&#8221;, &#8230;  </p>
<p>To fix this problem, we need to implement getColumnName() in our custom TableModel. This method is not required for extending AbstractTableModel. So, some of us may not do it.</p>
<p>For example, if we define column names of a table as </p>
<p><code>String[] columnNames={"name1", "name2"};</code></p>
<p>Then, we can override the <code>getColumnName(int columnIndex)</code> as </p>
<p><code><br />
public String getColumnName(int columnIndex){<br />
      return columnNames[columnIndex];<br />
}<br />
</code></p>
<p>Well, do not get confused between:<br />
<code>getColumnNames()</code> and <code>getColumnName(int columnIndex)</code>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=235&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/10/07/fix-the-incorrectly-displayed-column-names-when-creating-a-custom-jtable-that-extends-abstracttablemodel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable clean URLs in Drupal 6.19</title>
		<link>http://mrtextminer.wordpress.com/2010/08/12/how-to-enable-clean-urls-in-drupal-6-19/</link>
		<comments>http://mrtextminer.wordpress.com/2010/08/12/how-to-enable-clean-urls-in-drupal-6-19/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 06:45:43 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=237</guid>
		<description><![CDATA[Drupal could be considered as one of the big three open-source Content Management Systems (CMSs), in addition to WordPress and Joomla. Its installation is simple. First, it requires a new blank database in MySQL with some proper privileges. Then, unzip &#8230; <a href="http://mrtextminer.wordpress.com/2010/08/12/how-to-enable-clean-urls-in-drupal-6-19/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=237&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Drupal could be considered as one of the big three open-source Content Management Systems (CMSs), in addition to WordPress and Joomla. Its installation is simple. First, it requires a new blank database in MySQL with some proper privileges. Then, unzip the drupal downloaded file into a web root directory of a web server. In case of Apache HTTP server, the web root directory is the htdocs directory. Finally, make a copy of default.settings.php in the $Drupal_Home/sites/default directory and rename it to settings.php. Nothing much to do rather than some mouse clicks and a few typings.</p>
<p>Although the installation is not difficult, its configuration needs some patience and knowledge. One desired configuration is to enable clean URLs. There are various approaches posted on the Internet. Some of them work for some people, and some of them don&#8217;t.</p>
<p>So, in this post, I&#8217;d like to share what is worked for me. My system is:</p>
<ul>
<li>Windows Vista (64-bit)</li>
<li>Apache HTTP Server (2.2.16 win32 x86 with ssl, msi installer)</li>
<li>PHP (5.3.3 win32 VC 9 x86)</li>
<li>MySQL (5.1.49, win32, noinstall version)</li>
<li>Drupal (6.19)</li>
</ul>
<p>To install Drupal, I unzip (and rename) Drupal into $APACHE_HOME/htdocs directory, resulting in $Apache_Home/htdocs/drupal.</p>
<p>To enable clean URL,</p>
<p>1) Edit .htaccess in $PHP_HOME</p>
<p><strong>Change the following line from:</strong> </p>
<p><code>#RewriteBase   /</code></p>
<p><strong>to:</strong></p>
<p><code>RewriteBase    /drupal</code></p>
<p>2) Edit httpd.conf in $APACHE_HOME/conf</p>
<p><strong>Change the following line from:</strong></p>
<p><code>#LoadModule rewrite_module modules/mod_rewrite.so</code></p>
<p><strong>to:</strong></p>
<p><code>LoadModule rewrite_module modules/mod_rewrite.so</code></p>
<p><strong>, and then change this line from: </strong></p>
<p><code>AllowOverride None</code></p>
<p><strong>to:</strong></p>
<p><code>AllowOverride All</code></p>
<p><strong>Note:</strong> there are more than one <code>AllowOverride None</code> in httpd.conf file. The correct one is under the paragraph with .htaccess in it.</p>
<p>3) After saving those modifications above, restart MySQL and HTTP Server, open a browser, and point the browser to <code>http://localhost/drupal</code>. Next, click on &#8220;Administer&#8221; &#8211;&gt; &#8220;Clean URLs&#8221;. Now, The &#8220;Enabled&#8221; bullet list should be active.</p>
<p>Hope this help save you guys&#8217; time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=237&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/08/12/how-to-enable-clean-urls-in-drupal-6-19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>Greenstone 3 Installation on Window 7 (64-bit)</title>
		<link>http://mrtextminer.wordpress.com/2010/04/07/greenstone-3-installation-in-window-7-64-bit/</link>
		<comments>http://mrtextminer.wordpress.com/2010/04/07/greenstone-3-installation-in-window-7-64-bit/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:30:57 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=194</guid>
		<description><![CDATA[In this blog, I&#8217;d like to share my experience on installing Greenstone3, a digital library software for building and distributing digital library collections, in my 64-bit version of Windows 7 machine. My installation approach may certainly not be a good &#8230; <a href="http://mrtextminer.wordpress.com/2010/04/07/greenstone-3-installation-in-window-7-64-bit/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=194&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this blog, I&#8217;d like to share my experience on installing Greenstone3, a digital library software for building and distributing digital library collections, in my 64-bit version of Windows 7 machine. My installation approach may certainly not be a good one, but it can get the software up and running.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>Sun JDK 1.6.0_17 (jdk-6u17-windows-i586.exe)</li>
<li>Apache Tomcat 6.0.26 (apache-tomcat-6.0.26-windows-x86.zip)</li>
<li>Greenstone3 (greenstone-3.04-win32.exe)</li>
<p><strong>(Note: Although my machine and OS are 64-bit versions, the software above is all 32-bit).)</strong>
</ul>
<p><strong>The installation procedure is divided into the following main steps.</strong></p>
<ol>
<li>Install Sun JDK</li>
<li>Install Apache Tomcat</li>
<li>Install Greenstone3</li>
<li>Configure Greenstone</li>
<li>Configure Tomcat</li>
<li>Run Greenstone3</li>
</ol>
<p><strong>1. Sun JDK Installation</strong></p>
<ul>
<li>Double click on the jdk-6u17-windows-i586.exe file to install it into the default directory, which is C:\Program Files (x86)\Java.</li>
<li>Set JAVA_HOME.
<ul>
<li>Control Panel &gt; System and Security &gt; System &gt; Advanced System Settings &gt; Environment Variables.</li>
<li>Under the System Variables, click the &#8220;New&#8230;&#8221; button.</li>
<li>Enter values for the following two variables: <strong><em>Variable name:</em></strong> <code>JAVA_HOME</code>, and <strong><em>Variable value:</em></strong> <code>C:\Program Files (x86)\Java\Jdk1.6.0_17</code>.</li>
<li>Click the OK button to complete the setup.</li>
</ul>
</li>
<li>Add Java to the PATH environment.
<ul>
<li>Under the System Variables, click to highlight the &#8220;Path&#8221; variable.</li>
<li>Click the &#8220;Edit&#8230;&#8221; button.</li>
<li>Add <code>%JAVA_HOME%\bin</code> to the end of Path&#8217;s <strong>variable value</strong>.</li>
<li>Click the OK, OK and OK buttons to complete the setup.</li>
</ul>
</li>
</ul>
<p><strong>2. Apache Tomcat Installation</strong></p>
<ul>
<li>Unzip the &#8220;apache-tomcat-6.0.26-windows-x86.zip&#8221; file into any directory</li>
<li>Copy the unzipped directory and paste it into <code>C:\</code>, resulting in <code>C:\apache-tomcat-6.0.26</code> directory.</li>
<li>Set up Apache Tomcat home path
<ul>
<li>Go to the Environment Variables, using the same approach as used in setting JAVA_HOME above.</li>
<li>Click the &#8220;New&#8230;&#8221; button.
                       </li>
<li>Enter values for the following two variables: <strong><em>Variable name:</em></strong> <code>CATALINA_HOME</code>, and <strong><em>Variable value:</em></strong> <code>C:\apache-tomcat-6.0.26</code>.</li>
<li>Click the OK, OK and OK buttons to complete the setup.</li>
</ul>
</li>
<li> Test the Apache Tomcat installation
<ul>
<li>Open a web browser</li>
<li>Type: <code>http://localhost:8080/</code> in the address bar.</li>
<li>The Apache Tomcat startup page should be displayed.</li>
</ul>
</li>
</ul>
<p><strong>3. Greenstone3 Installation</strong></p>
<ul>
<li>Double click on the greenstone-3.04-win32.exe file.</li>
<li>Install it into <code>C:\Users\YourUserName</code> directory where <code>YourUserName</code> is the user name used in your machine such as John.</li>
<li>During the installation, install everything but exclude Apache-Tomcat (by unchecking the textbox) that comes with Greenstone3.</li>
<li>The installed directory would be <code>C:\Users\YourUserName\Greenstone3</code>.</li>
</ul>
<p><strong>4. Greenstone3 Configuration</strong></p>
<ul>
<li>Edit the greenstone3.xml in the <code>C:\Users\YourUserName\Greenstone3\resources\web\tomcat</code> by replacing <code>@gsdl3webhome@</code> with <code>C:\Users\YourUserName\Greenstone3\web</code> for the <code>docBase=</code> variable.</li>
<li>Copy and paste the edited greenstone3.xml file into <code>C:\apache-tomecat-6.0.26\conf\Catalina\localhost</code>.	</li>
<li>Edit build.properties file in the <code>C:\Users\YourUserName\Greenstone3</code> directory by adding <code>"C:\apache-tomcat-6.0.26"</code> to the <strong>tomcat.installed.path</strong> variable in the file (This step is required for running Greenstone Librarian Interface (GLI)).</li>
</ul>
<p><strong>5. Apache Tomcat Configuration</strong></p>
<ul>
<li>Copy and paste all the .dll files in the <code>C:\Users\YourUserName\Greenstone3\lib\jni</code> directory into <code>C:\apache-tomcat-6.0.26\bin</code> directory. </li>
<li>Copy and paste all the .jar files in the <code>C:\Users\YourUserName\Greenstone3\lib\jni</code> directory into <code>C:\apache-tomcat-6.0.26\lib</code> directory. </li>
<p><strong>(Note: I know that there is a better way to set up these .dll and .jar files for Tomcat server, but I still do not know how to do it yet.)</strong>
</ul>
<p><strong>6. Running Greenstone3</strong></p>
<ul>
<li>Start the Apache Tomcat server
<ul>
<li>Open a command prompt.</li>
<li>Issue a command to change directory to the <code>C:\apache-tomcat-6.0.26\bin</code></li>
<li>Issue the following command: <code>startup.bat</code></li>
</ul>
</li>
<li>Open the Greenstone3 web server
<ul>
<li>Open a web browser</li>
<li>Type: <code>http://localhost:8080/greenstone3/</code> in the address bar.</li>
<li>The Greenstone 3 welcome page should shown up. On this page, there are four hypertext links.
<ul>
<li>Run the test servlet.</li>
<li>Run the default library servlet. </li>
<li>Run the &#8216;standard&#8217; servlet. </li>
<li>Run the gateway servlet. </li>
</ul>
</li>
<li>The top three links should be working well. The bottom link requires Apache Axis to be installed. (<strong>Note: I have not tried it.</strong>)</li>
</ul>
</li>
<li>Run the Greenstone Librarian Interface (GLI)
<ul>
<li>Open a command prompt.</li>
<li>Issue a command to change directory to <code>C:\Users\YourUserName\gli</code> directory.</li>
<li>Issue the following command: <code>gli.bat</code>. The GLI should be activated successfully.</li>
</ul>
</li>
<p><strong>(Note: I am still not able to run GLI from All Programs &gt; Greenstone-3.04 &gt; Greenstone Librarian Interface (GLI).)</strong></p>
</ul>
<p><strong>Concluding Remarks</strong></p>
<p>        I was spending so much time to get this Greenstone3 up and running on my 64-bit version of Windows 7 machine, a lot of googling and hair pulling. Well, I am glad that I can get it working eventually although some more things need to be done such as running GLI from the <code>All Programs</code> menu of Windows 7. Anyway, I hope that this blog will save you guys time and resources. Have fun and have a good day.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=194&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/04/07/greenstone-3-installation-in-window-7-64-bit/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
		<item>
		<title>Object-Relational Mapping Using Hibernate (MySQL+Java+Netbeans IDE): Part I</title>
		<link>http://mrtextminer.wordpress.com/2010/03/18/object-relational-mapping-using-hibernate-mysqljavanetbeans-ide/</link>
		<comments>http://mrtextminer.wordpress.com/2010/03/18/object-relational-mapping-using-hibernate-mysqljavanetbeans-ide/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 05:56:58 +0000</pubDate>
		<dc:creator>mrtextminer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mrtextminer.wordpress.com/?p=174</guid>
		<description><![CDATA[What world are you living in? Relational world or object-oriented world? Maybe you do not know what your answer is. Let ask more specific questions. Are you modeling your software application using object-oriented approach?, are you using UML (Unified Modeling &#8230; <a href="http://mrtextminer.wordpress.com/2010/03/18/object-relational-mapping-using-hibernate-mysqljavanetbeans-ide/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=174&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What world are you living in? Relational world or object-oriented world? Maybe you do not know what your answer is. Let ask more specific questions.</p>
<p>Are you modeling your software application using object-oriented approach?, are you using UML (Unified Modeling Language)?, and are you implementing your application using Java, C++ or C#? If you say &#8220;yes&#8221; to one of these three questions, you are living in an object-oriented world.</p>
<p>Hold on. Are you sure if OO is the only world where you are in? Have you ever used a database for storing data? If you say &#8220;yes&#8221;, I bet that more than 80% of you guys have used relational database management systems (RDBMS) such as MySQL, MS SQL Server, and Oracle. RDBMSs are systems that provide functionalities and tools (with SQL capabilities) for creating a database, and controling and managing data in the database. The database in this type of systems is a relational database which is developed via the use of Entity-Relationship (ER) or Enhanced-Entity-Relationship (EER) diagram.</p>
<p>So, what do you usually do if you need to store data for your software application? You can still write your application using Java or Object-Oriented approach and use MySQL which is a relational database for storing data. How? Well, you could embed SQL queries within your Java application by using JDBC or Java Database Connector or J/Connector for MySQL. This is also what I usually do.</p>
<p>(Storing data from software applications to be used between sessions is known as providing persistence to data.)</p>
<p>So, you may ask what my point is. Well, the thing is that if you have to embed SQL queries into Java applications, you have to specify SQL queries in advance statically and possibly dynamically or on the fly).  To be able to write SQL queries, you certainly must understand the underlying model of the relational database. What if you are not the one who designs the database or you do not know much about the relational model? In addition, an inclusion of SQL queries within your application unavoidably add more complexity to your programs. </p>
<p>Isn&#8217;t better if you can just focus on writing your Java programs and the data that you want to store or retrieve can be inserted and retrieved from the relational database automatically without your notice?  The answer is &#8220;yes&#8221;. What you need is a middle man which maps your OO application to relational database (RDB), for example, Java Persistence API, Oracle&#8217;s Toplink, Java Data Objects and Hibernate (NHibernate for .NET). These middle men are called Object-Relational Mapping frameworks.</p>
<p>An object-relational mapping framework provides developers transparent persistence to data in their software application development using OO and relational database. In other words, the developers can concentrate on their application development without concerning the underlying relational database (separation of concerns). </p>
<p>OK OK. you may want to ask this question. Why do we need this framework to map OO to relational? Well, the answer is easy. Although OO model looks really similar to relational models or ER/EER models. They are quite different.</p>
<p>In the next part, I will write about their differences, how we can map them, and how to use Hibernate.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrtextminer.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrtextminer.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrtextminer.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrtextminer.wordpress.com&amp;blog=1701026&amp;post=174&amp;subd=mrtextminer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mrtextminer.wordpress.com/2010/03/18/object-relational-mapping-using-hibernate-mysqljavanetbeans-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310e8295876fd8667ebab31e15bfdb00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mrtextminer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
