1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.lar;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.zip.ZipReader;
28  import com.liferay.portal.kernel.zip.ZipWriter;
29  
30  import java.io.Serializable;
31  
32  import java.util.List;
33  import java.util.Map;
34  import java.util.Set;
35  
36  /**
37   * <a href="PortletDataContext.java.html"><b><i>View Source</i></b></a>
38   *
39   * <p>
40   * Holds context information that is used during exporting adn importing portlet
41   * data.
42   * </p>
43   *
44   * @author Brian Wing Shun Chan
45   * @author Raymond Augé
46   *
47   */
48  public interface PortletDataContext extends Serializable {
49  
50      public long getCompanyId();
51  
52      public long getGroupId();
53  
54      public long getPlid();
55  
56      public void setPlid(long plid);
57  
58      public Map getParameterMap();
59  
60      public boolean getBooleanParameter(String namespace, String name);
61  
62      public Set getPrimaryKeys();
63  
64      public boolean addPrimaryKey(Class<?> classObj, Object primaryKey);
65  
66      public boolean hasPrimaryKey(Class<?> classObj, Object primaryKey);
67  
68      public Map getNewPrimaryKeysMap(Class<?> classObj);
69  
70      public Map getComments();
71  
72      public void addComments(Class<?> classObj, Object primaryKey)
73          throws PortalException, SystemException;
74  
75      public void addComments(String className, Object primaryKey, List messages)
76          throws PortalException, SystemException;
77  
78      public void importComments(
79              Class<?> classObj, Object primaryKey, Object newPrimaryKey,
80              long groupId)
81          throws PortalException, SystemException;
82  
83      public Map getRatingsEntries();
84  
85      public void addRatingsEntries(Class<?> classObj, Object primaryKey)
86          throws PortalException, SystemException;
87  
88      public void addRatingsEntries(
89              String className, Object primaryKey, List entries)
90          throws PortalException, SystemException;
91  
92      public void importRatingsEntries(
93              Class<?> classObj, Object primaryKey, Object newPrimaryKey)
94          throws PortalException, SystemException;
95  
96      public String[] getTagsEntries(Class<?> classObj, Object primaryKey);
97  
98      public String[] getTagsEntries(String className, Object primaryKey);
99  
100     public Map<String, String[]> getTagsEntries();
101 
102     public void addTagsEntries(Class<?> classObj, Object classPK)
103         throws PortalException, SystemException;
104 
105     public void addTagsEntries(
106             String className, Object classPK, String[] values)
107         throws PortalException, SystemException;
108 
109     public String getDataStrategy();
110 
111     public UserIdStrategy getUserIdStrategy() throws SystemException;
112 
113     public long getUserId(String userUuid) throws SystemException;
114 
115     public ZipReader getZipReader();
116 
117     public ZipWriter getZipWriter();
118 
119 }