Foros de discusión

"Portlet" Help

Renata Siega, modificado hace 11 años.

"Portlet" Help

Junior Member Mensajes: 34 Fecha de incorporación: 29/10/12 Mensajes recientes
Hello,
I need some help, I don't even know the name of the portlet that I am looking for, worst, I don't even know if it is really a portlet.
The description is:
Is the window that handles the list of portlets that you can drag and drop to your page.
Why I need it:
I need to know the name, for have somewhere to start the search for classes that this "portlet" uses to show de list of portlets, and I need to know how it gets the instances of the portlets, how it knows which portlets are shown in the list.
If someone knows what I am talking about and knows the answer to one of my questions, please, help.
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: "Portlet" Help

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
How about starting out by reading liferay's online document and setting up liferay and playing out with it a little bit.

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide
Renata Siega, modificado hace 11 años.

RE: "Portlet" Help

Junior Member Mensajes: 34 Fecha de incorporación: 29/10/12 Mensajes recientes
Hi, I already use Liferay, I am developing porlets for my company, I just dind't know how to explain what I was looking for, but, anyways, I solved part of the problem:
@PostConstruct
public void init(){
try {
User currentUser = getCurrentUser();
List<Portlet> portlets = PortletLocalServiceUtil.getPortlets(currentUser.getCompanyId(), false, false);
int total = portlets.size();
for (int j = 0; j < total; j++) {
Portlet portlet = portlets.get(j);
PluginPackage pluginPackage = portlet.getPluginPackage();
PluginSetting pluginSetting = PluginSettingLocalServiceUtil.getPluginSetting(currentUser.getCompanyId(), portlet.getPortletId(), Plugin.TYPE_PORTLET);
this.nomePortlets += portlet.getDisplayName();
}
} catch (SystemException e) {
} catch (WebServiceException e) {
} catch (Exception e){
}
}


protected User getCurrentUser(){
User u = null;
FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext externalContext = fc.getExternalContext();
if (externalContext.getUserPrincipal() == null) {
//logger.info("current principal is null");
System.out.println("current principal is null");
} else {
Long id = Long.parseLong(externalContext.getUserPrincipal().getName());
try {
u = UserLocalServiceUtil.getUserById(id);
} catch (PortalException e) {
} catch (SystemException e) {
//Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
return u;
}

Thanks!