Fórum

get org Id in ModelListner/ServiceWrapper.

Thirumal Reddy, modificado 7 Anos atrás.

get org Id in ModelListner/ServiceWrapper.

Regular Member Postagens: 216 Data de Entrada: 03/12/15 Postagens Recentes
Hi All,
how can i get Organization Id in Roles service wrapper/Model Listener.?

Thanks,
Thirumal.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Postagens: 14915 Data de Entrada: 02/09/06 Postagens Recentes
You can't.
thumbnail
Amos Fong, modificado 7 Anos atrás.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
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, modificado 7 Anos atrás.

RE: get org Id in ModelListner/ServiceWrapper.

Liferay Legend Postagens: 14915 Data de Entrada: 02/09/06 Postagens Recentes
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.