Tuesday, June 11, 2013

How to create relational data model with Oracle SQL Developer Data Modeler


This tutorial shows how to create a relational data model by creating tables, adding columns to tables, defining relationships between tables, etc. 

Pre-requisite
1. JRE is installed.
2. Oracle SQL Developer Data Modeler is installed.

1. Create table.
    Make sure you are in relational tab > click table() icon > move the pointer to the white empty space.
data modeler relational tab

Sunday, June 9, 2013

Getting started with Oracle SQL developer Data modeler


Oracle SQL Developer Data Modeler is free tool from Oracle.
As mentioned in the name, this is a free database modeling tool.
Below are some of the features provided:
- Create logical data model
- Create relational data model
- Convert logical data model to relational data model
- Convert relational data model to logical data model
- Export data model to SQL scripts
- etc.

Saturday, June 8, 2013

Handling Many-to-Many relationship in relational model


When doing database design with logical model, we are allowed to create many-to-many (M:N) relationship.
M:N relationship ER modeling

But M:N relationship is not available in relational model. 

In this case, we have break the many-to-many relationship to two (2) one-to-many (1:M) relationship and add an intermediary in between the two entities.

How to install PrimeFaces Extensions in a PrimeFaces project

I was looking to install PrimeFaces Extensions into my PrimeFaces project, but I failed to find any website that mention how PrimeFaces Extensions install into a PrimeFaces project.

Thus, I have to try and error by myself. 


Then I copied the primefaces-extensions-0.6.2.jar into my PrimeFaces project and start the Tomcat.
Unfortunately, the application failed to start and showing the following error.
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringEscapeUtils
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at com.sun.faces.util.Util.loadClass(Util.java:273)
 at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:311)
 at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processFunctions(FaceletTaglibConfigProcessor.java:616)
 ... 14 more

It's required me to add in commons-lang3-3.1.jar into the project and restart again.

this time I was successfully start the Tomcat server, and tested the PrimeFaces Extensions with the following code.
<pe:inputNumber id="input2" value="#{testBean.numberValue}"
                symbol=" CHF" symbolPosition="s"
                decimalSeparator="," thousandSeparator=".">
    <p:ajax event="blur" />
</pe:inputNumber>

Output:
pe:inputText component

Conclusion:

copy the following jar into the existing PrimeFaces project and test the PrimeFaces Extensions again
1. primefaces-extensions-0.6.2.jar
2. commons-lang3-3.1.jar

It should works!



Done!!

Thursday, June 6, 2013

Authorization in JSF with Facelets View Handler

According to wikipedia, authorization is the function of specifying access rights to resources.
Authorization is important to protect sensitive against different users.

The simplest way is to provide the access right to the targeted fields/components directly
for readOnly access,
<h:outputText id="authorizedId" value="#{bean.authorizedValue}" readonly="#{bean.authorizedReadonly}" />

for viewable access,
<h:outputText id="authorizedId" value="#{bean.authorizedValue}" disabled="#{bean.authorizedDisabled}" />

but the above solution is NOT feasible if there are many pages and fields/components to be authorized;
NOT flexible, if there are access right changes, re-coding is required.

Another feasible way is through FaceletsViewHandler.
In JSF with Facelets view handling, we can actually place all the authorization controls to the FaceletsViewHandler as the control central.

LinkWithin

Related Posts Plugin for WordPress, Blogger...