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.portal.lar;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.kernel.zip.ZipReader;
20  import com.liferay.portal.kernel.zip.ZipWriter;
21  import com.liferay.portlet.messageboards.model.MBMessage;
22  import com.liferay.portlet.ratings.model.RatingsEntry;
23  
24  import java.io.InputStream;
25  import java.io.Serializable;
26  
27  import java.util.Date;
28  import java.util.List;
29  import java.util.Map;
30  import java.util.Set;
31  
32  /**
33   * <a href="PortletDataContext.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * Holds context information that is used during exporting and importing portlet
37   * data.
38   * </p>
39   *
40   * @author Brian Wing Shun Chan
41   * @author Raymond Augé
42   */
43  public interface PortletDataContext extends Serializable {
44  
45      public static final String ROOT_PATH_GROUPS = "/groups/";
46  
47      public static final String ROOT_PATH_LAYOUTS = "/layouts/";
48  
49      public static final String ROOT_PATH_PORTLETS = "/portlets/";
50  
51      public void addComments(Class<?> classObj, long classPK)
52          throws SystemException;
53  
54      public void addComments(
55          String className, long classPK, List<MBMessage> messages);
56  
57      public boolean addPrimaryKey(Class<?> classObj, String primaryKey);
58  
59      public void addRatingsEntries(Class<?> classObj, long classPK)
60          throws SystemException;
61  
62      public void addRatingsEntries(
63          String className, long classPK, List<RatingsEntry> entries);
64  
65      public void addTagsEntries(Class<?> classObj, long classPK)
66          throws SystemException;
67  
68      public void addTagsEntries(String className, long classPK, String[] values);
69  
70      public void addZipEntry(String path, byte[] bytes) throws SystemException;
71  
72      public void addZipEntry(String path, InputStream is) throws SystemException;
73  
74      public void addZipEntry(String path, Object object) throws SystemException;
75  
76      public void addZipEntry(String path, String s) throws SystemException;
77  
78      public void addZipEntry(String name, StringBuilder sb)
79          throws SystemException;
80  
81      public Object fromXML(byte[] bytes);
82  
83      public Object fromXML(String xml);
84  
85      public boolean getBooleanParameter(String namespace, String name);
86  
87      public ClassLoader getClassLoader();
88  
89      public Map<String, List<MBMessage>> getComments();
90  
91      public long getCompanyId();
92  
93      public String getDataStrategy();
94  
95      public Date getEndDate();
96  
97      public long getGroupId();
98  
99      public long getImportGroupId();
100 
101     public String getImportLayoutPath(long layoutId);
102 
103     public String getImportPortletPath(String portletId);
104 
105     public String getImportRootPath();
106 
107     public String getLayoutPath(long layoutId);
108 
109     public Map<?, ?> getNewPrimaryKeysMap(Class<?> classObj);
110 
111     public long getOldPlid();
112 
113     public Map<String, String[]> getParameterMap();
114 
115     public long getPlid();
116 
117     public String getPortletPath(String portletId);
118 
119     public Set<String> getPrimaryKeys();
120 
121     public Map<String, List<RatingsEntry>> getRatingsEntries();
122 
123     public String getRootPath();
124 
125     public Date getStartDate();
126 
127     public Map<String, String[]> getTagsEntries();
128 
129     public String[] getTagsEntries(Class<?> classObj, long classPK);
130 
131     public String[] getTagsEntries(String className, long classPK);
132 
133     public long getUserId(String userUuid) throws SystemException;
134 
135     public UserIdStrategy getUserIdStrategy() throws SystemException;
136 
137     public List<String> getZipEntries();
138 
139     public byte[] getZipEntryAsByteArray(String path);
140 
141     public InputStream getZipEntryAsInputStream(String path);
142 
143     public Object getZipEntryAsObject(String path);
144 
145     public String getZipEntryAsString(String path);
146 
147     public List<String> getZipFolderEntries();
148 
149     public List<String> getZipFolderEntries(String path);
150 
151     public ZipReader getZipReader();
152 
153     public ZipWriter getZipWriter();
154 
155     public boolean hasDateRange();
156 
157     public boolean hasNotUniquePerLayout(String portletId);
158 
159     public boolean hasPrimaryKey(Class<?> classObj, String primaryKey);
160 
161     public void importComments(
162             Class<?> classObj, long classPK, long newClassPK, long groupId)
163         throws PortalException, SystemException;
164 
165     public void importRatingsEntries(
166             Class<?> classObj, long classPK, long newClassPK)
167         throws PortalException, SystemException;
168 
169     public boolean isPathNotProcessed(String path);
170 
171     public boolean isWithinDateRange(Date modifiedDate);
172 
173     public void putNotUniquePerLayout(String portletId);
174 
175     public void setClassLoader(ClassLoader classLoader);
176 
177     public void setImportGroupId(long importGroupId);
178 
179     public void setOldPlid(long oldPlid);
180 
181     public void setPlid(long plid);
182 
183     public String toXML(Object object);
184 
185 }