- 浏览: 297630 次
- 性别:
- 来自: 东京
文章分类
最新评论
-
80后的童年2:
企业级分布式搜索平台Solr视频教程网盘地址:https:// ...
企业级搜索引擎Solr使用入门指南 -
springdata_spring:
apache lucene开源框架demo使用实例教程源代码下 ...
Lucene / Solr 开发经验 -
springdata-jpa:
java web开发分页demo源代码下载:http://ww ...
简易java分页标签 -
zjf_sdnu:
兄弟,script写错了
jqGrid初学备注 -
85600367:
你好,请教一个问题。当进行分布式查询时solr无法查询到Luc ...
Lucene / Solr 开发经验
本篇部分引用以下文章:
http://daoger.iteye.com/blog/359826
首先下载liferay-tomcat-bundle和liferay-plugin-SDK,将其解压直系统任意目录。
进入liferay-plugin-SDK目录,新建plugin项目:
ant -Dportlet.name=<project name> -Dportlet.display.name="<portlet title>" create
新建Eclipse Java项目LiferayPlugin,将liferay-plugin-SDK解压后的目录拷贝至里面。将Liferay需要的jar加入环境变量(主要包括tomcat/webapps/ROOT/WEB-INF/lib和tomcat/common/lib/ext两个文件夹里面的jar)
在LiferayPlugin目根目录下,新建资源文件build.{username}.properties,这里的username是你的计算机用户名称。然后在build.{username}.properties文件中添加app.server.dir这一个属性,它的值指向tomcat的目录。
build新建的portlet项目,此后运行Liferay,就可在plugin中看见发布的portlet。
以下引用ipc-baseball-portlet.rar 中的部分源码:
<?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> <listener> <listener-class>com.liferay.portal.kernel.spring.context.PortletContextLoaderListener</listener-class> </listener> <taglib> <taglib-uri>http://java.sun.com/jstl/core_rt</taglib-uri> <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location> </taglib> </web-app>
<?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"> <!-- <default-namespace>http://liferay.com/events</default-namespace> --> <portlet> <portlet-name>pitcher-portlet</portlet-name> <display-name>Pitcher Portlet</display-name> <portlet-class>com.liferay.ipc.PitcherPortlet</portlet-class> <init-param> <name>view-jsp</name> <value>/pitcher/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <portlet-info> <title>Pitcher Portlet</title> <short-title>Pitcher Portlet</short-title> <keywords>IPC Baseball Pitcher</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> <supported-publishing-event> <qname xmlns:x="http://liferay.com/events">x:ipc.pitch</qname> </supported-publishing-event> </portlet> <event-definition> <qname xmlns:x="http://liferay.com/events">x:ipc.pitch</qname> <value-type>java.lang.String</value-type> </event-definition> </portlet-app>
/** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.liferay.ipc; import java.io.IOException; import java.util.Random; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.GenericPortlet; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.ProcessAction; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.xml.namespace.QName; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * This portlet demonstrates the new Event model in JSR-286 * that is used to achieve Inter-Portlet Communication. This portlet * will "throw" an event out there for another portlet to catch. * * @author Rich Sezov * */ public class PitcherPortlet extends GenericPortlet { public void init() throws PortletException { editJSP = getInitParameter("edit-jsp"); helpJSP = getInitParameter("help-jsp"); viewJSP = getInitParameter("view-jsp"); } public void doDispatch(RenderRequest req, RenderResponse res) throws IOException, PortletException { String jspPage = req.getParameter("jspPage"); if (jspPage != null) { include(jspPage, req, res); } else { super.doDispatch(req, res); } } public void doEdit(RenderRequest req, RenderResponse res) throws IOException, PortletException { if (req.getPreferences() == null) { super.doEdit(req, res); } else { include(editJSP, req, res); } } public void doHelp(RenderRequest req, RenderResponse res) throws IOException, PortletException { include(helpJSP, req, res); } public void doView(RenderRequest req, RenderResponse res) throws IOException, PortletException { include(viewJSP, req, res); } protected void include(String path, RenderRequest req, RenderResponse res) throws IOException, PortletException { PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(path); if (prd == null) { _log.error(path + " is not a valid include"); } else { prd.include(req, res); } } /** * Since Portlet 2.0's GenericPortlet class lets you call methods * from processAction via annotations, we don't even need to touch the * processAction method to call our actions. * */ @ProcessAction(name = "pitchBall") public void pitchBall(ActionRequest request, ActionResponse response) { String pitchType = null; // Send an Event that the ball has been pitched. Random random = new Random(System.currentTimeMillis()); int pitch = random.nextInt(3) + 1; switch (pitch) { case 1: pitchType = "Fast Ball"; break; case 2: pitchType = "Curve Ball"; break; case 3: pitchType = "Slider"; break; // should never print default: pitchType = "Screw Ball"; } QName qName = new QName("http://liferay.com/events", "ipc.pitch"); response.setEvent(qName, pitchType); } protected String editJSP; protected String helpJSP; protected String viewJSP; private static Log _log = LogFactory.getLog(PitcherPortlet.class); }
<% /** * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects /> <p>Click the link below to pitch the ball. </p> <a href="<portlet:actionURL name="pitchBall"></portlet:actionURL>">Pitch!</a>
发表评论
-
Struts2 Jsonplugin 详解
2009-07-08 21:41 7099本文转自: http://www.blogjava.net/f ... -
一点struts json备注
2009-07-05 00:30 1534下载struts json插件:jsonplugin-0.33 ... -
Hibernate annotation简单配置
2009-06-29 00:04 1656<?xml version="1.0" ... -
Liferay下整合Spring和Hibernate开发Plugin初试
2009-05-26 00:41 4895简单的说,完全不知道Liferay下应该如何做开发。所以完全凭 ... -
Hibernate通用DAO
2009-01-02 17:46 3625/** * @author Clay Zhong, zjcl ... -
Acegi获取用户信息
2008-12-04 23:38 2856import org.acegisecurity.Authen ... -
Acegi详解
2008-11-16 21:15 1767本文转自:http://www.yuanma.org/data ... -
velocity.properties source code
2008-11-04 22:37 3003# Licensed to the Apache Softwa ... -
DetachedCriteria,Hibernate模糊查询
2008-09-21 10:59 41991,假设存在Thesis对象: package org.cms ... -
lucene常用搜索排序摘录
2008-09-16 23:38 3144一,查询 一个关键字,对一个字段进行查询 Query ... -
Solr中SimplePostTool的修改
2008-09-15 22:38 2985将源代码修改为传递字符串,去掉files以及stdin模式。 ... -
Struts2,Spring2,Hibernate3整合
2008-09-15 11:44 33791. web.xml <?xml version=&qu ... -
企业级搜索引擎Solr使用入门指南
2008-09-10 22:43 16680本文转自 http://chuanliang2 ... -
Lucene / Solr 开发经验
2008-09-10 22:12 20032转自 Lucene/Solr开发经验[原] 作者 张驰有道 ... -
Lucene初学备注
2008-09-07 19:51 12631,检索文件目录,创建index import java.io ... -
JR各Ajax框架基础教程收集
2008-08-24 12:19 1212JQuery: http://www.javaresearch ... -
Spring 2.0 中配置 JPA
2008-04-20 16:57 3894翻译:SpringSide团队 转载请注明出处。 本文提供了 ... -
Hibernate延迟加载
2008-02-09 16:22 2737延迟初始化错误是运用Hibernate开发项目时最常见的错误。 ... -
Properties资源文件编码
2008-01-26 17:26 15171、展开Eclipse的Help菜单,将鼠标移到Softwar ... -
struts+hibernate分页
2007-12-17 20:53 1726新建表 sql 代码 DROP DATABAS ...
相关推荐
Liferay Plugin SDK是开发Liferay插件的工具包。这份文档详述了如何使用SDK创建和管理各种插件,如钩子、布局、工作流定义等。开发者将学习到如何使用Ant脚本部署插件,以及如何利用Liferay的API扩展其功能。此外,...
Liferay入门帮助文档是针对Liferay开发的一份指南,它主要涵盖了如何开始使用这个全面的门户解决方案。Liferay是一个基于Java Enterprise Edition (J2EE) 的应用,它整合了多种技术,如EJB (Enterprise JavaBeans) ...
开发者将学习到如何利用Liferay的服务架构来开发可扩展、高性能的应用,并且理解Liferay的模块化设计,如ServiceBuilder、Hook、Ext Plugin等。 其次,《Liferay 用户开发接口》深入解析了Liferay中的用户管理和...
【Liferay 6.2 开发指南】 Liferay 6.2 是一个开源的企业级门户平台,它提供了丰富的功能和高度可扩展性,适合构建企业内部或外部的协作、信息共享和业务应用集成的网站。本开发指南将帮助开发者深入理解 Liferay ...
### Liferay快速入门知识点详解 #### 一、Liferay Portal简介与快速启动 ...无论是对于希望快速搭建企业门户的用户,还是想要深入探索Liferay开发的开发者,这份快速入门指南都是一个不可或缺的资源。
### Liferay 6.2 主题开发中文指南 #### 一、引言 在现代Web开发领域中,网站不仅需要具备强大的功能,还需要拥有吸引人的视觉设计与良好的用户体验。Liferay作为一款开源的企业级门户平台,提供了丰富的工具与...
Liferay 6.2是一款流行的开源企业级门户平台,它提供了丰富的功能,包括内容管理、社交媒体集成、工作流程以及自定义开发能力。本指南将基于提供的"liferay 6.2开发指南+用户手册"来深入讲解其核心知识点。 1. **...
6. **部署描述符**:如liferay-plugin-package.xml,定义portlet的部署信息,如版本、依赖、资源引用等。 7. **资源权限**:Liferay支持细粒度的资源权限控制,开发者可以为portlet定义不同级别的访问权限。 8. **...
### Liferay 6.0 开发指南核心知识点详解 #### 一、引言与核心技术 在《Liferay 6.0 开发指南》中,首先介绍了Liferay 6.0的核心技术及其开发策略。Liferay是一款强大的开源门户平台,支持企业级应用的构建与部署...
此外,"plugins开发指南11-plugin中开发hibernate应用.pdf"涵盖了在Liferay中使用Hibernate进行数据持久化的实践方法,这对于处理复杂业务逻辑至关重要。 "plugins开发指南13-liferay中使用ldap分析.pdf"讨论了...
**Liferay Portal 开发大全** Liferay Portal 是一个开源的企业级门户平台,广泛用于构建复杂的Web应用程序和企业内部协作系统。它提供了丰富的功能,包括内容管理、社交媒体集成、工作流支持以及用户界面定制。本...
本文档旨在详细介绍如何通过插件(plugin)方式开发Liferay Portlet。 #### 二、开发模式的选择 Liferay提供了两种主要的扩展开发方式: 1. **Ext 方式**:这种方式的优点是可以利用Liferay现有的所有模板内容,...
【标题】"7z压缩,三合一-LifeRay-开发参考手册&二次开发指南&4.3中文开发指南" 涵盖了LifeRay平台的重要学习资源,这些文档为开发者提供了全面的指导,帮助他们理解并掌握LifeRay的开发技术。 【描述】中提到的三...
《Liferay开发文档集合》是针对企业级门户平台Liferay的一系列技术指南,涵盖了从基础安装到高级定制的全方位知识。这些PDF文档旨在帮助开发者、系统管理员和IT专业人员更好地理解和利用Liferay Portal来构建和管理...
通过上述内容的整理和总结,可以看出文档主要介绍了Liferay开发的基础概念,包括Liferay的版本信息、Portlet开发、主题和布局模板的自定义、插件SDK和Liferay IDE的使用,以及如何配置开发环境。同时,也涉及了...
Liferay 6.2 开发环境搭建.doc,包括Liferay SDK下载及搭建过程等!
LifeRay架构开发手册,liferay Portal开发解析等精彩文章
《Liferay 6.2 开发完全指南》是一本针对Liferay最新版本6.2的详尽教程,旨在帮助开发者全面理解和掌握Liferay平台的开发技术。本教程以Liferay官方的技术文档为基础,同时提供了配套的视频教程,使得学习过程更为...
liferay6.2开发指南liferay6.2开发指南.doc