0

正如该线程所建议的那样,我已经为社交办公室日历创建了自定义模型侦听器,但是当尝试扩展我的插件时,构建失败,原因是项目中不存在目标“compile-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)成功扩展了其他社交办公插件(聊天门户、联系人等),但在这些情况下,我没有像现在这样添加自定义 Java 类与模型侦听器。

4

1 回答 1

0

ext模型侦听器在插件中不可用,因为exts 旨在直接覆盖门户类。

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

  1. 导航到/hooks/插件 SDK。
  2. 使用 create 脚本创建一个新的钩子(例如./create.sh my-test "My Test"
  3. 然后/my-test-hook/docroot/WEB-INF/liferay-hook.xml写:

    <hook>
        <portal-properties>portal.properties</portal-properties>
    </hook>
    
  4. 创建/my-test-hook/docroot/WEB-INF/src/portal.properties.

  5. 现在添加您的模型侦听器: value.object.listener.com.liferay.portal.model.User=com.test.MyListener
于 2014-07-15T23:43:53.240 回答