@Override public PortletDataContext createPreparePortletDataContext( long companyId, long groupId, String range, Date startDate, Date endDate) throws PortletDataException { validateDateRange(startDate, endDate); PortletDataContext portletDataContext = createPortletDataContext( companyId, groupId); portletDataContext.setEndDate(endDate); Map<String, String[]> parameterMap = Collections.emptyMap(); if (range != null) { parameterMap = new HashMap<>(); parameterMap.put(ExportImportDateUtil.RANGE, new String[] {range}); } portletDataContext.setParameterMap(parameterMap); portletDataContext.setStartDate(startDate); return portletDataContext; }
@Override public PortletDataContext createExportPortletDataContext( long companyId, long groupId, Map<String, String[]> parameterMap, Date startDate, Date endDate, ZipWriter zipWriter) throws PortletDataException { validateDateRange(startDate, endDate); PortletDataContext portletDataContext = createPortletDataContext( companyId, groupId); portletDataContext.setEndDate(endDate); portletDataContext.setParameterMap(parameterMap); portletDataContext.setStartDate(startDate); portletDataContext.setZipWriter(zipWriter); return portletDataContext; }
@Override public PortletDataContext createImportPortletDataContext( long companyId, long groupId, Map<String, String[]> parameterMap, UserIdStrategy userIdStrategy, ZipReader zipReader) throws PortletDataException { PortletDataContext portletDataContext = createPortletDataContext( companyId, groupId); String dataStrategy = MapUtil.getString( parameterMap, PortletDataHandlerKeys.DATA_STRATEGY, PortletDataHandlerKeys.DATA_STRATEGY_MIRROR); portletDataContext.setDataStrategy(dataStrategy); portletDataContext.setNewLayouts(new ArrayList<Layout>()); portletDataContext.setParameterMap(parameterMap); portletDataContext.setUserIdStrategy(userIdStrategy); portletDataContext.setZipReader(zipReader); readXML(portletDataContext); Map<Long, Long> groupIds = (Map<Long, Long>)portletDataContext.getNewPrimaryKeysMap( Group.class); groupIds.put( portletDataContext.getSourceCompanyGroupId(), portletDataContext.getCompanyGroupId()); return portletDataContext; }
portletDataContext.getNewPrimaryKeysMaps()); clonePortletDataContext.setParameterMap( portletDataContext.getParameterMap()); clonePortletDataContext.setPortletId(portletDataContext.getPortletId());