1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.softwarecatalog.model.impl;
16  
17  import com.liferay.portal.kernel.exception.SystemException;
18  import com.liferay.portal.kernel.log.Log;
19  import com.liferay.portal.kernel.log.LogFactoryUtil;
20  import com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion;
21  import com.liferay.portlet.softwarecatalog.model.SCProductEntry;
22  import com.liferay.portlet.softwarecatalog.model.SCProductVersion;
23  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalServiceUtil;
24  import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalServiceUtil;
25  
26  import java.util.List;
27  
28  /**
29   * <a href="SCProductVersionImpl.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Brian Wing Shun Chan
32   */
33  public class SCProductVersionImpl
34      extends SCProductVersionModelImpl implements SCProductVersion {
35  
36      public SCProductVersionImpl() {
37      }
38  
39      public List<SCFrameworkVersion> getFrameworkVersions()
40          throws SystemException {
41  
42          return SCFrameworkVersionLocalServiceUtil.
43              getProductVersionFrameworkVersions(getProductVersionId());
44      }
45  
46      public SCProductEntry getProductEntry() {
47          SCProductEntry productEntry = null;
48  
49          try {
50              productEntry = SCProductEntryLocalServiceUtil.getProductEntry(
51                  getProductEntryId());
52          }
53          catch (Exception e) {
54              productEntry = new SCProductEntryImpl();
55  
56              _log.error(e);
57          }
58  
59          return productEntry;
60      }
61  
62      private static Log _log = LogFactoryUtil.getLog(SCProductVersionImpl.class);
63  
64  }