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.wiki.asset;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.SystemException;
19  import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
20  import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
21  import com.liferay.portlet.asset.model.AssetRenderer;
22  import com.liferay.portlet.asset.model.BaseAssetRendererFactory;
23  import com.liferay.portlet.wiki.model.WikiPage;
24  import com.liferay.portlet.wiki.service.WikiPageLocalServiceUtil;
25  
26  import javax.portlet.PortletURL;
27  
28  /**
29   * <a href="WikiPageAssetRendererFactory.java.html"><b><i>View Source</i></b>
30   * </a>
31   *
32   * @author Julio Camarero
33   */
34  public class WikiPageAssetRendererFactory extends BaseAssetRendererFactory {
35  
36      public static final String CLASS_NAME = WikiPage.class.getName();
37  
38      public static final String TYPE = "wiki";
39  
40      public AssetRenderer getAssetRenderer(long classPK)
41          throws PortalException, SystemException {
42  
43          WikiPage page = WikiPageLocalServiceUtil.getPage(classPK);
44  
45          return new WikiPageAssetRenderer(page);
46      }
47  
48      public String getClassName() {
49          return CLASS_NAME;
50      }
51  
52      public String getType() {
53          return TYPE;
54      }
55  
56      public PortletURL getURLAdd(
57          LiferayPortletRequest liferayPortletRequest,
58          LiferayPortletResponse liferayPortletResponse) {
59  
60          return null;
61      }
62  
63  }