use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method createGitRepository.
public void createGitRepository(IProgressMonitor monitor) {
try {
File localDir = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile() + "/" + workflowProject.getName());
Repository newRepo = null;
if (workflowProject.getMdwVcsRepository().hasRemoteRepository()) {
monitor.subTask("Cloning Git repository");
VcsRepository gitRepo = workflowProject.getMdwVcsRepository();
Git.cloneRepository().setURI(gitRepo.getRepositoryUrlWithCredentials()).setDirectory(localDir).call();
} else {
newRepo = new FileRepository(new File(localDir + "/.git"));
newRepo.create();
}
// .gitignore
Generator generator = new Generator(shell);
JetAccess jet = getJet("source/.ignorejet", getProject().getSourceProject(), ".gitignore", null);
generator.createFile(jet, monitor);
} catch (Exception ex) {
PluginMessages.uiError(ex, "Create Cloud Project", workflowProject);
}
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method generateEarArtifacts.
public void generateEarArtifacts(IProgressMonitor monitor) throws CoreException {
Generator generator = new Generator(shell);
IProject earProject = workflowProject.getEarProject();
// TODO: why is this META-INF here?
earProject.getFolder("META-INF").delete(true, monitor);
// build.xml
JetAccess jet = getJet("ear/build.xmljet", earProject, "build.xml", null);
generator.createFile(jet, monitor);
// release_build.xml
jet = getJet("ear/release_build.xmljet", earProject, "release_build.xml", null);
generator.createFile(jet, monitor);
// .externalToolBuilders folder
PluginUtil.createFolder(earProject, new Path(".externalToolBuilders"), monitor);
// builder.launch
jet = getJet("ear/externalToolBuilders/builder.launchjet", earProject, ".externalToolBuilders/" + workflowProject.getSourceProjectName() + "Builder.launch", null);
generator.createFile(jet, monitor);
// ApplicationProperties.xml
if (workflowProject.checkRequiredVersion(5, 1, 8))
jet = getJet("ear/deploy/config/ApplicationPropertiesEmpty.xmljet", earProject, "deploy/config/ApplicationProperties.xml", null);
else
jet = getJet("ear/deploy/config/ApplicationProperties.xmljet", earProject, "deploy/config/ApplicationProperties.xml", null);
generator.createFile(jet, monitor);
// ApplicationCache.xml
jet = getJet("ear/deploy/config/ApplicationCache.xmljet", earProject, "deploy/config/ApplicationCache.xml", null);
generator.createFile(jet, monitor);
// deploy/env folder
PluginUtil.createFolder(earProject, new Path("deploy/env"), monitor);
// project.properties
jet = getJet("ear/deploy/env/project.propertiesjet", earProject, "deploy/env/project.properties", null);
generator.createFile(jet, monitor);
// env.properties.dev
jet = getJet("ear/deploy/env/env.properties.devjet", earProject, "deploy/env/env.properties.dev", null);
generator.createFile(jet, monitor);
// application.xml
PluginUtil.createFolder(earProject, new Path("EarContent/META-INF"), monitor);
jet = getJet("ear/EarContent/META-INF/application.xmljet", earProject, workflowProject.getEarContentFolder().getProjectRelativePath() + "/META-INF/application.xml", null);
generator.createFile(jet, monitor);
// startWebLogic.cmd.tmpl
jet = getJet("ear/deploy/config/startWebLogic.cmd.tmpljet", earProject, "deploy/config/startWebLogic.cmd.tmpl", null);
generator.createFile(jet, monitor);
// designerConfig.xml
jet = getJet("ear/deploy/config/designerConfig.xmljet", earProject, "deploy/config/designerConfig.xml", null);
generator.createFile(jet, monitor);
}
use of com.centurylink.mdw.plugin.codegen.JetAccess in project mdw-designer by CenturyLinkCloud.
the class ProjectInflator method generateSourceArtifacts.
public void generateSourceArtifacts(IProgressMonitor monitor) throws CoreException {
Generator generator = new Generator(shell);
IProject sourceProject = workflowProject.getSourceProject();
// build.xml
JetAccess jet = getJet("source/build.xmljet", sourceProject, "build.xml", null);
generator.createFile(jet, monitor);
// base .*ignore
jet = getJet("source/.ignorejet", sourceProject, ".cvsignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/.ignorejet", sourceProject, ".dmignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/.ignorejet", sourceProject, ".svnignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/.ignorejet", sourceProject, ".gitignore", null);
generator.createFile(jet, monitor);
// META-INF .*ignore
jet = getJet("source/src/META-INF/.ignorejet", sourceProject, "src/META-INF/.cvsignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/src/META-INF/.ignorejet", sourceProject, "src/META-INF/.dmignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/src/META-INF/.ignorejet", sourceProject, "src/META-INF/.svnignore", null);
generator.createFile(jet, monitor);
jet = getJet("source/src/META-INF/.ignorejet", sourceProject, "src/META-INF/.gitignore", null);
generator.createFile(jet, monitor);
if (workflowProject.isEjbSourceProject() && workflowProject.getServerSettings().isJBoss()) {
jet = getJet("source/src/META-INF/jboss.xmljet", sourceProject, "src/META-INF/jboss.xml", null);
generator.createFile(jet, monitor);
}
// baseline ejb impl
if (workflowProject.isEjbSourceProject()) {
String ejbPath = "src/" + workflowProject.getDefaultSourceCodePackagePath() + "/services";
PluginUtil.createFoldersAsNeeded(sourceProject, sourceProject.getFolder(new Path(ejbPath)), monitor);
jet = getJet("source/src/ejbs/WorkflowManager.javajet", sourceProject, ejbPath + "/" + workflowProject.getSourceProjectName() + "Manager.java", null);
generator.createFile(jet, monitor);
jet = getJet("source/src/ejbs/WorkflowManagerBean.javajet", sourceProject, ejbPath + "/" + workflowProject.getSourceProjectName() + "ManagerBean.java", null);
generator.createFile(jet, monitor);
} else {
String srcPath = "src/" + workflowProject.getDefaultSourceCodePackagePath() + "/hello";
PluginUtil.createFoldersAsNeeded(sourceProject, sourceProject.getFolder(new Path(srcPath)), monitor);
jet = getJet("source/src/pojos/Hello.javajet", sourceProject, srcPath + "/" + workflowProject.getSourceProjectName() + "Hello.java", null);
generator.createFile(jet, monitor);
}
}
Aggregations