001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.repository.proxy;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.repository.model.Folder;
020    import com.liferay.portal.security.permission.PermissionChecker;
021    import com.liferay.portlet.expando.model.ExpandoBridge;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    import java.util.List;
027    import java.util.Map;
028    
029    /**
030     * @author Mika Koivisto
031     */
032    public class FolderProxyBean
033            extends RepositoryModelProxyBean implements Folder {
034    
035            public FolderProxyBean(Folder folder, ClassLoader classLoader) {
036                    super(classLoader);
037    
038                    _folder = folder;
039            }
040    
041            @Override
042            public Object clone() {
043                    FolderProxyBean folderProxyBean = newFolderProxyBean(_folder);
044    
045                    folderProxyBean.setCompanyId(getCompanyId());
046                    folderProxyBean.setCreateDate(getCreateDate());
047                    folderProxyBean.setGroupId(getGroupId());
048                    folderProxyBean.setModifiedDate(getModifiedDate());
049                    folderProxyBean.setPrimaryKeyObj(getPrimaryKeyObj());
050                    folderProxyBean.setUserId(getUserId());
051                    folderProxyBean.setUserName(getUserName());
052    
053                    try {
054                            folderProxyBean.setUserUuid(getUserUuid());
055                    }
056                    catch (SystemException se) {
057                    }
058    
059                    folderProxyBean.setUuid(getUuid());
060    
061                    return folderProxyBean;
062            }
063    
064            public boolean containsPermission(
065                            PermissionChecker permissionChecker, String actionId)
066                    throws PortalException, SystemException {
067    
068                    return _folder.containsPermission(permissionChecker, actionId);
069            }
070    
071            public List<Long> getAncestorFolderIds()
072                    throws PortalException, SystemException {
073    
074                    return _folder.getAncestorFolderIds();
075            }
076    
077            public List<Folder> getAncestors() throws PortalException, SystemException {
078                    List<Folder> folders = _folder.getAncestors();
079    
080                    return toFolderProxyBeans(folders);
081            }
082    
083            public Map<String, Serializable> getAttributes() {
084                    return _folder.getAttributes();
085            }
086    
087            public long getCompanyId() {
088                    return _folder.getCompanyId();
089            }
090    
091            public Date getCreateDate() {
092                    return _folder.getCreateDate();
093            }
094    
095            public String getDescription() {
096                    return _folder.getDescription();
097            }
098    
099            public ExpandoBridge getExpandoBridge() {
100                    ExpandoBridge expandoBridge = _folder.getExpandoBridge();
101    
102                    return (ExpandoBridge)newProxyInstance(
103                            expandoBridge, ExpandoBridge.class);
104            }
105    
106            public long getFolderId() {
107                    return _folder.getFolderId();
108            }
109    
110            public long getGroupId() {
111                    return _folder.getGroupId();
112            }
113    
114            public Date getLastPostDate() {
115                    return _folder.getLastPostDate();
116            }
117    
118            public Object getModel() {
119                    return _folder.getModel();
120            }
121    
122            public Class<?> getModelClass() {
123                    return _folder.getModelClass();
124            }
125    
126            public String getModelClassName() {
127                    return _folder.getModelClassName();
128            }
129    
130            public Date getModifiedDate() {
131                    return _folder.getModifiedDate();
132            }
133    
134            public String getName() {
135                    return _folder.getName();
136            }
137    
138            public Folder getParentFolder() throws PortalException, SystemException {
139                    Folder folder = _folder.getParentFolder();
140    
141                    return newFolderProxyBean(folder);
142            }
143    
144            public long getParentFolderId() {
145                    return _folder.getParentFolderId();
146            }
147    
148            public long getPrimaryKey() {
149                    return _folder.getPrimaryKey();
150            }
151    
152            public Serializable getPrimaryKeyObj() {
153                    return _folder.getPrimaryKeyObj();
154            }
155    
156            public long getRepositoryId() {
157                    return _folder.getRepositoryId();
158            }
159    
160            public long getUserId() {
161                    return _folder.getUserId();
162            }
163    
164            public String getUserName() {
165                    return _folder.getUserName();
166            }
167    
168            public String getUserUuid() throws SystemException {
169                    return _folder.getUserUuid();
170            }
171    
172            public String getUuid() {
173                    return _folder.getUuid();
174            }
175    
176            public boolean hasInheritableLock() {
177                    return _folder.hasInheritableLock();
178            }
179    
180            public boolean hasLock() {
181                    return _folder.hasLock();
182            }
183    
184            public boolean isDefaultRepository() {
185                    return _folder.isDefaultRepository();
186            }
187    
188            public boolean isEscapedModel() {
189                    return _folder.isEscapedModel();
190            }
191    
192            public boolean isLocked() {
193                    return _folder.isLocked();
194            }
195    
196            public boolean isMountPoint() {
197                    return _folder.isMountPoint();
198            }
199    
200            public boolean isRoot() {
201                    return _folder.isRoot();
202            }
203    
204            public boolean isSupportsLocking() {
205                    return _folder.isSupportsLocking();
206            }
207    
208            public boolean isSupportsMetadata() {
209                    return _folder.isSupportsMetadata();
210            }
211    
212            public boolean isSupportsMultipleUpload() {
213                    return _folder.isSupportsMultipleUpload();
214            }
215    
216            public boolean isSupportsShortcuts() {
217                    return _folder.isSupportsShortcuts();
218            }
219    
220            public boolean isSupportsSocial() {
221                    return _folder.isSupportsSocial();
222            }
223    
224            public boolean isSupportsSubscribing() {
225                    return _folder.isSupportsSubscribing();
226            }
227    
228            public void setCompanyId(long companyId) {
229                    _folder.setCompanyId(companyId);
230            }
231    
232            public void setCreateDate(Date date) {
233                    _folder.setCreateDate(date);
234            }
235    
236            public void setGroupId(long groupId) {
237                    _folder.setGroupId(groupId);
238            }
239    
240            public void setModifiedDate(Date date) {
241                    _folder.setModifiedDate(date);
242            }
243    
244            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
245                    _folder.setPrimaryKeyObj(primaryKeyObj);
246            }
247    
248            public void setUserId(long userId) {
249                    _folder.setUserId(userId);
250            }
251    
252            public void setUserName(String userName) {
253                    _folder.setUserName(userName);
254            }
255    
256            public void setUserUuid(String userUuid) {
257                    _folder.setUserUuid(userUuid);
258            }
259    
260            public void setUuid(String uuid) {
261                    _folder.setUuid(uuid);
262            }
263    
264            public Folder toEscapedModel() {
265                    Folder folder = _folder.toEscapedModel();
266    
267                    return newFolderProxyBean(folder);
268            }
269    
270            public Folder toUnescapedModel() {
271                    Folder folder = _folder.toUnescapedModel();
272    
273                    return newFolderProxyBean(folder);
274            }
275    
276            private Folder _folder;
277    
278    }