Java 类com.liferay.portal.kernel.util.DateRange 实例源码

项目:ch-inofix-timetracker    文件:TaskRecordExportController.java   
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;
}
项目:ch-inofix-contact-manager    文件:ContactExportController.java   
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;
}
项目:ch-inofix-data-manager    文件:MeasurementExportController.java   
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;
}