All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.export_portlet.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.96
Show newest version
<%--
/**
 * 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 tabs3 = ParamUtil.getString(request, "tabs3", "new-export-process");

PortletURL portletURL = PortletURLBuilder.createRenderURL(
	renderResponse
).setMVCRenderCommandName(
	"/export_import/export_import"
).setPortletResource(
	portletResource
).buildPortletURL();
%>




	

		<%
		int incompleteBackgroundTasksCount = BackgroundTaskManagerUtil.getBackgroundTasksCount(themeDisplay.getScopeGroupId(), selPortlet.getPortletId(), BackgroundTaskExecutorNames.PORTLET_EXPORT_BACKGROUND_TASK_EXECUTOR, false);
		%>

		
" id="incompleteProcessMessage">
<% PortletDataHandler portletDataHandler = selPortlet.getPortletDataHandlerInstance(); PortletDataHandlerControl[] configurationControls = portletDataHandler.getExportConfigurationControls(company.getCompanyId(), themeDisplay.getScopeGroupId(), selPortlet, plid, false); %>
    • <% String rootControlId = PortletDataHandlerKeys.PORTLET_CONFIGURATION + StringPool.UNDERLINE + selPortlet.getRootPortletId(); %>
        • <% request.setAttribute("render_controls.jsp-action", Constants.EXPORT); request.setAttribute("render_controls.jsp-childControl", false); request.setAttribute("render_controls.jsp-controls", configurationControls); request.setAttribute("render_controls.jsp-portletId", selPortlet.getRootPortletId()); request.setAttribute("render_controls.jsp-rootControlId", rootControlId); %>
      Liferay.Util.toggleBoxes( '<%= PortletDataHandlerKeys.PORTLET_CONFIGURATION + StringPool.UNDERLINE + selPortlet.getRootPortletId() %>', 'showChangeConfiguration<%= StringPool.UNDERLINE + selPortlet.getRootPortletId() %>' );
<% DateRange dateRange = ExportImportDateUtil.getDateRange(renderRequest, themeDisplay.getScopeGroupId(), false, plid, selPortlet.getPortletId(), ExportImportDateUtil.RANGE_ALL); Date startDate = dateRange.getStartDate(); Date endDate = dateRange.getEndDate(); PortletDataContext portletDataContext = PortletDataContextFactoryUtil.createPreparePortletDataContext(themeDisplay, startDate, endDate); portletDataHandler.prepareManifestSummary(portletDataContext, portletPreferences); ManifestSummary manifestSummary = portletDataContext.getManifestSummary(); long exportModelCount = portletDataHandler.getExportModelCount(manifestSummary); long modelDeletionCount = manifestSummary.getModelDeletionCount(portletDataHandler.getDeletionSystemEventStagedModelTypes()); %>
  • <% Calendar endCalendar = CalendarFactoryUtil.getCalendar(timeZone, locale); if (endDate != null) { endCalendar.setTime(endDate); } Calendar startCalendar = CalendarFactoryUtil.getCalendar(timeZone, locale); if (startDate != null) { startCalendar.setTime(startDate); } else { startCalendar.add(Calendar.DATE, -1); } %>
    • <%= (exportModelCount > 0) ? exportModelCount : StringPool.BLANK %> <%= (modelDeletionCount > 0) ? (modelDeletionCount + StringPool.SPACE + LanguageUtil.get(request, "deletions")) : StringPool.BLANK %> <% String rootControlId = PortletDataHandlerKeys.PORTLET_DATA + StringPool.UNDERLINE + selPortlet.getRootPortletId(); %> <% PortletDataHandlerControl[] exportControls = portletDataHandler.getExportControls(); PortletDataHandlerControl[] metadataControls = portletDataHandler.getExportMetadataControls(); %>
      • <% request.setAttribute("render_controls.jsp-action", Constants.EXPORT); request.setAttribute("render_controls.jsp-childControl", false); request.setAttribute("render_controls.jsp-controls", exportControls); request.setAttribute("render_controls.jsp-manifestSummary", manifestSummary); request.setAttribute("render_controls.jsp-portletDisabled", !portletDataHandler.isPublishToLiveByDefault()); request.setAttribute("render_controls.jsp-rootControlId", rootControlId); %>
        <% for (PortletDataHandlerControl metadataControl : metadataControls) { PortletDataHandlerBoolean control = (PortletDataHandlerBoolean)metadataControl; PortletDataHandlerControl[] childrenControls = control.getChildren(); %> <% request.setAttribute("render_controls.jsp-controls", childrenControls); %>
        <% } %>
      Liferay.Util.toggleBoxes( '<%= PortletDataHandlerKeys.PORTLET_DATA + StringPool.UNDERLINE + selPortlet.getRootPortletId() %>', 'showChangeContent<%= StringPool.UNDERLINE + selPortlet.getRootPortletId() %>' );
<% Group group = themeDisplay.getScopeGroup(); %>
var liferayForm = Liferay.Form.get('fm1'); var form = liferayForm.formNode; form.on('submit', (event) => { event.halt(); var exportImport = Liferay.component( 'ExportImportComponent' ); var dateChecker = exportImport.getDateRangeChecker(); if (dateChecker.validRange) { submitForm(form, form.attr('action'), false); } else { exportImport.showNotification(dateChecker); } }); var oldFieldRules = liferayForm.get('fieldRules'); var fieldRules = [ { body: function (val, fieldNode, ruleValue) { <% JSONArray blacklistCharJSONArray = JSONFactoryUtil.createJSONArray(); for (String s : PropsValues.DL_CHAR_BLACKLIST) { blacklistCharJSONArray.put(s); } %> var blacklistCharJSONArray = <%= blacklistCharJSONArray.toJSONString() %>; for (var i = 0; i < blacklistCharJSONArray.length; i++) { if (val.indexOf(blacklistCharJSONArray[i]) !== -1) { return false; } } return true; }, custom: true, errorMessage: '<%= LanguageUtil.get(request, "the-following-are-invalid-characters") + HtmlUtil.escapeJS(Arrays.toString(PropsValues.DL_CHAR_BLACKLIST)) %>', fieldName: 'exportFileName', validatorName: 'custom_exportFileNameValidator', }, ]; if (oldFieldRules) { fieldRules = fieldRules.concat(oldFieldRules); } liferayForm.set('fieldRules', fieldRules);
var exportImport = new Liferay.ExportImport({ commentsNode: '#<%= PortletDataHandlerKeys.COMMENTS %>', deletionsNode: '#<%= PortletDataHandlerKeys.DELETIONS %>', form: document.fm1, incompleteProcessMessageNode: '#incompleteProcessMessage', locale: '<%= locale.toLanguageTag() %>', namespace: '', processesNode: '#exportProcesses', processesResourceURL: '<%= HtmlUtil.escapeJS(exportProcessesURL.toString()) %>', rangeAllNode: '#rangeAll', rangeDateRangeNode: '#rangeDateRange', rangeLastNode: '#rangeLast', ratingsNode: '#<%= PortletDataHandlerKeys.RATINGS %>', timeZoneOffset: <%= timeZoneOffset %>, }); Liferay.component('ExportImportComponent', exportImport); Liferay.once('destroyPortlet', () => { exportImport.destroy(); }); Liferay.Util.toggleRadio('rangeAll', '', [ 'startEndDate', 'rangeLastInputs', ]); Liferay.Util.toggleRadio( 'rangeDateRange', 'startEndDate', 'rangeLastInputs' ); Liferay.Util.toggleRadio( 'rangeLast', 'rangeLastInputs', ['startEndDate'] );




© 2015 - 2024 Weber Informatics LLC | Privacy Policy