I am learning "how to create portal application", went through some documents and tutorials. I found we need one application server, one portal container and one IDE.
please help me to understand it.
I want to create a portlet and deploy it on weblogic server. so what the things i required.
means: any plugin in eclipse portlet container application server etc.....
Thanks
I've just got the pluto portlet container up and running. The tutorials for pluto are a bit sketchy and most contain errors that can throw you off course. As such, I've made this as thorough as I can.
I've since managed to get pluto running under WebLogic, albeit not perfectly (discussed later). So, I think your aims are:
So, here goes:
1. Install a portlet container: eg pluto
I recommend you start with the pluto portlet as this is the reference implementation and adheres to version 2 of the spec (JSR-286). Download the binary distribution from:
http://portals.apache.org/pluto/v20/getting-started.html
This comes housed within a tomcat 6 webserver. So, to run a basic portlet, you just need to configure and start tomcat. The pluto web application can be found in the webapps directory.
To understand more about tomcat, see here:
http://www.puschitz.com/InstallingTomcat.html#InstallingTomcatSoftware
Note that this is slightly complicated (for good reason) as it recommends creating separate instances of tomcat. This tutorial really only takes an hour though so I'd recommend it in advance of your portlet work so that you have a good foundation.
In simple terms though, to start up pluto (well, tomcat), you just need to set your ${CATALINA_HOME} to be your tomcat installation directoy (pluto-2.0.2) and execute {pluto_install_dir}/bin/startup.sh. You can access the pluto portal from a browser with:
http://localhost:8080/pluto/portal
2. Create a HelloWorld portlet, deploy it and publish it
Happily, the pluto tutorial is nearly good enough to get you going. Unbelievably, all the tutorials I found had flaws or errors. With a little help, you should get this going though. It is at the same place:
http://portals.apache.org/pluto/v20/deploying.html
The directory structure shown under "Portlet Assembly" is slightly wrong. The webapp folder should be at the same level as the java folder, under main.
Here is a sample HelloWorld portlet that presents using direct output in the response (like a servlet):
package com.mycompany.portlet;
//imports omitted...
public class HelloWorldPortlet extends GenericPortlet{
protected void doView(RenderRequest request,RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
response.getWriter().println("Hello World");
}
}
Here's an example WEB-INF/portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>HelloWorld Description</description>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name>Hello World Display Name</display-name>
<portlet-class>com.mycompany.portlet.HelloWorldPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Hello World</title>
<short-title>Hello World</short-title>
<keywords>Hello,pluto</keywords>
</portlet-info>
</portlet>
</portlet-app>
Here's an example WEB-INF/web.xml:
<web-app id="WebApp_ID">
<display-name>Hello World Portlet</display-name>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>tld/portlet.tld</taglib-location>
</taglib>
</web-app>
Put portlet.tld (the prtlet 2.0 version) in your tld directory. Note we aren't using JSPs so this will be empty. For a good (but broken) JSP based tutorial, see here:
http://www.ibm.com/developerworks/java/library/j-pluto/
Build using the mvn build script supplied in:
http://portals.apache.org/pluto/v20/deploying.html
If you don't add the automatic deployment section of the build script the move the build war to your pluto (tomcat) webapps.
Within your browser, you must publish your new HelloWorld webapp from the admin page within the pluto portal (add page -> add portlet). A new tab should be added containing your portlet.
3. Deploy the portlet under WebLogic
Add the pluto libraries to your WebLogic lib. I put these in your domain library directory (which contains a readme indicating this is for adding jars to be dynamically loaded on 10.2.3). This is ${MYDOMAIN}/lib. The jars to locate there are as follows:
Add the pluto web application and any referenced (published) webapps into your WLS upload directory. This means including testsuite which is provided with pluto and your new helloworld webapp.
Configure WLS to be able to access your portlets:
4. Portlet Communication
Have two portlets interoperating. Refer to:
http://publib.boulder.ibm.com/infocenter/wpexpdoc/v6r1/index.jsp?topic=/com.ibm.wp.exp.doc_v6101/dev/pltcom_pubrndrprm.html
5. Build more heavyweight portlets
Refer to more complex webapp tutorial using JSPs at:
http://www.ibm.com/developerworks/java/library/j-pluto/
//Warning: portlet 1.0 (JSR-168) and contains errors
Then try your own...
6. Upgrade portal implementation
Try out JetSpeed for example. Refer to:
http://portals.apache.org/jetspeed-2/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.