vendredi 21 décembre 2012

How to installing Oracle Database 11g on Linux


1.
For this installation, you need either the DVDs or a downloaded version of the DVDs. In this tutorial, you install from the downloaded version. From the directory where the DVD files were unzipped, open a terminal window and enter the following:
./runInstaller.sh 

2.
The product you want to install is Oracle Database 11g. Make sure the product is selected and click Next.

2.
You will perform a basic installation with a starter database. Enter orcl for the Global Database Name and oraclefor Database Password and Confirm Password. Then, click Next.

3.
You need to specify your Inventory directory. The location should be set to /u01/app/oracle/oraInventory. Accept the default Operating System group name, oinstall. Then, click Next.

4.
The installer now verifies that the system meets all the minimum requirements for installing and configuring the chosen product. Please correct any reported errors before continuing. When the check successfully completes, click Next.

5.
Oracle Configuration Manager allows you to associate your configuration information with your Metalink account. You can choose to enable it on this window. Then, click Next.

5.
Review the Summary window to verify what is to be installed. Then, click Install.

6.
The progress window appears.

7.
The Configuration Assistants window appears.

8.
Your database is now being created.

9.
When the database has been created, you can unlock the users you want to use. Click OK.

10.You need to execute orainstRoot.sh and root.sh as the root user.


11.Open a terminal window and enter the following commands. Follow the prompts as instructed.
su -
<rootpassword>
cd /u01/app/oracle/oraInventory
./orainstRoot.sh
cd ../product/11.1.0/db_1
./root.sh
exit
exit

12.Switch back to the Universal Installer and click OK.


13.
Click Exit. Click Yes to confirm exit.




To test that your installation completed successfully, perform the following steps:
1.
Open a browser and enter the following URL:
https://<hostname>:1158/em
where <hostname> should be changed to your machine name, IP address, or localhost.
Because Enterprise Manager Database Control is a secure site, you need a certificate. Select the Accept this certificate permanently option, and then click OK.

2.
Enter system as the User Name and oracle as the Password, and then click Login.

3.
The Database Control Home Page appears. Your installation was successful.



In this tutorial, you learned how to install and test the Oracle Database 11g installation on Linux.

How to installing Oracle Database 11g on Windows

1.
For this installation, you need either the DVDs or a downloaded version of the DVDs. In this tutorial, you install from the downloaded version. From the directory where the DVD files were unzipped, open Windows Explorer and double-click on setup.exe from the \db\Disk1 directory.
2.
The product you want to install is Oracle Database 11g. Make sure the product is selected and click Next.

3.
You will perform a basic installation with a starter database. Enter orcl for the Global Database Name and oraclefor Database Password and Confirm Password. Then, click Next.

4.
Oracle Configuration Manager allows you to associate your configuration information with your Metalink account. You can choose to enable it on this window. Then, click Next.

5.
Review the Summary window to verify what is to be installed. Then, click Install.

6.
The progress window appears.

7.
The Configuration Assistants window appears.

8.
Your database is now being created.

9.
When the database has been created, you can unlock the users you want to use. Click OK.

10.
Click Exit. Click Yes to confirm exit.



To test that your installation completed successfully, perform the following steps:
1.
Open a browser and enter the following URL:
https://<hostname>:1158/em
where <hostname> should be changed to your machine name, IP address, or localhost.
Because Enterprise Manager Database Control is a secure site, you need a certificate. Select the Accept this certificate permanently option, and then click OK.

2.
Enter system as the User Name and oracle as the Password, and then click Login.


3.
The Database Control Home Page appears. Your installation was successful.


Summary

In this tutorial, you learned how to install and test the Oracle Database 11g installation on Windows.

dimanche 16 décembre 2012

How to creat Sample Sping Portlet


Step 1:
Setup plugin and server environment for Liferay 5.2.0 +

Step 2:
Create new portlet by running the following command from plugin ? portlet folder.
Command:
ant create -Dportlet.name="spring-mvc-demo" -Dportlet.display.name="Spring MVC Demo Portlet"
(or)
create.bat "spring-mvc-demo" "Spring MVC Demo Portlet"
spring-mvc-demo-portlet will available under portlet folder.

Step 3:
Create "context" folder under spring-mvc-demo ? docroot ? WEB-INF path.
Create the following spring-portlet.xml file under the context folder.


===================spring-portlet.xml===================
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/html/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
<property name="portletModeMap">
<map>
<entry key="view"><ref local="springController"/></entry>
</map>
</property>
</bean>
<bean id="springController" class="com.sigma.SigmaController" >
<property name="viewName" value="view" />
</bean>
</beans>

