public static PortletDataContext clonePortletDataContext( PortletDataContext portletDataContext) { return _portletDataContextFactory.clonePortletDataContext( portletDataContext); }
public static PortletDataContext createExportPortletDataContext( long companyId, long groupId, Map<String, String[]> parameterMap, Date startDate, Date endDate, ZipWriter zipWriter) throws PortletDataException { return _portletDataContextFactory.createExportPortletDataContext( companyId, groupId, parameterMap, startDate, endDate, zipWriter); }
public static PortletDataContext createImportPortletDataContext( long companyId, long groupId, Map<String, String[]> parameterMap, UserIdStrategy userIdStrategy, ZipReader zipReader) throws PortletDataException { return _portletDataContextFactory.createImportPortletDataContext( companyId, groupId, parameterMap, userIdStrategy, zipReader); }
public static PortletDataContext createPreparePortletDataContext( long companyId, long groupId, String range, Date startDate, Date endDate) throws PortletDataException { return _portletDataContextFactory.createPreparePortletDataContext( companyId, groupId, range, startDate, endDate); }
public static PortletDataContext createPreparePortletDataContext( ThemeDisplay themeDisplay, Date startDate, Date endDate) throws PortletDataException { return _portletDataContextFactory.createPreparePortletDataContext( themeDisplay, startDate, endDate); }
String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), t);
/** * @deprecated As of Judson (7.1.x), replaced by {@link * #getManifestSummary(PortletDataContext)} */ @Deprecated @Override public ManifestSummary getManifestSummary( long userId, long groupId, Map<String, String[]> parameterMap, File file) throws Exception { final Group group = _groupLocalService.getGroup(groupId); String userIdStrategy = MapUtil.getString( parameterMap, PortletDataHandlerKeys.USER_ID_STRATEGY); ZipReader zipReader = ZipReaderFactoryUtil.getZipReader(file); PortletDataContext portletDataContext = _portletDataContextFactory.createImportPortletDataContext( group.getCompanyId(), groupId, parameterMap, getUserIdStrategy(userId, userIdStrategy), zipReader); try { return getManifestSummary(portletDataContext); } finally { zipReader.close(); } }
_portletDataContextFactory.createExportPortletDataContext( group.getCompanyId(), sourceGroupId, parameterMap, dateRange.getStartDate(), dateRange.getEndDate(), zipWriter);
String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), userId); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), t);
/** * @deprecated As of Judson (7.1.x), replaced by {@link * #validateMissingReferences(PortletDataContext)} */ @Deprecated @Override public MissingReferences validateMissingReferences( long userId, long groupId, Map<String, String[]> parameterMap, File file) throws Exception { Group group = _groupLocalService.getGroup(groupId); String userIdStrategy = MapUtil.getString( parameterMap, PortletDataHandlerKeys.USER_ID_STRATEGY); ZipReader zipReader = ZipReaderFactoryUtil.getZipReader(file); PortletDataContext portletDataContext = _portletDataContextFactory.createImportPortletDataContext( group.getCompanyId(), groupId, parameterMap, getUserIdStrategy(userId, userIdStrategy), zipReader); try { return validateMissingReferences(portletDataContext); } finally { zipReader.close(); } }
protected PortletDataContext getPortletDataContext( ExportImportConfiguration exportImportConfiguration) throws PortalException { Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap(); 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 = _exportImportHelper.getPortletZipWriter( portletId); PortletDataContext portletDataContext = _portletDataContextFactory.createExportPortletDataContext( layout.getCompanyId(), sourceGroupId, parameterMap, dateRange.getStartDate(), dateRange.getEndDate(), zipWriter); portletDataContext.setExportImportProcessId( String.valueOf( exportImportConfiguration.getExportImportConfigurationId())); portletDataContext.setOldPlid(sourcePlid); portletDataContext.setPlid(sourcePlid); portletDataContext.setPortletId(portletId); portletDataContext.setType("portlet"); return portletDataContext; }
String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), t);
protected PortletDataContext getPortletDataContext( ExportImportConfiguration exportImportConfiguration, File file) throws PortalException { Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap(); long userId = MapUtil.getLong(settingsMap, "userId"); long targetGroupId = MapUtil.getLong(settingsMap, "targetGroupId"); boolean privateLayout = MapUtil.getBoolean( settingsMap, "privateLayout"); Map<String, String[]> parameterMap = (Map<String, String[]>)settingsMap.get("parameterMap"); Group group = _groupLocalService.getGroup(targetGroupId); String userIdStrategyString = MapUtil.getString( parameterMap, PortletDataHandlerKeys.USER_ID_STRATEGY); UserIdStrategy userIdStrategy = _exportImportHelper.getUserIdStrategy( userId, userIdStrategyString); ZipReader zipReader = ZipReaderFactoryUtil.getZipReader(file); PortletDataContext portletDataContext = _portletDataContextFactory.createImportPortletDataContext( group.getCompanyId(), targetGroupId, parameterMap, userIdStrategy, zipReader); portletDataContext.setExportImportProcessId( String.valueOf( exportImportConfiguration.getExportImportConfigurationId())); portletDataContext.setPrivateLayout(privateLayout); return portletDataContext; }
String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), userId); String.valueOf( exportImportConfiguration.getExportImportConfigurationId()), _portletDataContextFactory.clonePortletDataContext( portletDataContext), t);
_portletDataContextFactory.createImportPortletDataContext( layout.getCompanyId(), targetGroupId, parameterMap, userIdStrategy, zipReader);
ExportImportLifecycleConstants.EVENT_PORTLET_IMPORT_STARTED, getProcessFlag(), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); EVENT_PORTLET_IMPORT_SUCCEEDED, getProcessFlag(), _portletDataContextFactory.clonePortletDataContext( portletDataContext)); ExportImportLifecycleConstants.EVENT_PORTLET_IMPORT_FAILED, getProcessFlag(), _portletDataContextFactory.clonePortletDataContext( portletDataContext), t);
@Override public ManifestSummary getManifestSummary( long userId, long groupId, Map<String, String[]> parameterMap, FileEntry fileEntry) throws Exception { File file = FileUtil.createTempFile("lar"); ZipReader zipReader = null; ManifestSummary manifestSummary = null; try (InputStream inputStream = _dlFileEntryLocalService.getFileAsStream( fileEntry.getFileEntryId(), fileEntry.getVersion(), false)) { FileUtil.write(file, inputStream); Group group = _groupLocalService.getGroup(groupId); String userIdStrategy = MapUtil.getString( parameterMap, PortletDataHandlerKeys.USER_ID_STRATEGY); zipReader = ZipReaderFactoryUtil.getZipReader(file); PortletDataContext portletDataContext = _portletDataContextFactory.createImportPortletDataContext( group.getCompanyId(), groupId, parameterMap, getUserIdStrategy(userId, userIdStrategy), zipReader); manifestSummary = getManifestSummary(portletDataContext); } finally { if (zipReader != null) { zipReader.close(); } FileUtil.delete(file); } return manifestSummary; }
_portletDataContextFactory.clonePortletDataContext( portletDataContext);