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.publish.shared;
029
030import java.util.List;
031import java.util.Map;
032
033import com.google.gwt.user.client.rpc.IsSerializable;
034
035/**
036 * A bean that contains both publish options and a map of projects.<p>
037 *
038 * @since 8.0
039 */
040public class CmsPublishData implements IsSerializable {
041
042    /** Name of the used dictionary. */
043    public static final String DICT_NAME = "org_opencms_ade_publish";
044
045    /** The close link. */
046    private String m_closeLink;
047
048    /** The publish group list. */
049    private CmsPublishGroupList m_groups;
050
051    /** The publish options. */
052    private CmsPublishOptions m_options;
053
054    /** The list of projects. */
055    private List<CmsProjectBean> m_projects;
056
057    /** The currently selected workflow. */
058    private String m_selectedWorkflowId;
059
060    /** Flag which controls whether the confirmation dialog should be shown before returning to the workplace. */
061    private boolean m_showConfirmation;
062
063    /** The available work flow actions. */
064    private Map<String, CmsWorkflow> m_workflows;
065
066    /**
067     * Creates a new instance.<p>
068     *
069     * @param options the publish options
070     * @param projects the map of projects
071     * @param groups the publish groups
072     * @param workflows the available work flows
073     * @param selectedWorkflowId the selected workflow id
074     */
075    public CmsPublishData(
076        CmsPublishOptions options,
077        List<CmsProjectBean> projects,
078        CmsPublishGroupList groups,
079        Map<String, CmsWorkflow> workflows,
080        String selectedWorkflowId) {
081
082        m_options = options;
083        m_projects = projects;
084        m_groups = groups;
085        m_workflows = workflows;
086        m_selectedWorkflowId = selectedWorkflowId;
087    }
088
089    /**
090     * For serialization.<p>
091     */
092    protected CmsPublishData() {
093
094        // for serialization
095    }
096
097    /**
098     * Gets the close link to open when the dialog is finished.<p>
099     *
100     * @return the close link
101     */
102    public String getCloseLink() {
103
104        return m_closeLink;
105    }
106
107    /**
108     * Returns the publish groups.<p>
109     *
110     * @return the publish groups
111     */
112    public CmsPublishGroupList getGroups() {
113
114        return m_groups;
115    }
116
117    /**
118     * Returns the publish options.<p>
119     *
120     * @return the publish options
121     */
122    public CmsPublishOptions getOptions() {
123
124        return m_options;
125    }
126
127    /**
128     * Returns the list of projects.<p>
129     *
130     * @return the list of projects
131     */
132    public List<CmsProjectBean> getProjects() {
133
134        return m_projects;
135    }
136
137    /**
138     * Returns the selected workflow.<p>
139     *
140     * @return the selected workflow
141     */
142    public String getSelectedWorkflowId() {
143
144        return m_selectedWorkflowId;
145    }
146
147    /**
148     * Returns the available work flow actions.<p>
149     *
150     * @return the available work flow actions
151     */
152    public Map<String, CmsWorkflow> getWorkflows() {
153
154        return m_workflows;
155    }
156
157    /**
158     * Returns true if the confirmation dialog should be shown before returning to the workplace.<p>
159     *
160     * @return true if the confirmation dialog is enabled
161     */
162    public boolean isShowConfirmation() {
163
164        return m_showConfirmation;
165    }
166
167    /**
168     * Sets the close link.<p>
169     *
170     * @param closeLink the close link
171     */
172    public void setCloseLink(String closeLink) {
173
174        m_closeLink = closeLink;
175
176    }
177
178    /**
179     * Enables or disables showing the confirmation dialog before returning to the workplace.<p>
180     *
181     * @param confirm true if the confirmation dialog should be shown
182     */
183    public void setShowConfirmation(boolean confirm) {
184
185        m_showConfirmation = confirm;
186    }
187}