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: ExportImportConfiguration
Hi,
I am trying to import programatically a navigation menu from one site to another. I export from the control panel the file from origin site, and then I recover it from database with this:
configuration = ExportImportConfigurationLocalServiceUtil.getExportImportConfiguration(siteId);
file = ExportImportLocalServiceUtil.exportLayoutsAsFile(
configuration );
Now I am trying to import to other file with this
ExportImportLocalService.importLayouts(ExportImportConfiguration exportImportConfiguration, File file)
but I don't know how to create the new ExportImportConfiguration
object. Could anyone help me?
Thanks in advance
Regards,
Hi Daniel,
Have you tried the examples that you can find in the portal source?
Can that work to you?
Regards,
Zsigmond
Hi,
First of all, thanks for the help. I was able to create exportIMport configuration with you link, but when I try to import, I received a
com.liferay.exportimport.kernel.exception.LARTypeException
The file which I am trying to import is a lar file generated from the
control panel, and not modified. Do you have any idea wy this is happening?
Thanks!
Regards
Hi Daniel,
That may come if the LAR type is not one of the predifined ones, "layout-prototype", "layout-set" or "layout-set-prototype". You could debug on the code level to see what is coming during processing the LAR.
Otherwise, knowing where on the Control Panel you generated the LAR file exactly or a step by step description of what your trying may help to find the problem.
Zsigmond
Hi,
Thanks for the help. I was generating an export lar file of the navigation menu a site(Liferay 7.3). Menu - Site Builder - Navigation menus
Regards,
Hi,
Ok, I think the problem is that the LAR file you exported there is a portlet type LAR file that contains all the data from the Navigation Menus portlet. That won't work in your code as that is for layouts. You can use LAR file that has been exported from a site, site temple, or page template.
Regards,
Zsigmond
Powered by Liferay™