本文整理汇总了Java中org.jboss.forge.addon.ui.result.Results.success方法的典型用法代码示例。如果您正苦于以下问题:Java Results.success方法的具体用法?Java Results.success怎么用?Java Results.success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.forge.addon.ui.result.Results
的用法示例。
在下文中一共展示了Results.success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
UIContext uiContext = context.getUIContext();
Map<Object, Object> attributeMap = uiContext.getAttributeMap();
List<GitClonedRepoDetails> clonedRepos = (List<GitClonedRepoDetails>) attributeMap.get(AttributeMapKeys.GIT_CLONED_REPOS);
if (clonedRepos != null) {
for (GitClonedRepoDetails clonedRepo : clonedRepos) {
Git git = clonedRepo.getGit();
String gitUrl = clonedRepo.getGitUrl();
UserDetails userDetails = clonedRepo.getUserDetails();
File basedir = clonedRepo.getDirectory();
String message = "Adding pipeline";
try {
LOG.info("Performing a git commit and push on URI " + gitUrl);
gitAddCommitAndPush(git, gitUrl, userDetails, basedir, message);
} catch (GitAPIException e) {
return Results.fail("Failed to commit and push repository " + clonedRepo.getGitRepoName() + " due to " + e, e);
} finally {
removeTemporaryFiles(basedir);
}
}
}
return Results.success();
}
示例2: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(final UIExecutionContext context) throws Exception
{
final UIContext uiContext = context.getUIContext();
applyUIValues(uiContext);
// add driver dependency
final Project project = helper.getProject(uiContext);
final DatabaseType database = dbType.getValue();
final Coordinate driverCoordinate = database.getDriverCoordinate();
SpringBootHelper.addDependency(project, driverCoordinate.getGroupId(), driverCoordinate.getArtifactId())
.setScopeType("runtime");
SpringBootHelper.addSpringBootDependency(project, SpringBootFacet.SPRING_BOOT_STARTER_DATA_JPA_ARTIFACT)
.setScopeType("runtime");
return Results.success("Spring Boot JPA successfully set up!");
}
示例3: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
String url = getJolokiaUrl();
if (url == null) {
return Results.fail("Not connected to remote jolokia agent. Use camel-connect command first");
}
boolean val = "true".equals(decode.getValue());
String[] val2 = null;
if (filter.getValue() != null) {
String s = filter.getValue().toString();
val2 = s.split(",");
}
org.apache.camel.commands.EndpointStatisticCommand command = new org.apache.camel.commands.EndpointStatisticCommand(name.getValue(), val, val2);
command.execute(getController(), getOutput(context), getError(context));
return Results.success();
}
示例4: editEndpointXml
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
private Result editEndpointXml(List<String> lines, String lineNumber, String endpointUrl, String uri, FileResource file, String xml) {
// the list is 0-based, and line number is 1-based
int idx = Integer.valueOf(lineNumber) - 1;
String line = lines.get(idx);
// replace uri with new value
line = StringHelper.replaceAll(line, endpointUrl, uri);
lines.set(idx, line);
LOG.info("Updating " + endpointUrl + " to " + uri + " at line " + lineNumber + " in file " + xml);
// and save the file back
String content = LineNumberHelper.linesToString(lines);
file.setContents(content);
return Results.success("Update endpoint uri: " + uri + " in file " + xml);
}
示例5: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
ConnectionProfileManager manager = managerProvider.getConnectionProfileManager();
if (connectionProfile != null)
{
ConnectionProfile connection = manager.loadConnectionProfiles().get(connectionProfile.getValue());
if (!connection.isSavePassword())
{
String password = connectionProfilePassword.getValue();
if (password == null)
password = "";
connection.setPassword(password);
}
Project selectedProj = getSelectedProject(context);
if (selectedProj.getFacet(DatabaseMigrationFacet.class).isInstalled())
selectedProj.getFacet(DatabaseMigrationFacet.class).setPropertiesFile(connection);
}
return Results
.success("Properties stored!");
}
示例6: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
Project selectedProj = getSelectedProject(context);
ChangeLogFileGenerator generator = new ChangeLogFileGenerator(selectedProj);
String mode = generationMode.getValue();
if (mode.equals(Constants.MODE_EMPTY_CHANGELOG))
{
generator.generateEmptyMasterChangeLog();
}
else
{
//generator.generateChangeLogFromDatabase();
}
return Results
.success("Master ChangeLog File has been created");
}
示例7: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext executionContext) throws Exception
{
UIProvider provider = executionContext.getUIContext().getProvider();
UIOutput output = provider.getOutput();
PrintStream out = output.out();
for (FractionDescriptor fraction : WildFlySwarmFacet.getAllFractionDescriptors())
{
if (!fraction.isInternal())
{
String msg = String.format("%s: %s (%s)", fraction.getArtifactId(), fraction.getName(),
fraction.getDescription());
out.println(msg);
}
}
return Results.success();
}
示例8: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
Project project = getSelectedProject(context);
UIOutput output = context.getUIContext().getProvider().getOutput();
PackagingFacet packagingFacet = project.getFacet(PackagingFacet.class);
try
{
packagingFacet.createBuilder().addArguments("wildfly-swarm:run").runTests(false).build(output.out(),
output.err());
}
catch (BuildException ie)
{
if (!(ie.getCause() instanceof InterruptedException))
{
return Results.fail("Error while running the build", ie.getCause());
}
}
return Results.success();
}
示例9: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
Project project = getSelectedProject(context);
final DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class);
if (!isArquillianWildflySwarmDependencyInstalled(dependencyFacet)) {
installArquillianWildflySwarmDependency(dependencyFacet);
}
JavaClassSource test = Roaster.create(JavaClassSource.class)
.setPackage(targetPackage.getValue())
.setName(named.getValue());
addArquillianRunner(test);
addDefaultDeploymentAnnotation(test, project);
addArquillianResourceEnricher(test);
addTestMethod(test);
JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
facet.saveTestJavaSource(test);
return Results.success(String.format("Test Class %s.%s was created", targetPackage.getValue(), named.getValue()));
}
示例10: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
Project project = getSelectedProject(context);
WildFlySwarmFacet facet = project.getFacet(WildFlySwarmFacet.class);
if (fractionElements.hasValue())
{
List<FractionDescriptor> fractions = Lists.toList(fractionElements.getValue());
facet.installFractions(fractions);
List<String> artifactIds = fractions.stream().map(FractionDescriptor::getArtifactId)
.collect(Collectors.toList());
return Results.success("Wildfly Swarm Fractions '"
+ artifactIds
+ "' were successfully added to the project descriptor");
}
return Results.success();
}
示例11: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
Project project = getSelectedProject(context);
File instanceFile = getFile(project, instancePath.getValue());
File schemaFile = new File(
instanceFile.getParentFile(), instanceFile.getName() + XSD_EXT);
File targetPath = new File(
project.getRoot().getChild("src/main/java").getFullyQualifiedName());
XmlModelGenerator xmlGen = new XmlModelGenerator();
JCodeModel model = xmlGen.generateFromInstance(
instanceFile,
schemaFile, packageName.getValue(), targetPath);
addGeneratedTypes(project, model);
return Results.success("Model classes created for " + instancePath.getValue());
}
示例12: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
Project project = getSelectedProject(context);
MapperContext mapCtx = getMapperContext(project);
CamelConfigBuilder camelConfig = CamelConfigBuilder.loadConfig(
getFile(project, CAMEL_CTX_PATH));
camelConfig.addTransformation(mapCtx.getTransformId(),
mapCtx.getDozerPath(),
TransformType.valueOf(mapCtx.getSourceType()),
mapCtx.getSourceModel().getType(),
TransformType.valueOf(mapCtx.getTargetType()),
mapCtx.getTargetModel().getType());
FileOutputStream fos = new FileOutputStream(getFile(project, CAMEL_CTX_PATH));
camelConfig.saveConfig(fos);
fos.close();
return Results.success();
}
示例13: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
Project project = getSelectedProject(context);
// Create configuration
getMapperContext(project).setDozerPath(dozerConfig.getValue());
MapperConfiguration config = loadConfig(project);
config.addClassMapping(sourceModel.getValue(), targetModel.getValue());
// Load models into mapper context
getMapperContext(project).setSourceModel(loadModel(project, sourceModel.getValue()));
getMapperContext(project).setTargetModel(loadModel(project, targetModel.getValue()));
// Save on our way out
saveConfig(project);
return Results.success("Created mapping configuration.");
}
示例14: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
Project project = getSelectedProject(context);
File schemaFile = getFile(project, schemaPath.getValue());
URL jsonSchemaUrl = schemaFile.toURI().toURL();
File targetPath = new File(project.getRoot().getChild("src/main/java").getFullyQualifiedName());
JsonModelGenerator modelGen = new JsonModelGenerator();
JCodeModel model = modelGen.generateFromSchema(
className.getValue(), packageName.getValue(), jsonSchemaUrl, targetPath);
addGeneratedTypes(project, model);
return Results.success("Model classes created for " + schemaPath.getValue());
}
示例15: execute
import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
griffonFacet = griffonVersion.getValue();
FrameworkTypes frameworkTypeValue = frameworkType.getValue();
LanguageTypes languageTypeValue = languageType.getValue();
griffonFacet.setLanguage(languageTypeValue);
griffonFacet.setFramework(frameworkTypeValue);
if (facetFactory.install(getSelectedProject(context.getUIContext()), griffonFacet)) {
return Results.success(properties.getMessage("plugin.install.success"));
}
return Results.fail(properties.getMessage("plugin.install.failure"));
}