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.portlet.layoutsadmin.lar;
016    
017    import com.liferay.portal.kernel.lar.StagedModelType;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.portal.model.StagedModel;
020    import com.liferay.portal.model.Theme;
021    import com.liferay.portal.model.impl.ThemeImpl;
022    import com.liferay.portal.security.auth.CompanyThreadLocal;
023    import com.liferay.portlet.expando.model.ExpandoBridge;
024    
025    import java.io.Serializable;
026    
027    import java.util.Date;
028    
029    /**
030     * @author Mate Thurzo
031     */
032    public class StagedTheme extends ThemeImpl implements StagedModel {
033    
034            public StagedTheme(Theme theme) {
035                    super(theme.getThemeId());
036            }
037    
038            @Override
039            public Object clone() {
040                    ThemeImpl themeImpl = new ThemeImpl(getThemeId());
041    
042                    return new StagedTheme(themeImpl);
043            }
044    
045            @Override
046            public long getCompanyId() {
047                    return CompanyThreadLocal.getCompanyId();
048            }
049    
050            @Override
051            public Date getCreateDate() {
052                    return new Date();
053            }
054    
055            @Override
056            public ExpandoBridge getExpandoBridge() {
057                    return null;
058            }
059    
060            @Override
061            public Class<?> getModelClass() {
062                    return StagedTheme.class;
063            }
064    
065            @Override
066            public String getModelClassName() {
067                    return StagedTheme.class.getName();
068            }
069    
070            @Override
071            public Date getModifiedDate() {
072                    return new Date();
073            }
074    
075            @Override
076            public Serializable getPrimaryKeyObj() {
077                    return getThemeId();
078            }
079    
080            @Override
081            public StagedModelType getStagedModelType() {
082                    return new StagedModelType(StagedTheme.class);
083            }
084    
085            @Override
086            public String getUuid() {
087                    return StringPool.BLANK;
088            }
089    
090            @Override
091            public void setCompanyId(long companyId) {
092                    throw new UnsupportedOperationException();
093            }
094    
095            @Override
096            public void setCreateDate(Date date) {
097                    throw new UnsupportedOperationException();
098            }
099    
100            @Override
101            public void setModifiedDate(Date date) {
102                    throw new UnsupportedOperationException();
103            }
104    
105            @Override
106            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
107                    throw new UnsupportedOperationException();
108            }
109    
110            @Override
111            public void setUuid(String uuid) {
112                    throw new UnsupportedOperationException();
113            }
114    
115    }