| JournalCreationStrategyImpl.java |
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.lar;
16
17 import com.liferay.portal.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 long getApprovalUserId(PortletDataContext context, Object journalObj)
44 throws Exception {
45
46 return JournalCreationStrategy.USE_DEFAULT_USER_ID_STRATEGY;
47 }
48
49 public String getTransformedContent(
50 PortletDataContext context, JournalArticle newArticle)
51 throws Exception {
52
53 return JournalCreationStrategy.ARTICLE_CONTENT_UNCHANGED;
54 }
55
56 public boolean addCommunityPermissions(
57 PortletDataContext context, Object journalObj)
58 throws Exception {
59
60 return true;
61 }
62
63 public boolean addGuestPermissions(
64 PortletDataContext context, Object journalObj)
65 throws Exception {
66
67 return true;
68 }
69
70 }