Step 4:
Create html folder under spring-mvc-demo ? docroot ? WEB-INF path.
Create the following view.jsp file under the html folder.

===================view.jsp===================
Hi!! Welcome to spring demo porltet.

 Note: Delete the file view.jsp, css and js folder which is available under docroot folder.

Step 5:
Create sigma folder under spring-mvc-demo ? docroot ? WEB-INF ? src ? com path.
Create the following SigmaController.java file under the html folder.

===================SigmaController.java===================
package com.sigma;

import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.portlet.mvc.ParameterizableViewController;
import org.springframework.web.portlet.mvc.AbstractController;
public class SigmaController extends ParameterizableViewController
{
public ModelAndView handleRequest(RenderRequest req,
RenderResponse res) throws Exception {
return new ModelAndView(this.getViewName());
}
}

Note: Delete the jsp folder which is available under
spring-mvc-demo ? docroot ? WEB-INF ? src ? com folder.

Step 6:
Alter the portlet.xml file which is available under spring-mvc-demo->docroot->WEB-INF path.

<?xml version="1.0"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
<portlet>
<portlet-name>spring-mvc-demo</portlet-name>
<display-name>Spring MVC Demo Porlet</display-name>
<portlet-class>
org.springframework.web.portlet.DispatcherPortlet
</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/context/spring-portlet.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Spring MVC Demo Porlet</title>
<short-title>Spring MVC Demo Porlet</short-title>
<keywords>Spring MVC Demo Porlet</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>

Step 7:
Alter the liferay-display.xml file which is available under spring-mvc-demo ? docroot ? WEB-INF path.

<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 5.2.0//EN" "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">

<display>
<category name="category.sigma">
<portlet id="spring-mvc-demo" />
</category>
</display>

Step 8:
Alter the web.xml file which is available under spring-mvc-demo->docroot->WEB-INF path.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.ViewRendererServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>
</web-app>

Step 9:
Create lib folder if not exists under spring-mvc-demo->docroot->WEB-INF path.
Include the following jar files.
1.spring-webmvc-portlet.jar
2.spring-webmvc.jar
3.spring.jar
4.jstl.jar

Step 10:
Goto the spring-mvc-demo folder and run the following command deploy to server.
command: ant clean compile deploy.

Step 11:
Start the server and check this portlet.

Liferay IDE Getting Started Tutorial


Installation

If you have not already installed Liferay IDE view Liferay IDE Installation Guide for a detailed walk-through of installation.

Requirements before getting started

1. Liferay Portal 6.0 (RC2 or greater) downloaded and installed (or download in the IDE itself)
2. Liferay Plug-ins SDK 6.0 (RC2 or greater) downloaded and installed (or download in the IDE itself)
3. Eclipse Helios/Galileo Java EE for developers package - see the Liferay IDE Installation Guide for more information.
Note: earlier versions of Liferay, e.g. 5.x, are not supported yet by the Liferay IDE

Liferay Plug-ins SDK Setup

Before you can begin creating new Liferay plug-in projects, a Liferay Plug-ins SDK and Liferay Portal must be installed and configured in the IDE.

1. Open Eclipse with Liferay IDE installed.
2. Open Preference page for Liferay > Installed SDKs ( Go to Window > Preferences > Liferay > Installed SDKs )


3. If you have not already downloaded the Liferay Plug-ins SDK for your portal version you can download it from the sourceforge.net Liferay downloads page. Liferay plugin sdk is located available in the "portal" folder. In the "portal" folder, select the Liferay version matching the Liferay version. Within this folder, look for liferay-plugins-sdk-x.x.x.zip (usually the last file).
4. Add your SDK using the Add button which brings up the Add SDK Dialog:


5. Browse to the location of your Plug-ins SDK installation.
6. The default name is the name of the directory but you can change it if you wish.
7. Select OK and you should see your SDK in the list of Installed SDKs.




Note: multiple SDKs can be added to the preferences but you will need to select at least one SDK to be the default which is represented by the SDK that has the checkbox selected.

Note: if you have version 6.0.4 of Liferay Portal and the Plugin SDK, you will need to change your build.properties file. The SDK plugin assumes you have installed the SDK at the same level (same directory) as the portal directory. In the line

