Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: 560587f6e451e49124e5a743bdca72df4225dfb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*******************************************************************************
 * Copyright (c) 2003, 2004, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.application.internal.operations;

import org.eclipse.jst.j2ee.internal.archive.operations.AppClientComponentExportOperation;
import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler;
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;


public class AppClientComponentExportDataModelProvider extends J2EEComponentExportDataModelProvider {

    public AppClientComponentExportDataModelProvider() {
        super();
    }

    public IDataModelOperation getDefaultOperation() {
        return new AppClientComponentExportOperation(model);
    }

    protected String getModuleExtension() {
        return ".jar"; //$NON-NLS-1$
    }

    protected String getWrongComponentTypeString(String projectName) {
        return EARCreationResourceHandler.getString(EARCreationResourceHandler.NOT_AN_APP_CLIENT, new Object[]{projectName});
    }

    protected String getProjectType() {
        return J2EEProjectUtilities.APPLICATION_CLIENT;
    }
    /**
     * Exports the specified Application Client Module project to the specified Application Client
     * Jar file.
     * 
     * @param appClientProjectName
     *            The name of the Application Client Module project to export.
     * @param appClientJarFileName
     *            The fully qualified Application Client Jar file location to export the specified
     *            Application Client Module project.
     * @param overwriteExisting
     *            If this is <code>true</code> then an existing file at the location specified by
     *            <code>earFileName</code> will be overwritten.
     * @param exportSource
     *            If this is <code>true</code> then all source files in the specified Application
     *            Client Module will be included in the resulting Application Client Jar file.
     * @plannedfor WTP 1.0
     */
//    public static void exportProject(String appClientProjectName, String appClientJarFileName, boolean overwriteExisting, boolean exportSource) {
//        AppClientModuleExportDataModel dataModel = new AppClientModuleExportDataModel();
//        dataModel.setProperty(PROJECT_NAME, appClientProjectName);
//        dataModel.setBooleanProperty(OVERWRITE_EXISTING, overwriteExisting);
//        dataModel.setProperty(ARCHIVE_DESTINATION, appClientJarFileName);
//        dataModel.setBooleanProperty(EXPORT_SOURCE_FILES, exportSource);
//        try {
//            dataModel.getDefaultOperation().run(null);
//        } catch (InvocationTargetException e) {
//            Logger.getLogger().logError(e);
//        } catch (InterruptedException e) {
//            Logger.getLogger().logError(e);
//        }
//    }
}

Back to the top