use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectConfigurator method addFrameworkJarsToClasspath.
/**
* For remote and cloud projects.
*/
public void addFrameworkJarsToClasspath(final IProgressMonitor monitor) throws CoreException {
if (project.isRemote()) {
// code generation runs on the UI thread
Generator generator = new Generator(MdwPlugin.getShell());
IProject sourceProject = project.getSourceProject();
// pom.xml
JetAccess jet = getJet("osgi/remote_pom.xmljet", sourceProject, "pom.xml");
generator.createFile(jet, monitor);
// force maven refresh
addMavenNature(monitor);
} else if (project.isOsgi() || project.isWar()) {
// pom.xml is generated with project
} else if (project.isCloudProject()) {
IFolder earFolder = project.getSourceProject().getFolder(new Path("deploy/ear"));
addJarsToClasspath(project.getJavaProject(), earFolder, monitor);
IFolder earAppInfLib = earFolder.getFolder(new Path("APP-INF/lib"));
addJarsToClasspath(project.getJavaProject(), earAppInfLib, monitor);
}
IFolder libFolder = project.getSourceProject().getFolder("lib");
if (libFolder.exists())
addJarsToClasspath(project.getJavaProject(), libFolder, monitor);
IFolder webLibFolder = project.getSourceProject().getFolder(new Path("web/WEB-INF/lib"));
if (webLibFolder.exists())
addJarsToClasspath(project.getJavaProject(), webLibFolder, monitor);
J2EEComponentClasspathUpdater.getInstance().queueUpdateModule(project.getSourceProject());
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectConfigurator method getJet.
protected JetAccess getJet(String jetFile, IProject targetProject, String targetPath) {
JetConfig jetConfig = new JetConfig();
jetConfig.setModel(project);
jetConfig.setSettings(MdwPlugin.getSettings());
jetConfig.setPluginId(MdwPlugin.getPluginId());
jetConfig.setTargetFolder(targetProject.getName());
jetConfig.setTargetFile(targetPath);
jetConfig.setTemplateRelativeUri("templates/" + jetFile);
return new JetAccess(jetConfig);
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method generateWarCloudArtifacts.
public void generateWarCloudArtifacts(IProgressMonitor monitor) throws CoreException {
Generator generator = new Generator(shell);
IProject sourceProject = workflowProject.getSourceProject();
if (workflowProject.isFilePersist())
PluginUtil.createFoldersAsNeeded(sourceProject, workflowProject.getAssetFolder(), monitor);
// pom.xml
JetAccess jet;
if (workflowProject.isFilePersist()) {
String template = workflowProject.checkRequiredVersion(6, 0) ? "cloud/cloud_fs_pom.xmljet" : "cloud/55/cloud_fs_pom.xmljet";
jet = getJet(template, sourceProject, "pom.xml", null);
} else
jet = getJet("osgi/remote_pom.xmljet", sourceProject, "pom.xml", null);
generator.createFile(jet, monitor);
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method getJet.
private JetAccess getJet(String jetFile, IProject targetProject, String targetPath, IPackageFragment pkg) {
// prepare config for creating files
JetConfig jetConfig = new JetConfig();
jetConfig.setModel(workflowProject);
jetConfig.setSettings(mdwSettings);
jetConfig.setPluginId(MdwPlugin.getPluginId());
if (pkg == null)
jetConfig.setPackageName("");
else
jetConfig.setPackageName(pkg.getElementName());
jetConfig.setTargetFolder(targetProject.getName());
jetConfig.setTargetFile(targetPath);
jetConfig.setTemplateRelativeUri("templates/" + jetFile);
return new JetAccess(jetConfig);
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method generateWebArtifacts.
public void generateWebArtifacts(IProgressMonitor monitor) throws CoreException {
Generator generator = new Generator(shell);
IProject webProject = workflowProject.getWebProject();
// build.xml
JetAccess jet = getJet("web/build.xmljet", webProject, "build.xml", null);
generator.createFile(jet, monitor);
jet = getJet("web/readme.txtjet", webProject, "readme.txt", null);
generator.createFile(jet, monitor);
}
Aggregations