0

I have created my custom Model Listener for Social Office Calendar as this thread suggests but when trying to extend my plugin the build fails and the reason is that the target "compile-java" does not exist in the project.

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". 

Does this have to do with the build-common-plugin-ext.xml or I should have followed another procedure for implementing a custom model listener in social office calendar?

Note: I have extended successfully other social office plugins(chat-portlet, contacts etc.) with the same build file(build-common-plugin-ext.xml) but in those cases I didn't add a custom Java class like now with the model listener.

jkonst
  • 433
  • 6
  • 20
  • Consider adding the platform you're working on to the tag list. The liferay tags might not generate that many views. – Arctodus Jul 15 '14 at 13:18

1 Answers1

0

Model listeners are not available in an ext plugin because exts are designed to directly override portal classes.

To add just a model listener, I suggest using a hook plugin by doing the following:

  1. Navigate to /hooks/ in your Plugins SDK.
  2. Use the create script to create a new hook (ex. ./create.sh my-test "My Test")
  3. Then in /my-test-hook/docroot/WEB-INF/liferay-hook.xml write:

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

  5. Now add your model listener: value.object.listener.com.liferay.portal.model.User=com.test.MyListener
rp.
  • 3,435
  • 1
  • 21
  • 29
  • what I'm trying to do is to add a listener for a model entity of a plugin portlet like social office calendar. So I have to add value.object.listener.com.liferay.calendar.model.Calendar=com.liferay.calendar.model.listeners.CalendarListener in service.properties and not in portal.properties. – jkonst Jul 16 '14 at 11:57