use of org.sonar.db.component.ComponentDto in project sonarqube by SonarSource.
the class PersistComponentsStep method createForDirectory.
public ComponentDto createForDirectory(Component directory, PathAwareVisitor.Path<ComponentDtoHolder> path) {
ComponentDto res = createBase(directory);
res.setScope(Scopes.DIRECTORY);
res.setQualifier(Qualifiers.DIRECTORY);
res.setName(directory.getReportAttributes().getPath());
res.setLongName(directory.getReportAttributes().getPath());
res.setPath(directory.getReportAttributes().getPath());
setParentModuleProperties(res, path);
return res;
}
use of org.sonar.db.component.ComponentDto in project sonarqube by SonarSource.
the class PersistComponentsStep method createForProject.
public ComponentDto createForProject(Component project) {
ComponentDto res = createBase(project);
res.setScope(Scopes.PROJECT);
res.setQualifier(Qualifiers.PROJECT);
res.setName(project.getName());
res.setLongName(res.name());
res.setDescription(project.getDescription());
res.setProjectUuid(res.uuid());
res.setRootUuid(res.uuid());
res.setUuidPath(UUID_PATH_OF_ROOT);
res.setModuleUuidPath(UUID_PATH_SEPARATOR + res.uuid() + UUID_PATH_SEPARATOR);
return res;
}
use of org.sonar.db.component.ComponentDto in project sonarqube by SonarSource.
the class PersistComponentsStep method setRootAndParentModule.
/**
* Applies to a node of type either MODULE, SUBVIEW, PROJECT_VIEW
*/
private static void setRootAndParentModule(ComponentDto res, PathAwareVisitor.Path<ComponentDtoHolder> path) {
ComponentDto rootDto = path.root().getDto();
res.setRootUuid(rootDto.uuid());
res.setProjectUuid(rootDto.uuid());
ComponentDto parentModule = path.parent().getDto();
res.setUuidPath(formatUuidPathFromParent(parentModule));
res.setModuleUuid(parentModule.uuid());
res.setModuleUuidPath(parentModule.moduleUuidPath() + res.uuid() + UUID_PATH_SEPARATOR);
}
use of org.sonar.db.component.ComponentDto in project sonarqube by SonarSource.
the class PersistComponentsStep method createForProjectView.
private ComponentDto createForProjectView(Component projectView, PathAwareVisitor.Path<ComponentDtoHolder> path) {
ComponentDto res = createBase(projectView);
res.setScope(Scopes.FILE);
res.setQualifier(Qualifiers.PROJECT);
res.setName(projectView.getName());
res.setLongName(res.name());
res.setCopyComponentUuid(projectView.getProjectViewAttributes().getProjectUuid());
setRootAndParentModule(res, path);
return res;
}
use of org.sonar.db.component.ComponentDto in project sonarqube by SonarSource.
the class PersistComponentsStep method createForView.
private ComponentDto createForView(Component view) {
ComponentDto res = createBase(view);
res.setScope(Scopes.PROJECT);
res.setQualifier(Qualifiers.VIEW);
res.setName(view.getName());
res.setDescription(view.getDescription());
res.setLongName(res.name());
res.setProjectUuid(res.uuid());
res.setRootUuid(res.uuid());
res.setUuidPath(UUID_PATH_OF_ROOT);
res.setModuleUuidPath(UUID_PATH_SEPARATOR + res.uuid() + UUID_PATH_SEPARATOR);
return res;
}
Aggregations