| JournalCreationStrategyImpl.java |
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.journal.lar;
16
17 import com.liferay.portal.kernel.lar.PortletDataContext;
18 import com.liferay.portlet.journal.model.JournalArticle;
19
20 /**
21 * <a href="JournalCreationStrategyImpl.java.html"><b><i>View Source</i></b></a>
22 *
23 * <p>
24 * Provides the strategy for creating new content when new Journal content is
25 * imported into a layout set from a LAR. The default strategy implemented by
26 * this class is to return zero for the author and approval user ids, which
27 * causes the default user id import strategy to be used. Content will be added
28 * as is with no transformations.
29 * </p>
30 *
31 * @author Joel Kozikowski
32 * @see com.liferay.portlet.journal.lar.JournalContentPortletDataHandlerImpl
33 * @see com.liferay.portlet.journal.lar.JournalPortletDataHandlerImpl
34 */
35 public class JournalCreationStrategyImpl implements JournalCreationStrategy {
36
37 public long getAuthorUserId(PortletDataContext context, Object journalObj)
38 throws Exception {
39
40 return JournalCreationStrategy.USE_DEFAULT_USER_ID_STRATEGY;
41 }
42
43 public String getTransformedContent(
44 PortletDataContext context, JournalArticle newArticle)
45 throws Exception {
46
47 return JournalCreationStrategy.ARTICLE_CONTENT_UNCHANGED;
48 }
49
50 public boolean addCommunityPermissions(
51 PortletDataContext context, Object journalObj)
52 throws Exception {
53
54 return true;
55 }
56
57 public boolean addGuestPermissions(
58 PortletDataContext context, Object journalObj)
59 throws Exception {
60
61 return true;
62 }
63
64 }