Then two lines down change app.server.dir to app.server.dir=${project.dir}/tomcat-6.0.26. ⢠Save the modifications. â
User Manual Liferay Development Project for SEMATECH Extranet
Team Members: Arvind Patil Peng Ye Rohan Warkad Veena Ravishankar Vikram Patil Yuheng Zhao
Under the Guidance of: Professor Mei Hwa Chen
Fall 2011
0
1. Liferay 6 Installation Instructions for Sematech ....................................................................................... 2 1.1 Downloads .......................................................................................................................................... 2 1.2 Extract and place ................................................................................................................................ 2 1.3 Property Files ..................................................................................................................................... 3 1.4 Database Configuration ...................................................................................................................... 4 1.5 Eclipse Setup ...................................................................................................................................... 6 1.6 Requirements before getting started ............................................................................................... 10 Testing the Liferay portal server # ......................................................................................................... 16 1.7 Organizations and User Groups ....................................................................................................... 21 2. Sematech System ................................................................................................................................... 21 2.1 Brief Overview .................................................................................................................................. 21 2.2 Technical Specifications ................................................................................................................... 22 2.2.1 Registration Portlet ................................................................................................................... 22 2.3 Workflow .......................................................................................................................................... 22 2.3.1 Add Activity: .............................................................................................................................. 22 2.3.2 Add Company ............................................................................................................................ 24 2.3.3 Add User .................................................................................................................................... 24 2.4 Technical Specifications Summary ................................................................................................... 24
1
1. Liferay 6 Installation Instructions for Sematech 1.1 Downloads Download all files of Liferay latest version: From http://sourceforge.net/projects/lportal/ Downloads should contain following files: • • •
liferay-portal-tomcat (the big green button right when you come to the page) liferay-portal-src liferay-plugins-sdk
1.2 Extract and place
• • •
Create folder Liferay in designated hard drive. Place all downloaded zip files inside just created Liferay folder . Extract liferay-portal-tomcat and move all of the contents out of the folder it creates and up one level so that everything resides directly under the liferay folder. Extract the liferay-portal-src package and rename the folder it creates to “source”. Create a folder named plugins, move the liferay-plugins-sdk zip inside, and then unzip it. This is important as the liferay-plugins-sdk file does NOT create a folder to place all of its content inside.
Once done, you should have a liferay folder which looks like this: In this case: Liferay Home=C: \Liferay File structure should look like:
2
1.3 Property Files We need to create two properties files with respect to Environment: • •
Build.username.properties Release.username.properties
In order to get Plugins SDK, Portal Source, and Tomcat to recognize that the others exist, we need to set some property files. Go into the plugins directory and copy build.properties to build.username.properties where “username” is the name of your user account on the OS. Scroll down to the uncommented section for Tomcat and add
project.dir=C:\Liferay
(Be sure to put in the actual path to your Liferay folder.)
3
Then two lines down change app.server.dir to
app.server.dir=${project.dir}/tomcat-6.0.26
•
Save the modifications.
•
Go into source directory and copy release.properties to release.username.properties
•
Edit release.username.properties file and under “##Plugins Environment”, change the line to
lp.plugins.dir=${project.dir}/plugins Save and then copy build.properties to build.username.properties. Right below the “##Compiler” section, add
project.dir=C:\Liferay
Save Modifications.
1.4 Database Configuration We are considering MySQL as database here. You can select database of your choice accordingly credentials will be changed in following files based on selected database First download and start MySQL and workbench Step 1. To create new schema execute following commands create database lportal;
4
grant all on lportal.* to 'lportal'@'localhost' identified by 'lportal' with grant option; grant all on lportal.* to 'lportal'@'localhost.localdomain' identified by 'lportal' with grant option; Step 2. In the eclipse, set up Liferay and then Go to database connection • Right click --> new • Select MySQL click next select the driver, enter properties(user name , password, database(lportal) ) • Click OK • Now test connection. Step 3. Go to liferay-portal-tomcat-6.0.6-20110225\liferay-portal-6.0.6\tomcat6.0.29\webapps\ROOT\WEB-INF\classes\ Create file portal-ext.properties •
Copy and paste following contents to this file
jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost:3308/lportal?useUnicode=true&characterEncoding =UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=12345 •
Save and close.
Step 4 Go to C:\liferay-portal-tomcat-6.0.6-20110225\liferay-portal-6.0.6\tomcat6.0.29\webapps\ROOT\WEB-INF\classes\portal-impl\portal. Properties
5
Comment this part # # Hypersonic # #jdbc.default.driver.ClassName=org.hsqldb.jdbcDriver #jdbc.default.url=jdbc:hsqldb:${liferay. Home}/data/hsql/lportal #jdbc.default.username=sa #jdbc.default.password=
Uncomment this part and enter username and password for database # # MySQL # jdbc.default.driver.ClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UT F-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=
1.5 Eclipse Setup • • •
•
Download Eclipse Helios: http://www.eclipse.org/downloads/ Fire up Eclipse Helios, and when it asks for the workspace directory, points it directly to the liferay folder. If this is your first time firing up this version of Eclipse, then click on the "Workbench" icon to go to the main view of the application. Now we need to tell Eclipse that we have two different projects we want to the app to utilize: plugins and source.
Under file, go to New > Project... and specify Java Project. For each, point it to the plugins or source directory and click "Finish.".
6
Liferay IDE available in Eclipse Marketplace •
Launch the new Eclipse Marketplace client:
•
If you haven't launched the client before, you will need to choose the "Eclipse Marketplace", then you will see this screen:
7
•
To install Liferay IDE simply search for "Liferay" and it should find the entry for the IDE and then just click the "Install" button to continue.
8
•
Lastly you should see a screen that just confirms you want to install the Liferay IDE plugins. Click "Finish" to continue the installation.
9
1.6 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.
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 thesourceforge.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:
10
• • •
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.
11
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.
12
•
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.
13
•
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.
14
•
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.
15
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"
16
•
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.
17
•
3. The eclipse browser should open to the portal home at http://localhost:8080
18
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
19
•
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.
20
1.7 Organizations and User Groups •
To enable Organizations to be associated with UserGroups
Set the following in your liferay-portal-tomcat-6.0.6-20110225\liferay-portal-6.0.6\tomcat6.0.29\webapps\ROOT\WEB-INF\classes\portal-ext.properties organizations.user.group.membership.enabled=true
2. Sematech System 2.1 Brief Overview Our System is divided into two parts: 1. External User Registration GUI. 2. Administrator Portlet inside Liferay. • • • • •
For User Registration we have external registration page. This registration page will ask all necessary demographic details of user. Once User enters all registration details his profile is created and sent to approval to Administrator. Administrator will be able to see all registered users then he can approve users who will be Liferay Users. Administrator can also add Companies as well as Activities.
21
2.2 Technical Specifications • • • • •
User registration page which is developed as external to Liferay system. Allows users to register to get into system. Users will be asked to enter their demographic details to this registration form. This registration form is a JSP which will collect all these details and persist it to external MySQL database. Demographic details of User will be: o First Name o Middle Initial o Last Name o Country of Citizenship o Country of Residence o Company Name o Username o Password
2.2.1 Registration Portlet • Registration Portlet is a portlet that will function for Administrator. • Only Administrator has access to this portlet. • Administrator will be shown the portlet that contains the following features: 1. Add activity 2. Add Company 3. Add User
2.3 Workflow 2.3.1 Add Activity Administrator will be asked to enter activity name and he will be asked to enter parent of that activity. As administrator will hit “ADD” button corresponding activity will be added inside Liferay. Technical Details: • • • •
As Administrator enters Activity Name and Parent name from this page. This form will be submitted to Liferay by calling the method addActivity (). In this method corresponding activity node with Role of that activity will be created. Create a homepage for the activity
22
•
o Go to Control Manager èControl Panel => Organizations =>Go to Actions on that node => Manage Pages => Add Pages o Enter name of your choice for the page name. o Go to Public pages of this selected node. o This should be Home page o Click Save. Add document library and set information classification o go to Organizations o Go to public pages o There should be Home Page and another child pages o On child page add document Library o Create 3 folders and name each of them according to their information classification. o Set permission for folders. § Go to Actions of folder to assign permission. § Folders in document library should be assigned its Information Classification. § If Information Classification is Public Select Sematech_Confidential Supplier_Confidential Public § If Information Classification is Sematech_Confidential Select Sematech_Confidential Supplier_Confidential §
•
•
If Information Classification is Supplier_Confidential Select Supplier_Confidential
§ Click save. Set export classification o Export Classification is assigned on page level. Page should always be a child page (i.e.child page is any page other than Homepage) o Export Classification should always be given to the child page NEVER to Home Page o Go to Page o Click on Permissions tab. o Assign export classification to that page. Set inheritance
23
•
o To be able to access this node by its ancestors, corresponding nodes’ roles should be assigned to Home page of current node o Go to Permissions tab of current node and assign all ancestor nodes’ roles to that page, this way inheritance will be taken care of. All ancestors’ nodes will have access to their child nodes.
2.3.2 Add Company For Company to register inside Liferay o Administrator will be asked to enter § Company Name, § Information Classification and § Member Type o After Administrator click on “ADD” button he/she will be redirected to a page where he/she will associate this Company to a node. o Administrator will be asked to enter: o Node Name to be associated with Company and Company Name.
Technical Details: • •
When Administrator enters Company details those will be transferred to Liferay by calling addCompany () method and that company will be registered to Liferay. Information Classification which is associated with Company which is defined as Role and both of them are associated when Administrator click on “ADD” button on GUI.
2.3.3 Add User • Users will register from the external registration page then all of them will be listed . • When Administrator clicks on add User he/she will get a list of all registered users. • Administrator will select Users and when he/she clicks on “APRROVE” which he/she wants to add in Liferay. • Users will be added into Liferay.
2.4 Technical Specifications Summary •
As users registers from external GUI he will be added to external database.
24
• • • • • •
Inside Administrator when he wants to add Users all externally registered Users will be shown as List with all necessary details .This list will be fetched from external database. Administrator will select user on checkbox and all user details will be transferred To addUser() method which eventually adds User to Liferay. When administrator approves User, User will be assigned to Company he belongs to. Based on his Country of Residence and Country of Citizenship his Export Classification is calculated As export classification is defined as Role inside Liferay, this export classification is assigned to User at the same time.
25