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 public static JSONArray getErrorMessagesJSONArray(
220 Locale locale, Map<String, MissingReference> missingReferences) {
221
222 return _staging.getErrorMessagesJSONArray(locale, missingReferences);
223 }
224
225
230 @Deprecated
231 public static JSONArray getErrorMessagesJSONArray(
232 Locale locale, Map<String, MissingReference> missingReferences,
233 Map<String, Serializable> contextMap) {
234
235 return _staging.getErrorMessagesJSONArray(
236 locale, missingReferences, contextMap);
237 }
238
239 public static JSONObject getExceptionMessagesJSONObject(
240 Locale locale, Exception e,
241 ExportImportConfiguration exportImportConfiguration) {
242
243 return _staging.getExceptionMessagesJSONObject(
244 locale, e, exportImportConfiguration);
245 }
246
247
252 @Deprecated
253 public static JSONObject getExceptionMessagesJSONObject(
254 Locale locale, Exception e, Map<String, Serializable> contextMap) {
255
256 return _staging.getExceptionMessagesJSONObject(locale, e, contextMap);
257 }
258
259 public static Group getLiveGroup(long groupId) {
260 return _staging.getLiveGroup(groupId);
261 }
262
263 public static long getLiveGroupId(long groupId) {
264 return _staging.getLiveGroupId(groupId);
265 }
266
267
272 @Deprecated
273 public static List<Layout> getMissingParentLayouts(
274 Layout layout, long liveGroupId)
275 throws Exception {
276
277 return _staging.getMissingParentLayouts(layout, liveGroupId);
278 }
279
280 public static long getRecentLayoutRevisionId(
281 HttpServletRequest request, long layoutSetBranchId, long plid)
282 throws PortalException {
283
284 return _staging.getRecentLayoutRevisionId(
285 request, layoutSetBranchId, plid);
286 }
287
288 public static long getRecentLayoutRevisionId(
289 User user, long layoutSetBranchId, long plid)
290 throws PortalException {
291
292 return _staging.getRecentLayoutRevisionId(
293 user, layoutSetBranchId, plid);
294 }
295
296 public static long getRecentLayoutSetBranchId(
297 HttpServletRequest request, long layoutSetId) {
298
299 return _staging.getRecentLayoutSetBranchId(request, layoutSetId);
300 }
301
302 public static long getRecentLayoutSetBranchId(User user, long layoutSetId) {
303 return _staging.getRecentLayoutSetBranchId(user, layoutSetId);
304 }
305
306 public static String getRemoteSiteURL(
307 Group stagingGroup, boolean privateLayout)
308 throws PortalException {
309
310 return _staging.getRemoteSiteURL(stagingGroup, privateLayout);
311 }
312
313 public static String getSchedulerGroupName(
314 String destinationName, long groupId) {
315
316 return _staging.getSchedulerGroupName(destinationName, groupId);
317 }
318
319 public static String getStagedPortletId(String portletId) {
320 return _staging.getStagedPortletId(portletId);
321 }
322
323 public static long[] getStagingAndLiveGroupIds(long groupId)
324 throws PortalException {
325
326 return _staging.getStagingAndLiveGroupIds(groupId);
327 }
328
329 public static Group getStagingGroup(long groupId) {
330 return _staging.getStagingGroup(groupId);
331 }
332
333
338 @Deprecated
339 public static Map<String, String[]> getStagingParameters() {
340 return _staging.getStagingParameters();
341 }
342
343
348 @Deprecated
349 public static Map<String, String[]> getStagingParameters(
350 PortletRequest PortletRequest) {
351
352 return _staging.getStagingParameters(PortletRequest);
353 }
354
355 public static JSONArray getWarningMessagesJSONArray(
356 Locale locale, Map<String, MissingReference> missingReferences) {
357
358 return _staging.getWarningMessagesJSONArray(locale, missingReferences);
359 }
360
361
366 @Deprecated
367 public static JSONArray getWarningMessagesJSONArray(
368 Locale locale, Map<String, MissingReference> missingReferences,
369 Map<String, Serializable> contextMap) {
370
371 return _staging.getWarningMessagesJSONArray(
372 locale, missingReferences, contextMap);
373 }
374
375 public static WorkflowTask getWorkflowTask(
376 long userId, LayoutRevision layoutRevision)
377 throws PortalException {
378
379 return _staging.getWorkflowTask(userId, layoutRevision);
380 }
381
382 public static boolean hasWorkflowTask(
383 long userId, LayoutRevision layoutRevision)
384 throws PortalException {
385
386 return _staging.hasWorkflowTask(userId, layoutRevision);
387 }
388
389 public static boolean isIncomplete(Layout layout, long layoutSetBranchId) {
390 return _staging.isIncomplete(layout, layoutSetBranchId);
391 }
392
393
398 @Deprecated
399 public static void lockGroup(long userId, long groupId)
400 throws PortalException {
401
402 _staging.lockGroup(userId, groupId);
403 }
404
405 public static void publishLayout(
406 long userId, long plid, long liveGroupId, boolean includeChildren)
407 throws PortalException {
408
409 _staging.publishLayout(userId, plid, liveGroupId, includeChildren);
410 }
411
412 public static void publishLayouts(
413 long userId, ExportImportConfiguration exportImportConfiguration)
414 throws PortalException {
415
416 _staging.publishLayouts(userId, exportImportConfiguration);
417 }
418
419 public static void publishLayouts(
420 long userId, long exportImportConfigurationId)
421 throws PortalException {
422
423 _staging.publishLayouts(userId, exportImportConfigurationId);
424 }
425
426 public static void publishLayouts(
427 long userId, long sourceGroupId, long targetGroupId,
428 boolean privateLayout, long[] layoutIds,
429 Map<String, String[]> parameterMap)
430 throws PortalException {
431
432 _staging.publishLayouts(
433 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
434 parameterMap);
435 }
436
437
441 @Deprecated
442 public static void publishLayouts(
443 long userId, long sourceGroupId, long targetGroupId,
444 boolean privateLayout, long[] layoutIds,
445 Map<String, String[]> parameterMap, Date startDate, Date endDate)
446 throws PortalException {
447
448 _staging.publishLayouts(
449 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
450 parameterMap, startDate, endDate);
451 }
452
453 public static void publishLayouts(
454 long userId, long sourceGroupId, long targetGroupId,
455 boolean privateLayout, long[] layoutIds, String name,
456 Map<String, String[]> parameterMap)
457 throws PortalException {
458
459 _staging.publishLayouts(
460 userId, sourceGroupId, targetGroupId, privateLayout, layoutIds,
461 name, parameterMap);
462 }
463
464
468 @Deprecated
469 public static void publishLayouts(
470 long userId, long sourceGroupId, long targetGroupId,
471 boolean privateLayout, Map<Long, Boolean> layoutIdMap,
472 Map<String, String[]> parameterMap, Date startDate, Date endDate)
473 throws PortalException {
474
475 _staging.publishLayouts(
476 userId, sourceGroupId, targetGroupId, privateLayout, layoutIdMap,
477 parameterMap, startDate, endDate);
478 }
479
480 public static void publishLayouts(
481 long userId, long sourceGroupId, long targetGroupId,
482 boolean privateLayout, Map<String, String[]> parameterMap)
483 throws PortalException {
484
485 _staging.publishLayouts(
486 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap);
487 }
488
489
493 @Deprecated
494 public static void publishLayouts(
495 long userId, long sourceGroupId, long targetGroupId,
496 boolean privateLayout, Map<String, String[]> parameterMap,
497 Date startDate, Date endDate)
498 throws PortalException {
499
500 _staging.publishLayouts(
501 userId, sourceGroupId, targetGroupId, privateLayout, parameterMap,
502 startDate, endDate);
503 }
504
505 public static void publishPortlet(
506 long userId, ExportImportConfiguration exportImportConfiguration)
507 throws PortalException {
508
509 _staging.publishPortlet(userId, exportImportConfiguration);
510 }
511
512 public static void publishPortlet(
513 long userId, long exportImportConfigurationId)
514 throws PortalException {
515
516 _staging.publishPortlet(userId, exportImportConfigurationId);
517 }
518
519 public static void publishPortlet(
520 long userId, long sourceGroupId, long targetGroupId,
521 long sourcePlid, long targetPlid, String portletId,
522 Map<String, String[]> parameterMap)
523 throws PortalException {
524
525 _staging.publishPortlet(
526 userId, sourceGroupId, targetGroupId, sourcePlid, targetPlid,
527 portletId, parameterMap);
528 }
529
530 public static void publishToLive(PortletRequest PortletRequest)
531 throws PortalException {
532
533 _staging.publishToLive(PortletRequest);
534 }
535
536 public static void publishToLive(
537 PortletRequest PortletRequest, Portlet portlet)
538 throws PortalException {
539
540 _staging.publishToLive(PortletRequest, portlet);
541 }
542
543 public static void publishToRemote(PortletRequest PortletRequest)
544 throws PortalException {
545
546 _staging.publishToRemote(PortletRequest);
547 }
548
549 public static void scheduleCopyFromLive(PortletRequest PortletRequest)
550 throws PortalException {
551
552 _staging.scheduleCopyFromLive(PortletRequest);
553 }
554
555 public static void schedulePublishToLive(PortletRequest PortletRequest)
556 throws PortalException {
557
558 _staging.schedulePublishToLive(PortletRequest);
559 }
560
561 public static void schedulePublishToRemote(PortletRequest PortletRequest)
562 throws PortalException {
563
564 _staging.schedulePublishToRemote(PortletRequest);
565 }
566
567 public static void setRecentLayoutBranchId(
568 HttpServletRequest request, long layoutSetBranchId, long plid,
569 long layoutBranchId)
570 throws PortalException {
571
572 _staging.setRecentLayoutBranchId(
573 request, layoutSetBranchId, plid, layoutBranchId);
574 }
575
576 public static void setRecentLayoutBranchId(
577 User user, long layoutSetBranchId, long plid, long layoutBranchId)
578 throws PortalException {
579
580 _staging.setRecentLayoutBranchId(
581 user, layoutSetBranchId, plid, layoutBranchId);
582 }
583
584 public static void setRecentLayoutRevisionId(
585 HttpServletRequest request, long layoutSetBranchId, long plid,
586 long layoutRevisionId)
587 throws PortalException {
588
589 _staging.setRecentLayoutRevisionId(
590 request, layoutSetBranchId, plid, layoutRevisionId);
591 }
592
593 public static void setRecentLayoutRevisionId(
594 User user, long layoutSetBranchId, long plid, long layoutRevisionId)
595 throws PortalException {
596
597 _staging.setRecentLayoutRevisionId(
598 user, layoutSetBranchId, plid, layoutRevisionId);
599 }
600
601 public static void setRecentLayoutSetBranchId(
602 HttpServletRequest request, long layoutSetId,
603 long layoutSetBranchId)
604 throws PortalException {
605
606 _staging.setRecentLayoutSetBranchId(
607 request, layoutSetId, layoutSetBranchId);
608 }
609
610 public static void setRecentLayoutSetBranchId(
611 User user, long layoutSetId, long layoutSetBranchId)
612 throws PortalException {
613
614 _staging.setRecentLayoutSetBranchId(
615 user, layoutSetId, layoutSetBranchId);
616 }
617
618 public static String stripProtocolFromRemoteAddress(String remoteAddress) {
619 return _staging.stripProtocolFromRemoteAddress(remoteAddress);
620 }
621
622
627 @Deprecated
628 public static void unlockGroup(long groupId) {
629 _staging.unlockGroup(groupId);
630 }
631
632 public static void unscheduleCopyFromLive(PortletRequest PortletRequest)
633 throws PortalException {
634
635 _staging.unscheduleCopyFromLive(PortletRequest);
636 }
637
638 public static void unschedulePublishToLive(PortletRequest PortletRequest)
639 throws PortalException {
640
641 _staging.unschedulePublishToLive(PortletRequest);
642 }
643
644 public static void unschedulePublishToRemote(PortletRequest PortletRequest)
645 throws PortalException {
646
647 _staging.unschedulePublishToRemote(PortletRequest);
648 }
649
650 public static void updateLastImportSettings(
651 Element layoutElement, Layout layout,
652 PortletDataContext portletDataContext)
653 throws PortalException {
654
655 _staging.updateLastImportSettings(
656 layoutElement, layout, portletDataContext);
657 }
658
659
665 @Deprecated
666 public static void updateLastPublishDate(
667 long sourceGroupId, boolean privateLayout, Date lastPublishDate)
668 throws PortalException {
669
670 _staging.updateLastPublishDate(
671 sourceGroupId, privateLayout, lastPublishDate);
672 }
673
674
680 @Deprecated
681 public static void updateLastPublishDate(
682 String portletId, PortletPreferences portletPreferences,
683 Date lastPublishDate)
684 throws PortalException {
685
686 _staging.updateLastPublishDate(
687 portletId, portletPreferences, lastPublishDate);
688 }
689
690 public static void updateStaging(
691 PortletRequest PortletRequest, Group liveGroup)
692 throws PortalException {
693
694 _staging.updateStaging(PortletRequest, liveGroup);
695 }
696
697 public static void validateRemote(
698 long groupId, String remoteAddress, int remotePort,
699 String remotePathContext, boolean secureConnection,
700 long remoteGroupId)
701 throws PortalException {
702
703 _staging.validateRemote(
704 groupId, remoteAddress, remotePort, remotePathContext,
705 secureConnection, remoteGroupId);
706 }
707
708
712 @Deprecated
713 public static void validateRemote(
714 String remoteAddress, int remotePort, String remotePathContext,
715 boolean secureConnection, long remoteGroupId)
716 throws PortalException {
717
718 _staging.validateRemote(
719 remoteAddress, remotePort, remotePathContext, secureConnection,
720 remoteGroupId);
721 }
722
723 private static final Staging _staging =
724 ProxyFactory.newServiceTrackedInstance(Staging.class);
725
726 }