1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.softwarecatalog.model.impl;
16  
17  import com.liferay.portal.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  }