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            @Override
032            public List<SCFrameworkVersion> getFrameworkVersions() {
033                    return SCFrameworkVersionLocalServiceUtil.
034                            getProductVersionFrameworkVersions(getProductVersionId());
035            }
036    
037            @Override
038            public SCProductEntry getProductEntry() {
039                    SCProductEntry productEntry = null;
040    
041                    try {
042                            productEntry = SCProductEntryLocalServiceUtil.getProductEntry(
043                                    getProductEntryId());
044                    }
045                    catch (Exception e) {
046                            productEntry = new SCProductEntryImpl();
047    
048                            _log.error(e);
049                    }
050    
051                    return productEntry;
052            }
053    
054            private static final Log _log = LogFactoryUtil.getLog(
055                    SCProductVersionImpl.class);
056    
057    }