Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.netbeans.modules.glassfish.eecommon.api.config.J2eeModuleHelper;
import org.netbeans.modules.j2ee.dd.api.common.RootInterface;
import org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException;
import org.netbeans.modules.j2ee.dd.api.ejb.EjbJar;
import org.netbeans.modules.j2ee.dd.api.web.WebApp;
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
import org.openide.filesystems.FileObject;
Expand Down Expand Up @@ -177,30 +179,10 @@ public boolean accept(File f) {
}

public static FileObject getSunDDFromProjectsModuleVersion(J2eeModule mod, String sunDDFileName) {
FileObject retVal = null;
String suffix = "-java_ee_5/";
if (null != mod) {
String modVer = mod.getModuleVersion();
J2eeModule.Type t = mod.getType();
// ejb 2.0, 2.1, 3.0, 3.1
// web 2.3, 2.4, 2.5, 3.0
// appcli 1.3, 1.4, 5.0, 6.0
// ear 1.3, 1.4, 5, 6
if (modVer.equals("6") || modVer.equals("6.0") || modVer.endsWith("1.6") || modVer.equals("3.1")) {
suffix = "-java_ee/";
} else if (modVer.equals("3.0")) {
if (J2eeModule.Type.WAR.equals(t)) {
suffix = "-java_ee/";
}
} else if (modVer.equals("1.4") || modVer.equals("2.4") || modVer.equals("2.1")) {
suffix = "-j2ee_1_4/";
} else if (modVer.equals("2.0") || modVer.equals("2.3") || modVer.equals("1.3")) {
suffix = "-j2ee_1_3/";
}
}
FileObject retVal;
String suffix = "-java_ee/";
String resource = "org-netbeans-modules-glassfish-eecommon-ddtemplates" + suffix + sunDDFileName; // NOI18N
retVal = FileUtil.getConfigFile(resource);

return retVal;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public final class SunDDVisualPanel extends JPanel {
private String sunDDFileName;
private File sunDDFile;
private File sunDDLocation;
private static final String STANDARD_DD_NAME = "web.xml";

public SunDDVisualPanel() {
initComponents();
Expand All @@ -58,10 +59,10 @@ void setProject(final Project project) {
J2eeModule j2eeModule = provider.getJ2eeModule();
sunDDFileName = getConfigFileName(j2eeModule,provider.getServerInstanceID());

// Calculate location:
sunDDFile = (sunDDFileName != null) ? j2eeModule.getDeploymentConfigurationFile(sunDDFileName) : null;
sunDDLocation = (sunDDFile != null) ? sunDDFile.getParentFile() : null;
// Calculate location:
sunDDLocation = j2eeModule.getDeploymentConfigurationFile(STANDARD_DD_NAME).getParentFile();
sunDDFile = (sunDDFileName != null) ? new File(sunDDLocation, sunDDFileName) : null;

// initialize visual components
textFileName.setText(sunDDFileName); // NOI18N
textProjectName.setText(ProjectUtils.getInformation(project).getDisplayName());
Expand Down