001    /**
002     * Copyright (c) 2000-2013 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.dynamicdatamapping.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.util.OrderByComparator;
020    import com.liferay.portal.service.ServiceContext;
021    import com.liferay.portal.theme.ThemeDisplay;
022    import com.liferay.portlet.dynamicdatamapping.storage.Field;
023    import com.liferay.portlet.dynamicdatamapping.storage.Fields;
024    
025    import java.io.Serializable;
026    
027    /**
028     * @author Eduardo Lundgren
029     * @author Marcellus Tavares
030     */
031    public interface DDM {
032    
033            public DDMDisplay getDDMDisplay(ServiceContext serviceContext);
034    
035            public Serializable getDisplayFieldValue(
036                            ThemeDisplay themeDisplay, Serializable fieldValue, String type)
037                    throws Exception;
038    
039            public Fields getFields(
040                            long ddmStructureId, long ddmTemplateId,
041                            ServiceContext serviceContext)
042                    throws PortalException, SystemException;
043    
044            public Fields getFields(
045                            long ddmStructureId, long ddmTemplateId, String fieldNamespace,
046                            ServiceContext serviceContext)
047                    throws PortalException, SystemException;
048    
049            public Fields getFields(long ddmStructureId, ServiceContext serviceContext)
050                    throws PortalException, SystemException;
051    
052            public Fields getFields(
053                            long ddmStructureId, String fieldNamespace,
054                            ServiceContext serviceContext)
055                    throws PortalException, SystemException;
056    
057            public String[] getFieldsDisplayValues(Field fieldsDisplayField)
058                    throws Exception;
059    
060            public Serializable getIndexedFieldValue(
061                            Serializable fieldValue, String type)
062                    throws Exception;
063    
064            public OrderByComparator getStructureOrderByComparator(
065                    String orderByCol, String orderByType);
066    
067            public OrderByComparator getTemplateOrderByComparator(
068                    String orderByCol, String orderByType);
069    
070            public Fields mergeFields(Fields newFields, Fields existingFields);
071    
072    }