LPS-38694

Hey Shinn,

This is a rework of https://github.com/rotty3000/liferay-portal/pull/327. I think I structured it the way Ray wanted it but I'm not sure. If it looks ok would you mind sending it through Ray again? Thanks!