001
014
015 package com.liferay.portlet.dynamicdatalists.util;
016
017 import com.liferay.portal.kernel.dao.orm.QueryUtil;
018 import com.liferay.portal.kernel.util.LocaleUtil;
019 import com.liferay.portal.kernel.util.OrderByComparator;
020 import com.liferay.portal.kernel.workflow.WorkflowConstants;
021
022 import java.util.Locale;
023
024
028 public abstract class BaseDDLExporter implements DDLExporter {
029
030 @Override
031 public byte[] export(long recordSetId) throws Exception {
032 return doExport(
033 recordSetId, WorkflowConstants.STATUS_ANY, QueryUtil.ALL_POS,
034 QueryUtil.ALL_POS, null);
035 }
036
037 @Override
038 public byte[] export(long recordSetId, int status) throws Exception {
039 return doExport(
040 recordSetId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
041 }
042
043 @Override
044 public byte[] export(long recordSetId, int status, int start, int end)
045 throws Exception {
046
047 return doExport(recordSetId, status, start, end, null);
048 }
049
050 @Override
051 public byte[] export(
052 long recordSetId, int status, int start, int end,
053 OrderByComparator orderByComparator)
054 throws Exception {
055
056 return doExport(recordSetId, status, start, end, orderByComparator);
057 }
058
059 @Override
060 public Locale getLocale() {
061 if (_locale == null) {
062 _locale = LocaleUtil.getDefault();
063 }
064
065 return _locale;
066 }
067
068 @Override
069 public void setLocale(Locale locale) {
070 _locale = locale;
071 }
072
073 protected abstract byte[] doExport(
074 long recordSetId, int status, int start, int end,
075 OrderByComparator orderByComparator)
076 throws Exception;
077
078 private Locale _locale;
079
080 }