META-INF.resources.export_import_process.jsp Maven / Gradle / Ivy
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
String backURL = ParamUtil.getString(request, "backURL");
ExportImportProcessDisplayContext exportImportProcessDisplayContext = new ExportImportProcessDisplayContext(request);
BackgroundTask backgroundTask = exportImportProcessDisplayContext.getBackgroundTask();
if (Validator.isNotNull(backURL)) {
portletDisplay.setShowBackIcon(true);
portletDisplay.setURLBack(backURL);
}
%>
<%
BackgroundTaskDisplay backgroundTaskDisplay = BackgroundTaskDisplayFactoryUtil.getBackgroundTaskDisplay(curBackgroundTask);
String backgroundTaskName = backgroundTaskDisplay.getDisplayName(request);
%>
<%
String backgroundTaskUserName = LanguageUtil.get(request, "deleted-user");
User backgroundTaskUser = UserLocalServiceUtil.fetchUser(backgroundTask.getUserId());
if (backgroundTaskUser != null) {
backgroundTaskUserName = backgroundTaskUser.getFullName();
}
Date createDate = curBackgroundTask.getCreateDate();
String modifiedDateDescription = LanguageUtil.getTimeDescription(request, System.currentTimeMillis() - createDate.getTime(), true);
%>
<%= HtmlUtil.escape(backgroundTaskName) %>
<%
for (FileEntry fileEntry : curBackgroundTask.getAttachmentsFileEntries()) {
%>
<%
}
%>
<%
BackgroundTaskStatus backgroundTaskStatus = BackgroundTaskStatusRegistryUtil.getBackgroundTaskStatus(curBackgroundTask.getBackgroundTaskId());
%>
<%
int percentage = 100;
long allModelAdditionCountersTotal = GetterUtil.getLong(backgroundTaskStatus.getAttribute("allModelAdditionCountersTotal"));
long allPortletAdditionCounter = GetterUtil.getLong(backgroundTaskStatus.getAttribute("allPortletAdditionCounter"));
long currentModelAdditionCountersTotal = GetterUtil.getLong(backgroundTaskStatus.getAttribute("currentModelAdditionCountersTotal"));
long currentPortletAdditionCounter = GetterUtil.getLong(backgroundTaskStatus.getAttribute("currentPortletAdditionCounter"));
long allProgressBarCountersTotal = allModelAdditionCountersTotal + allPortletAdditionCounter;
long currentProgressBarCountersTotal = currentModelAdditionCountersTotal + currentPortletAdditionCounter;
if (allProgressBarCountersTotal > 0) {
percentage = Math.round((float)currentProgressBarCountersTotal / allProgressBarCountersTotal * 100);
}
%>
<%
String stagedModelName = (String)backgroundTaskStatus.getAttribute("stagedModelName");
String stagedModelType = (String)backgroundTaskStatus.getAttribute("stagedModelType");
%>
<%= StringPool.TRIPLE_PERIOD %> <%= ResourceActionsUtil.getModelResource(locale, stagedModelType) %> <%= HtmlUtil.escape(stagedModelName) %>
<%
int incompleteBackgroundTasksCount = 0;
if ((backgroundTask != null) && backgroundTask.isInProgress()) {
incompleteBackgroundTasksCount = 1;
}
%>
function viewBackgroundTaskDetails(backgroundTaskId) {
var title = '';
var backgroundTaskNameElement = document.getElementById(
' backgroundTaskName' + backgroundTaskId
);
if (backgroundTaskNameElement) {
title = backgroundTaskNameElement.textContent;
}
Liferay.fire(' viewBackgroundTaskDetails', {
nodeId: 'backgroundTaskStatusMessage' + backgroundTaskId,
title: title,
});
}