当前位置: 首页>>代码示例>>Java>>正文


Java MapUtil类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.MapUtil的典型用法代码示例。如果您正苦于以下问题:Java MapUtil类的具体用法?Java MapUtil怎么用?Java MapUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MapUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了MapUtil类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPortletDataContext

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的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;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:21,代码来源:TaskRecordExportController.java

示例2: getPortletDataContext

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的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;
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:21,代码来源:ContactExportController.java

示例3: getPortletDataContext

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的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;
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:27,代码来源:MeasurementExportController.java

示例4: importMeasurementsInBackground

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
@Override
public long importMeasurementsInBackground(
        ExportImportConfiguration exportImportConfiguration,
        InputStream inputStream, String extension) throws PortalException {

    Map<String, Serializable> settingsMap = exportImportConfiguration
            .getSettingsMap();

    long targetGroupId = MapUtil.getLong(settingsMap, "targetGroupId");

    DataManagerPortletPermission.check(getPermissionChecker(),
            targetGroupId, MeasurementActionKeys.IMPORT_MEASUREMENTS);

    return measurementLocalService.importMeasurementsInBackground(
            getUserId(), exportImportConfiguration, inputStream, extension);
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:17,代码来源:MeasurementServiceImpl.java

示例5: ExportImportBackgroundTaskDisplay

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
public ExportImportBackgroundTaskDisplay(BackgroundTask backgroundTask) {
    super(backgroundTask);

    Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap();

    _cmd = MapUtil.getString(taskContextMap, Constants.CMD);
    _percentage = PERCENTAGE_NONE;

    if (backgroundTaskStatus == null) {
        _allProgressBarCountersTotal = 0;
        _currentProgressBarCountersTotal = 0;
        _phase = null;
        _stagedModelName = null;
        _stagedModelType = null;

        return;
    }

    long allModelAdditionCountersTotal = getBackgroundTaskStatusAttributeLong("allModelAdditionCountersTotal");
    long allPortletAdditionCounter = getBackgroundTaskStatusAttributeLong("allPortletAdditionCounter");

    _allProgressBarCountersTotal = allModelAdditionCountersTotal + allPortletAdditionCounter;

    long currentModelAdditionCountersTotal = getBackgroundTaskStatusAttributeLong(
            "currentModelAdditionCountersTotal");
    long currentPortletAdditionCounter = getBackgroundTaskStatusAttributeLong("currentPortletAdditionCounter");

    _currentProgressBarCountersTotal = currentModelAdditionCountersTotal + currentPortletAdditionCounter;

    _phase = getBackgroundTaskStatusAttributeString("phase");
    _stagedModelName = getBackgroundTaskStatusAttributeString("stagedModelName");
    _stagedModelType = getBackgroundTaskStatusAttributeString("stagedModelType");
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:34,代码来源:ExportImportBackgroundTaskDisplay.java

示例6: getTemplateVars

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
@Override
protected Map<String, Object> getTemplateVars() {
    Map<String, Object> templateVars = new HashMap<>();

    templateVars.put("exported", MapUtil.getBoolean(backgroundTask.getTaskContextMap(), "exported"));
    templateVars.put("validated", MapUtil.getBoolean(backgroundTask.getTaskContextMap(), "validated"));

    templateVars.put("htmlUtil", HtmlUtil.getHtml());

    return templateVars;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:12,代码来源:ExportImportBackgroundTaskDisplay.java

示例7: importTaskRecordsInBackground

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
@Override
public long importTaskRecordsInBackground(ExportImportConfiguration exportImportConfiguration,
        InputStream inputStream, String extension) throws PortalException {

    Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap();

    long targetGroupId = MapUtil.getLong(settingsMap, "targetGroupId");

    TimetrackerPortletPermission.check(getPermissionChecker(), targetGroupId,
            TimetrackerActionKeys.IMPORT_TASK_RECORDS);

    return taskRecordLocalService.importTaskRecordsInBackground(getUserId(), exportImportConfiguration,
            inputStream, extension);
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:15,代码来源:TaskRecordServiceImpl.java

示例8: importContactsInBackground

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
@Override
public long importContactsInBackground(ExportImportConfiguration exportImportConfiguration, InputStream inputStream,
        String extension) throws PortalException {

    Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap();

    long sourceGroupId = MapUtil.getLong(settingsMap, "sourceGroupId");
    // long targetGroupId = MapUtil.getLong(settingsMap, "targetGroupId");

    ContactManagerPortletPermission.check(getPermissionChecker(), sourceGroupId,
            ContactManagerActionKeys.IMPORT_CONTACTS);

    return contactLocalService.importContactsInBackground(getUserId(), exportImportConfiguration, inputStream,
            extension);
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:16,代码来源:ContactServiceImpl.java

示例9: importJournalArticle

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
protected void importJournalArticle(
		PortletDataContext portletDataContext, Layout layout,
		Element layoutElement)
	throws Exception {

	UnicodeProperties typeSettingsProperties =
		layout.getTypeSettingsProperties();

	String articleId = typeSettingsProperties.getProperty(
		"article-id", StringPool.BLANK);

	if (Validator.isNull(articleId)) {
		return;
	}

	JournalPortletDataHandlerImpl.importReferencedData(
		portletDataContext, layoutElement);

	Element structureElement = layoutElement.element("structure");

	if (structureElement != null) {
		JournalPortletDataHandlerImpl.importStructure(
			portletDataContext, structureElement);
	}

	Element templateElement = layoutElement.element("template");

	if (templateElement != null) {
		JournalPortletDataHandlerImpl.importTemplate(
			portletDataContext, templateElement);
	}

	Element articleElement = layoutElement.element("article");

	if (articleElement != null) {
		JournalPortletDataHandlerImpl.importArticle(
			portletDataContext, articleElement);
	}

	Map<String, String> articleIds =
		(Map<String, String>)portletDataContext.getNewPrimaryKeysMap(
			JournalArticle.class + ".articleId");

	articleId = MapUtil.getString(articleIds, articleId, articleId);

	typeSettingsProperties.setProperty("article-id", articleId);

	JournalContentSearchLocalServiceUtil.updateContentSearch(
		portletDataContext.getScopeGroupId(), layout.isPrivateLayout(),
		layout.getLayoutId(), StringPool.BLANK, articleId, true);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:52,代码来源:LayoutImporter.java

示例10: doImportStagedModel

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
@Override
protected void doImportStagedModel(
		PortletDataContext portletDataContext, Album album)
	throws Exception {

	long userId = portletDataContext.getUserId(album.getUserUuid());

	ServiceContext serviceContext = portletDataContext.createServiceContext(
		album);

	String artistPath = ExportImportPathUtil.getModelPath(
		portletDataContext, Artist.class.getName(), album.getArtistId());

	Artist artist = (Artist)portletDataContext.getZipEntryAsObject(
		artistPath);

	if (artist != null) {
		StagedModelDataHandlerUtil.importReferenceStagedModel(
			portletDataContext, album, Artist.class, album.getArtistId());
	}

	Map<Long, Long> artistIds =
		(Map<Long, Long>)portletDataContext.getNewPrimaryKeysMap(
			Artist.class);

	long artistId = MapUtil.getLong(
		artistIds, album.getArtistId(), album.getArtistId());

	Album importedAlbum = null;

	if (portletDataContext.isDataStrategyMirror()) {
		Album existingAlbum =
			AlbumLocalServiceUtil.fetchAlbumByUuidAndGroupId(
				album.getUuid(), portletDataContext.getScopeGroupId());

		if (existingAlbum == null) {
			serviceContext.setUuid(album.getUuid());

			importedAlbum = AlbumLocalServiceUtil.addAlbum(
				userId, artistId, album.getName(), album.getYear(), null,
				serviceContext);
		}
		else {
			importedAlbum = AlbumLocalServiceUtil.updateAlbum(
				userId, existingAlbum.getAlbumId(), artistId,
				album.getName(), album.getYear(), null, serviceContext);
		}
	}
	else {
		importedAlbum = AlbumLocalServiceUtil.addAlbum(
			userId, artistId, album.getName(), album.getYear(), null,
			serviceContext);
	}

	Element albumElement =
		portletDataContext.getImportDataStagedModelElement(album);

	List<Element> attachmentElements =
		portletDataContext.getReferenceDataElements(
			albumElement, FileEntry.class,
			PortletDataContext.REFERENCE_TYPE_WEAK);

	for (Element attachmentElement : attachmentElements) {
		String path = attachmentElement.attributeValue("path");

		FileEntry fileEntry =
			(FileEntry)portletDataContext.getZipEntryAsObject(path);

		importedAlbum = AlbumLocalServiceUtil.updateAlbum(
			userId, importedAlbum.getAlbumId(), importedAlbum.getArtistId(),
			importedAlbum.getName(), importedAlbum.getYear(),
			fileEntry.getContentStream(), serviceContext);
	}

	portletDataContext.importClassedModel(album, importedAlbum);
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:77,代码来源:AlbumStagedModelDataHandler.java

示例11: getExportImportConfiguration

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
protected ExportImportConfiguration getExportImportConfiguration(BackgroundTask backgroundTask) {

        Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap();

        long exportImportConfigurationId = MapUtil.getLong(taskContextMap, "exportImportConfigurationId");

        return ExportImportConfigurationLocalServiceUtil.fetchExportImportConfiguration(exportImportConfigurationId);
    }
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:9,代码来源:BaseExportImportBackgroundTaskExecutor.java

示例12: getExportImportConfiguration

import com.liferay.portal.kernel.util.MapUtil; //导入依赖的package包/类
protected ExportImportConfiguration getExportImportConfiguration(BackgroundTask backgroundTask) {

       Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap();

       long exportImportConfigurationId = MapUtil.getLong(taskContextMap, "exportImportConfigurationId");

       return ExportImportConfigurationLocalServiceUtil.fetchExportImportConfiguration(exportImportConfigurationId);
   }
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:9,代码来源:BaseExportImportBackgroundTaskExecutor.java


注:本文中的com.liferay.portal.kernel.util.MapUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。