001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ade.postupload.shared;
029
030import org.opencms.util.CmsUUID;
031
032import java.util.HashMap;
033import java.util.Map;
034
035import com.google.gwt.user.client.rpc.IsSerializable;
036
037/**
038 * Runtime data bean for prefetching.<p>
039 *
040 * @since 8.0.0
041 */
042public class CmsPostUploadDialogBean implements IsSerializable {
043
044    /** Name of the used js variable. */
045    public static final String DICT_NAME = "postupload_dialog";
046
047    /**
048     * A map of the resources for which the properties should be edited, with the structure ids as keys and the resource
049     * paths as values.
050     */
051    private Map<CmsUUID, String> m_resources = new HashMap<CmsUUID, String>();
052
053    /** Flag which controls whether the property configurations should be used. */
054    private boolean m_useConfiguration;
055
056    /** Flag to control if configured basic properties should be shown. */
057    private boolean m_addBasicProperties;
058
059    /**
060     * Default constructor for serialization.<p>
061     */
062    public CmsPostUploadDialogBean() {
063
064        // default constructor for serialization
065    }
066
067    /**
068     * Creates a new instance.<p>
069     *
070     * @param resources the map of resources for which the properties should be uploaded
071     */
072    public CmsPostUploadDialogBean(Map<CmsUUID, String> resources) {
073
074        m_resources.putAll(resources);
075    }
076
077    /**
078     * Returns the list of resource paths.<p>
079     *
080     * @return the list of resource paths
081     */
082    public Map<CmsUUID, String> getResources() {
083
084        return m_resources;
085    }
086
087    /**
088     * Returns true if the basic properties configured for the sitemap should be shown.
089     * @return true if the basic properties configured for the sitemap should be shown.
090     */
091    public boolean isAddBasicProperties() {
092
093        return m_addBasicProperties;
094    }
095
096    /**
097     * Returns true if the property configurations should be used.<p>
098     *
099     * @return true if the property configurations should be used
100     */
101    public boolean isUsePropertyConfiguration() {
102
103        return m_useConfiguration;
104
105    }
106
107    /**
108     * Set a flag, indicating if basic properties as configured in the sitemap are merged into the
109     * properties shown on file upload.
110     *
111     * @param addBasicProperties flag, indicating if basic properties as configured in the sitemap should be added
112     */
113    public void setAddBasicProperties(final boolean addBasicProperties) {
114
115        m_addBasicProperties = addBasicProperties;
116    }
117
118    /**
119     * Sets the map of resources for which the properties should be uploaded.<p>
120     *
121     * @param resources the map of resources for which the properties should be uploaded
122     */
123    public void setResources(Map<CmsUUID, String> resources) {
124
125        m_resources = resources;
126    }
127
128    /**
129     * Enables/disables use of the property configuration.<p>
130     *
131     * @param useConfiguration true if the property configuration should be used
132     */
133    public void setUsePropertyConfiguration(boolean useConfiguration) {
134
135        m_useConfiguration = useConfiguration;
136    }
137
138}