简体   繁体   English

如何创建Portlet /在Weblogic IDE Eclipse上部署

[英]How to create portlets / deploy on weblogic IDE eclipse

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. 我发现我们需要一台应用程序服务器,一台门户容器和一台IDE。

please help me to understand it. 请帮助我理解它。

I want to create a portlet and deploy it on weblogic server. 我想创建一个portlet并将其部署在weblogic服务器上。 so what the things i required. 所以我需要什么。

means: any plugin in eclipse portlet container application server etc..... 表示:eclipse portlet容器应用服务器中的任何插件等。

Thanks 谢谢

I've just got the pluto portlet container up and running. 我刚刚启动并运行了pluto portlet容器。 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). 从那以后,我设法使冥王星在WebLogic下运行,尽管并不完美(稍后讨论)。 So, I think your aims are: 因此,我认为您的目标是:

  1. Install a portlet container: eg pluto 安装一个portlet容器:例如pluto
  2. Create a HelloWorld portlet, deploy it and publish it 创建一个HelloWorld portlet,进行部署并发布
  3. Perhaps, deploy the portlet so that it runs under WebLogic? 也许部署portlet,使其在WebLogic下运行? Not sure if this is what you intend. 不确定这是否是您想要的。
  4. Portlet communication Portlet通讯
  5. Build more heavyweight portlets that do what you want 构建更多重量级的portlet,满足您的需求
  6. Upgrade portal implementation (eg JetSpeed) 升级门户实施(例如JetSpeed)

So, here goes: 因此,这里是:

1. Install a portlet container: eg pluto 1.安装Portlet容器:例如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). 我建议您从pluto portlet开始,因为这是参考实现,并且遵循规范的版本2(JSR-286)。 Download the binary distribution from: 从以下位置下载二进制发行版:

http://portals.apache.org/pluto/v20/getting-started.html

This comes housed within a tomcat 6 webserver. 它位于tomcat 6网络服务器中。 So, to run a basic portlet, you just need to configure and start tomcat. 因此,要运行基本的portlet,只需配置并启动tomcat。 The pluto web application can be found in the webapps directory. 可以在webapps目录中找到pluto Web应用程序。

To understand more about tomcat, see here: 要了解有关tomcat的更多信息,请参见此处:

http://www.puschitz.com/InstallingTomcat.html#InstallingTomcatSoftware

Note that this is slightly complicated (for good reason) as it recommends creating separate instances of tomcat. 请注意,这有些复杂(有充分的理由),因为它建议创建单独的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. 虽然本教程实际上只花了一个小时,所以我建议您在Portlet工作之前进行推荐,以便您有良好的基础。

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. 简单来说,要启动pluto(好是tomcat),您只需将$ {CATALINA_HOME}设置为您的tomcat安装目录(pluto-2.0.2)并执行{pluto_install_dir} /bin/startup.sh。 You can access the pluto portal from a browser with: 您可以使用以下方法从浏览器访问pluto门户:

http://localhost:8080/pluto/portal

2. Create a HelloWorld portlet, deploy it and publish it 2.创建一个HelloWorld portlet,进行部署并发布

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. “ Portlet程序集”下显示的目录结构略有错误。 The webapp folder should be at the same level as the java folder, under main. webapp文件夹应与main文件夹下的java文件夹处于同一级别。

