Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在liferay社交插件上创建模型侦听器_Java_Eclipse Plugin_Liferay_Liferay 6_Liferay Ide - Fatal编程技术网

Java 在liferay社交插件上创建模型侦听器

Java 在liferay社交插件上创建模型侦听器,java,eclipse-plugin,liferay,liferay-6,liferay-ide,Java,Eclipse Plugin,Liferay,Liferay 6,Liferay Ide,我已经按照建议为Social Office Calendar创建了自定义模型侦听器,但尝试构建时失败,原因是项目中不存在目标“编译java” BUILD FAILED C:\devel\fishnet\liferay-fishnet-project-6-2\liferay-plugins-sdk-6.2\build-common-plugin-ext.xml:66: The following error occurred while executing this line: C:\devel\

我已经按照建议为Social Office Calendar创建了自定义模型侦听器,但尝试构建时失败,原因是项目中不存在目标“编译java”

BUILD FAILED
C:\devel\fishnet\liferay-fishnet-project-6-2\liferay-plugins-sdk-6.2\build-common-plugin-ext.xml:66: The following error occurred while executing this line:
C:\devel\fishnet\liferay-fishnet-project-6-2\liferay-plugins-sdk-6.2\build-common-plugin-ext.xml:347: The following error occurred while executing this line:
Target "compile-java" does not exist in the project "calendar-new-portlet". 
这是否与build-common-plugin-ext.xml有关,或者我应该按照另一个过程在社交办公室日历中实现自定义模型侦听器


注意:我已经用相同的构建文件(build-common-plugin-ext.xml)成功地扩展了其他社交办公室插件(chatportlet、contacts等),但在这些情况下,我没有像现在这样添加自定义Java类和模型侦听器

模型侦听器在
ext
插件中不可用,因为
ext
s被设计为直接覆盖门户类

要仅添加一个模型侦听器,我建议通过执行以下操作使用
hook
插件:

  • 导航到插件SDK中的
    /hooks/
  • 使用创建脚本创建一个新的钩子(例如,
    /create.sh my test“my test”
  • 然后在
    /my test hook/docroot/WEB-INF/liferay hook.xml
    中编写:

    <hook>
        <portal-properties>portal.properties</portal-properties>
    </hook>
    
    
    portal.properties
    
  • 创建
    /mytesthook/docroot/WEB-INF/src/portal.properties

  • 现在添加模型侦听器:
    value.object.listener.com.liferay.portal.model.User=com.test.MyListener

  • 考虑将你正在处理的平台添加到标签列表中。liferay标记可能不会生成那么多视图。我尝试的是为插件portlet(如social office calendar)的模型实体添加一个侦听器。因此,我必须在service.properties中添加value.object.listener.com.liferay.calendar.model.calendar=com.liferay.calendar.model.listeners.CalendarListener,而不是在portal.properties中。