app.server.dir=${project.dir}/../bundles/app_server_name of build.properties you have to change bundles with the name of the Liferay portal installation directory e.g. liferay-portal-6.0.4.
Otherwise, portlets created with the SDK plugin will not be deployed by Ant.

Liferay Portal Tomcat Runtime / Server Setup

1. In eclipse open the Runtime environments preference page (Go to Window > Preferences > Server > Runtime environments)



2. Click Add to add a new Liferay runtime and find Liferay v6 Tomcat under the Liferay, Inc. category and click Next.




3. If you have not already downloaded and installed a copy of the Liferay Portal Tomcat bundle then you can download the latest Liferay Portal Tomcat bundle by clicking the "Download and Install..." button within the wizard.



4. If you used the download option you can skip this step, if not, click Browse and select the location of the liferay-portal-6.0.2 directory.


5. Once you have selected the Liferay portal directory if it has a bundled JRE then that bundled JRE will be automatically selected as the JRE to use for launching the server. However, if there is no bundled JRE (Mac and Linux users) then you will need to select the JRE to use for launch.



6. Click finish and you should see the Liferay portal runtime in the list of runtimes in the preference page.


7. Click OK to save the runtime preferences.
8. If you didn't choose to create a server you will need to create one from the servers view before you can test the server.


9. Find the Liferay, Inc category and select the Liferay v6 Server and choose the Liferay v6 Runtime that you had previously created.

Setting the Console Encoding

This step is not necessary for Liferay IDE 1.2 and greater, see http://issues.liferay.com/browse/IDE-287

This steps are not necessary if Liferay is installed on an OS whose encoding is latin1 or UTF-8 (most US and European OS). Otherwise, it is necessary to specify the console encoding to properly display console messages.

1. Select "Run" - "Run Configuration..." from the Eclipse menu.
2. Select "Liferay v6.0 Server" from the menu.
3. Select the "Common" tab.
4. In the encoding section, select "Other" and "UTF-8". Select "Apply" - "Close".

Testing the Liferay portal server 

1. Go to the servers view and you should see the new server that was created. right click and choose "Start" or "Debug"



2. You should see messages appear in the Console view and once it starts, the servers view will update to show that it is "Started" and then, right-click the server and select the (Liferay Portal > Open Portal Home) action.


3. The eclipse browser should open to the portal home at http://localhost:8080


Create new Liferay Plug-in Project 

1. Now that a SDK and portal server have been configured you can create a new Liferay plug-in project. Go to File > New Project... > Liferay > Liferay Plug-in Project



2. In the Liferay Plugin project wizard page, select the SDK and Liferay runtime and then select the plug-in type (portlet is default) and now you can create a new plug-in project, by clicking Finish.



3. If it worked you should see a new plugin project in the package explorer, so you are ready to begin Plugin Development.


Liferay IDE Installation Guide


his document is a detailed guide to installation of Liferay IDE.

Requirements

  • Java 5.0 JRE
  • Eclipse Inidigo (3.7.x) or Eclipse Helios (3.6.x) IDE for Java EE Developers

Installation steps

1. Install Eclipse Indigo or Helios (unzip download file from above)
2. Run eclipse.exe
3. When eclipse opens, go to Help > Install New Software... 



4. Click "Add..." button to open Add Site dialog
5. Type in Liferay IDE for name, and location use one of the following URLs
Eclipse Indigo Update sites

Indigo release stable URL - http://releases.liferay.com/tools/ide/eclipse/indigo/stable/
Indigo release nightly URL - http://releases.liferay.com/tools/ide/eclipse/indigo/nightly/ (Unstable version)
Eclipse Helios Update sites

Helios release stable URL - http://releases.liferay.com/tools/ide/eclipse/helios/stable/
Helios release nightly URL - http://releases.liferay.com/tools/ide/eclipse/helios/nightly/ (Unstable version)

6. Select OK
7. Select the Liferay IDE site from the combo selection box.
8. When the table refreshes you should see Liferay Tooling category and one entry for Liferay IDE feature, select the checkbox to install the feature.



9. Click Next and then click Finish to begin the install
10. After plugins download and install you will have to accept that the content is unsigned and then restart eclipse.
11. After you restart, go to Help > About Eclipse and you should see a Icon badge for Liferay IDE that shows you have it properly installed.


    Alternative installation


    a. Insted of typing in URL you can download the the archived update site from this link liferay-ide-eclipse-updatesite-1.4.0.zip
    b. In Add Site dialog, click the "Archive" button and browse to the location of the downloaded zip file.
    c. Installation proceeds normally

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More