001
014
015 package com.liferay.portlet.exportimport.staging;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.exception.PortalException;
020 import com.liferay.portal.kernel.json.JSONArray;
021 import com.liferay.portal.kernel.json.JSONObject;
022 import com.liferay.portal.kernel.util.ProxyFactory;
023 import com.liferay.portal.kernel.util.UnicodeProperties;
024 import com.liferay.portal.kernel.workflow.WorkflowTask;
025 import com.liferay.portal.kernel.xml.Element;
026 import com.liferay.portal.model.Group;
027 import com.liferay.portal.model.Layout;
028 import com.liferay.portal.model.LayoutRevision;
029 import com.liferay.portal.model.Portlet;
030 import com.liferay.portal.model.User;
031 import com.liferay.portal.service.ServiceContext;
032 import com.liferay.portlet.exportimport.lar.MissingReference;
033 import com.liferay.portlet.exportimport.lar.PortletDataContext;
034 import com.liferay.portlet.exportimport.model.ExportImportConfiguration;
035
036 import java.io.Serializable;
037
038 import java.util.Date;
039 import java.util.List;
040 import java.util.Locale;
041 import java.util.Map;
042
043 import javax.portlet.PortletPreferences;
044 import javax.portlet.PortletRequest;
045
046 import javax.servlet.http.HttpServletRequest;
047
048
051 @ProviderType
052 public class StagingUtil {
053
054 public static String buildRemoteURL(
055 String remoteAddress, int remotePort, String remotePathContext,
056 boolean secureConnection) {
057
058 return _staging.buildRemoteURL(
059 remoteAddress, remotePort, remotePathContext, secureConnection);
060 }
061
062
065 @Deprecated
066 public static String buildRemoteURL(
067 String remoteAddress, int remotePort, String remotePathContext,
068 boolean secureConnection, long remoteGroupId, boolean privateLayout) {
069
070 return _staging.buildRemoteURL(
071 remoteAddress, remotePort, remotePathContext, secureConnection,
072 remoteGroupId, privateLayout);
073 }
074
075 public static String buildRemoteURL(
076 UnicodeProperties typeSettingsProperties) {
077
078 return _staging.buildRemoteURL(typeSettingsProperties);
079 }
080
081
087 @Deprecated
088 public static void checkDefaultLayoutSetBranches(
089 long userId, Group liveGroup, boolean branchingPublic,
090 boolean branchingPrivate, boolean remote,
091 ServiceContext serviceContext)
092 throws PortalException {
093
094 _staging.checkDefaultLayoutSetBranches(
095 userId, liveGroup, branchingPublic, branchingPrivate, remote,
096 serviceContext);
097 }
098
099 public static void copyFromLive(PortletRequest PortletRequest)
100 throws PortalException {
101
102 _staging.copyFromLive(PortletRequest);
103 }
104
105 public static void copyFromLive(
106 PortletRequest PortletRequest, Portlet portlet)
107 throws PortalException {
108
109 _staging.copyFromLive(PortletRequest, portlet);
110 }
111
112
116 @Deprecated
117 public static void copyPortlet(
118 PortletRequest PortletRequest, long sourceGroupId,
119 long targetGroupId, long sourcePlid, long targetPlid,
120 String portletId)
121 throws PortalException {
122
123 _staging.copyPortlet(
124 PortletRequest, sourceGroupId, targetGroupId, sourcePlid,
125 targetPlid, portletId);
126 }
127
128 public static void copyRemoteLayouts(
129 ExportImportConfiguration exportImportConfiguration)
130 throws PortalException {
131
132 _staging.copyRemoteLayouts(exportImportConfiguration);
133 }
134
135 public static void copyRemoteLayouts(long exportImportConfigurationId)
136 throws PortalException {
137
138 _staging.copyRemoteLayouts(exportImportConfigurationId);
139 }
140
141 public static void copyRemoteLayouts(
142 long sourceGroupId, boolean privateLayout,
143 Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap,
144 String remoteAddress, int remotePort, String remotePathContext,
145 boolean secureConnection, long remoteGroupId,
146 boolean remotePrivateLayout)
147 throws PortalException {
148
149 _staging.copyRemoteLayouts(
150 sourceGroupId, privateLayout, layoutIdMap, parameterMap,
151 remoteAddress, remotePort, remotePathContext, secureConnection,
152 remoteGroupId, remotePrivateLayout);
153 }
154
155
160 @Deprecated
161 public static void copyRemoteLayouts(
162 long sourceGroupId, boolean privateLayout,
163 Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap,
164 String remoteAddress, int remotePort, String remotePathContext,
165 boolean secureConnection, long remoteGroupId,
166 boolean remotePrivateLayout, Date startDate, Date endDate)
167 throws PortalException {
168
169 _staging.copyRemoteLayouts(
170 sourceGroupId, privateLayout, layoutIdMap, parameterMap,
171 remoteAddress, remotePort, remotePathContext, secureConnection,
172 remoteGroupId, remotePrivateLayout, startDate, endDate);
173 }
174
175 public static void copyRemoteLayouts(
176 long sourceGroupId, boolean privateLayout,
177 Map<Long, Boolean> layoutIdMap, String name,
178 Map<String, String[]> parameterMap, String remoteAddress,
179 int remotePort, String remotePathContext, boolean secureConnection,
180 long remoteGroupId, boolean remotePrivateLayout)
181 throws PortalException {
182
183 _staging.copyRemoteLayouts(
184 sourceGroupId, privateLayout, layoutIdMap, name, parameterMap,
185 remoteAddress, remotePort, remotePathContext, secureConnection,
186 remoteGroupId, remotePrivateLayout);
187 }
188
189 public static void deleteLastImportSettings(
190 Group liveGroup, boolean privateLayout)
191 throws PortalException {
192
193 _staging.deleteLastImportSettings(liveGroup, privateLayout);
194 }
195
196 public static void deleteRecentLayoutRevisionId(
197 HttpServletRequest request, long layoutSetBranchId, long plid) {
198
199 _staging.deleteRecentLayoutRevisionId(request, layoutSetBranchId, plid);
200 }
201
202 public static void deleteRecentLayoutRevisionId(
203 long userId, long layoutSetBranchId, long plid) {
204
205 _staging.deleteRecentLayoutRevisionId(userId, layoutSetBranchId, plid);
206 }
207
208
212 @Deprecated
213 public static void deleteRecentLayoutRevisionId(
214 User user, long layoutSetBranchId, long plid) {
215
216 _staging.deleteRecentLayoutRevisionId(user, layoutSetBranchId, plid);
217 }
218
219
224 @Deprecated
225 public static void disableStaging(
226 Group scopeGroup, Group liveGroup, ServiceContext serviceContext)
227 throws Exception {
228
229 _staging.disableStaging(scopeGroup, liveGroup, serviceContext);
230 }
231
232
237 @Deprecated
238 public static void disableStaging(
239 Group liveGroup, ServiceContext serviceContext)
240 throws Exception {
241
242 _staging.disableStaging(liveGroup, serviceContext);
243 }
244
245
250 @Deprecated
251 public static void disableStaging(
252 PortletRequest portletRequest, Group scopeGroup, Group liveGroup,
253 ServiceContext serviceContext)
254 throws Exception {
255
256 _staging.disableStaging(
257 portletRequest, scopeGroup, liveGroup, serviceContext);
258 }
259
260
265 @Deprecated
266 public static void disableStaging(
267 PortletRequest portletRequest, Group liveGroup,
268 ServiceContext serviceContext)
269 throws Exception {
270
271 _staging.disableStaging(portletRequest, liveGroup, serviceContext);
272 }
273
274
279 @Deprecated
280 public static void enableLocalStaging(
281 long userId, Group scopeGroup, Group liveGroup,
282 boolean branchingPublic, boolean branchingPrivate,
283 ServiceContext serviceContext)
284 throws Exception {
285
286 _staging.enableLocalStaging(
287 userId, scopeGroup, liveGroup, branchingPublic, branchingPrivate,
288 serviceContext);
289 }
290
291
297 @Deprecated
298 public static void enableRemoteStaging(
299 long userId, Group scopeGroup, Group liveGroup,
300 boolean branchingPublic, boolean branchingPrivate,
301 String remoteAddress, int remotePort, String remotePathContext,
302 boolean secureConnection, long remoteGroupId,
303 ServiceContext serviceContext)
304 throws Exception {
305
306 _staging.enableRemoteStaging(
307 userId, scopeGroup, liveGroup, branchingPublic, branchingPrivate,
308 remoteAddress, remotePort, remotePathContext, secureConnection,
309 remoteGroupId, serviceContext);
310 }
311
312 public static JSONArray getErrorMessagesJSONArray(
313 Locale locale, Map<String, MissingReference> missingReferences) {
314
315 return _staging.getErrorMessagesJSONArray(locale, missingReferences);
316 }
317
318
323 @Deprecated
324 public static JSONArray getErrorMessagesJSONArray(
325 Locale locale, Map<String, MissingReference> missingReferences,
326 Map<String, Serializable> contextMap) {
327
328 return _staging.getErrorMessagesJSONArray(
329 locale, missingReferences, contextMap);
330 }
331
332 public static JSONObject getExceptionMessagesJSONObject(
333 Locale locale, Exception e,
334 ExportImportConfiguration exportImportConfiguration) {
335
336 return _staging.getExceptionMessagesJSONObject(
337 locale, e, exportImportConfiguration);
338 }
339
340
345 @Deprecated
346 public static JSONObject getExceptionMessagesJSONObject(
347 Locale locale, Exception e, Map<String, Serializable> contextMap) {
348
349 return _staging.getExceptionMessagesJSONObject(locale, e, contextMap);
350 }
351
352 public static Group getLiveGroup(long groupId) {
353 return _staging.getLiveGroup(groupId);
354 }
355
356 public static long getLiveGroupId(long groupId) {
357 return _staging.getLiveGroupId(groupId);
358 }
359
360
365 @Deprecated
366 public static List<Layout> getMissingParentLayouts(
367 Layout layout, long liveGroupId)
368 throws Exception {
369
370 return _staging.getMissingParentLayouts(layout, liveGroupId);
371 }
372
373 public static long getRecentLayoutRevisionId(
374 HttpServletRequest request, long layoutSetBranchId, long plid)
375 throws PortalException {
376
377 return _staging.getRecentLayoutRevisionId(
378 request, layoutSetBranchId, plid);
379 }
380
381 public static long getRecentLayoutRevisionId(
382 User user, long layoutSetBranchId, long plid)
383 throws PortalException {
384
385 return _staging.getRecentLayoutRevisionId(
386 user, layoutSetBranchId, plid);
387 }
388
389 public static long getRecentLayoutSetBranchId(
390 HttpServletRequest request, long layoutSetId) {
391
392 return _staging.getRecentLayoutSetBranchId(request, layoutSetId);
393 }
394
395 public static long getRecentLayoutSetBranchId(User user, long layoutSetId) {
396 return _staging.getRecentLayoutSetBranchId(user, layoutSetId);
397 }
398
399 public static String getRemoteSiteURL(
400 Group stagingGroup, boolean privateLayout)
401 throws PortalException {
402
403 return _staging.getRemoteSiteURL(stagingGroup, privateLayout);
404 }
405
406 public static String getSchedulerGroupName(
407 String destinationName, long groupId) {
408
409 return _staging.getSchedulerGroupName(destinationName, groupId);
410 }
411
412 public static String getStagedPortletId(String portletId) {
413 return _staging.getStagedPortletId(portletId);
414 }
415
416 public static long[] getStagingAndLiveGroupIds(long groupId)
417 throws PortalException {
418
419 return _staging.getStagingAndLiveGroupIds(groupId);
420 }
421
422 public static Group getStagingGroup(long groupId) {
423 return _staging.getStagingGroup(groupId);
424 }
425
426
431 @Deprecated
432 public static Map<String, String[]> getStagingParameters() {
433 return _staging.getStagingParameters();
434 }
435
436
441 @Deprecated
442 public static Map<String, String[]> getStagingParameters(
443 PortletRequest PortletRequest) {
444
445 return _staging.getStagingParameters(PortletRequest);
446 }
447
448 public static JSONArray getWarningMessagesJSONArray(
449 Locale locale, Map<String, MissingReference> missingReferences) {
450
451 return _staging.getWarningMessagesJSONArray(locale, missingReferences);
452 }
453
454
459 @Deprecated
460 public static JSONArray getWarningMessagesJSONArray(
461 Locale locale, Map<String, MissingReference> missingReferences,
462 Map<String, Serializable> contextMap) {
463
464 return _staging.getWarningMessagesJSONArray(
465 locale, missingReferences, contextMap);
466 }
467
468 public static WorkflowTask getWorkflowTask(
469 long userId, LayoutRevision layoutRevision)
470 throws PortalException {
471
472 return _staging.getWorkflowTask(userId, layoutRevision);
473 }
474
475 public static boolean hasWorkflowTask(
476 long userId, LayoutRevision layoutRevision)
477 throws PortalException {
478
479 return _staging.hasWorkflowTask(userId, layoutRevision);
480 }
481
482 public static boolean isIncomplete(Layout layout, long layoutSetBranchId) {
483 return _staging.isIncomplete(layout, layoutSetBranchId);
484 }
485
486
491 @Deprecated
492 public static void lockGroup(long userId, long groupId)
493 throws PortalException {
494
495 _staging.lockGroup(userId, groupId);
496 }
497
498 public static void publishLayout(
499 long userId, long plid, long liveGroupId, boolean includeChildren)
500 throws PortalException {
501
502 _staging.publishLayout(userId, plid, liveGroupId, includeChildren);
503 }
504
505 public static void publishLayouts(
506 long userId, ExportImportConfiguration exportImportConfiguration)
507 throws PortalException {
508
509 _staging.publishLayouts(userId, exportImportConfiguration);
510 }
511
512 public static void publishLayouts(
513 long userId, long exportImportConfigurationId)
514 throws PortalException {
515
516 _staging.publishLayouts(userId, exportImportConfigurationId);
517 }
518
519 public static void publishLayouts(
520 long userId, long sourceGroupId, long targetGroupId,
521 boolean privateLayout, long[] layoutIds,
522 Map<String, String[]> parameterMap)
523 throws PortalException {
524
525 _staging.publishLayouts(
526 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
527 parameterMap);
528 }
529
530
534 @Deprecated
535 public static void publishLayouts(
536 long userId, long sourceGroupId, long targetGroupId,
537 boolean privateLayout, long[] layoutIds,
538 Map<String, String[]> parameterMap, Date startDate, Date endDate)
539 throws PortalException {
540
541 _staging.publishLayouts(
542 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
543 parameterMap, startDate, endDate);
544 }
545
546 public static void publishLayouts(
547 long userId, long sourceGroupId, long targetGroupId,
548 boolean privateLayout, long[] layoutIds, String name,
549 Map<String, String[]> parameterMap)
550 throws PortalException {
551
552 _staging.publishLayouts(
553 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
554 name, parameterMap);
555 }
556
557
561 @Deprecated
562 public static void publishLayouts(
563 long userId, long sourceGroupId, long targetGroupId,
564 boolean privateLayout, Map<Long, Boolean> layoutIdMap,
565 Map<String, String[]> parameterMap, Date startDate, Date endDate)
566 throws PortalException {
567
568 _staging.publishLayouts(
569 userId, sourceGroupId, targetGroupId, privateLayout, layoutIdMap,
570 parameterMap, startDate, endDate);
571 }
572
573 public static void publishLayouts(
574 long userId, long sourceGroupId, long targetGroupId,
575 boolean privateLayout, Map<String, String[]> parameterMap)
576 throws PortalException {
577
578 _staging.publishLayouts(
579 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap);
580 }
581
582
586 @Deprecated
587 public static void publishLayouts(
588 long userId, long sourceGroupId, long targetGroupId,
589 boolean privateLayout, Map<String, String[]> parameterMap,
590 Date startDate, Date endDate)
591 throws PortalException {
592
593 _staging.publishLayouts(
594 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap,
595 startDate, endDate);
596 }
597
598 public static void publishPortlet(
599 long userId, ExportImportConfiguration exportImportConfiguration)
600 throws PortalException {
601
602 _staging.publishPortlet(userId, exportImportConfiguration);
603 }
604
605 public static void publishPortlet(
606 long userId, long exportImportConfigurationId)
607 throws PortalException {
608
609 _staging.publishPortlet(userId, exportImportConfigurationId);
610 }
611
612 public static void publishPortlet(
613 long userId, long sourceGroupId, long targetGroupId,
614 long sourcePlid, long targetPlid, String portletId,
615 Map<String, String[]> parameterMap)
616 throws PortalException {
617
618 _staging.publishPortlet(
619 userId, sourceGroupId, targetGroupId, sourcePlid, targetPlid,
620 portletId, parameterMap);
621 }
622
623 public static void publishToLive(PortletRequest PortletRequest)
624 throws PortalException {
625
626 _staging.publishToLive(PortletRequest);
627 }
628
629 public static void publishToLive(
630 PortletRequest PortletRequest, Portlet portlet)
631 throws PortalException {
632
633 _staging.publishToLive(PortletRequest, portlet);
634 }
635
636 public static void publishToRemote(PortletRequest PortletRequest)
637 throws PortalException {
638
639 _staging.publishToRemote(PortletRequest);
640 }
641
642 public static void scheduleCopyFromLive(PortletRequest PortletRequest)
643 throws PortalException {
644
645 _staging.scheduleCopyFromLive(PortletRequest);
646 }
647
648 public static void schedulePublishToLive(PortletRequest PortletRequest)
649 throws PortalException {
650
651 _staging.schedulePublishToLive(PortletRequest);
652 }
653
654 public static void schedulePublishToRemote(PortletRequest PortletRequest)
655 throws PortalException {
656
657 _staging.schedulePublishToRemote(PortletRequest);
658 }
659
660 public static void setRecentLayoutBranchId(
661 HttpServletRequest request, long layoutSetBranchId, long plid,
662 long layoutBranchId)
663 throws PortalException {
664
665 _staging.setRecentLayoutBranchId(
666 request, layoutSetBranchId, plid, layoutBranchId);
667 }
668
669 public static void setRecentLayoutBranchId(
670 User user, long layoutSetBranchId, long plid, long layoutBranchId)
671 throws PortalException {
672
673 _staging.setRecentLayoutBranchId(
674 user, layoutSetBranchId, plid, layoutBranchId);
675 }
676
677 public static void setRecentLayoutRevisionId(
678 HttpServletRequest request, long layoutSetBranchId, long plid,
679 long layoutRevisionId)
680 throws PortalException {
681
682 _staging.setRecentLayoutRevisionId(
683 request, layoutSetBranchId, plid, layoutRevisionId);
684 }
685
686 public static void setRecentLayoutRevisionId(
687 User user, long layoutSetBranchId, long plid, long layoutRevisionId)
688 throws PortalException {
689
690 _staging.setRecentLayoutRevisionId(
691 user, layoutSetBranchId, plid, layoutRevisionId);
692 }
693
694 public static void setRecentLayoutSetBranchId(
695 HttpServletRequest request, long layoutSetId,
696 long layoutSetBranchId)
697 throws PortalException {
698
699 _staging.setRecentLayoutSetBranchId(
700 request, layoutSetId, layoutSetBranchId);
701 }
702
703 public static void setRecentLayoutSetBranchId(
704 User user, long layoutSetId, long layoutSetBranchId)
705 throws PortalException {
706
707 _staging.setRecentLayoutSetBranchId(
708 user, layoutSetId, layoutSetBranchId);
709 }
710
711 public static String stripProtocolFromRemoteAddress(String remoteAddress) {
712 return _staging.stripProtocolFromRemoteAddress(remoteAddress);
713 }
714
715
720 @Deprecated
721 public static void unlockGroup(long groupId) {
722 _staging.unlockGroup(groupId);
723 }
724
725 public static void unscheduleCopyFromLive(PortletRequest PortletRequest)
726 throws PortalException {
727
728 _staging.unscheduleCopyFromLive(PortletRequest);
729 }
730
731 public static void unschedulePublishToLive(PortletRequest PortletRequest)
732 throws PortalException {
733
734 _staging.unschedulePublishToLive(PortletRequest);
735 }
736
737 public static void unschedulePublishToRemote(PortletRequest PortletRequest)
738 throws PortalException {
739
740 _staging.unschedulePublishToRemote(PortletRequest);
741 }
742
743 public static void updateLastImportSettings(
744 Element layoutElement, Layout layout,
745 PortletDataContext portletDataContext)
746 throws PortalException {
747
748 _staging.updateLastImportSettings(
749 layoutElement, layout, portletDataContext);
750 }
751
752
758 @Deprecated
759 public static void updateLastPublishDate(
760 long sourceGroupId, boolean privateLayout, Date lastPublishDate)
761 throws PortalException {
762
763 _staging.updateLastPublishDate(
764 sourceGroupId, privateLayout, lastPublishDate);
765 }
766
767
773 @Deprecated
774 public static void updateLastPublishDate(
775 String portletId, PortletPreferences portletPreferences,
776 Date lastPublishDate)
777 throws PortalException {
778
779 _staging.updateLastPublishDate(
780 portletId, portletPreferences, lastPublishDate);
781 }
782
783 public static void updateStaging(
784 PortletRequest PortletRequest, Group liveGroup)
785 throws PortalException {
786
787 _staging.updateStaging(PortletRequest, liveGroup);
788 }
789
790 public static void validateRemote(
791 long groupId, String remoteAddress, int remotePort,
792 String remotePathContext, boolean secureConnection,
793 long remoteGroupId)
794 throws PortalException {
795
796 _staging.validateRemote(
797 groupId, remoteAddress, remotePort, remotePathContext,
798 secureConnection, remoteGroupId);
799 }
800
801
805 @Deprecated
806 public static void validateRemote(
807 String remoteAddress, int remotePort, String remotePathContext,
808 boolean secureConnection, long remoteGroupId)
809 throws PortalException {
810
811 _staging.validateRemote(
812 remoteAddress, remotePort, remotePathContext, secureConnection,
813 remoteGroupId);
814 }
815
816 private static final Staging _staging =
817 ProxyFactory.newServiceTrackedInstance(Staging.class);
818
819 }