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.ui.apps.dbmanager;
029
030import org.opencms.report.A_CmsReportThread;
031import org.opencms.ui.CmsVaadinUtils;
032import org.opencms.ui.apps.Messages;
033import org.opencms.workplace.threads.CmsDatabaseImportThread;
034
035import com.vaadin.ui.Button;
036import com.vaadin.v7.ui.CheckBox;
037import com.vaadin.v7.ui.ComboBox;
038
039/**
040 * Class for the import from server option.<p>
041 */
042public class CmsDbImportServer extends A_CmsServerImportForm {
043
044    /**Vaadin serial id.*/
045    private static final long serialVersionUID = -1489144623755018754L;
046
047    /**vaadin component.*/
048    private CheckBox m_keepPermissions;
049
050    /**vaadin component.*/
051    private ComboBox m_moduleSelect;
052
053    /**vaadin component.*/
054    private Button m_ok;
055
056    /**vaadin component.*/
057    private ComboBox m_siteSelect;
058
059    /**vaadin component.*/
060    private ComboBox m_projectSelect;
061
062    /**
063     * Public constructor.<p>
064     *
065     * @param app which calls the form
066     */
067    public CmsDbImportServer(I_CmsReportApp app) {
068
069        super(app, "packages", false);
070
071    }
072
073    /**
074     * @see org.opencms.ui.apps.dbmanager.A_CmsServerImportForm#getImportSelect()
075     */
076    @Override
077    public ComboBox getImportSelect() {
078
079        return m_moduleSelect;
080    }
081
082    /**
083     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getThread()
084     */
085    @Override
086    public A_CmsReportThread getThread() {
087
088        return new CmsDatabaseImportThread(
089            getCmsObject(),
090            m_importFile.getPath(),
091            m_keepPermissions.getValue().booleanValue());
092    }
093
094    /**
095     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getCancelButton()
096     */
097    @Override
098    protected Button getCancelButton() {
099
100        return null;
101    }
102
103    /**
104     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getOkButton()
105     */
106    @Override
107    protected Button getOkButton() {
108
109        return m_ok;
110    }
111
112    @Override
113    protected ComboBox getProjectSelector() {
114
115        return m_projectSelect;
116    }
117
118    /**
119     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getReportPath()
120     */
121    @Override
122    protected String getReportPath() {
123
124        return CmsDbImportApp.PATH_REPORT_SERVER;
125    }
126
127    /**
128     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getSiteSelector()
129     */
130    @Override
131    protected ComboBox getSiteSelector() {
132
133        return m_siteSelect;
134    }
135
136    /**
137     * @see org.opencms.ui.apps.dbmanager.A_CmsImportForm#getTitle()
138     */
139    @Override
140    protected String getTitle() {
141
142        return CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_IMPORTSERVER_ADMIN_TOOL_NAME_0);
143    }
144}