001    /**
002     * Copyright (c) 2000-present 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.softwarecatalog.model.impl;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion;
020    import com.liferay.portlet.softwarecatalog.model.SCProductEntry;
021    import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalServiceUtil;
022    import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalServiceUtil;
023    
024    import java.util.List;
025    
026    /**
027     * @author Brian Wing Shun Chan
028     */
029    public class SCProductVersionImpl extends SCProductVersionBaseImpl {
030    
031            public SCProductVersionImpl() {
032            }
033    
034            @Override
035            public List<SCFrameworkVersion> getFrameworkVersions() {
036                    return SCFrameworkVersionLocalServiceUtil.
037                            getProductVersionFrameworkVersions(getProductVersionId());
038            }
039    
040            @Override
041            public SCProductEntry getProductEntry() {
042                    SCProductEntry productEntry = null;
043    
044                    try {
045                            productEntry = SCProductEntryLocalServiceUtil.getProductEntry(
046                                    getProductEntryId());
047                    }
048                    catch (Exception e) {
049                            productEntry = new SCProductEntryImpl();
050    
051                            _log.error(e);
052                    }
053    
054                    return productEntry;
055            }
056    
057            private static final Log _log = LogFactoryUtil.getLog(
058                    SCProductVersionImpl.class);
059    
060    }