use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayProfileIdDefaultValueService method compute.
@Override
protected String compute() {
NewLiferayProfile profile = _newLiferayProfile();
String defaultRuntimeName = profile.getRuntimeName().content();
/*
* First try to use this as a runtimeName, but need to check it against existing possible values.
* If no existing profiles with this name exist, use it, if not, append a (1)
*/
String data = defaultRuntimeName;
if (data.equals("<None>")) {
return StringPool.EMPTY;
}
data = data.replaceAll(StringPool.SPACE, StringPool.DASH);
NewLiferayPluginProjectOp op = profile.nearest(NewLiferayPluginProjectOp.class);
Set<String> possibleValues = NewLiferayPluginProjectOpMethods.getPossibleProfileIds(op, false);
while (possibleValues.contains(data)) {
try {
data = _nextSuffix(data);
} catch (Exception e) {
}
}
return data;
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class NewLiferayProfileRuntimeValidationService method compute.
@Override
protected Status compute() {
Status retval = Status.createOkStatus();
NewLiferayPluginProjectOp op = context(NewLiferayPluginProjectOp.class);
NewLiferayProjectProvider<NewLiferayPluginProjectOp> provider = op.getProjectProvider().content(true);
if ("maven".equals(provider.getShortName())) {
NewLiferayProfile newLiferayProfile = context(NewLiferayProfile.class);
String runtimeName = newLiferayProfile.getRuntimeName().content(true);
IRuntime runtime = ServerUtil.getRuntime(runtimeName);
if (runtime == null) {
retval = Status.createErrorStatus("Liferay runtime must be configured.");
}
}
return retval;
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class ActiveProfilesValidationService method compute.
@Override
protected Status compute() {
NewLiferayPluginProjectOp op = _op();
String activeProfileId = op.getActiveProfilesValue().content();
NewLiferayProjectProvider<NewLiferayPluginProjectOp> provider = op.getProjectProvider().content(true);
if ("maven".equals(provider.getShortName()) && (activeProfileId != null) && activeProfileId.contains(StringPool.SPACE)) {
return Status.createErrorStatus("No spaces are allowed in profile id values.");
}
return Status.createOkStatus();
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class ArchetypeDefaultValueService method compute.
@Override
protected String compute() {
NewLiferayPluginProjectOp op = _op();
PluginType pluginType = op.getPluginType().content();
String frameworkType = null;
if (pluginType.equals(PluginType.portlet)) {
IPortletFramework portletFramework = op.getPortletFramework().content();
if (portletFramework.isRequiresAdvanced()) {
IPortletFramework framework = op.getPortletFrameworkAdvanced().content();
frameworkType = framework.getShortName();
} else {
frameworkType = portletFramework.getShortName();
}
} else {
frameworkType = pluginType.name();
}
frameworkType = frameworkType.replaceAll("_", "-");
NewLiferayProjectProvider<NewLiferayPluginProjectOp> provider = op.getProjectProvider().content();
return provider.getData("archetypeGAV", String.class, frameworkType).get(0);
}
use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.
the class ArtifactVersionDefaultValueService method initDefaultValueService.
protected void initDefaultValueService() {
super.initDefaultValueService();
Listener listener = new FilteredListener<PropertyContentEvent>() {
@Override
protected void handleTypedEvent(PropertyContentEvent event) {
refresh();
}
};
NewLiferayPluginProjectOp op = _op();
op.getLocation().attach(listener);
op.getProjectName().attach(listener);
}
Aggregations