use of com.liferay.exportimport.kernel.exception.LARFileNameException in project liferay-imex by jpdacunha.
the class SiteImporter method doImportLar.
private void doImportLar(File groupDir, Properties config, User user, Group group, Locale locale, boolean debug, String prefix, boolean privateLayout) throws Exception {
long groupId = group.getGroupId();
long userId = user.getUserId();
String name = "IMEX : site import process";
String description = "This an automatic site import triggered by IMEX";
long[] layoutIds = SiteCommonUtil.ALL_LAYOUTS;
Map<String, String[]> parameterMap = null;
Map<String, Serializable> settingsMap = null;
int importType = ExportImportConfigurationConstants.TYPE_IMPORT_LAYOUT;
String larFileName = FileNames.getLarSiteFileName(group, privateLayout);
try {
parameterMap = larService.buildParameterMapFromProperties(config, prefix);
settingsMap = ExportImportConfigurationSettingsMapFactoryUtil.buildImportLayoutSettingsMap(user, groupId, privateLayout, layoutIds, parameterMap);
ExportImportConfiguration exportImportConfiguration = larService.createExportImportConfiguration(groupId, userId, name, description, importType, settingsMap, new ServiceContext());
larService.doImport(user, exportImportConfiguration, groupDir, larFileName);
} catch (LARFileNameException e) {
reportService.getMessage(_log, group.getFriendlyURL(), "[" + larFileName + "] is missing in [" + groupDir.getAbsolutePath() + "]");
if (debug) {
_log.error(e, e);
}
}
}
Aggregations