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 public byte[] export(long recordSetId) throws Exception {
031 return doExport(
032 recordSetId, WorkflowConstants.STATUS_ANY, QueryUtil.ALL_POS,
033 QueryUtil.ALL_POS, null);
034 }
035
036 public byte[] export(long recordSetId, int status) throws Exception {
037 return doExport(
038 recordSetId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
039 }
040
041 public byte[] export(long recordSetId, int status, int start, int end)
042 throws Exception {
043
044 return doExport(recordSetId, status, start, end, null);
045 }
046
047 public byte[] export(
048 long recordSetId, int status, int start, int end,
049 OrderByComparator orderByComparator)
050 throws Exception {
051
052 return doExport(recordSetId, status, start, end, orderByComparator);
053 }
054
055 public Locale getLocale() {
056 if (_locale == null) {
057 _locale = LocaleUtil.getDefault();
058 }
059
060 return _locale;
061 }
062
063 public void setLocale(Locale locale) {
064 _locale = locale;
065 }
066
067 protected abstract byte[] doExport(
068 long recordSetId, int status, int start, int end,
069 OrderByComparator orderByComparator)
070 throws Exception;
071
072 private Locale _locale;
073
074 }