001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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.OrderByComparator;
019    import com.liferay.portal.kernel.workflow.WorkflowConstants;
020    
021    /**
022     * @author Marcellus Tavares
023     */
024    public abstract class BaseDDLExporter implements DDLExporter {
025    
026            public byte[] export(long recordSetId) throws Exception {
027                    return doExport(
028                            recordSetId, WorkflowConstants.STATUS_ANY, QueryUtil.ALL_POS,
029                            QueryUtil.ALL_POS, null);
030            }
031    
032            public byte[] export(long recordSetId, int status) throws Exception {
033                    return doExport(
034                            recordSetId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
035            }
036    
037            public byte[] export(long recordSetId, int status, int start, int end)
038                    throws Exception {
039    
040                    return doExport(recordSetId, status, start, end, null);
041            }
042    
043            public byte[] export(
044                            long recordSetId, int status, int start, int end,
045                            OrderByComparator orderByComparator)
046                    throws Exception {
047    
048                    return doExport(recordSetId, status, start, end, orderByComparator);
049            }
050    
051            protected abstract byte[] doExport(
052                            long recordSetId, int status, int start, int end,
053                            OrderByComparator orderByComparator)
054                    throws Exception;
055    
056    }