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.journal.model.impl;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.kernel.util.PropsKeys;
20  import com.liferay.portal.model.Image;
21  import com.liferay.portal.service.ImageLocalServiceUtil;
22  import com.liferay.portal.util.PropsUtil;
23  import com.liferay.portlet.journal.model.JournalTemplate;
24  
25  /**
26   * <a href="JournalTemplateImpl.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   */
30  public class JournalTemplateImpl
31      extends JournalTemplateModelImpl implements JournalTemplate {
32  
33      public static final String LANG_TYPE_CSS = "css";
34  
35      public static final String LANG_TYPE_VM = "vm";
36  
37      public static final String LANG_TYPE_XSL = "xsl";
38  
39      public static final String[] LANG_TYPES = PropsUtil.getArray(
40          PropsKeys.JOURNAL_TEMPLATE_LANGUAGE_TYPES);
41  
42      public JournalTemplateImpl() {
43      }
44  
45      public String getSmallImageType() throws PortalException, SystemException {
46          if (_smallImageType == null && isSmallImage()) {
47              Image smallImage =  ImageLocalServiceUtil.getImage(
48                  getSmallImageId());
49  
50              _smallImageType = smallImage.getType();
51          }
52  
53          return _smallImageType;
54      }
55  
56      public void setSmallImageType(String smallImageType) {
57          _smallImageType = smallImageType;
58      }
59  
60      private String _smallImageType;
61  
62  }