Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Marvin Bleiberg
Extending a Microstrategy Portlet
15 octobre 2013 14:39
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

I have a third-party (Microstrategy) Portlet that is working as expected. I would like to extend that portlet, by allowing it (read-only) access to specific Liferay data (native, or custom fields in Expando).
a) Does Liferay allow or prevent this type of access from a 3rd party portlet?
b) given the answer to "a", what are options and recommendations to accomplish this?
I understand that Liferay data can in theory be accessed programatically, but do not have any idea whether/how to do this from a 3rd party portlet.

thank you!
Marvin
David H Nebinger
RE: Extending a Microstrategy Portlet
15 octobre 2013 14:58
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

All liferay data is in a database, so you can use the database connection to access the data.

Unfortunately the liferay database is esoteric and subject to change w/ each new release. You may be able to figure out the tables/joins you want to pull together into MS, but there's no guarantee it is going to continue to work.

Many of the FK fields are logical-only (no DBMS FK definitions), and often times the value may point to one of many other tables depending upon other column values for the row.
Marvin Bleiberg
RE: Extending a Microstrategy Portlet
15 octobre 2013 18:33
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

David-
Thank you for your reply.
Assuming I use Custom Fields (Expando tables) - Is direct access of the db the only (or best) way for the portlet to access this data? I was hoping there might be an existing Liferay service to pull the desired data, and that this service can easily be made available to a third party portlet.
thank you-
Marvin
David H Nebinger
RE: Extending a Microstrategy Portlet
15 octobre 2013 18:46
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

Sure, there's the Liferay API which is the preferred method of accessing this data.

Honestly I don't know a lot about microstrategy, but I'm not sure how you would plug into the Liferay API (a Java API) using an existing, canned 3rd party portlet.
Marvin Bleiberg
RE: Extending a 3rd-party java Portlet
16 octobre 2013 09:50
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

For any generic 3rd party portlet written in java that displays 3rd party content (but not Liferay content) - does the Liferay platform allow the portlet to call for data from Liferay using the Liferay API, or is this prevented by design? If the former - is there some small set of code to be added to the portlet? If the latter - Is there some straightforward Liferay configuration setting that needs to be turned on/off?
I'm hoping to understand enough about the approach required, in order to give a java developer something specific to accomplish.

thank you-
Marvin
David H Nebinger
RE: Extending a 3rd-party java Portlet
16 octobre 2013 11:25
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

Any portlet can access the Liferay API. The API is there for anyone to use.

The questions that you'll encounter are:

1. do you have the source for the "3rd party portlet"? If not, you may be out of luck. Having the source is a requirement.

2. do you have an experienced developer? You'll need someone that knows their stuff, either as an employee or via a consulting firm.
Marvin Bleiberg
RE: Extending a 3rd-party java Portlet
17 octobre 2013 12:24
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

David-
The answer to #1 is "yes", we do have the source code. My java developer's response is as follows:
"The MicroStrategy portlet runs on separate war. We do not want to make a direct database call within this war . You said that Liferay has API for database call, do you know if those API make a call to expose Liferay public interface? We do not want to manage specific Liferay configuration setting inside the MicroStrategy portlet war"

The developer is not an expert in Liferay - hopefully you can answer her questions, or at least help us understand if we are on the wrong track somehow.
thank you again for your help.
David H Nebinger
RE: Extending a 3rd-party java Portlet
17 octobre 2013 14:24
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

All Liferay portlets have access to the portal-service.jar that is in the global library directory of the app server (lib/ext in tomcat).

It is this jar that has the entire Liferay API that is available to the portlet. To get a list of users, for example, you can use com.liferay.portal.service.UserLocalServiceUtil.getUsers(-1,-1) to retrieve a list of Liferay users.

There are many other services contained within portal-service.jar to access all kinds of things...
Marvin Bleiberg
RE: Extending a 3rd-party java Portlet
22 octobre 2013 19:47
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

David-
I found this code in the internet:

User user = UserLocalServiceUtil.getUserById(userid);

For setting the value
user.getExpandoBridge().setAttribute(IConstants.EXPANDO_USER_JOB_DESCRIPTION, "some desc" );

For retrieving the value
user.getExpandoBridge().getAttribute(IConstants.EXPANDO_USER_JOB_DESCRIPTION);

In my case, I declared "propertyA"on the User level. Is it correct to retrieve propertyA with -
user.getExpandoBridge().getAttribute("propertyA");

thank you-
Marvin
David H Nebinger
RE: Extending a 3rd-party java Portlet
23 octobre 2013 05:59
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

Sure.
Marvin Bleiberg
RE: Extending a 3rd-party java Portlet
9 novembre 2013 19:50
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

David-
Thank you for your help so far. We've been able to get the expando values fromthe tables for a simple text field, but are struggling with getting the value where the Expando field type is "Group of Text Values". How should we approach this? In general - Is there a good reference for differences in using these field types?
thank you again-
Marvin
Marvin Bleiberg
RE: Extending a 3rd-party java Portlet
9 novembre 2013 21:09
Réponse

Marvin Bleiberg

Rang: New Member

Publications: 16

Date d'inscription: 4 juin 2012

Publications Récentes

David-
Thank you - we were able to resolve that last part.

If anyone wants the code, this is what we used to get the value from Expando, where the Expando field type is "Group of Text Values":
User user = UserLocalServiceUtil.getUserById(liferayUserID));
String[] attrGroupArray = (String[]) user.getExpandoBridge().getAttribute("AttrGroup");
if (attrGroupArray.length > 0){
attrGroupvalue = attrGroupArray [0];
}