本文整理汇总了Java中com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil类的典型用法代码示例。如果您正苦于以下问题:Java PortletDataContextFactoryUtil类的具体用法?Java PortletDataContextFactoryUtil怎么用?Java PortletDataContextFactoryUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PortletDataContextFactoryUtil类属于com.liferay.exportimport.kernel.lar包,在下文中一共展示了PortletDataContextFactoryUtil类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPortletDataContext
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
protected PortletDataContext getPortletDataContext(ExportImportConfiguration exportImportConfiguration)
throws PortalException {
Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap();
long companyId = MapUtil.getLong(settingsMap, "companyId");
long sourceGroupId = MapUtil.getLong(settingsMap, "sourceGroupId");
String portletId = MapUtil.getString(settingsMap, "portletId");
Map<String, String[]> parameterMap = (Map<String, String[]>) settingsMap.get("parameterMap");
DateRange dateRange = ExportImportDateUtil.getDateRange(exportImportConfiguration);
ZipWriter zipWriter = ExportImportHelperUtil.getPortletZipWriter(portletId);
PortletDataContext portletDataContext = PortletDataContextFactoryUtil.createExportPortletDataContext(companyId,
sourceGroupId, parameterMap, dateRange.getStartDate(), dateRange.getEndDate(), zipWriter);
portletDataContext.setPortletId(portletId);
return portletDataContext;
}
示例2: importFile
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public void importFile(ExportImportConfiguration exportImportConfiguration, File file) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setTaskRecordImportInProcess(true);
// TODO: process import-settings
// Map<String, Serializable> settingsMap =
// exportImportConfiguration.getSettingsMap();
doImportFile(file, exportImportConfiguration.getUserId(), exportImportConfiguration.getGroupId());
ExportImportThreadLocal.setTaskRecordImportInProcess(false);
} catch (Throwable t) {
ExportImportThreadLocal.setTaskRecordImportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_TASK_RECORDS_IMPORT_FAILED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext), t);
throw t;
}
}
示例3: getPortletDataContext
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
protected PortletDataContext getPortletDataContext(ExportImportConfiguration exportImportConfiguration)
throws PortalException {
Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap();
long companyId = MapUtil.getLong(settingsMap, "companyId");
long sourceGroupId = MapUtil.getLong(settingsMap, "sourceGroupId");
String portletId = MapUtil.getString(settingsMap, "portletId");
Map<String, String[]> parameterMap = (Map<String, String[]>) settingsMap.get("parameterMap");
DateRange dateRange = ExportImportDateUtil.getDateRange(exportImportConfiguration);
ZipWriter zipWriter = ExportImportHelperUtil.getPortletZipWriter(portletId);
PortletDataContext portletDataContext = PortletDataContextFactoryUtil.createExportPortletDataContext(
companyId, sourceGroupId, parameterMap, dateRange.getStartDate(), dateRange.getEndDate(),
zipWriter);
portletDataContext.setPortletId(portletId);
return portletDataContext;
}
示例4: importFile
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public void importFile(ExportImportConfiguration exportImportConfiguration, File file) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setContactImportInProcess(true);
// TODO: process import-settings
// Map<String, Serializable> settingsMap =
// exportImportConfiguration.getSettingsMap();
doImportFile(file, exportImportConfiguration.getUserId(), exportImportConfiguration.getGroupId());
ExportImportThreadLocal.setContactImportInProcess(false);
} catch (Throwable t) {
ExportImportThreadLocal.setContactImportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_CONTACTS_IMPORT_FAILED, getProcessFlag(),
PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext), t);
throw t;
}
}
示例5: getPortletDataContext
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
protected PortletDataContext getPortletDataContext(ExportImportConfiguration exportImportConfiguration)
throws PortalException {
Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap();
// String fileName = MapUtil.getString(settingsMap, "fileName");
long sourcePlid = MapUtil.getLong(settingsMap, "sourcePlid");
long sourceGroupId = MapUtil.getLong(settingsMap, "sourceGroupId");
String portletId = MapUtil.getString(settingsMap, "portletId");
Map<String, String[]> parameterMap = (Map<String, String[]>) settingsMap.get("parameterMap");
DateRange dateRange = ExportImportDateUtil.getDateRange(exportImportConfiguration);
Layout layout = _layoutLocalService.getLayout(sourcePlid);
ZipWriter zipWriter = ExportImportHelperUtil.getPortletZipWriter(portletId);
PortletDataContext portletDataContext = PortletDataContextFactoryUtil.createExportPortletDataContext(
layout.getCompanyId(), sourceGroupId, parameterMap, dateRange.getStartDate(), dateRange.getEndDate(),
zipWriter);
portletDataContext.setOldPlid(sourcePlid);
portletDataContext.setPlid(sourcePlid);
portletDataContext.setPortletId(portletId);
return portletDataContext;
}
示例6: importFile
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public void importFile(ExportImportConfiguration exportImportConfiguration,
File file) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setMeasurementImportInProcess(true);
// TODO: process import-settings
// Map<String, Serializable> settingsMap =
// exportImportConfiguration.getSettingsMap();
doImportFile(file, exportImportConfiguration.getUserId(),
exportImportConfiguration.getGroupId());
ExportImportThreadLocal.setMeasurementImportInProcess(false);
} catch (Throwable t) {
ExportImportThreadLocal.setMeasurementImportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(
EVENT_MEASUREMENTS_IMPORT_FAILED, getProcessFlag(),
PortletDataContextFactoryUtil
.clonePortletDataContext(portletDataContext),
t);
throw t;
}
}
示例7: export
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public File export(ExportImportConfiguration exportImportConfiguration) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setTaskRecordExportInProcess(true);
portletDataContext = getPortletDataContext(exportImportConfiguration);
exportImportConfiguration.getSettingsMap();
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_TASK_RECORDS_EXPORT_STARTED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
File file = doExport(portletDataContext);
ExportImportThreadLocal.setTaskRecordExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_TASK_RECORDS_EXPORT_SUCCEEDED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
return file;
} catch (Throwable t) {
_log.error(t);
ExportImportThreadLocal.setTaskRecordExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_TASK_RECORDS_EXPORT_FAILED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext), t);
throw t;
}
}
示例8: export
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public File export(ExportImportConfiguration exportImportConfiguration) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setContactExportInProcess(true);
portletDataContext = getPortletDataContext(exportImportConfiguration);
exportImportConfiguration.getSettingsMap();
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_CONTACTS_EXPORT_STARTED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
File file = doExport(portletDataContext);
ExportImportThreadLocal.setContactExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_CONTACTS_EXPORT_SUCCEEDED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
return file;
} catch (Throwable t) {
_log.error(t);
ExportImportThreadLocal.setContactExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_CONTACTS_EXPORT_FAILED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext), t);
throw t;
}
}
示例9: export
import com.liferay.exportimport.kernel.lar.PortletDataContextFactoryUtil; //导入依赖的package包/类
@Override
public File export(ExportImportConfiguration exportImportConfiguration) throws Exception {
PortletDataContext portletDataContext = null;
try {
ExportImportThreadLocal.setMeasurementExportInProcess(true);
portletDataContext = getPortletDataContext(exportImportConfiguration);
exportImportConfiguration.getSettingsMap();
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_MEASUREMENTS_EXPORT_STARTED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
File file = doExport(portletDataContext);
ExportImportThreadLocal.setMeasurementExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_MEASUREMENTS_EXPORT_SUCCEEDED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext));
return file;
} catch (Throwable t) {
_log.error(t);
ExportImportThreadLocal.setMeasurementExportInProcess(false);
_exportImportLifecycleManager.fireExportImportLifecycleEvent(EVENT_MEASUREMENTS_EXPORT_FAILED,
getProcessFlag(), PortletDataContextFactoryUtil.clonePortletDataContext(portletDataContext), t);
throw t;
}
}