Skip to content

Instantly share code, notes, and snippets.

@sammso
Last active November 22, 2017 06:35
Show Gist options
  • Save sammso/9d1e85001765ae63cd5af53e91423124 to your computer and use it in GitHub Desktop.
Save sammso/9d1e85001765ae63cd5af53e91423124 to your computer and use it in GitHub Desktop.
Consulting 2017-11-20

Hooking the ActionCommand at Liferay

@Component(
		immediate = true,
		property = {
			"javax.portlet.name=" + GradebookPortletKeys.PORTLET_NAME,
			"mvc.command.name=/gradebook/assignment/add",
			"service.ranking:Integer=100" 
	},
		service = MVCActionCommand.class)
public class AddAssignmentMVCActionCommandHook implements MVCActionCommand {

	@Override
	public boolean processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException {
		_log.fatal("I'm hooked 3");
		return mvcActionCommand.processAction(actionRequest, actionResponse);
	}

	@Reference(target = "(&(mvc.command.name=/gradebook/assignment/add)" +
			"(component.name=com.liferay.training.space.gradebook.portlet.command.AddAssignmentMVCActionCommand))")
	protected MVCActionCommand mvcActionCommand;
	
	private Log _log = LogFactoryUtil.getLog(AddAssignmentMVCActionCommandHook.class);
}

Liferay version numbering.

Version numbers at Liferay:

  • 1.0.0 -> new package -- > Kernel 2.0.0 -> -- > com.liferay.counter → com.liferay.counter.kernel equals 6.??? to 1.0.0 .. this is zeroing version numbering
  • 6.2.0 -> 6.2 compatbile package
  • 6.3.0 -> 6.2 compatbile package with new methods
  • 7.0.0 -> package that does exists on 6.2 but incompatible changes

JSF issues

13:18:00,587 ERROR [fileinstall-/<removed>/bundles/osgi/war][:57] Liferay Faces Bridge Implementation 4.1.0 (Sep 9, 2017 AD) is designed to be used with Portlet 2.0 but detected 1.0

Root cause:

https://issues.liferay.com/browse/FACES-3238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment