Package org.eclipse.mylyn.tasks.core.data

Examples of org.eclipse.mylyn.tasks.core.data.TaskData


      if (tasks.size()>0) {
        ITask firstTask = tasks.get(0);
        String repositoryUrl = firstTask.getRepositoryUrl();
       
        if (repositoryUrl!=null && taskDataManager.hasTaskData(firstTask)) {
          TaskData taskData = taskDataManager.getTaskData(firstTask);
          TaskAttribute attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
          Set<String> commonIds = new HashSet<String>(attribute.getOptions().keySet());
         
          for (ITask task : tasks) {
            if (task.getRepositoryUrl().equals(repositoryUrl)) { //Same-Repository-Policy
              if (taskDataManager.hasTaskData(task)) {
                taskData = taskDataManager.getTaskData(task);
                attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
                commonIds.retainAll(attribute.getOptions().keySet());
              }
            } else {
              return null; //Same-Repository-Policy
            }
View Full Code Here


            openTask = false;
            ITaskDataWorkingCopy copy = taskDataManager.getWorkingCopy(task);
            model = new TaskDataModel(repository, task, copy);
          }

          TaskData taskData = model.getTaskData();
         
         
          for (RedmineAttribute redmineAttribute : attributes) {
            if(redmineAttribute!=null) {
              attributeName = redmineAttribute.name();
              TaskAttribute attribute = taskData.getRoot().getAttribute(redmineAttribute.getTaskKey());

              String newValue = getValue(redmineAttribute, taskData);
              if(!attribute.getValue().equals(newValue)) {
                if(openTask) {
                  setOpenTaskValue(attribute, newValue, taskData, model);
View Full Code Here

 
  public TaskData createTaskDataFromIssue(TaskRepository repository, Issue issue, IProgressMonitor monitor) throws CoreException {

    Configuration configuration = connector.getRepositoryConfiguration(repository);
    try {
      TaskData taskData = new TaskData(getAttributeMapper(repository), RedmineCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), issue.getId() + ""); //$NON-NLS-1$
      createAttributes(repository, taskData, issue, configuration);
      createOperations(taskData, issue, configuration);

      IssueMapper.updateTaskData(repository, taskData, configuration, issue);
      return taskData;
View Full Code Here

  private List<CustomValue> customValues;
 
  public void applyTo(TaskAttribute taskAttribute, Configuration configuration) {
    Assert.isNotNull(taskAttribute);
   
    TaskData taskData = taskAttribute.getTaskData();
    TaskAttributeMapper mapper = taskData.getAttributeMapper();
   
    String projectVal = taskData.getRoot().getAttribute(RedmineAttribute.PROJECT.getTaskKey()).getValue();
    Project project = configuration.getProjects().getById(RedmineUtil.parseIntegerId(projectVal));
   
    taskAttribute.getMetaData().defaults().setType(IRedmineConstants.TASK_ATTRIBUTE_TIMEENTRY);
    if (getTimeEntryId() > 0) {
      mapper.setIntegerValue(taskAttribute, getTimeEntryId());
View Full Code Here

  @Override
  public TaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) throws CoreException {
    monitor = Policy.monitorFor(monitor);
    monitor.beginTask(Messages.PROGRESS_TASK_DOWNLOAD, IProgressMonitor.UNKNOWN);
   
    TaskData taskData = null;
   
    try {
      int id = Integer.parseInt(taskId);

      IClient client = getClientManager().getClient(repository);
View Full Code Here

          IStatus status = new Status(IStatus.ERROR, RedmineCorePlugin.PLUGIN_ID, Messages.ERRMSG_MISSING_UPDATEDON);
          collector.failed(""+partialIssue.getId(), status); //$NON-NLS-1$
          continue;
        }

        TaskData taskData = taskDataHandler.createTaskDataFromIssue(repository, partialIssue, monitor);
        taskData.setPartial(true);
       
        collector.accept(taskData);
      }
     
    } catch (RedmineStatusException e) {
View Full Code Here

  }
 
  @Test
  public void testUpdateTaskData() throws Exception{
    Issue issue = TestData.issue2;
    TaskData taskData = buildEmptyTaskData(issue);
   
    TaskAttribute root = taskData.getRoot();
    TaskAttribute attribute = null;

    IssueMapper.updateTaskData(repository, taskData, cfg, issue);

    assertEquals(issue.getSubject(), root.getAttribute(RedmineAttribute.SUMMARY.getTaskKey()).getValue());
View Full Code Here

    Field f = Settings.class.getDeclaredField("useIssueDoneRatio");
    f.setAccessible(true);
    f.setBoolean(cfg.getSettings(), false);
   
    Issue issue = TestData.issue2;
    TaskData taskData = buildEmptyTaskData(issue);
   
    TaskAttribute root = taskData.getRoot();
    IssueMapper.updateTaskData(repository, taskData, cfg, issue);

    assertEquals("", root.getAttribute(RedmineAttribute.PROGRESS.getTaskKey()).getValue());
  }
View Full Code Here

  @Test
  public void testUpdateTaskData_empty() throws Exception{
    Issue issue = new Issue();
    issue.setProjectId(1);
    issue.setTrackerId(1);
    TaskData taskData = buildEmptyTaskData(issue);
   
    TaskAttribute root = taskData.getRoot();
    IssueMapper.updateTaskData(repository, taskData, cfg, issue);
   
    assertEquals("", root.getAttribute(RedmineAttribute.SUMMARY.getTaskKey()).getValue());
    assertEquals("", root.getAttribute(RedmineAttribute.DESCRIPTION.getTaskKey()).getValue());
    assertEquals("1", root.getAttribute(RedmineAttribute.TRACKER.getTaskKey()).getValue());
View Full Code Here

    //TODO available Status
  }
 
  @Test
  public void createIssue() throws Exception {
    TaskData taskData = buildEmptyTaskData(TestData.issue2);
    fillTaskData(taskData, TestData.issue2);
   
    Issue issue = IssueMapper.createIssue(repository, taskData, null, cfg);
    assertNotNull(issue);
   
View Full Code Here

TOP

Related Classes of org.eclipse.mylyn.tasks.core.data.TaskData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.