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