use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class PortalRuntimeWizard method isComplete.
@Override
public boolean isComplete() {
boolean retval = false;
final IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
if (runtime != null) {
final IStatus status = runtime.validate(null);
retval = status == null || status.getSeverity() != IStatus.ERROR;
}
return retval;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class PortalRuntimeWizard method enter.
@Override
public void enter() {
if (this.composite != null) {
final IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
this.composite.setRuntime(runtime);
}
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class LiferayRuntimeStubWizardFragment method isComplete.
public boolean isComplete() {
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
if (runtime == null) {
return false;
}
IStatus status = runtime.validate(null);
return status != null && status.getSeverity() != IStatus.ERROR;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class LiferayRuntimeStubWizardFragment method enter.
public void enter() {
if (composite != null) {
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
composite.setRuntime(runtime);
}
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class MavenModuleFragmentProjectTests method testNewModuleFragmentFileProjectValidation.
@Test
public void testNewModuleFragmentFileProjectValidation() throws Exception {
deleteAllWorkspaceProjects();
NewModuleFragmentFilesOp fop = NewModuleFragmentFilesOp.TYPE.instantiate();
Status projectValidationStatus = fop.getProjectName().validation();
assertEquals("No suitable Liferay fragment project.", projectValidationStatus.message());
NewModuleFragmentOp op = NewModuleFragmentOp.TYPE.instantiate();
final String runtimeName = "liferay-portal-7.0";
final NullProgressMonitor npm = new NullProgressMonitor();
IRuntime runtime = ServerCore.findRuntime(runtimeName);
if (runtime == null) {
final IRuntimeWorkingCopy runtimeWC = ServerCore.findRuntimeType(getRuntimeId()).createRuntime(runtimeName, npm);
runtimeWC.setName(runtimeName);
runtimeWC.setLocation(getLiferayRuntimeDir());
runtime = runtimeWC.save(true, npm);
}
assertNotNull(runtime);
List<String> bundles = ServerUtil.getModuleFileListFrom70Server(runtime);
assertNotNull(bundles);
for (String hostOsgiBundle : bundles) {
if (hostOsgiBundle.contains("com.liferay.asset.display.web")) {
op.setProjectName("test-project-validation");
op.setProjectProvider("gradle-module-fragment");
op.setLiferayRuntimeName(runtimeName);
op.setHostOsgiBundle(hostOsgiBundle);
OverrideFilePath overrideFilePath = op.getOverrideFiles().insert();
overrideFilePath.setValue("META-INF/resources/view.jsp");
Status gradleExeStatus = NewModuleFragmentOpMethods.execute(op, ProgressMonitorBridge.create(new NullProgressMonitor()));
assertTrue(gradleExeStatus.ok());
IProject existedGradleProject = CoreUtil.getProject(op.getProjectName().content());
assertNotNull(existedGradleProject);
IFile bndFile = existedGradleProject.getFile("bnd.bnd");
bndFile.delete(true, true, new NullProgressMonitor());
fop.setProjectName(op.getProjectName().content());
projectValidationStatus = fop.getProjectName().validation();
assertEquals("Can't find bnd.bnd file in the project.", projectValidationStatus.message());
}
}
}
Aggregations