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.dynamicdatalists.ddm;
016    
017    import com.liferay.portal.kernel.language.LanguageUtil;
018    import com.liferay.portal.util.PortalUtil;
019    import com.liferay.portal.util.PortletKeys;
020    import com.liferay.portal.util.PropsValues;
021    import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
022    import com.liferay.portlet.dynamicdatalists.service.permission.DDLPermission;
023    import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
024    import com.liferay.portlet.dynamicdatamapping.util.BaseDDMDisplay;
025    
026    import java.util.Locale;
027    
028    /**
029     * @author Eduardo Garcia
030     */
031    public class DDLDDMDisplay extends BaseDDMDisplay {
032    
033            @Override
034            public String getPortletId() {
035                    return PortletKeys.DYNAMIC_DATA_LISTS;
036            }
037    
038            @Override
039            public String getResourceName() {
040                    return DDLPermission.RESOURCE_NAME;
041            }
042    
043            @Override
044            public String getStorageType() {
045                    return PropsValues.DYNAMIC_DATA_LISTS_STORAGE_TYPE;
046            }
047    
048            @Override
049            public String getStructureName(Locale locale) {
050                    return LanguageUtil.get(locale, "data-definition");
051            }
052    
053            @Override
054            public String getStructureType() {
055                    return DDLRecordSet.class.getName();
056            }
057    
058            @Override
059            public long getTemplateHandlerClassNameId(
060                    DDMTemplate template, long classNameId) {
061    
062                    return PortalUtil.getClassNameId(DDLRecordSet.class);
063            }
064    
065    }