001
014
015 package com.liferay.exportimport.kernel.lar;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.exception.PortalException;
020 import com.liferay.portal.kernel.model.Layout;
021 import com.liferay.portal.kernel.model.Portlet;
022 import com.liferay.portal.kernel.model.StagedModel;
023 import com.liferay.portal.kernel.repository.model.FileEntry;
024 import com.liferay.portal.kernel.theme.ThemeDisplay;
025 import com.liferay.portal.kernel.util.DateRange;
026 import com.liferay.portal.kernel.util.ProxyFactory;
027 import com.liferay.portal.kernel.xml.Document;
028 import com.liferay.portal.kernel.xml.Element;
029 import com.liferay.portal.kernel.zip.ZipWriter;
030
031 import java.io.File;
032
033 import java.util.Calendar;
034 import java.util.List;
035 import java.util.Map;
036
037 import javax.portlet.PortletPreferences;
038 import javax.portlet.PortletRequest;
039
040
043 @ProviderType
044 public class ExportImportHelperUtil {
045
046 public static long[] getAllLayoutIds(long groupId, boolean privateLayout) {
047 return _exportImportHelper.getAllLayoutIds(groupId, privateLayout);
048 }
049
050 public static Map<Long, Boolean> getAllLayoutIdsMap(
051 long groupId, boolean privateLayout) {
052
053 return _exportImportHelper.getAllLayoutIdsMap(groupId, privateLayout);
054 }
055
056
061 @Deprecated
062 public static Calendar getCalendar(
063 PortletRequest portletRequest, String paramPrefix,
064 boolean timeZoneSensitive) {
065
066 return _exportImportHelper.getCalendar(
067 portletRequest, paramPrefix, timeZoneSensitive);
068 }
069
070 public static List<Portlet> getDataSiteLevelPortlets(long companyId)
071 throws Exception {
072
073 return _exportImportHelper.getDataSiteLevelPortlets(companyId);
074 }
075
076 public static List<Portlet> getDataSiteLevelPortlets(
077 long companyId, boolean excludeDataAlwaysStaged)
078 throws Exception {
079
080 return _exportImportHelper.getDataSiteLevelPortlets(
081 companyId, excludeDataAlwaysStaged);
082 }
083
084
089 @Deprecated
090 public static DateRange getDateRange(
091 PortletRequest portletRequest, long groupId, boolean privateLayout,
092 long plid, String portletId, String defaultRange)
093 throws Exception {
094
095 return _exportImportHelper.getDateRange(
096 portletRequest, groupId, privateLayout, plid, portletId,
097 defaultRange);
098 }
099
100
103 @Deprecated
104 public static Layout getExportableLayout(ThemeDisplay themeDisplay)
105 throws PortalException {
106
107 return _exportImportHelper.getExportableLayout(themeDisplay);
108 }
109
110 public static String getExportableRootPortletId(
111 long companyId, String portletId)
112 throws Exception {
113
114 return _exportImportHelper.getExportableRootPortletId(
115 companyId, portletId);
116 }
117
118
122 @Deprecated
123 public static boolean[] getExportPortletControls(
124 long companyId, String portletId,
125 Map<String, String[]> parameterMap)
126 throws Exception {
127
128 return _exportImportHelper.getExportPortletControls(
129 companyId, portletId, parameterMap);
130 }
131
132
136 @Deprecated
137 public static boolean[] getExportPortletControls(
138 long companyId, String portletId,
139 Map<String, String[]> parameterMap, String type)
140 throws Exception {
141
142 return _exportImportHelper.getExportPortletControls(
143 companyId, portletId, parameterMap, type);
144 }
145
146 public static Map<String, Boolean> getExportPortletControlsMap(
147 long companyId, String portletId,
148 Map<String, String[]> parameterMap)
149 throws Exception {
150
151 return _exportImportHelper.getExportPortletControlsMap(
152 companyId, portletId, parameterMap);
153 }
154
155 public static Map<String, Boolean> getExportPortletControlsMap(
156 long companyId, String portletId,
157 Map<String, String[]> parameterMap, String type)
158 throws Exception {
159
160 return _exportImportHelper.getExportPortletControlsMap(
161 companyId, portletId, parameterMap, type);
162 }
163
164
169 @Deprecated
170 public static boolean[] getImportPortletControls(
171 long companyId, String portletId,
172 Map<String, String[]> parameterMap, Element portletDataElement)
173 throws Exception {
174
175 return _exportImportHelper.getImportPortletControls(
176 companyId, portletId, parameterMap, portletDataElement);
177 }
178
179
184 @Deprecated
185 public static boolean[] getImportPortletControls(
186 long companyId, String portletId,
187 Map<String, String[]> parameterMap, Element portletDataElement,
188 ManifestSummary manifestSummary)
189 throws Exception {
190
191 return _exportImportHelper.getImportPortletControls(
192 companyId, portletId, parameterMap, portletDataElement,
193 manifestSummary);
194 }
195
196 public static Map<String, Boolean> getImportPortletControlsMap(
197 long companyId, String portletId,
198 Map<String, String[]> parameterMap, Element portletDataElement,
199 ManifestSummary manifestSummary)
200 throws Exception {
201
202 return _exportImportHelper.getImportPortletControlsMap(
203 companyId, portletId, parameterMap, portletDataElement,
204 manifestSummary);
205 }
206
207 public static Map<Long, Boolean> getLayoutIdMap(
208 PortletRequest portletRequest)
209 throws PortalException {
210
211 return _exportImportHelper.getLayoutIdMap(portletRequest);
212 }
213
214 public static long[] getLayoutIds(List<Layout> layouts) {
215 return _exportImportHelper.getLayoutIds(layouts);
216 }
217
218 public static long[] getLayoutIds(Map<Long, Boolean> layoutIdMap)
219 throws PortalException {
220
221 return _exportImportHelper.getLayoutIds(layoutIdMap);
222 }
223
224 public static long[] getLayoutIds(
225 Map<Long, Boolean> layoutIdMap, long targetGroupId)
226 throws PortalException {
227
228 return _exportImportHelper.getLayoutIds(layoutIdMap, targetGroupId);
229 }
230
231 public static long[] getLayoutIds(PortletRequest portletRequest)
232 throws PortalException {
233
234 return _exportImportHelper.getLayoutIds(portletRequest);
235 }
236
237 public static long[] getLayoutIds(
238 PortletRequest portletRequest, long targetGroupId)
239 throws PortalException {
240
241 return _exportImportHelper.getLayoutIds(portletRequest, targetGroupId);
242 }
243
244 public static ZipWriter getLayoutSetZipWriter(long groupId) {
245 return _exportImportHelper.getLayoutSetZipWriter(groupId);
246 }
247
248
252 @Deprecated
253 public static ManifestSummary getManifestSummary(
254 long userId, long groupId, Map<String, String[]> parameterMap,
255 File file)
256 throws Exception {
257
258 return _exportImportHelper.getManifestSummary(
259 userId, groupId, parameterMap, file);
260 }
261
262 public static ManifestSummary getManifestSummary(
263 long userId, long groupId, Map<String, String[]> parameterMap,
264 FileEntry fileEntry)
265 throws Exception {
266
267 return _exportImportHelper.getManifestSummary(
268 userId, groupId, parameterMap, fileEntry);
269 }
270
271 public static ManifestSummary getManifestSummary(
272 PortletDataContext portletDataContext)
273 throws Exception {
274
275 return _exportImportHelper.getManifestSummary(portletDataContext);
276 }
277
278 public static List<Layout> getMissingParentLayouts(
279 Layout layout, long liveGroupId)
280 throws PortalException {
281
282 return _exportImportHelper.getMissingParentLayouts(layout, liveGroupId);
283 }
284
285 public static long getModelDeletionCount(
286 final PortletDataContext portletDataContext,
287 final StagedModelType stagedModelType)
288 throws PortalException {
289
290 return _exportImportHelper.getModelDeletionCount(
291 portletDataContext, stagedModelType);
292 }
293
294 public static ZipWriter getPortletZipWriter(String portletId) {
295 return _exportImportHelper.getPortletZipWriter(portletId);
296 }
297
298 public static String getSelectedLayoutsJSON(
299 long groupId, boolean privateLayout, String selectedNodes) {
300
301 return _exportImportHelper.getSelectedLayoutsJSON(
302 groupId, privateLayout, selectedNodes);
303 }
304
305 public static FileEntry getTempFileEntry(
306 long groupId, long userId, String folderName)
307 throws PortalException {
308
309 return _exportImportHelper.getTempFileEntry(
310 groupId, userId, folderName);
311 }
312
313 public static UserIdStrategy getUserIdStrategy(
314 long userId, String userIdStrategy)
315 throws PortalException {
316
317 return _exportImportHelper.getUserIdStrategy(userId, userIdStrategy);
318 }
319
320 public static boolean isReferenceWithinExportScope(
321 PortletDataContext portletDataContext, StagedModel stagedModel) {
322
323 return _exportImportHelper.isReferenceWithinExportScope(
324 portletDataContext, stagedModel);
325 }
326
327
333 @Deprecated
334 public static String replaceExportContentReferences(
335 PortletDataContext portletDataContext,
336 StagedModel entityStagedModel, Element entityElement,
337 String content, boolean exportReferencedContent)
338 throws Exception {
339
340 return _exportImportHelper.replaceExportContentReferences(
341 portletDataContext, entityStagedModel, entityElement, content,
342 exportReferencedContent);
343 }
344
345
351 @Deprecated
352 public static String replaceExportContentReferences(
353 PortletDataContext portletDataContext,
354 StagedModel entityStagedModel, String content,
355 boolean exportReferencedContent)
356 throws Exception {
357
358 return _exportImportHelper.replaceExportContentReferences(
359 portletDataContext, entityStagedModel, content,
360 exportReferencedContent);
361 }
362
363
369 @Deprecated
370 public static String replaceExportContentReferences(
371 PortletDataContext portletDataContext,
372 StagedModel entityStagedModel, String content,
373 boolean exportReferencedContent, boolean escapeContent)
374 throws Exception {
375
376 return _exportImportHelper.replaceExportContentReferences(
377 portletDataContext, entityStagedModel, content,
378 exportReferencedContent, escapeContent);
379 }
380
381
384 @Deprecated
385 public static String replaceExportDLReferences(
386 PortletDataContext portletDataContext,
387 StagedModel entityStagedModel, Element entityElement,
388 String content, boolean exportReferencedContent)
389 throws Exception {
390
391 return _exportImportHelper.replaceExportDLReferences(
392 portletDataContext, entityStagedModel, entityElement, content,
393 exportReferencedContent);
394 }
395
396
399 @Deprecated
400 public static String replaceExportDLReferences(
401 PortletDataContext portletDataContext,
402 StagedModel entityStagedModel, String content,
403 boolean exportReferencedContent)
404 throws Exception {
405
406 return _exportImportHelper.replaceExportDLReferences(
407 portletDataContext, entityStagedModel, content,
408 exportReferencedContent);
409 }
410
411
414 @Deprecated
415 public static String replaceExportLayoutReferences(
416 PortletDataContext portletDataContext, String content)
417 throws Exception {
418
419 return _exportImportHelper.replaceExportLayoutReferences(
420 portletDataContext, content);
421 }
422
423
426 @Deprecated
427 public static String replaceExportLayoutReferences(
428 PortletDataContext portletDataContext, String content,
429 boolean exportReferencedContent)
430 throws Exception {
431
432 return _exportImportHelper.replaceExportLayoutReferences(
433 portletDataContext, content, exportReferencedContent);
434 }
435
436
439 @Deprecated
440 public static String replaceExportLinksToLayouts(
441 PortletDataContext portletDataContext,
442 StagedModel entityStagedModel, Element entityElement,
443 String content, boolean exportReferencedContent)
444 throws Exception {
445
446 return _exportImportHelper.replaceExportLinksToLayouts(
447 portletDataContext, entityStagedModel, entityElement, content,
448 exportReferencedContent);
449 }
450
451
454 @Deprecated
455 public static String replaceExportLinksToLayouts(
456 PortletDataContext portletDataContext,
457 StagedModel entityStagedModel, String content)
458 throws Exception {
459
460 return _exportImportHelper.replaceExportLinksToLayouts(
461 portletDataContext, entityStagedModel, content);
462 }
463
464
470 @Deprecated
471 public static String replaceImportContentReferences(
472 PortletDataContext portletDataContext, Element entityElement,
473 String content, boolean importReferencedContent)
474 throws Exception {
475
476 return _exportImportHelper.replaceImportContentReferences(
477 portletDataContext, entityElement, content,
478 importReferencedContent);
479 }
480
481
487 @Deprecated
488 public static String replaceImportContentReferences(
489 PortletDataContext portletDataContext,
490 StagedModel entityStagedModel, String content)
491 throws Exception {
492
493 return _exportImportHelper.replaceImportContentReferences(
494 portletDataContext, entityStagedModel, content);
495 }
496
497
500 @Deprecated
501 public static String replaceImportDLReferences(
502 PortletDataContext portletDataContext, Element entityElement,
503 String content, boolean importReferencedContent)
504 throws Exception {
505
506 return _exportImportHelper.replaceImportDLReferences(
507 portletDataContext, entityElement, content,
508 importReferencedContent);
509 }
510
511
514 @Deprecated
515 public static String replaceImportDLReferences(
516 PortletDataContext portletDataContext,
517 StagedModel entityStagedModel, String content)
518 throws Exception {
519
520 return _exportImportHelper.replaceImportDLReferences(
521 portletDataContext, entityStagedModel, content);
522 }
523
524
527 @Deprecated
528 public static String replaceImportLayoutReferences(
529 PortletDataContext portletDataContext, String content)
530 throws Exception {
531
532 return _exportImportHelper.replaceImportLayoutReferences(
533 portletDataContext, content);
534 }
535
536
539 @Deprecated
540 public static String replaceImportLayoutReferences(
541 PortletDataContext portletDataContext, String content,
542 boolean importReferencedContent)
543 throws Exception {
544
545 return _exportImportHelper.replaceImportLayoutReferences(
546 portletDataContext, content, importReferencedContent);
547 }
548
549
552 @Deprecated
553 public static String replaceImportLinksToLayouts(
554 PortletDataContext portletDataContext, String content)
555 throws Exception {
556
557 return _exportImportHelper.replaceImportLinksToLayouts(
558 portletDataContext, content);
559 }
560
561
564 @Deprecated
565 public static String replaceImportLinksToLayouts(
566 PortletDataContext portletDataContext, String content,
567 boolean importReferencedContent)
568 throws Exception {
569
570 return _exportImportHelper.replaceImportLinksToLayouts(
571 portletDataContext, content, importReferencedContent);
572 }
573
574
580 @Deprecated
581 public static void updateExportPortletPreferencesClassPKs(
582 PortletDataContext portletDataContext, Portlet portlet,
583 PortletPreferences portletPreferences, String key, String className)
584 throws Exception {
585
586 _exportImportHelper.updateExportPortletPreferencesClassPKs(
587 portletDataContext, portlet, portletPreferences, key, className);
588 }
589
590
595 @Deprecated
596 public static void updateExportPortletPreferencesClassPKs(
597 PortletDataContext portletDataContext, Portlet portlet,
598 PortletPreferences portletPreferences, String key, String className,
599 Element rootElement)
600 throws Exception {
601
602 _exportImportHelper.updateExportPortletPreferencesClassPKs(
603 portletDataContext, portlet, portletPreferences, key, className,
604 rootElement);
605 }
606
607
612 @Deprecated
613 public static void updateImportPortletPreferencesClassPKs(
614 PortletDataContext portletDataContext,
615 PortletPreferences portletPreferences, String key, Class<?> clazz,
616 long companyGroupId)
617 throws Exception {
618
619 _exportImportHelper.updateImportPortletPreferencesClassPKs(
620 portletDataContext, portletPreferences, key, clazz, companyGroupId);
621 }
622
623
627 @Deprecated
628 public static MissingReferences validateMissingReferences(
629 long userId, long groupId, Map<String, String[]> parameterMap,
630 File file)
631 throws Exception {
632
633 return _exportImportHelper.validateMissingReferences(
634 userId, groupId, parameterMap, file);
635 }
636
637 public static MissingReferences validateMissingReferences(
638 final PortletDataContext portletDataContext)
639 throws Exception {
640
641 return _exportImportHelper.validateMissingReferences(
642 portletDataContext);
643 }
644
645 public static void writeManifestSummary(
646 Document document, ManifestSummary manifestSummary) {
647
648 _exportImportHelper.writeManifestSummary(document, manifestSummary);
649 }
650
651 private static final ExportImportHelper _exportImportHelper =
652 ProxyFactory.newServiceTrackedInstance(ExportImportHelper.class);
653
654 }