Fórum

Liferay Android: How to call the portlet methods in android?

Kishan Pawar, modificado 7 Anos atrás.

Liferay Android: How to call the portlet methods in android?

New Member Postagens: 6 Data de Entrada: 02/06/16 Postagens Recentes
Hello,

I am developing an android app with Liferay SDK. I want to fetch the portlet methods in the android app. These portlet methods include the PortletSession object as one of the parameters. So how should I invoke those methods in android app? Whether I'll need to pass some unique identifier from android side so as it will recognize it is calling the same session, or something else? If it going to be SessionID, then how to fetch the SessionID in android? Any help will be appreciated. Thank you!
thumbnail
Javier Gamarra, modificado 7 Anos atrás.

RE: Liferay Android: How to call the portlet methods in android?

Expert Postagens: 348 Data de Entrada: 12/02/15 Postagens Recentes
The best way of interacting with the portal, from your mobile app would be exposing the features to a remote service and then generating the mobile services from that code.

If you want to access a portlet... you would have to replicate the properties it needs... so for example you should provide a valid authentication, store the portal cookies, provide the url parameters... and everything calling each time with a http connection and dealing with the headers and parameters, it is very hard work if you can expose that features with a remote service I wholeheartedly recommend it.

If you just need the same session and you want to invoke an action in the server side you could store the cookie after logging in from the mobile phone and attach it each time. There is an example here (in signInWithCookie).
Kishan Pawar, modificado 7 Anos atrás.

RE: Liferay Android: How to call the portlet methods in android?

New Member Postagens: 6 Data de Entrada: 02/06/16 Postagens Recentes
Hey thank you for your swift response. Your suggestion seems great, but I want to avoid the back-and-forth passing of the cookies. My purpose is to maintain the sessions for unauthenticated users. How can I do that? Additionally, is there anything where I can recognize the identity of the unauthenticated(not logged in or signed in) users using sessions or anything else?
thumbnail
Javier Gamarra, modificado 7 Anos atrás.

RE: Liferay Android: How to call the portlet methods in android?

Expert Postagens: 348 Data de Entrada: 12/02/15 Postagens Recentes
The exposed remote web services need authentication by default (or to disable it explicitly that is not recommended). If those services are your own, they can be unauthenticated without problems.

I don't understand the need to maintain the session if you are using anonymous services? how if not done via cookies/oauth/basic auth?

I think the portal is already capturing some information and assigning an anonymous user id for each request coming with the same parameters. But this is more portal side features, I think it should better asked in the portal side of the forums emoticon