PageRenderTime 48ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/apps/staging/staging-processes-web/src/main/resources/META-INF/resources/new_publication/publish_layouts.jsp

http://github.com/liferay/liferay-portal
JavaServer Pages | 262 lines | 216 code | 33 blank | 13 comment | 9 complexity | eb4585eb5e81a1c28417dcea814325bf MD5 | raw file
Possible License(s): LGPL-2.0
  1. <%--
  2. /**
  3. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  4. *
  5. * This library is free software; you can redistribute it and/or modify it under
  6. * the terms of the GNU Lesser General Public License as published by the Free
  7. * Software Foundation; either version 2.1 of the License, or (at your option)
  8. * any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. --%>
  16. <%@ include file="/init.jsp" %>
  17. <%@ include file="/new_publication/publish_layouts_setup.jspf" %>
  18. <portlet:renderURL var="basePortletURL">
  19. <portlet:param name="mvcRenderCommandName" value="/staging_processes/view_processes_list" />
  20. </portlet:renderURL>
  21. <aui:form action='<%= portletURL.toString() + "&etag=0&strip=0" %>' cssClass="lfr-export-dialog" method="post" name="exportPagesFm" onSubmit='<%= "event.preventDefault(); " + liferayPortletResponse.getNamespace() + "publishPages();" %>'>
  22. <aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= cmd %>" />
  23. <aui:input name="exportImportConfigurationId" type="hidden" value="<%= exportImportConfigurationId %>" />
  24. <aui:input name="originalCmd" type="hidden" value="<%= cmd %>" />
  25. <aui:input name="currentURL" type="hidden" value="<%= currentURL %>" />
  26. <aui:input name="redirect" type="hidden" value="<%= basePortletURL %>" />
  27. <aui:input name="groupId" type="hidden" value="<%= stagingGroupId %>" />
  28. <aui:input name="privateLayout" type="hidden" value="<%= privateLayout %>" />
  29. <aui:input name="layoutSetBranchName" type="hidden" value="<%= layoutSetBranchName %>" />
  30. <aui:input name="lastImportUserName" type="hidden" value="<%= user.getFullName() %>" />
  31. <aui:input name="lastImportUserUuid" type="hidden" value="<%= String.valueOf(user.getUserUuid()) %>" />
  32. <aui:input name="treeId" type="hidden" value="<%= treeId %>" />
  33. <aui:input name="<%= PortletDataHandlerKeys.PORTLET_ARCHIVED_SETUPS_ALL %>" type="hidden" value="<%= true %>" />
  34. <aui:input name="<%= PortletDataHandlerKeys.PORTLET_CONFIGURATION_ALL %>" type="hidden" value="<%= true %>" />
  35. <aui:input name="<%= PortletDataHandlerKeys.PORTLET_SETUP_ALL %>" type="hidden" value="<%= true %>" />
  36. <aui:input name="<%= PortletDataHandlerKeys.PORTLET_USER_PREFERENCES_ALL %>" type="hidden" value="<%= true %>" />
  37. <liferay-staging:process-error
  38. authException="<%= true %>"
  39. duplicateLockException="<%= true %>"
  40. illegalArgumentException="<%= true %>"
  41. layoutPrototypeException="<%= true %>"
  42. remoteExportException="<%= true %>"
  43. remoteOptionsException="<%= true %>"
  44. systemException="<%= true %>"
  45. />
  46. <div id="<portlet:namespace />publishOptions">
  47. <div class="export-dialog-tree">
  48. <liferay-staging:incomplete-process-message
  49. localPublishing="<%= localPublishing %>"
  50. />
  51. <aui:fieldset-group markupView="lexicon">
  52. <aui:fieldset>
  53. <c:choose>
  54. <c:when test="<%= exportImportConfiguration == null %>">
  55. <aui:input label="title" maxlength='<%= ModelHintsUtil.getMaxLength(ExportImportConfiguration.class.getName(), "name") %>' name="name" placeholder="process-name-placeholder" />
  56. </c:when>
  57. <c:otherwise>
  58. <aui:input label="title" maxlength='<%= ModelHintsUtil.getMaxLength(ExportImportConfiguration.class.getName(), "name") %>' name="name" value="<%= exportImportConfiguration.getName() %>" />
  59. </c:otherwise>
  60. </c:choose>
  61. </aui:fieldset>
  62. <aui:fieldset cssClass="options-group">
  63. <clay:sheet-section>
  64. <h3 class="sheet-subtitle"><liferay-ui:message key="date" /></h3>
  65. <%@ include file="/new_publication/publish_layouts_scheduler.jspf" %>
  66. </clay:sheet-section>
  67. </aui:fieldset>
  68. <liferay-staging:deletions
  69. cmd="<%= Constants.PUBLISH %>"
  70. disableInputs="<%= configuredPublish %>"
  71. exportImportConfigurationId="<%= exportImportConfigurationId %>"
  72. />
  73. <c:if test="<%= !group.isCompany() && GroupCapabilityUtil.isSupportsPages(group) %>">
  74. <liferay-staging:select-pages
  75. action="<%= Constants.PUBLISH %>"
  76. disableInputs="<%= configuredPublish %>"
  77. exportImportConfigurationId="<%= exportImportConfigurationId %>"
  78. groupId="<%= groupId %>"
  79. privateLayout="<%= privateLayout %>"
  80. treeId="<%= treeId %>"
  81. />
  82. </c:if>
  83. <liferay-staging:content
  84. cmd="<%= cmd %>"
  85. disableInputs="<%= configuredPublish %>"
  86. exportImportConfigurationId="<%= exportImportConfigurationId %>"
  87. type="<%= localPublishing ? Constants.PUBLISH_TO_LIVE : Constants.PUBLISH_TO_REMOTE %>"
  88. />
  89. <liferay-staging:permissions
  90. action="<%= Constants.PUBLISH %>"
  91. descriptionCSSClass="permissions-description"
  92. disableInputs="<%= configuredPublish %>"
  93. exportImportConfigurationId="<%= exportImportConfigurationId %>"
  94. global="<%= group.isCompany() %>"
  95. labelCSSClass="permissions-label"
  96. />
  97. <c:if test="<%= !localPublishing %>">
  98. <aui:fieldset collapsible="<%= true %>" cssClass="options-group" label="remote-live-connection-settings">
  99. <liferay-staging:remote-options
  100. disableInputs="<%= configuredPublish %>"
  101. exportImportConfigurationId="<%= exportImportConfigurationId %>"
  102. privateLayout="<%= privateLayout %>"
  103. />
  104. </aui:fieldset>
  105. </c:if>
  106. </aui:fieldset-group>
  107. </div>
  108. <aui:button-row>
  109. <aui:button id="addButton" onClick='<%= liferayPortletResponse.getNamespace() + "schedulePublishEvent();" %>' value="add-event" />
  110. <aui:button id="publishButton" type="submit" value="<%= LanguageUtil.get(request, publishMessageKey) %>" />
  111. <aui:button href="<%= basePortletURL %>" type="cancel" />
  112. </aui:button-row>
  113. </div>
  114. </aui:form>
  115. <aui:script>
  116. function <portlet:namespace />publishPages() {
  117. var exportImport = Liferay.component(
  118. '<portlet:namespace />ExportImportComponent'
  119. );
  120. var deletePortletDataBeforeImportingCheckbox = document.getElementById(
  121. '<portlet:namespace />deletePortletDataBeforeImportingCheckbox'
  122. );
  123. var dateChecker = exportImport.getDateRangeChecker();
  124. if (dateChecker.validRange) {
  125. var form = document.<portlet:namespace />exportPagesFm;
  126. if (
  127. deletePortletDataBeforeImportingCheckbox &&
  128. deletePortletDataBeforeImportingCheckbox.checked
  129. ) {
  130. confirm(
  131. '<%= UnicodeLanguageUtil.get(request, "delete-application-data-before-importing-confirmation") %>'
  132. ) && submitForm(form);
  133. }
  134. else {
  135. submitForm(form);
  136. }
  137. }
  138. else {
  139. exportImport.showNotification(dateChecker);
  140. }
  141. }
  142. Liferay.Util.toggleRadio(
  143. '<portlet:namespace />allApplications',
  144. '<portlet:namespace />showChangeGlobalConfiguration',
  145. ['<portlet:namespace />selectApplications']
  146. );
  147. Liferay.Util.toggleRadio(
  148. '<portlet:namespace />allContent',
  149. '<portlet:namespace />showChangeGlobalContent',
  150. ['<portlet:namespace />selectContents']
  151. );
  152. Liferay.Util.toggleRadio(
  153. '<portlet:namespace />publishingEventNow',
  154. '<portlet:namespace />publishButton',
  155. ['<portlet:namespace />selectSchedule', '<portlet:namespace />addButton']
  156. );
  157. Liferay.Util.toggleRadio(
  158. '<portlet:namespace />publishingEventSchedule',
  159. ['<portlet:namespace />selectSchedule', '<portlet:namespace />addButton'],
  160. '<portlet:namespace />publishButton'
  161. );
  162. Liferay.Util.toggleRadio('<portlet:namespace />rangeAll', '', [
  163. '<portlet:namespace />startEndDate',
  164. '<portlet:namespace />rangeLastInputs',
  165. ]);
  166. Liferay.Util.toggleRadio(
  167. '<portlet:namespace />rangeDateRange',
  168. '<portlet:namespace />startEndDate',
  169. '<portlet:namespace />rangeLastInputs'
  170. );
  171. Liferay.Util.toggleRadio('<portlet:namespace />rangeLastPublish', '', [
  172. '<portlet:namespace />startEndDate',
  173. '<portlet:namespace />rangeLastInputs',
  174. ]);
  175. Liferay.Util.toggleRadio(
  176. '<portlet:namespace />rangeLast',
  177. '<portlet:namespace />rangeLastInputs',
  178. ['<portlet:namespace />startEndDate']
  179. );
  180. </aui:script>
  181. <aui:script use="liferay-staging-processes-export-import">
  182. var exportImport = new Liferay.ExportImport({
  183. commentsNode: '#<%= PortletDataHandlerKeys.COMMENTS %>',
  184. deletionsNode: '#<%= PortletDataHandlerKeys.DELETIONS %>',
  185. form: document.<portlet:namespace />exportPagesFm,
  186. incompleteProcessMessageNode:
  187. '#<portlet:namespace />incompleteProcessMessage',
  188. locale: '<%= locale.toLanguageTag() %>',
  189. namespace: '<portlet:namespace />',
  190. pageTreeId: '<%= treeId %>',
  191. processesNode: '#publishProcesses',
  192. rangeAllNode: '#rangeAll',
  193. rangeDateRangeNode: '#rangeDateRange',
  194. rangeLastNode: '#rangeLast',
  195. rangeLastPublishNode: '#rangeLastPublish',
  196. ratingsNode: '#<%= PortletDataHandlerKeys.RATINGS %>',
  197. setupNode: '#<%= PortletDataHandlerKeys.PORTLET_SETUP_ALL %>',
  198. timeZoneOffset: <%= timeZoneOffset %>,
  199. userPreferencesNode:
  200. '#<%= PortletDataHandlerKeys.PORTLET_USER_PREFERENCES_ALL %>',
  201. });
  202. Liferay.component('<portlet:namespace />ExportImportComponent', exportImport);
  203. var clickHandler = function (event) {
  204. var dataValue = event.target.ancestor('li').attr('data-value');
  205. processDataValue(dataValue);
  206. };
  207. var processDataValue = function (dataValue) {
  208. var customConfiguration = A.one(
  209. '#<portlet:namespace />customConfiguration'
  210. );
  211. var savedConfigurations = A.one(
  212. '#<portlet:namespace />savedConfigurations'
  213. );
  214. if (dataValue === 'custom') {
  215. savedConfigurations.hide();
  216. customConfiguration.show();
  217. }
  218. else if (dataValue === 'saved') {
  219. customConfiguration.hide();
  220. savedConfigurations.show();
  221. }
  222. };
  223. var publishConfigurationButtons = A.one(
  224. '#<portlet:namespace />publishConfigurationButtons'
  225. );
  226. if (publishConfigurationButtons) {
  227. publishConfigurationButtons.delegate('click', clickHandler, 'li a');
  228. }
  229. </aui:script>