本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}