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
066 @Deprecated
067 public static String buildRemoteURL(
068 String remoteAddress, int remotePort, String remotePathContext,
069 boolean secureConnection, long remoteGroupId, boolean privateLayout) {
070
071 return _staging.buildRemoteURL(
072 remoteAddress, remotePort, remotePathContext, secureConnection,
073 remoteGroupId, privateLayout);
074 }
075
076 public static String buildRemoteURL(
077 UnicodeProperties typeSettingsProperties) {
078
079 return _staging.buildRemoteURL(typeSettingsProperties);
080 }
081
082
088 @Deprecated
089 public static void checkDefaultLayoutSetBranches(
090 long userId, Group liveGroup, boolean branchingPublic,
091 boolean branchingPrivate, boolean remote,
092 ServiceContext serviceContext)
093 throws PortalException {
094
095 _staging.checkDefaultLayoutSetBranches(
096 userId, liveGroup, branchingPublic, branchingPrivate, remote,
097 serviceContext);
098 }
099
100 public static void copyFromLive(PortletRequest PortletRequest)
101 throws PortalException {
102
103 _staging.copyFromLive(PortletRequest);
104 }
105
106 public static void copyFromLive(
107 PortletRequest PortletRequest, Portlet portlet)
108 throws PortalException {
109
110 _staging.copyFromLive(PortletRequest, portlet);
111 }
112
113
117 @Deprecated
118 public static void copyPortlet(
119 PortletRequest PortletRequest, long sourceGroupId,
120 long targetGroupId, long sourcePlid, long targetPlid,
121 String portletId)
122 throws PortalException {
123
124 _staging.copyPortlet(
125 PortletRequest, sourceGroupId, targetGroupId, sourcePlid,
126 targetPlid, portletId);
127 }
128
129 public static void copyRemoteLayouts(
130 ExportImportConfiguration exportImportConfiguration)
131 throws PortalException {
132
133 _staging.copyRemoteLayouts(exportImportConfiguration);
134 }
135
136 public static void copyRemoteLayouts(long exportImportConfigurationId)
137 throws PortalException {
138
139 _staging.copyRemoteLayouts(exportImportConfigurationId);
140 }
141
142 public static void copyRemoteLayouts(
143 long sourceGroupId, boolean privateLayout,
144 Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap,
145 String remoteAddress, int remotePort, String remotePathContext,
146 boolean secureConnection, long remoteGroupId,
147 boolean remotePrivateLayout)
148 throws PortalException {
149
150 _staging.copyRemoteLayouts(
151 sourceGroupId, privateLayout, layoutIdMap, parameterMap,
152 remoteAddress, remotePort, remotePathContext, secureConnection,
153 remoteGroupId, remotePrivateLayout);
154 }
155
156
161 @Deprecated
162 public static void copyRemoteLayouts(
163 long sourceGroupId, boolean privateLayout,
164 Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap,
165 String remoteAddress, int remotePort, String remotePathContext,
166 boolean secureConnection, long remoteGroupId,
167 boolean remotePrivateLayout, Date startDate, Date endDate)
168 throws PortalException {
169
170 _staging.copyRemoteLayouts(
171 sourceGroupId, privateLayout, layoutIdMap, parameterMap,
172 remoteAddress, remotePort, remotePathContext, secureConnection,
173 remoteGroupId, remotePrivateLayout, startDate, endDate);
174 }
175
176 public static void copyRemoteLayouts(
177 long sourceGroupId, boolean privateLayout,
178 Map<Long, Boolean> layoutIdMap, String name,
179 Map<String, String[]> parameterMap, String remoteAddress,
180 int remotePort, String remotePathContext, boolean secureConnection,
181 long remoteGroupId, boolean remotePrivateLayout)
182 throws PortalException {
183
184 _staging.copyRemoteLayouts(
185 sourceGroupId, privateLayout, layoutIdMap, name, parameterMap,
186 remoteAddress, remotePort, remotePathContext, secureConnection,
187 remoteGroupId, remotePrivateLayout);
188 }
189
190 public static void deleteLastImportSettings(
191 Group liveGroup, boolean privateLayout)
192 throws PortalException {
193
194 _staging.deleteLastImportSettings(liveGroup, privateLayout);
195 }
196
197 public static void deleteRecentLayoutRevisionId(
198 HttpServletRequest request, long layoutSetBranchId, long plid) {
199
200 _staging.deleteRecentLayoutRevisionId(request, layoutSetBranchId, plid);
201 }
202
203 public static void deleteRecentLayoutRevisionId(
204 long userId, long layoutSetBranchId, long plid) {
205
206 _staging.deleteRecentLayoutRevisionId(userId, layoutSetBranchId, plid);
207 }
208
209
213 @Deprecated
214 public static void deleteRecentLayoutRevisionId(
215 User user, long layoutSetBranchId, long plid) {
216
217 _staging.deleteRecentLayoutRevisionId(user, layoutSetBranchId, plid);
218 }
219
220 public static JSONArray getErrorMessagesJSONArray(
221 Locale locale, Map<String, MissingReference> missingReferences) {
222
223 return _staging.getErrorMessagesJSONArray(locale, missingReferences);
224 }
225
226
231 @Deprecated
232 public static JSONArray getErrorMessagesJSONArray(
233 Locale locale, Map<String, MissingReference> missingReferences,
234 Map<String, Serializable> contextMap) {
235
236 return _staging.getErrorMessagesJSONArray(
237 locale, missingReferences, contextMap);
238 }
239
240 public static JSONObject getExceptionMessagesJSONObject(
241 Locale locale, Exception e,
242 ExportImportConfiguration exportImportConfiguration) {
243
244 return _staging.getExceptionMessagesJSONObject(
245 locale, e, exportImportConfiguration);
246 }
247
248
253 @Deprecated
254 public static JSONObject getExceptionMessagesJSONObject(
255 Locale locale, Exception e, Map<String, Serializable> contextMap) {
256
257 return _staging.getExceptionMessagesJSONObject(locale, e, contextMap);
258 }
259
260 public static Group getLiveGroup(long groupId) {
261 return _staging.getLiveGroup(groupId);
262 }
263
264 public static long getLiveGroupId(long groupId) {
265 return _staging.getLiveGroupId(groupId);
266 }
267
268
273 @Deprecated
274 public static List<Layout> getMissingParentLayouts(
275 Layout layout, long liveGroupId)
276 throws Exception {
277
278 return _staging.getMissingParentLayouts(layout, liveGroupId);
279 }
280
281 public static long getRecentLayoutRevisionId(
282 HttpServletRequest request, long layoutSetBranchId, long plid)
283 throws PortalException {
284
285 return _staging.getRecentLayoutRevisionId(
286 request, layoutSetBranchId, plid);
287 }
288
289 public static long getRecentLayoutRevisionId(
290 User user, long layoutSetBranchId, long plid)
291 throws PortalException {
292
293 return _staging.getRecentLayoutRevisionId(
294 user, layoutSetBranchId, plid);
295 }
296
297 public static long getRecentLayoutSetBranchId(
298 HttpServletRequest request, long layoutSetId) {
299
300 return _staging.getRecentLayoutSetBranchId(request, layoutSetId);
301 }
302
303 public static long getRecentLayoutSetBranchId(User user, long layoutSetId) {
304 return _staging.getRecentLayoutSetBranchId(user, layoutSetId);
305 }
306
307 public static String getRemoteSiteURL(
308 Group stagingGroup, boolean privateLayout)
309 throws PortalException {
310
311 return _staging.getRemoteSiteURL(stagingGroup, privateLayout);
312 }
313
314 public static String getSchedulerGroupName(
315 String destinationName, long groupId) {
316
317 return _staging.getSchedulerGroupName(destinationName, groupId);
318 }
319
320 public static String getStagedPortletId(String portletId) {
321 return _staging.getStagedPortletId(portletId);
322 }
323
324 public static long[] getStagingAndLiveGroupIds(long groupId)
325 throws PortalException {
326
327 return _staging.getStagingAndLiveGroupIds(groupId);
328 }
329
330 public static Group getStagingGroup(long groupId) {
331 return _staging.getStagingGroup(groupId);
332 }
333
334
339 @Deprecated
340 public static Map<String, String[]> getStagingParameters() {
341 return _staging.getStagingParameters();
342 }
343
344
349 @Deprecated
350 public static Map<String, String[]> getStagingParameters(
351 PortletRequest PortletRequest) {
352
353 return _staging.getStagingParameters(PortletRequest);
354 }
355
356 public static JSONArray getWarningMessagesJSONArray(
357 Locale locale, Map<String, MissingReference> missingReferences) {
358
359 return _staging.getWarningMessagesJSONArray(locale, missingReferences);
360 }
361
362
367 @Deprecated
368 public static JSONArray getWarningMessagesJSONArray(
369 Locale locale, Map<String, MissingReference> missingReferences,
370 Map<String, Serializable> contextMap) {
371
372 return _staging.getWarningMessagesJSONArray(
373 locale, missingReferences, contextMap);
374 }
375
376 public static WorkflowTask getWorkflowTask(
377 long userId, LayoutRevision layoutRevision)
378 throws PortalException {
379
380 return _staging.getWorkflowTask(userId, layoutRevision);
381 }
382
383 public static boolean hasWorkflowTask(
384 long userId, LayoutRevision layoutRevision)
385 throws PortalException {
386
387 return _staging.hasWorkflowTask(userId, layoutRevision);
388 }
389
390 public static boolean isIncomplete(Layout layout, long layoutSetBranchId) {
391 return _staging.isIncomplete(layout, layoutSetBranchId);
392 }
393
394
399 @Deprecated
400 public static void lockGroup(long userId, long groupId)
401 throws PortalException {
402
403 _staging.lockGroup(userId, groupId);
404 }
405
406 public static void publishLayout(
407 long userId, long plid, long liveGroupId, boolean includeChildren)
408 throws PortalException {
409
410 _staging.publishLayout(userId, plid, liveGroupId, includeChildren);
411 }
412
413 public static void publishLayouts(
414 long userId, ExportImportConfiguration exportImportConfiguration)
415 throws PortalException {
416
417 _staging.publishLayouts(userId, exportImportConfiguration);
418 }
419
420 public static void publishLayouts(
421 long userId, long exportImportConfigurationId)
422 throws PortalException {
423
424 _staging.publishLayouts(userId, exportImportConfigurationId);
425 }
426
427 public static void publishLayouts(
428 long userId, long sourceGroupId, long targetGroupId,
429 boolean privateLayout, long[] layoutIds,
430 Map<String, String[]> parameterMap)
431 throws PortalException {
432
433 _staging.publishLayouts(
434 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
435 parameterMap);
436 }
437
438
442 @Deprecated
443 public static void publishLayouts(
444 long userId, long sourceGroupId, long targetGroupId,
445 boolean privateLayout, long[] layoutIds,
446 Map<String, String[]> parameterMap, Date startDate, Date endDate)
447 throws PortalException {
448
449 _staging.publishLayouts(
450 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
451 parameterMap, startDate, endDate);
452 }
453
454 public static void publishLayouts(
455 long userId, long sourceGroupId, long targetGroupId,
456 boolean privateLayout, long[] layoutIds, String name,
457 Map<String, String[]> parameterMap)
458 throws PortalException {
459
460 _staging.publishLayouts(
461 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
462 name, parameterMap);
463 }
464
465
469 @Deprecated
470 public static void publishLayouts(
471 long userId, long sourceGroupId, long targetGroupId,
472 boolean privateLayout, Map<Long, Boolean> layoutIdMap,
473 Map<String, String[]> parameterMap, Date startDate, Date endDate)
474 throws PortalException {
475
476 _staging.publishLayouts(
477 userId, sourceGroupId, targetGroupId, privateLayout, layoutIdMap,
478 parameterMap, startDate, endDate);
479 }
480
481 public static void publishLayouts(
482 long userId, long sourceGroupId, long targetGroupId,
483 boolean privateLayout, Map<String, String[]> parameterMap)
484 throws PortalException {
485
486 _staging.publishLayouts(
487 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap);
488 }
489
490
494 @Deprecated
495 public static void publishLayouts(
496 long userId, long sourceGroupId, long targetGroupId,
497 boolean privateLayout, Map<String, String[]> parameterMap,
498 Date startDate, Date endDate)
499 throws PortalException {
500
501 _staging.publishLayouts(
502 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap,
503 startDate, endDate);
504 }
505
506 public static void publishPortlet(
507 long userId, ExportImportConfiguration exportImportConfiguration)
508 throws PortalException {
509
510 _staging.publishPortlet(userId, exportImportConfiguration);
511 }
512
513 public static void publishPortlet(
514 long userId, long exportImportConfigurationId)
515 throws PortalException {
516
517 _staging.publishPortlet(userId, exportImportConfigurationId);
518 }
519
520 public static void publishPortlet(
521 long userId, long sourceGroupId, long targetGroupId,
522 long sourcePlid, long targetPlid, String portletId,
523 Map<String, String[]> parameterMap)
524 throws PortalException {
525
526 _staging.publishPortlet(
527 userId, sourceGroupId, targetGroupId, sourcePlid, targetPlid,
528 portletId, parameterMap);
529 }
530
531 public static void publishToLive(PortletRequest PortletRequest)
532 throws PortalException {
533
534 _staging.publishToLive(PortletRequest);
535 }
536
537 public static void publishToLive(
538 PortletRequest PortletRequest, Portlet portlet)
539 throws PortalException {
540
541 _staging.publishToLive(PortletRequest, portlet);
542 }
543
544 public static void publishToRemote(PortletRequest PortletRequest)
545 throws PortalException {
546
547 _staging.publishToRemote(PortletRequest);
548 }
549
550 public static void scheduleCopyFromLive(PortletRequest PortletRequest)
551 throws PortalException {
552
553 _staging.scheduleCopyFromLive(PortletRequest);
554 }
555
556 public static void schedulePublishToLive(PortletRequest PortletRequest)
557 throws PortalException {
558
559 _staging.schedulePublishToLive(PortletRequest);
560 }
561
562 public static void schedulePublishToRemote(PortletRequest PortletRequest)
563 throws PortalException {
564
565 _staging.schedulePublishToRemote(PortletRequest);
566 }
567
568 public static void setRecentLayoutBranchId(
569 HttpServletRequest request, long layoutSetBranchId, long plid,
570 long layoutBranchId)
571 throws PortalException {
572
573 _staging.setRecentLayoutBranchId(
574 request, layoutSetBranchId, plid, layoutBranchId);
575 }
576
577 public static void setRecentLayoutBranchId(
578 User user, long layoutSetBranchId, long plid, long layoutBranchId)
579 throws PortalException {
580
581 _staging.setRecentLayoutBranchId(
582 user, layoutSetBranchId, plid, layoutBranchId);
583 }
584
585 public static void setRecentLayoutRevisionId(
586 HttpServletRequest request, long layoutSetBranchId, long plid,
587 long layoutRevisionId)
588 throws PortalException {
589
590 _staging.setRecentLayoutRevisionId(
591 request, layoutSetBranchId, plid, layoutRevisionId);
592 }
593
594 public static void setRecentLayoutRevisionId(
595 User user, long layoutSetBranchId, long plid, long layoutRevisionId)
596 throws PortalException {
597
598 _staging.setRecentLayoutRevisionId(
599 user, layoutSetBranchId, plid, layoutRevisionId);
600 }
601
602 public static void setRecentLayoutSetBranchId(
603 HttpServletRequest request, long layoutSetId,
604 long layoutSetBranchId)
605 throws PortalException {
606
607 _staging.setRecentLayoutSetBranchId(
608 request, layoutSetId, layoutSetBranchId);
609 }
610
611 public static void setRecentLayoutSetBranchId(
612 User user, long layoutSetId, long layoutSetBranchId)
613 throws PortalException {
614
615 _staging.setRecentLayoutSetBranchId(
616 user, layoutSetId, layoutSetBranchId);
617 }
618
619 public static String stripProtocolFromRemoteAddress(String remoteAddress) {
620 return _staging.stripProtocolFromRemoteAddress(remoteAddress);
621 }
622
623
628 @Deprecated
629 public static void unlockGroup(long groupId) {
630 _staging.unlockGroup(groupId);
631 }
632
633 public static void unscheduleCopyFromLive(PortletRequest PortletRequest)
634 throws PortalException {
635
636 _staging.unscheduleCopyFromLive(PortletRequest);
637 }
638
639 public static void unschedulePublishToLive(PortletRequest PortletRequest)
640 throws PortalException {
641
642 _staging.unschedulePublishToLive(PortletRequest);
643 }
644
645 public static void unschedulePublishToRemote(PortletRequest PortletRequest)
646 throws PortalException {
647
648 _staging.unschedulePublishToRemote(PortletRequest);
649 }
650
651 public static void updateLastImportSettings(
652 Element layoutElement, Layout layout,
653 PortletDataContext portletDataContext)
654 throws PortalException {
655
656 _staging.updateLastImportSettings(
657 layoutElement, layout, portletDataContext);
658 }
659
660
666 @Deprecated
667 public static void updateLastPublishDate(
668 long sourceGroupId, boolean privateLayout, Date lastPublishDate)
669 throws PortalException {
670
671 _staging.updateLastPublishDate(
672 sourceGroupId, privateLayout, lastPublishDate);
673 }
674
675
681 @Deprecated
682 public static void updateLastPublishDate(
683 String portletId, PortletPreferences portletPreferences,
684 Date lastPublishDate)
685 throws PortalException {
686
687 _staging.updateLastPublishDate(
688 portletId, portletPreferences, lastPublishDate);
689 }
690
691 public static void updateStaging(
692 PortletRequest PortletRequest, Group liveGroup)
693 throws PortalException {
694
695 _staging.updateStaging(PortletRequest, liveGroup);
696 }
697
698 public static void validateRemote(
699 long groupId, String remoteAddress, int remotePort,
700 String remotePathContext, boolean secureConnection,
701 long remoteGroupId)
702 throws PortalException {
703
704 _staging.validateRemote(
705 groupId, remoteAddress, remotePort, remotePathContext,
706 secureConnection, remoteGroupId);
707 }
708
709
713 @Deprecated
714 public static void validateRemote(
715 String remoteAddress, int remotePort, String remotePathContext,
716 boolean secureConnection, long remoteGroupId)
717 throws PortalException {
718
719 _staging.validateRemote(
720 remoteAddress, remotePort, remotePathContext, secureConnection,
721 remoteGroupId);
722 }
723
724 private static final Staging _staging =
725 ProxyFactory.newServiceTrackedInstance(Staging.class);
726
727 }