@Override public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException { List<Artifact> activeTeams = new LinkedList<>(); for (Artifact agTeam : ArtifactQuery.getArtifactListFromType( AtsArtifactTypes.AgileTeam, AtsUtilCore.getAtsBranch())) { if (agTeam.getSoleAttributeValue(AtsAttributeTypes.Active, true)) { activeTeams.add(agTeam); } } FilteredTreeArtifactDialog dialog = new FilteredTreeArtifactDialog( getName(), "Select Agile Team", activeTeams, new ArtifactTreeContentProvider(), new ArtifactLabelProvider()); if (dialog.open() == 0) { EntryDialog ed = new EntryDialog(getName(), "Enter new Agile Sprint name(s) (comma delimited)"); if (ed.open() == 0) { if (Strings.isValid(ed.getEntry())) { try { AgileEndpointApi ageilEp = AtsClientService.getAgileEndpoint(); JaxNewAgileSprint newSprint = new JaxNewAgileSprint(); int teamUuid = ((Artifact) dialog.getSelectedFirst()).getArtId(); for (String name : ed.getEntry().split(",")) { newSprint.setName(name); newSprint.setTeamUuid(teamUuid); Response response = ageilEp.createSprint(new Long(teamUuid), newSprint); JaxAgileSprint sprint = response.readEntity(JaxAgileSprint.class); if (sprint != null) { long uuid = sprint.getUuid(); Artifact sprintArt = ArtifactQuery.getArtifactFromId( new Long(uuid).intValue(), AtsUtilCore.getAtsBranch()); sprintArt.getParent().reloadAttributesAndRelations(); AtsUtil.openArtifact(sprintArt.getGuid(), OseeCmEditor.CmPcrEditor); } else { AWorkbench.popup("Error creating Agile Team [%s]", response.toString()); return; } } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } } }
public static Set<Artifact> getEmailGroupsAndUserGroups(User user) throws OseeCoreException { Set<Artifact> artifacts = new HashSet<Artifact>(); for (Artifact art : ArtifactQuery.getArtifactListFromType( CoreArtifactTypes.UserGroup, BranchManager.getCommonBranch())) { // Only add group if have read permissions if (!art.getName().equals("Root Artifact") && AccessControlManager.hasPermission(art, PermissionEnum.READ)) { artifacts.add(art); } } return artifacts; }
@Override public AtsArtifactConfigCache call() throws Exception { AtsArtifactConfigCache cache = new AtsArtifactConfigCache(); List<IArtifactType> typesToLoad = getTypesToLoad(); List<Artifact> artifactListFromType = ArtifactQuery.getArtifactListFromType( typesToLoad, AtsUtilCore.getAtsBranchToken(), DeletionFlag.EXCLUDE_DELETED); for (Artifact artifact : artifactListFromType) { loadAtsConfigCacheArtifacts(artifactStore, cache, artifact); } return cache; }