org.guvnor.common.services.project.model.Module.getRootPath()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.guvnor.common.services.project.model.Module.getRootPath()方法的一些代码示例,展示了Module.getRootPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.getRootPath()方法的具体详情如下:
包路径:org.guvnor.common.services.project.model.Module
类名称:Module
方法名:getRootPath

Module.getRootPath介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-client

private boolean contains(Collection<Module> modules,
             Module activeModule) {
  if (modules != null) {
    for (Module module : modules) {
      if (module.getRootPath().equals(activeModule.getRootPath())) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public boolean accept(final Path path) {
  final Module module = moduleService.resolveModule(path);
  return module.getRootPath().equals(path);
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

@Override
public WorkspaceProject resolveProject(final Space space,
                    final Module module) {
  return resolveProject(space,
             module.getRootPath());
}

代码示例来源:origin: kiegroup/appformer

@Override
public WorkspaceProject resolveProject(final Space space,
                    final Module module) {
  return resolveProject(space,
             module.getRootPath());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client

public void onArchiveActiveProject() {
  view.archive(context.getActiveModule()
            .map(module -> module.getRootPath())
            .orElseThrow(() -> new IllegalStateException("Cannot get root path without active module.")));
}

代码示例来源:origin: org.kie.workbench.forms/kie-wb-common-forms-editor-client

@Override
public List<Pair<String, ? extends IsWidget>> getExtensions() {
  formModelsPresenter.initialize(context.getActiveModule()
                      .orElseThrow(() -> new IllegalStateException("Cannot get module root path without an active module."))
                      .getRootPath());
  return super.getExtensions();
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public Collection<String> getRuleNames(final Path path,
                    final String packageName) {
  final Module module = moduleService.resolveModule(path);
  if (module == null) {
    return Collections.emptyList();
  } else {
    return queryRuleNames(
        packageName,
        module.getRootPath().toURI());
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-data-modeller-backend

@Override
public Path calculatePersistenceDescriptorPath(final Module module) {
  Path rootPath;
  if (module == null || (rootPath = module.getRootPath()) == null) {
    return null;
  }
  final org.uberfire.java.nio.file.Path nioRootPath = Paths.convert(rootPath);
  final Path descriptorPath = Paths.convert(nioRootPath.resolve(PERSISTENCE_DESCRIPTOR_PATH));
  return descriptorPath;
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-backend

/**
 * Returns the path where data sources and drivers are located for a given module.
 */
public Path getModuleDataSourcesContext(final Module module) {
  Path rootPath = module.getRootPath();
  org.uberfire.java.nio.file.Path dataSourcesNioPath = Paths.convert(rootPath).resolve("src/main/resources/META-INF");
  return Paths.convert(dataSourcesNioPath);
}

代码示例来源:origin: org.uberfire/uberfire-project-client

public void onModuleUpdated(@Observes final ModuleUpdatedEvent moduleUpdatedEvent) {
  if (activeModule != null && activeModule.getRootPath().equals(moduleUpdatedEvent.getOldModule().getRootPath())) {
    contextChangeEvent.fire(new WorkspaceProjectContextChangeEvent(new WorkspaceProject(activeWorkspaceProject.getOrganizationalUnit(),
                                              activeWorkspaceProject.getRepository(),
                                              activeWorkspaceProject.getBranch(),
                                              moduleUpdatedEvent.getNewModule()),
                                    moduleUpdatedEvent.getNewModule()));
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client

public static Module getModuleMock(final String uri) {
  final Module module = mock(Module.class);
  final Path path = getPathMock(uri);
  when(module.getRootPath()).thenReturn(path);
  return module;
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

private Module mockModule(final String myOldProject,
               final Path myOldProjectRootPath) {
    final Module module = mock(Module.class);
    when(module.getModuleName()).thenReturn(myOldProject);
    when(module.getRootPath()).thenReturn(myOldProjectRootPath);
    return module;
  }
}

代码示例来源:origin: kiegroup/appformer

public void onModuleUpdated(@Observes final ModuleUpdatedEvent moduleUpdatedEvent) {
  if (activeModule != null && activeModule.getRootPath().equals(moduleUpdatedEvent.getOldModule().getRootPath())) {
    contextChangeEvent.fire(new WorkspaceProjectContextChangeEvent(new WorkspaceProject(activeWorkspaceProject.getOrganizationalUnit(),
                                              activeWorkspaceProject.getRepository(),
                                              activeWorkspaceProject.getBranch(),
                                              moduleUpdatedEvent.getNewModule()),
                                    moduleUpdatedEvent.getNewModule()));
  }
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Before
public void setUp() {
  pipelineInvoker = new BuildPipelineInvoker(pipelineExecutor,
                        pipelineRegistry);
  when(pipelineRegistry.getPipelineByName(BuildPipelineInitializer.LOCAL_BUILD_PIPELINE)).thenReturn(pipeline);
  when(buildRequest.getModule()).thenReturn(module);
  when(module.getRootPath()).thenReturn(rootPath);
  when(rootPath.toURI()).thenReturn(ROOT_PATH_URI);
  when(resource.toURI()).thenReturn(RESOURCE_URI_1);
}

代码示例来源:origin: org.uberfire/uberfire-project-api

public String getModuleName() {
  if (pom != null && pom.getName() != null) {
    return pom.getName();
  } else if (pom != null && pom.getGav() != null && pom.getGav().getArtifactId() != null && !pom.getGav().getArtifactId().trim().isEmpty()) {
    return pom.getGav().getArtifactId();
  } else {
    return getRootPath().getFileName();
  }
}

代码示例来源:origin: kiegroup/appformer

public String getModuleName() {
  if (pom != null && pom.getName() != null) {
    return pom.getName();
  } else if (pom != null && pom.getGav() != null && pom.getGav().getArtifactId() != null && !pom.getGav().getArtifactId().trim().isEmpty()) {
    return pom.getGav().getArtifactId();
  } else {
    return getRootPath().getFileName();
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-examples-screen-backend

protected ImportProject makeExampleProject(final Module module,
                      ExampleRepository repository) {
  final String description = readDescription(module);
  final List<String> tags = getTags(module);
  return new ImportProject(module.getRootPath(),
               module.getModuleName(),
               description,
               repository.getUrl(),
               tags,
               repository.getCredentials());
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

@Override
public Package resolveDefaultWorkspacePackage(final Module module) {
  final Path moduleRootPath = module.getRootPath();
  final GAV gav = module.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(moduleRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}

代码示例来源:origin: kiegroup/appformer

@Override
public Package resolveDefaultWorkspacePackage(final Module module) {
  final Path moduleRootPath = module.getRootPath();
  final GAV gav = module.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(moduleRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-client

public void loadDrivers(final Command onSuccessCommand,
            final ParameterizedCommand<Throwable> onErrorCommand) {
  if (module == null) {
    queryService.call(
        getLoadDriversSuccessCallback(onSuccessCommand),
        getLoadDriversErrorCallback(onErrorCommand)).findGlobalDrivers();
  } else {
    queryService.call(
        getLoadDriversSuccessCallback(onSuccessCommand),
        getLoadDriversErrorCallback(onErrorCommand)).findModuleDrivers(module.getRootPath());
  }
}

相关文章