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