001    /**
002     * Copyright (c) 2000-present 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.model.impl;
016    
017    import com.liferay.portal.kernel.util.UnicodeProperties;
018    import com.liferay.portal.model.Repository;
019    import com.liferay.portlet.exportimport.lar.StagedModelType;
020    
021    /**
022     * @author Alexander Chow
023     */
024    public class RepositoryImpl extends RepositoryBaseImpl {
025    
026            @Override
027            public StagedModelType getStagedModelType() {
028                    return new StagedModelType(Repository.class);
029            }
030    
031            @Override
032            public String getTypeSettings() {
033                    if (_typeSettingsProperties == null) {
034                            return super.getTypeSettings();
035                    }
036                    else {
037                            return _typeSettingsProperties.toString();
038                    }
039            }
040    
041            @Override
042            public UnicodeProperties getTypeSettingsProperties() {
043                    if (_typeSettingsProperties == null) {
044                            _typeSettingsProperties = new UnicodeProperties(true);
045    
046                            _typeSettingsProperties.fastLoad(super.getTypeSettings());
047                    }
048    
049                    return _typeSettingsProperties;
050            }
051    
052            @Override
053            public void setTypeSettings(String typeSettings) {
054                    _typeSettingsProperties = null;
055    
056                    super.setTypeSettings(typeSettings);
057            }
058    
059            @Override
060            public void setTypeSettingsProperties(
061                    UnicodeProperties typeSettingsProperties) {
062    
063                    _typeSettingsProperties = typeSettingsProperties;
064    
065                    super.setTypeSettings(_typeSettingsProperties.toString());
066            }
067    
068            private UnicodeProperties _typeSettingsProperties;
069    
070    }