mhan810/liferay-portal — pull request #129 by KocsisDaniel (2013-05-30 09:50:36+00:00)
Title: LPS-35643

Hey Mike,

I need to create the UserStagedModelDataHandler to validate users as missing references and I think we might need it later, so it would be useful. The problem is the user entity already have a userId attribute(primary key because of our naming convention) what the AuditedModel requires as well, so we can't turn it into StagedModel just like we did before.

I think we have two options:

1. add only a fake userName attribute and with that user would be an AuditedModel (and a StagedModel), but userName and userId attributes won't reflect the same user and User won't act like other AuditedModels.
2. make the StagedModel interface even more lightweight and remove every unnecessary methods it inherits from AuditedModel like get/setUserId get/setUserName and introduce a new interface between StagedModel and StagedGroupedModel called StagedAuditedModel that keeps the current logic. User, because it misses only the userId/userName to be a StagedModel, turns into StagedModel without any additional change and in this way we also don't need to change the current staging API.

I chose the 2nd one to implement because it seemed to me a less "dirty" solution, however I either don't like the idea to change the current interface structure.

What do you think?

cc-ing: @matethurzo

thanks,
Daniel