Forums de discussion

get org Id in ModelListner/ServiceWrapper.

Thirumal Reddy, modifié il y a 7 années.

get org Id in ModelListner/ServiceWrapper.

Regular Member Publications: 216 Date d'inscription: 03/12/15 Publications récentes
Hi All,
how can i get Organization Id in Roles service wrapper/Model Listener.?

Thanks,
Thirumal.
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
You can't.
thumbnail
Amos Fong, modifié il y a 7 années.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Publications: 2047 Date d'inscription: 07/10/08 Publications récentes
I think it depends on what you mean?

If you're assigning an organization to a role, you should be able to get it with this modelListener method:
	public void onBeforeAddAssociation(
			Object classPK, String associationClassName,
			Object associationClassPK)
		throws ModelListenerException {
	}


I think you could also intercept methods in GroupLocalServiceImpl.addRoleGroups(). Not sure about this one though.
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Sorry, Amos, these guys are trying to figure out how to store roles or role assignments to some other table.

They recently posted threads on how to override the portlet class for a Liferay bundle (the one that contains the RoleAdmin portlet) so they could inject their code there, that too fails.

Unfortunately they won't share their actual requirement so we can't really point them in the right direction. Instead they're stabbing around in the dark trying to develop their own solution and, by the sounds of things, are not making a great deal of progress.

As soon as they can share their actual requirement/need, we'll be more than happy to help them. Until then, however, there's not much detail we can provide.