@Override public QueryResult<Panel> get(String studyStr, String entryStr, QueryOptions options, String sessionId) throws CatalogException { if (StringUtils.isNotEmpty(studyStr) && INSTALLATION_PANELS.equals(studyStr)) { Panel installationPanel = getInstallationPanel(entryStr); return new QueryResult<>(entryStr, -1, 1, 1, "", "", Collections.singletonList(installationPanel)); } else { return super.get(studyStr, entryStr, options, sessionId); } }
public void delete(String panelId, String token) throws CatalogException { String userId = userManager.getUserId(token); if (!authorizationManager.checkIsAdmin(userId)) { throw new CatalogAuthorizationException("Only the main OpenCGA administrator can delete global panels"); } Panel panel = getInstallationPanel(panelId); panelDBAdaptor.delete(panel.getUid()); }
public QueryResult<Panel> importInstallationPanel(String studyStr, String panelId, QueryOptions options, String token) throws CatalogException { String userId = userManager.getUserId(token); Study study = catalogManager.getStudyManager().resolveId(studyStr, userId); // 1. We check everything can be done authorizationManager.checkStudyPermission(study.getUid(), userId, StudyAclEntry.StudyPermissions.WRITE_PANELS); // Fetch the installation Panel (if it exists) Panel diseasePanel = getInstallationPanel(panelId); diseasePanel.setUuid(UUIDUtils.generateOpenCGAUUID(UUIDUtils.Entity.PANEL)); diseasePanel.getDiseasePanel().setCreationDate(TimeUtils.getTime()); diseasePanel.setRelease(studyManager.getCurrentRelease(study, userId)); diseasePanel.setVersion(1); // Install the current diseasePanel return panelDBAdaptor.insert(study.getUid(), diseasePanel, options); }