Here is a sample HelloWorld portlet that presents using direct output in the response (like a servlet): 这是一个示例HelloWorld portlet,它使用响应中的直接输出(如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: 这是一个示例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-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. 将portlet.tld(prtlet 2.0版本)放在您的tld目录中。 Note we aren't using JSPs so this will be empty. 注意,我们没有使用JSP,因此它将为空。 For a good (but broken) JSP based tutorial, see here: 有关基于JSP的良好(但不完整)的教程,请参见此处:

http://www.ibm.com/developerworks/java/library/j-pluto/

Build using the mvn build script supplied in: 使用提供的mvn构建脚本进行构建:

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. 如果不添加构建脚本的“自动部署”部分,请将构建战争移至您的Pluto(tomcat)Web应用程序。

Within your browser, you must publish your new HelloWorld webapp from the admin page within the pluto portal (add page -> add portlet). 在浏览器中,必须从冥王星门户(添加页面->添加portlet)的管理页面发布新的HelloWorld Web应用程序。 A new tab should be added containing your portlet. 应该添加一个包含您的Portlet的新选项卡。

3. Deploy the portlet under WebLogic 3.在WebLogic下部署portlet

  1. Add the pluto libraries to your WebLogic lib. 将冥王星库添加到WebLogic库中。 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). 我将它们放在您的域库目录中(该目录包含一个自述文件,指示这是用于添加要在10.2.3上动态加载的jars)。 This is ${MYDOMAIN}/lib. 这是$ {MYDOMAIN} / lib。 The jars to locate there are as follows: 要找到的罐子如下:

    http://portals.apache.org/pluto/v20/embedding.html http://portals.apache.org/pluto/v20/embedding.html

  2. Add the pluto web application and any referenced (published) webapps into your WLS upload directory. 将Pluto Web应用程序和所有引用(发布)的Webapp添加到WLS上传目录中。 This means including testsuite which is provided with pluto and your new helloworld webapp. 这意味着包括冥王星提供的测试套件和新的helloworld Web应用程序。

  3. Configure WLS to be able to access your portlets: 配置WLS以能够访问您的Portlet:

    1. The pluto webapps are security configured for users pluto and tomcat. Pluto Web应用程序是为用户Pluto和Tomcat配置的安全性。 So, you have to add a new "pluto" user to your WLS security realm [Security Realms -> myRealm] 因此,您必须向WLS安全领域添加一个新的“ pluto”用户[安全领域-> myRealm]
    2. Configure webapp security to map the security role to the WLS user. 配置webapp安全以将安全角色映射到WLS用户。 This means creating ${MYUPLOAD}/pluto/WEB-INF/weblogic.xml. 这意味着创建$ {MYUPLOAD} /pluto/WEB-INF/weblogic.xml。 Here add a "security-role-assignment" entry for principal pluto (your new WebLogic user). 在这里为主体冥王星(您的新WebLogic用户)添加一个“ security-role-assignment”条目。
    3. Note that the testsuite/WEB-INF/web.xml is only authorised for user tomcat. 请注意,testsuite / WEB-INF / web.xml仅授权给用户tomcat。 Change this to pluto. 将此更改为冥王星。
    4. Add portlet_2_0.tld to ${UPLOAD}/testsuite/WEB-INF/tld (make tld dir). 将portlet_2_0.tld添加到$ {UPLOAD} / testsuite / WEB-INF / tld(设为tld dir)。 This is available at: http://svn.apache.org/repos/asf/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/tld/portlet_2_0.tld 可在以下位置找到它: http : //svn.apache.org/repos/asf/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/tld/portlet_2_0.tld
    5. Several of the testsuites will still fail under WLS. 在WLS下,一些测试套件仍将失败。 There are outstanding issues between apache and the community. apache和社区之间存在悬而未决的问题。 They see it as a WLS issue (on the apache pluto jira at https://issues.apache.org/jira/browse/PLUTO-571 ). 他们将其视为WLS问题(在https://issues.apache.org/jira/browse/PLUTO-571的apache pluto jira上)。
    6. There is an issue where by the portlet is actually presented outside the portlet frame (div) when using JSP rendering. 使用JSP呈现时,portlet实际上呈现在portlet框架(div)之外,这是一个问题。 Not got to the bottom of this yet. 尚未深入探究。

4. Portlet Communication 4. Portlet通讯

Have two portlets interoperating. 有两个portlet可以互操作。 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 5.构建更多重量级的portlet

Refer to more complex webapp tutorial using JSPs at: 请参考使用JSP的更复杂的webapp教程,网址为:

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 6.升级门户实施

Try out JetSpeed for example. 以JetSpeed为例。 Refer to: 参考:

http://portals.apache.org/jetspeed-2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM