001    /**
002     * Copyright (c) 2000-2013 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.documentlibrary.model.impl;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.kernel.language.LanguageUtil;
019    import com.liferay.portlet.documentlibrary.model.DLFileEntryTypeConstants;
020    import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
021    import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil;
022    
023    import java.util.List;
024    import java.util.Locale;
025    
026    /**
027     * @author Alexander Chow
028     * @author Mate Thurzo
029     */
030    public class DLFileEntryTypeImpl extends DLFileEntryTypeBaseImpl {
031    
032            public DLFileEntryTypeImpl() {
033            }
034    
035            @Override
036            public List<DDMStructure> getDDMStructures() throws SystemException {
037                    return DDMStructureLocalServiceUtil.getDLFileEntryTypeStructures(
038                            getFileEntryTypeId());
039            }
040    
041            @Override
042            public String getName(Locale locale) {
043                    String name = super.getName(locale);
044    
045                    if (getFileEntryTypeId() ==
046                                    DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT) {
047    
048                            name = LanguageUtil.get(locale, name);
049                    }
050    
051                    return name;
052            }
053    
054            @Override
055            public boolean isExportable() {
056                    if (getFileEntryTypeId() ==
057                                    DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT) {
058    
059                            return false;
060                    }
061    
062                    return true;
063            }
064    
065    }