use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.
the class ModuleFragmentProjectGroupIdValidationService method compute.
@Override
protected Status compute() {
NewModuleFragmentOp op = _op();
NewLiferayProjectProvider<BaseModuleOp> provider = op.getProjectProvider().content(true);
if ("maven-module-fragment".equals(provider.getShortName())) {
Value<String> groupIdValue = _op().getGroupId();
String groupId = groupIdValue.content(true);
IStatus javaStatus = JavaConventions.validatePackageName(groupId, CompilerOptions.VERSION_1_7, CompilerOptions.VERSION_1_7);
if (!javaStatus.isOK()) {
return StatusBridge.create(javaStatus);
}
}
return Status.createOkStatus();
}
use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.
the class BaseProjectWizard method init.
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
if (selection != null) {
Object element = selection.getFirstElement();
if (element instanceof IResource) {
IResource resource = (IResource) element;
final IPath location = resource.getProject().getLocation();
if (location != null) {
((BaseModuleOp) element()).setInitialSelectionPath(PathBridge.create(location));
}
}
}
}
use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.
the class NewLiferayJSFModuleProjectOpMethods method execute.
public static final Status execute(NewLiferayJSFModuleProjectOp op, ProgressMonitor pm) {
IProgressMonitor monitor = ProgressMonitorBridge.create(pm);
monitor.beginTask("Creating Liferay JSF project (this process may take several minutes)", 100);
Status retval = null;
try {
NewLiferayProjectProvider<BaseModuleOp> projectProvider = op.getProjectProvider().content();
IStatus status = projectProvider.createNewProject(op, monitor);
retval = StatusBridge.create(status);
if (retval.ok()) {
_updateBuildPrefs(op);
}
} catch (Exception e) {
String msg = "Error creating Liferay module project.";
ProjectCore.logError(msg, e);
return Status.createErrorStatus(msg + " " + e.getMessage(), e);
}
return retval;
}
use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.
the class NewModuleFragmentOpMethods method getMavenParentPomGroupId.
public static String getMavenParentPomGroupId(NewModuleFragmentOp op, String projectName, IPath path) {
String retval = null;
File parentProjectDir = path.toFile();
NewLiferayProjectProvider<BaseModuleOp> provider = op.getProjectProvider().content();
IStatus locationStatus = provider.validateProjectLocation(projectName, path);
if (locationStatus.isOK() && FileUtil.hasChildren(parentProjectDir)) {
List<String> groupIds = provider.getData("parentGroupId", String.class, parentProjectDir);
if (ListUtil.isNotEmpty(groupIds)) {
retval = groupIds.get(0);
}
}
return retval;
}
use of com.liferay.ide.project.core.modules.BaseModuleOp in project liferay-ide by liferay.
the class NewModuleFragmentOpMethods method getMavenParentPomVersion.
public static String getMavenParentPomVersion(NewModuleFragmentOp op, String projectName, IPath path) {
String retval = null;
File parentProjectDir = path.toFile();
NewLiferayProjectProvider<BaseModuleOp> provider = op.getProjectProvider().content();
IStatus locationStatus = provider.validateProjectLocation(projectName, path);
if (locationStatus.isOK() && FileUtil.hasChildren(parentProjectDir)) {
List<String> versions = provider.getData("parentVersion", String.class, parentProjectDir);
if (ListUtil.isNotEmpty(versions)) {
retval = versions.get(0);
}
}
return retval;
}
Aggregations