public Collection<BranchDto> selectByComponent(DbSession dbSession, ComponentDto component) { String projectUuid = component.getMainBranchProjectUuid(); if (projectUuid == null) { projectUuid = component.projectUuid(); } return mapper(dbSession).selectByProjectUuid(projectUuid); }
public void switchIsLastFlagAndSetProcessedStatus(DbSession dbSession, String componentUuid, String analysisUuid) { SnapshotMapper mapper = mapper(dbSession); mapper.unsetIsLastFlagForComponentUuid(componentUuid); mapper(dbSession).setIsLastFlagForAnalysisUuid(analysisUuid); }
/** * Return all components of a project (including disable ones) */ public List<ComponentDto> selectAllComponentsFromProjectKey(DbSession session, String projectKey) { return mapper(session).selectComponentsFromProjectKeyAndScope(projectKey, null, false); }
public static ComponentDto newModuleDto(String uuid, ComponentDto parentModuleOrProject) { return newChildComponent(uuid, parentModuleOrProject, parentModuleOrProject) .setModuleUuidPath(parentModuleOrProject.moduleUuidPath() + uuid + UUID_PATH_SEPARATOR) .setDbKey(generateKey("MODULE_KEY_" + uuid, parentModuleOrProject)) .setName("NAME_" + uuid) .setLongName("LONG_NAME_" + uuid) .setPath("module") .setScope(Scopes.PROJECT) .setQualifier(Qualifiers.MODULE) .setLanguage(null); }
public static ComponentDto newSubView(ComponentDto viewOrSubView, String uuid, String key) { return newModuleDto(uuid, viewOrSubView) .setDbKey(key) .setName(key) .setLongName(key) .setScope(Scopes.PROJECT) .setQualifier(Qualifiers.SUBVIEW) .setPath(null); }
public static ComponentDto newView(OrganizationDto organizationDto, String uuid) { return newPrivateProjectDto(organizationDto, uuid) .setUuid(uuid) .setScope(Scopes.PROJECT) .setQualifier(Qualifiers.VIEW) .setPrivate(false); }
private ComponentDto newViewDto(OrganizationDto organizationDto) { return ComponentTesting.newView(organizationDto, VIEW_UUID) .setOrganizationUuid(ORGANIZATION_UUID) .setDbKey(VIEW_KEY) .setName(VIEW_NAME); }
private ComponentDto newComponentDto(String uuid) { return ComponentTesting.newFileDto(project) .setDbKey("key_" + uuid) .setUuid(uuid) .setPath("path_" + uuid); }
protected ComponentDto newProject(String key, String name) { return ComponentTesting.newPrivateProjectDto(organization, "UUID_" + key) .setDbKey(key) .setName(name); }
private static ComponentDto newView(String organizationUuid, String uuid) { return newProjectDto(organizationUuid, uuid, false) .setUuid(uuid) .setScope(Scopes.PROJECT) .setQualifier(Qualifiers.VIEW); }
private static ComponentTreeQuery.Builder newTreeQuery(String baseUuid) { return ComponentTreeQuery.builder() .setBaseUuid(baseUuid) .setStrategy(CHILDREN); }
private ComponentDto newSubViewDto(ComponentDto rootView) { return ComponentTesting.newSubView(rootView, SUBVIEW_1_UUID, SUBVIEW_1_KEY) .setName(SUBVIEW_1_NAME); }
/** * @deprecated since 6.6 * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) */ public ComponentDto insertView(OrganizationDto organizationDto) { return insertComponentImpl(newView(organizationDto), false, noExtraConfiguration()); }
/** * @deprecated since 6.6 * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) */ public ComponentDto insertView(OrganizationDto organizationDto, Consumer<ComponentDto> dtoPopulator) { return insertComponentImpl(newView(organizationDto), false, dtoPopulator); }
/** * Returns all projects (Scope {@link Scopes#PROJECT} and qualifier * {@link Qualifiers#PROJECT}) which are enabled. * <p> * Branches are not returned. * <p> * Used by Views. */ public List<ComponentDto> selectProjects(DbSession session) { return mapper(session).selectProjects(); }
/** * Retrieves all components with a specific root project Uuid, no other filtering is done by this method. * <p> * Used by Views plugin */ public List<ComponentDto> selectByProjectUuid(String projectUuid, DbSession dbSession) { return mapper(dbSession).selectByProjectUuid(projectUuid); }
/** * Scroll all <strong>enabled</strong> files of the specified project (same project_uuid) in no specific order with * 'SOURCE' source and a non null path. */ public void scrollAllFilesForFileMove(DbSession session, String projectUuid, ResultHandler<FileMoveRowDto> handler) { mapper(session).scrollAllFilesForFileMove(projectUuid, handler); }
/** * Select all projects for a given organization. * <p> * Branches are not returned */ public List<ComponentDto> selectProjectsByOrganization(DbSession dbSession, String organizationUuid) { return mapper(dbSession).selectProjectsByOrganization(organizationUuid); }
private static ComponentDto newProvisionedProject(OrganizationDto organizationDto, String uuid) { return ComponentTesting .newPrivateProjectDto(organizationDto, "provisioned-uuid-" + uuid) .setName("provisioned-name-" + uuid) .setDbKey("provisioned-key-" + uuid); } }
/** * @deprecated since 6.6 * @see #insertPublicPortfolio(OrganizationDto, Consumer[]) */ public ComponentDto insertView(OrganizationDto organizationDto, String uuid) { return insertComponentImpl(newView(organizationDto, uuid), false, noExtraConfiguration()); }