Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay Invitation module integrate in Liferay Rest Module
We are trying to integrate liferay's
com-liferay-invitation module in my own custome Rest
Module, for that i have added gradle
depandancy in the rest module.
So After the gradle build i am able to use the member invitation related classes and methods.
https://github.com/liferay/com-liferay-invitation/blob/master/invitation-invite-members-web/src/main/java/com/liferay/invitation/invite/members/web/internal/portlet/InviteMembersPortlet.java
same way when i try to write the code for addMemberRequests i need a object of serviceContext and in the serviceContext they pass the request object for portleturl, createAccountUrl etc parameter.
So here my Question is in the Rest Module is there any way so i am able to access the http servlet or any other request.
Thanks in advance
Hi Dipesh,
Are you saying that you are trying to access the web module from your REST module? if you are, then I would say that is the wrong solution. You should instead be trying to access the api module (which will in turn use the service) to perform your operation. If that is what you are doing, but you can't call the api method because you need a ServiceContext, you have two options.
1. Check to see if there is a method (or series of methods) that you can call that don't require the context object (though you probably already did this)
2. Build the service context yourself
The service context is just a helper class that caries a bunch of information to save you having to type out a million parameters. Not all the fields are necessarily populated, and even if the are, often onl;y a few of the actual fields are even used by the service. You sould be able to check the portal soource (service implementation) to see which fields are necessary and then build the service context yourself.
Powered by Liferay™