Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Matthias Gasser
Setting Organization Logo programmatically
September 14, 2012 4:32 AM
Answer

Matthias Gasser

Rank: New Member

Posts: 4

Join Date: September 7, 2012

Recent Posts

Dear Liferayers,

I'm able to create new organizations by the use of the OrganizationUtils, but unfortunately without being able to set the organization logo.

I've searched the JavaDoc (6.1), but all I could found where a method to actually delete the logo, and retrieve a default one, but not setting a new one.

Is there any liferay service provided to change a organization logo programmatically?

Thanks in advance,
Matthias
Ranga Rao Bobbili
RE: Setting Organization Logo programmatically
September 14, 2012 6:58 AM
Answer

Ranga Rao Bobbili

Rank: Regular Member

Posts: 152

Join Date: July 20, 2007

Recent Posts

Matthias Gasser:
Dear Liferayers,

I'm able to create new organizations by the use of the OrganizationUtils, but unfortunately without being able to set the organization logo.

I've searched the JavaDoc (6.1), but all I could found where a method to actually delete the logo, and retrieve a default one, but not setting a new one.

Is there any liferay service provided to change a organization logo programmatically?

Thanks in advance,
Matthias


Please verify your theme header.vm and modify your image path.

Regards,
Ranga Rao
Matthias Gasser
RE: Setting Organization Logo programmatically
September 14, 2012 7:39 AM
Answer

Matthias Gasser

Rank: New Member

Posts: 4

Join Date: September 7, 2012

Recent Posts

Ranga Rao Bobbili:

Please verify your theme header.vm and modify your image path.


Actually, I'm not trying to modify the appearance, rather then migrating the logo's of some legacy (not in liferay) organizations. It could be done by a manual task using the control panel, but as there are far too many to do so.

So I want to loop over all organizations, get their logo from the legacy system, and update the liferay organizations respectively.

Thanks for your advice anyway

Best Regards,
Alireza Zare
RE: Setting Organization Logo programmatically
September 14, 2012 8:37 AM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

If you look at organizationImpl.getLogoId()
It finds the group for the organization:
Group group = GroupLocalServiceUtil.getOrganizationGroup(getCompanyId(), getOrganizationId());
Retrieves the layoutSet
LayoutSet publicLayoutSet = LayoutSetLocalServiceUtil.getLayoutSet(group.getGroupId(), false);

I think this layoutset contains the logoId for the organization.

I hope changing the layoutset and giving it another Id will solve your problem.
Bart Simpson
RE: Setting Organization Logo programmatically
September 17, 2012 4:13 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Indeed, LayoutSetLocalServiceUtil has method updateLogo
Matthias Gasser
RE: Setting Organization Logo programmatically
September 17, 2012 1:33 PM
Answer

Matthias Gasser

Rank: New Member

Posts: 4

Join Date: September 7, 2012

Recent Posts

Thanks, indeed the logo hides within the LayoutSet. The updateLogo works fine!