001
014
015 package com.liferay.portal.kernel.lar;
016
017 import com.liferay.portal.kernel.backgroundtask.BackgroundTaskThreadLocal;
018 import com.liferay.portal.kernel.log.Log;
019 import com.liferay.portal.kernel.log.LogFactoryUtil;
020 import com.liferay.portal.kernel.util.ArrayUtil;
021 import com.liferay.portal.kernel.util.GetterUtil;
022 import com.liferay.portal.kernel.util.StringPool;
023 import com.liferay.portal.kernel.util.Time;
024 import com.liferay.portal.kernel.util.Validator;
025 import com.liferay.portal.kernel.xml.Document;
026 import com.liferay.portal.kernel.xml.DocumentException;
027 import com.liferay.portal.kernel.xml.Element;
028 import com.liferay.portal.kernel.xml.SAXReaderUtil;
029 import com.liferay.portal.model.Portlet;
030 import com.liferay.portal.service.PortletLocalServiceUtil;
031 import com.liferay.portal.service.PortletPreferencesLocalServiceUtil;
032 import com.liferay.portal.util.PortletKeys;
033 import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
034 import com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplate;
035 import com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplateUtil;
036
037 import java.io.IOException;
038
039 import java.util.ArrayList;
040 import java.util.List;
041
042 import javax.portlet.PortletPreferences;
043
044
047 public abstract class BasePortletDataHandler implements PortletDataHandler {
048
049 @Override
050 public PortletPreferences deleteData(
051 PortletDataContext portletDataContext, String portletId,
052 PortletPreferences portletPreferences)
053 throws PortletDataException {
054
055 long startTime = 0;
056
057 if (_log.isInfoEnabled()) {
058 _log.info("Deleting portlet " + portletId);
059
060 startTime = System.currentTimeMillis();
061 }
062
063 try {
064 return doDeleteData(
065 portletDataContext, portletId, portletPreferences);
066 }
067 catch (Exception e) {
068 throw new PortletDataException(e);
069 }
070 finally {
071 if (_log.isInfoEnabled()) {
072 long duration = System.currentTimeMillis() - startTime;
073
074 _log.info("Deleted portlet in " + Time.getDuration(duration));
075 }
076 }
077 }
078
079 @Override
080 public String exportData(
081 PortletDataContext portletDataContext, String portletId,
082 PortletPreferences portletPreferences)
083 throws PortletDataException {
084
085 long startTime = 0;
086
087 if (_log.isInfoEnabled()) {
088 _log.info("Exporting portlet " + portletId);
089
090 startTime = System.currentTimeMillis();
091 }
092
093 try {
094 portletDataContext.addDeletionSystemEventStagedModelTypes(
095 getDeletionSystemEventStagedModelTypes());
096
097 for (PortletDataHandlerControl portletDataHandlerControl :
098 getExportControls()) {
099
100 addUncheckedModelAdditionCount(
101 portletDataContext, portletDataHandlerControl);
102 }
103
104 if (BackgroundTaskThreadLocal.hasBackgroundTask()) {
105 PortletDataContext clonePortletDataContext =
106 PortletDataContextFactoryUtil.clonePortletDataContext(
107 portletDataContext);
108
109 prepareManifestSummary(
110 clonePortletDataContext, portletPreferences);
111
112 PortletDataHandlerStatusMessageSenderUtil.sendStatusMessage(
113 "portlet", portletId,
114 clonePortletDataContext.getManifestSummary());
115 }
116
117 return doExportData(
118 portletDataContext, portletId, portletPreferences);
119 }
120 catch (Exception e) {
121 throw new PortletDataException(e);
122 }
123 finally {
124 if (_log.isInfoEnabled()) {
125 long duration = System.currentTimeMillis() - startTime;
126
127 _log.info("Exported portlet in " + Time.getDuration(duration));
128 }
129 }
130 }
131
132 @Override
133 public DataLevel getDataLevel() {
134 return _dataLevel;
135 }
136
137 @Override
138 public String[] getDataPortletPreferences() {
139 return _dataPortletPreferences;
140 }
141
142 @Override
143 public StagedModelType[] getDeletionSystemEventStagedModelTypes() {
144 return _deletionSystemEventStagedModelTypes;
145 }
146
147 @Override
148 public PortletDataHandlerControl[] getExportConfigurationControls(
149 long companyId, long groupId, Portlet portlet,
150 boolean privateLayout)
151 throws Exception {
152
153 return getExportConfigurationControls(
154 companyId, groupId, portlet, -1, privateLayout);
155 }
156
157 @Override
158 public PortletDataHandlerControl[] getExportConfigurationControls(
159 long companyId, long groupId, Portlet portlet, long plid,
160 boolean privateLayout)
161 throws Exception {
162
163 List<PortletDataHandlerBoolean> configurationControls =
164 new ArrayList<PortletDataHandlerBoolean>();
165
166
167
168 if ((PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
169 companyId, groupId, PortletKeys.PREFS_OWNER_ID_DEFAULT,
170 PortletKeys.PREFS_OWNER_TYPE_LAYOUT, plid, portlet,
171 privateLayout, false) > 0) ||
172 (PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
173 groupId, PortletKeys.PREFS_OWNER_TYPE_GROUP,
174 portlet.getRootPortletId(), false) > 0) ||
175 (PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
176 companyId, PortletKeys.PREFS_OWNER_TYPE_COMPANY,
177 portlet.getRootPortletId(), false) > 0)) {
178
179 configurationControls.add(
180 new PortletDataHandlerBoolean(
181 null, PortletDataHandlerKeys.PORTLET_SETUP, "setup",
182 true, false, null, null, null));
183 }
184
185
186
187 if (PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
188 -1, PortletKeys.PREFS_OWNER_TYPE_ARCHIVED,
189 portlet.getRootPortletId(), false) > 0) {
190
191 configurationControls.add(
192 new PortletDataHandlerBoolean(
193 null, PortletDataHandlerKeys.PORTLET_ARCHIVED_SETUPS,
194 "archived-setups", true, false, null, null, null)
195 );
196 }
197
198
199
200 if ((PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
201 companyId, groupId, -1, PortletKeys.PREFS_OWNER_TYPE_USER, plid,
202 portlet, privateLayout, false) > 0) ||
203 (PortletPreferencesLocalServiceUtil.getPortletPreferencesCount(
204 companyId, groupId, groupId, PortletKeys.PREFS_OWNER_TYPE_USER,
205 PortletKeys.PREFS_PLID_SHARED, portlet, privateLayout, false)
206 > 0)) {
207
208 configurationControls.add(
209 new PortletDataHandlerBoolean(
210 null, PortletDataHandlerKeys.PORTLET_USER_PREFERENCES,
211 "user-preferences", true, false, null, null, null));
212 }
213
214 return configurationControls.toArray(
215 new PortletDataHandlerBoolean[configurationControls.size()]);
216 }
217
218 @Override
219 public PortletDataHandlerControl[] getExportControls() {
220 return _exportControls;
221 }
222
223 @Override
224 public PortletDataHandlerControl[] getExportMetadataControls() {
225 return _exportMetadataControls;
226 }
227
228 @Override
229 public long getExportModelCount(ManifestSummary manifestSummary) {
230 return getExportModelCount(manifestSummary, getExportControls());
231 }
232
233 @Override
234 public PortletDataHandlerControl[] getImportConfigurationControls(
235 Portlet portlet, ManifestSummary manifestSummary) {
236
237 String[] configurationPortletOptions =
238 manifestSummary.getConfigurationPortletOptions(
239 portlet.getRootPortletId());
240
241 return getImportConfigurationControls(configurationPortletOptions);
242 }
243
244 @Override
245 public PortletDataHandlerControl[] getImportConfigurationControls(
246 String[] configurationPortletOptions) {
247
248 List<PortletDataHandlerBoolean> configurationControls =
249 new ArrayList<PortletDataHandlerBoolean>();
250
251
252
253 if (ArrayUtil.contains(configurationPortletOptions, "setup")) {
254 configurationControls.add(
255 new PortletDataHandlerBoolean(
256 null, PortletDataHandlerKeys.PORTLET_SETUP, "setup", true,
257 false, null, null, null));
258 }
259
260
261
262 if (ArrayUtil.contains(
263 configurationPortletOptions, "archived-setups")) {
264
265 configurationControls.add(
266 new PortletDataHandlerBoolean(
267 null, PortletDataHandlerKeys.PORTLET_ARCHIVED_SETUPS,
268 "archived-setups", true, false, null, null, null));
269 }
270
271
272
273 if (ArrayUtil.contains(
274 configurationPortletOptions, "user-preferences")) {
275
276 configurationControls.add(
277 new PortletDataHandlerBoolean(
278 null, PortletDataHandlerKeys.PORTLET_USER_PREFERENCES,
279 "user-preferences", true, false, null, null, null));
280 }
281
282 return configurationControls.toArray(
283 new PortletDataHandlerBoolean[configurationControls.size()]);
284 }
285
286 @Override
287 public PortletDataHandlerControl[] getImportControls() {
288 return _importControls;
289 }
290
291 @Override
292 public PortletDataHandlerControl[] getImportMetadataControls() {
293 return _importMetadataControls;
294 }
295
296 @Override
297 public String getPortletId() {
298 return _portletId;
299 }
300
301 @Override
302 public PortletPreferences importData(
303 PortletDataContext portletDataContext, String portletId,
304 PortletPreferences portletPreferences, String data)
305 throws PortletDataException {
306
307 long startTime = 0;
308
309 if (_log.isInfoEnabled()) {
310 _log.info("Importing portlet " + portletId);
311
312 startTime = System.currentTimeMillis();
313 }
314
315 long sourceGroupId = portletDataContext.getSourceGroupId();
316
317 try {
318 if (Validator.isXml(data)) {
319 addImportDataRootElement(portletDataContext, data);
320 }
321
322 portletDataContext.addDeletionSystemEventStagedModelTypes(
323 getDeletionSystemEventStagedModelTypes());
324
325 return doImportData(
326 portletDataContext, portletId, portletPreferences, data);
327 }
328 catch (Exception e) {
329 throw new PortletDataException(e);
330 }
331 finally {
332 portletDataContext.setSourceGroupId(sourceGroupId);
333
334 if (_log.isInfoEnabled()) {
335 long duration = System.currentTimeMillis() - startTime;
336
337 _log.info("Imported portlet in " + Time.getDuration(duration));
338 }
339 }
340 }
341
342 @Override
343 public boolean isDataLocalized() {
344 return _dataLocalized;
345 }
346
347 @Override
348 public boolean isDataPortalLevel() {
349 return _dataLevel.equals(DataLevel.PORTAL);
350 }
351
352 @Override
353 public boolean isDataPortletInstanceLevel() {
354 return _dataLevel.equals(DataLevel.PORTLET_INSTANCE);
355 }
356
357 @Override
358 public boolean isDataSiteLevel() {
359 return _dataLevel.equals(DataLevel.SITE);
360 }
361
362 @Override
363 public boolean isPublishToLiveByDefault() {
364 return _publishToLiveByDefault;
365 }
366
367 @Override
368 public boolean isSupportsDataStrategyCopyAsNew() {
369 return _supportsDataStrategyCopyAsNew;
370 }
371
372 @Override
373 public void prepareManifestSummary(PortletDataContext portletDataContext)
374 throws PortletDataException {
375
376 prepareManifestSummary(portletDataContext, null);
377 }
378
379 @Override
380 public void prepareManifestSummary(
381 PortletDataContext portletDataContext,
382 PortletPreferences portletPreferences)
383 throws PortletDataException {
384
385 try {
386 doPrepareManifestSummary(portletDataContext, portletPreferences);
387 }
388 catch (Exception e) {
389 throw new PortletDataException(e);
390 }
391 }
392
393 @Override
394 public PortletPreferences processExportPortletPreferences(
395 PortletDataContext portletDataContext, String portletId,
396 PortletPreferences portletPreferences, Element rootElement)
397 throws PortletDataException {
398
399 String displayStyle = getDisplayTemplate(
400 portletDataContext, portletId, portletPreferences);
401
402 if (Validator.isNotNull(displayStyle) &&
403 displayStyle.startsWith(
404 PortletDisplayTemplate.DISPLAY_STYLE_PREFIX)) {
405
406 long displayStyleGroupId = getDisplayTemplateGroupId(
407 portletDataContext, portletId, portletPreferences);
408
409 long previousScopeGroupId = portletDataContext.getScopeGroupId();
410
411 if (displayStyleGroupId != portletDataContext.getScopeGroupId()) {
412 portletDataContext.setScopeGroupId(displayStyleGroupId);
413 }
414
415 DDMTemplate ddmTemplate =
416 PortletDisplayTemplateUtil.fetchDDMTemplate(
417 portletDataContext.getGroupId(), displayStyle);
418
419 if (ddmTemplate != null) {
420 StagedModelDataHandlerUtil.exportReferenceStagedModel(
421 portletDataContext, portletId, ddmTemplate);
422 }
423
424 portletDataContext.setScopeGroupId(previousScopeGroupId);
425 }
426
427 try {
428 return doProcessExportPortletPreferences(
429 portletDataContext, portletId, portletPreferences, rootElement);
430 }
431 catch (Exception e) {
432 throw new PortletDataException(e);
433 }
434 }
435
436 @Override
437 public PortletPreferences processImportPortletPreferences(
438 PortletDataContext portletDataContext, String portletId,
439 PortletPreferences portletPreferences)
440 throws PortletDataException {
441
442 try {
443 String displayStyle = getDisplayTemplate(
444 portletDataContext, portletId, portletPreferences);
445
446 if (Validator.isNotNull(displayStyle) &&
447 displayStyle.startsWith(
448 PortletDisplayTemplate.DISPLAY_STYLE_PREFIX)) {
449
450 DDMTemplate ddmTemplate = null;
451
452 long displayStyleGroupId = getDisplayTemplateGroupId(
453 portletDataContext, portletId, portletPreferences);
454
455 if (displayStyleGroupId ==
456 portletDataContext.getCompanyGroupId()) {
457
458 ddmTemplate = PortletDisplayTemplateUtil.fetchDDMTemplate(
459 portletDataContext.getCompanyGroupId(), displayStyle);
460 }
461 else if (displayStyleGroupId ==
462 portletDataContext.getSourceGroupId()) {
463
464 ddmTemplate = PortletDisplayTemplateUtil.fetchDDMTemplate(
465 portletDataContext.getScopeGroupId(), displayStyle);
466 }
467 else {
468 ddmTemplate = PortletDisplayTemplateUtil.fetchDDMTemplate(
469 displayStyleGroupId, displayStyle);
470 }
471
472 long importedDisplayStyleGroupId =
473 portletDataContext.getScopeGroupId();
474
475 if (ddmTemplate == null) {
476 String ddmTemplateUuid =
477 PortletDisplayTemplateUtil.getDDMTemplateUuid(
478 displayStyle);
479
480 Element ddmTemplateElement =
481 portletDataContext.getImportDataElement(
482 DDMTemplate.class.getSimpleName(), "uuid",
483 ddmTemplateUuid);
484
485 String ddmTemplatePath = ddmTemplateElement.attributeValue(
486 "path");
487
488 ddmTemplate =
489 (DDMTemplate)portletDataContext.getZipEntryAsObject(
490 ddmTemplatePath);
491
492 if (ddmTemplate != null) {
493 StagedModelDataHandlerUtil.importStagedModel(
494 portletDataContext, ddmTemplate);
495 }
496 }
497 else {
498 importedDisplayStyleGroupId = ddmTemplate.getGroupId();
499 }
500
501 portletPreferences.setValue(
502 "displayStyleGroupId",
503 String.valueOf(importedDisplayStyleGroupId));
504 }
505 else {
506 portletPreferences.setValue(
507 "displayStyleGroupId", StringPool.BLANK);
508 }
509
510 return doProcessImportPortletPreferences(
511 portletDataContext, portletId, portletPreferences);
512 }
513 catch (Exception e) {
514 throw new PortletDataException(e);
515 }
516 }
517
518 @Override
519 public void setPortletId(String portletId) {
520 _portletId = portletId;
521 }
522
523 protected Element addExportDataRootElement(
524 PortletDataContext portletDataContext) {
525
526 Document document = SAXReaderUtil.createDocument();
527
528 Class<?> clazz = getClass();
529
530 Element rootElement = document.addElement(clazz.getSimpleName());
531
532 portletDataContext.setExportDataRootElement(rootElement);
533
534 return rootElement;
535 }
536
537 protected Element addImportDataRootElement(
538 PortletDataContext portletDataContext, String data)
539 throws DocumentException {
540
541 Document document = SAXReaderUtil.read(data);
542
543 Element rootElement = document.getRootElement();
544
545 portletDataContext.setImportDataRootElement(rootElement);
546
547 long groupId = GetterUtil.getLong(
548 rootElement.attributeValue("group-id"));
549
550 if (groupId != 0) {
551 portletDataContext.setSourceGroupId(groupId);
552 }
553
554 return rootElement;
555 }
556
557 protected void addUncheckedModelAdditionCount(
558 PortletDataContext portletDataContext,
559 PortletDataHandlerControl portletDataHandlerControl) {
560
561 if (!(portletDataHandlerControl instanceof PortletDataHandlerBoolean)) {
562 return;
563 }
564
565 PortletDataHandlerBoolean portletDataHandlerBoolean =
566 (PortletDataHandlerBoolean)portletDataHandlerControl;
567
568 PortletDataHandlerControl[] childPortletDataHandlerControls =
569 portletDataHandlerBoolean.getChildren();
570
571 if (childPortletDataHandlerControls != null) {
572 for (PortletDataHandlerControl childPortletDataHandlerControl :
573 childPortletDataHandlerControls) {
574
575 addUncheckedModelAdditionCount(
576 portletDataContext, childPortletDataHandlerControl);
577 }
578 }
579
580 if (Validator.isNull(portletDataHandlerControl.getClassName())) {
581 return;
582 }
583
584 boolean checkedControl = GetterUtil.getBoolean(
585 portletDataContext.getBooleanParameter(
586 portletDataHandlerControl.getNamespace(),
587 portletDataHandlerControl.getControlName(), false));
588
589 if (!checkedControl) {
590 ManifestSummary manifestSummary =
591 portletDataContext.getManifestSummary();
592
593 String manifestSummaryKey = ManifestSummary.getManifestSummaryKey(
594 portletDataHandlerControl.getClassName(),
595 portletDataHandlerBoolean.getReferrerClassName());
596
597 manifestSummary.addModelAdditionCount(manifestSummaryKey, 0);
598 }
599 }
600
601 protected PortletPreferences doDeleteData(
602 PortletDataContext portletDataContext, String portletId,
603 PortletPreferences portletPreferences)
604 throws Exception {
605
606 return portletPreferences;
607 }
608
609 protected String doExportData(
610 PortletDataContext portletDataContext, String portletId,
611 PortletPreferences portletPreferences)
612 throws Exception {
613
614 return null;
615 }
616
617 protected PortletPreferences doImportData(
618 PortletDataContext portletDataContext, String portletId,
619 PortletPreferences portletPreferences, String data)
620 throws Exception {
621
622 return null;
623 }
624
625 protected void doPrepareManifestSummary(
626 PortletDataContext portletDataContext,
627 PortletPreferences portletPreferences)
628 throws Exception {
629 }
630
631 protected PortletPreferences doProcessExportPortletPreferences(
632 PortletDataContext portletDataContext, String portletId,
633 PortletPreferences portletPreferences, Element rootElement)
634 throws Exception {
635
636 return portletPreferences;
637 }
638
639 protected PortletPreferences doProcessImportPortletPreferences(
640 PortletDataContext portletDataContext, String portletId,
641 PortletPreferences portletPreferences)
642 throws Exception {
643
644 return portletPreferences;
645 }
646
647 protected String getDisplayTemplate(
648 PortletDataContext portletDataContext, String portletId,
649 PortletPreferences portletPreferences) {
650
651 try {
652 Portlet portlet = PortletLocalServiceUtil.getPortletById(
653 portletDataContext.getCompanyId(), portletId);
654
655 if (Validator.isNotNull(portlet.getTemplateHandlerClass())) {
656 return portletPreferences.getValue("displayStyle", null);
657 }
658 }
659 catch (Exception e) {
660 }
661
662 return null;
663 }
664
665 protected long getDisplayTemplateGroupId(
666 PortletDataContext portletDataContext, String portletId,
667 PortletPreferences portletPreferences) {
668
669 try {
670 Portlet portlet = PortletLocalServiceUtil.getPortletById(
671 portletDataContext.getCompanyId(), portletId);
672
673 if (Validator.isNotNull(portlet.getTemplateHandlerClass())) {
674 return GetterUtil.getLong(
675 portletPreferences.getValue("displayStyleGroupId", null));
676 }
677 }
678 catch (Exception e) {
679 }
680
681 return 0;
682 }
683
684 protected String getExportDataRootElementString(Element rootElement) {
685 if (rootElement == null) {
686 return StringPool.BLANK;
687 }
688
689 try {
690 Document document = rootElement.getDocument();
691
692 return document.formattedString();
693 }
694 catch (IOException ioe) {
695 return StringPool.BLANK;
696 }
697 }
698
699 protected long getExportModelCount(
700 ManifestSummary manifestSummary,
701 PortletDataHandlerControl[] portletDataHandlerControls) {
702
703 long totalModelCount = -1;
704
705 for (PortletDataHandlerControl portletDataHandlerControl :
706 portletDataHandlerControls) {
707
708 long modelCount = manifestSummary.getModelAdditionCount(
709 portletDataHandlerControl.getClassName(),
710 portletDataHandlerControl.getReferrerClassName());
711
712 if (portletDataHandlerControl
713 instanceof PortletDataHandlerBoolean) {
714
715 PortletDataHandlerBoolean portletDataHandlerBoolean =
716 (PortletDataHandlerBoolean)portletDataHandlerControl;
717
718 PortletDataHandlerControl[] childPortletDataHandlerControls =
719 portletDataHandlerBoolean.getChildren();
720
721 if (childPortletDataHandlerControls != null) {
722 long childModelCount = getExportModelCount(
723 manifestSummary, childPortletDataHandlerControls);
724
725 if (childModelCount != -1) {
726 if (modelCount == -1) {
727 modelCount = childModelCount;
728 }
729 else {
730 modelCount += childModelCount;
731 }
732 }
733 }
734 }
735
736 if (modelCount == -1) {
737 continue;
738 }
739
740 if (totalModelCount == -1) {
741 totalModelCount = modelCount;
742 }
743 else {
744 totalModelCount += modelCount;
745 }
746 }
747
748 return totalModelCount;
749 }
750
751
754 protected void setAlwaysExportable(boolean alwaysExportable) {
755 }
756
757
760 protected void setAlwaysStaged(boolean alwaysStaged) {
761 }
762
763 protected void setDataLevel(DataLevel dataLevel) {
764 _dataLevel = dataLevel;
765 }
766
767 protected void setDataLocalized(boolean dataLocalized) {
768 _dataLocalized = dataLocalized;
769 }
770
771 protected void setDataPortletPreferences(String... dataPortletPreferences) {
772 _dataPortletPreferences = dataPortletPreferences;
773 }
774
775 protected void setDeletionSystemEventStagedModelTypes(
776 StagedModelType... deletionSystemEventStagedModelTypes) {
777
778 _deletionSystemEventStagedModelTypes =
779 deletionSystemEventStagedModelTypes;
780 }
781
782 protected void setExportControls(
783 PortletDataHandlerControl... exportControls) {
784
785 _exportControls = exportControls;
786
787 setImportControls(exportControls);
788 }
789
790 protected void setExportMetadataControls(
791 PortletDataHandlerControl... exportMetadataControls) {
792
793 _exportMetadataControls = exportMetadataControls;
794
795 setImportMetadataControls(exportMetadataControls);
796 }
797
798 protected void setImportControls(
799 PortletDataHandlerControl... importControls) {
800
801 _importControls = importControls;
802 }
803
804 protected void setImportMetadataControls(
805 PortletDataHandlerControl... importMetadataControls) {
806
807 _importMetadataControls = importMetadataControls;
808 }
809
810 protected void setPublishToLiveByDefault(boolean publishToLiveByDefault) {
811 _publishToLiveByDefault = publishToLiveByDefault;
812 }
813
814 protected void setSupportsDataStrategyCopyAsNew(
815 boolean supportsDataStrategyCopyAsNew) {
816
817 _supportsDataStrategyCopyAsNew = supportsDataStrategyCopyAsNew;
818 }
819
820 private static Log _log = LogFactoryUtil.getLog(
821 BasePortletDataHandler.class);
822
823 private DataLevel _dataLevel = DataLevel.SITE;
824 private boolean _dataLocalized;
825 private String[] _dataPortletPreferences = StringPool.EMPTY_ARRAY;
826 private StagedModelType[] _deletionSystemEventStagedModelTypes =
827 new StagedModelType[0];
828 private PortletDataHandlerControl[] _exportControls =
829 new PortletDataHandlerControl[0];
830 private PortletDataHandlerControl[] _exportMetadataControls =
831 new PortletDataHandlerControl[0];
832 private PortletDataHandlerControl[] _importControls =
833 new PortletDataHandlerControl[0];
834 private PortletDataHandlerControl[] _importMetadataControls =
835 new PortletDataHandlerControl[0];
836 private String _portletId;
837 private boolean _publishToLiveByDefault;
838 private boolean _supportsDataStrategyCopyAsNew = true;
839
840 }