Hello Sascha,
here is a little howto for your first portlet in jetspeed2, additional i
want to invite you to the jax - conference,
where a associate of mine talks about this topic:
http://www.jax.de/konferenzen/psecom,id,269,nodeid,,.html#E27.
here is my first portlet:
public class FirstPortlet extends GenericPortlet{
Writer writer;
/* (non-Javadoc)
* @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
javax.portlet.RenderResponse)
*/
protected void doView(RenderRequest renderRequest, RenderResponse
renderResponse)
throws PortletException, IOException {
renderResponse.setContentType("text/html");
writer = renderResponse.getWriter();
writer.write("Hello I am a portlet and I am trapped in a
Portal!");
String jspName = "/jsp/firstportlet.jsp";
//writer.write(renderResponse.encodeURL(renderRequest.getContextPath()));
writer.write("<IMG
SRC="+renderResponse.encodeURL(renderRequest.getContextPath()+"/pics/oio.gif
")+">");
PortletRequestDispatcher rd =
getPortletContext().getRequestDispatcher(
jspName);
rd.include(renderRequest, renderResponse);
}
/* (non-Javadoc)
* @see javax.portlet.GenericPortlet#doHelp(javax.portlet.RenderRequest,
javax.portlet.RenderResponse)
*/
protected void doHelp(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
writer = response.getWriter();
response.setTitle("Helpsite of "+super.getTitle(request));
writer.write("Hier kann man Informationen uber die Benutzung
des Portlets
hinterlgen.");
}
/* (non-Javadoc)
* @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest,
javax.portlet.RenderResponse)
*/
protected void doEdit(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
writer = response.getWriter();
writer.write("Hier konnen Eigenschaften die -modifiable- sind
von den
Benutzern geandert werden");
writer.write("Man hat beispielsweise die Moglichkeit den Title
zu andern,
neben der Moglichkeit in der portlet.xml ");
writer.write("Das "+super.getTitle(request)+" war der alte
Titel");
response.setTitle("Edit of "+super.getTitle(request));
}
}
Additional there is a jsp and a pic which are included in the portlet. For
Example:
firstportlet.jsp
<HTML>
<HEAD>
<TITLE>Orientation in Objects GmbH</TITLE>
</HEAD>
<BODY>
<H3>Welcome !</H3>
<!--<INPUT TYPE="submit" name="save" value="Speichern"/>-->
</BODY>
</HTML>
The Structure of the "first steps" looks like this:
I've got a Project which has a source folder and following subfolders
/src
/src/java - for the java scources
/src/webapp/jsp - for the jsps
/src/webapp/pics - ^^
/src/webapp/WEB-INF/ here are my web.xml and my portlet.xml
You need also a maven.xml, a project.properties for Maven and a project.xml,
which is a descriptor and the descriptors web.xml and portlet.xml. The
portlet.xml describes your portlets with mime type, modes, etc., the web.xml
is the descriptor for your web application for example.:
<?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>
<display-name>first steps</display-name>
</web-app>
After all, you can create your war-archive via Maven and put into the
"deploy"-folder of your jetspeed2. The last step you've to do is to write a
statement for your portlet in one of the site.psml. have a look at the
default-page.psml in your "pages"-folder of your jetspeed2.
best regards,
Benjamin Bratkus
--
Orientation in Objects GmbH
Weinheimerstr. 68
D-68309 Mannheim
http://www.oio.de
Tel +49(0)621-71839-0
Fax. +49(0)621-71839-50
-----Ursprungliche Nachricht-----
Von: Sascha Glass [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 13. April 2005 14:40
An: [email protected]
Betreff: Jetspeed 2 - deployment
Hello,
Does anyone know more detailed information about deploying portlets to
Jetspeed 2 than
http://wiki.apache.org/portals/Jetspeed2/DeployingCustomPortlets ?
Thank you!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]