Package net.sf.redmine_mylyn.api.model

Examples of net.sf.redmine_mylyn.api.model.Configuration


      if(activityId==null) {
        AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(RedmineCorePlugin.REPOSITORY_KIND);
        if (connector!=null && connector instanceof RedmineRepositoryConnector){
         
          Configuration conf = ((RedmineRepositoryConnector) connector)
          .getRepositoryConfiguration(TasksUi
              .getRepositoryManager().getRepository(
                  task.getConnectorKind(),
                  task.getRepositoryUrl()));       
         
          Integer projectId = taskAttributeMapper.getIntegerValue(taskData.getRoot().getAttribute(RedmineAttribute.PROJECT.getTaskKey()));
          Project project = conf.getProjects().getById(projectId.intValue());
         
          if(project!=null) {
            TimeEntryActivities activities = project.getTimeEntryActivities();
            TimeEntryActivity activity = activities.getDefault();
            if(activity==null && activities.getAll().size()>0) {
View Full Code Here


  private StringParser stringParser;
 
  private Configuration configuration;
 
  Api_2_7_ClientImpl(IRedmineApiWebHelper webHelper) {
    this(webHelper, new Configuration());
  }
View Full Code Here

 
  @Override
  public void updateConfiguration(IProgressMonitor monitor) throws RedmineApiErrorException {
    monitor = Policy.monitorFor(monitor);

    Configuration conf = new Configuration();
   
    monitor.beginTask(Messages.PROGRESS_UPDATING_ATTRIBUTES, parserByClass.size()+1);
    GetMethod method = null;
   
    for (Entry<String, IModelParser<? extends AbstractPropertyContainer<?>>> entry : parserByClass.entrySet()) {
      method = new GetMethod(entry.getKey());
      AbstractPropertyContainer<?> propCt = executeMethod(method, entry.getValue(), monitor);

      if(monitor.isCanceled()) {
        throw new OperationCanceledException();
      } else {
        conf.setPropertyContainer(propCt);
        monitor.worked(1);
      }
    }

    method = new GetMethod(URL_SETTINGS);
    conf.setSettings(executeMethod(method, settingsParser, monitor));
    if(monitor.isCanceled()) {
      throw new OperationCanceledException();
    } else {
      monitor.worked(1);
    }
View Full Code Here

    synchronized(clientByUrl) {
      IClient client = clientByUrl.get(repository.getUrl());
     
      if(client==null) {
       
        Configuration conf = confByUrl.get(repository.getUrl());
        if(conf==null) {
          conf = new Configuration();
          confByUrl.put(repository.getUrl(), conf);
        }
       
        client = ClientFactory.createClient(repository, locationFactory.createWebLocation(repository), conf);
        clientByUrl.put(repository.getUrl(), client);
View Full Code Here

  protected static TaskRepositoryLocationFactory repositoryLocationFactory = new TaskRepositoryLocationFactory();
 
  public static IClient createClient(TaskRepository repository) throws RedmineStatusException {
    AbstractWebLocation location = repositoryLocationFactory.createWebLocation(repository);
    return createClient(repository, location, new Configuration());
  }
View Full Code Here

    TimeEntryActivity activity = null;
    AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(RedmineCorePlugin.REPOSITORY_KIND);
   
    if (connector!=null && connector instanceof RedmineRepositoryConnector){
     
      Configuration conf = ((RedmineRepositoryConnector) connector)
      .getRepositoryConfiguration(TasksUi
          .getRepositoryManager().getRepository(
              task.getConnectorKind(),
              task.getRepositoryUrl()));       
     
      Integer projectId = taskData.getAttributeMapper().getIntegerValue(
          taskData.getRoot().getAttribute(RedmineAttribute.PROJECT.getTaskKey()));
     
      Project project = conf.getProjects().getById(projectId.intValue());
     
      if(project!=null) {
        TimeEntryActivities activities = project.getTimeEntryActivities();
        activity = activities.getDefault();
        if(activity==null && activities.getAll().size()>0) {
View Full Code Here

    return null;
  }

  static Configuration buildConfiguration() {
    try {
      Configuration cfg = new Configuration();
      cfg.setSettings(new Settings());
     
      buildCustomFields(cfg.getCustomFields());
//    cfg.getIssueCategories()
//    cfg.getIssuePriorities()
//    cfg.getIssueStatuses()
      buildProjects(cfg.getProjects());
//    cfg.getQueries()
//    cfg.getSettings()
//    cfg.getTimeEntryActivities()
//    cfg.getTrackers()
      buildUsers(cfg.getUsers());
//    cfg.getVersions()
      return cfg;
    } catch(Exception e) {
      e.printStackTrace();
    }
View Full Code Here

    return false;
  }

  @Override
  public boolean initializeTaskData(TaskRepository repository, TaskData taskData, ITaskMapping taskMapping, IProgressMonitor monitor) throws CoreException {
    Configuration conf = connector.getRepositoryConfiguration(repository);
    Issue issue = new Issue();
   
    try {
      Project project = conf.getProjects().getAll().get(0);
      issue.setProjectId(project.getId());
      issue.setTrackerId(conf.getTrackers().getById(project.getTrackerIds()).get(0).getId());
     
      return initializeNewTaskData(issue, repository, taskData, monitor);
    } catch (RuntimeException e) {
      IStatus status = new Status(IStatus.ERROR, RedmineCorePlugin.PLUGIN_ID, Messages.ERRMSG_TASK_INITIALIZATION_FALED_INSUFFICENT_DATA, e);
      StatusHandler.log(status);
View Full Code Here

      throw new CoreException(status);
    }
  }

  private boolean initializeNewTaskData(Issue issue, TaskRepository repository, TaskData taskData, IProgressMonitor monitor) throws CoreException {
    Configuration conf = connector.getRepositoryConfiguration(repository);
   
    try {
      createAttributes(repository, taskData, issue, conf);
      createOperations(taskData, issue, conf);
     
      /* Default-Values */
      TaskAttribute root = taskData.getRoot();
      root.getAttribute(RedmineAttribute.PROJECT.getTaskKey()).setValue(""+issue.getProjectId()); //$NON-NLS-1$
      root.getAttribute(RedmineAttribute.TRACKER.getTaskKey()).setValue(""+issue.getTrackerId()); //$NON-NLS-1$
     
      IssuePriority priority = conf.getIssuePriorities().getDefault();
      if(priority!=null) {
        root.getAttribute(RedmineAttribute.PRIORITY.getTaskKey()).setValue(""+priority.getId()); //$NON-NLS-1$
      } else if(conf.getIssuePriorities().getAll().size()>0){
        root.getAttribute(RedmineAttribute.PRIORITY.getTaskKey()).setValue(""+conf.getIssuePriorities().getAll().get(0)); //$NON-NLS-1$
      }
     
      IssueStatus status = conf.getIssueStatuses().getDefault();
      if(status!=null) {
        root.getAttribute(RedmineAttribute.STATUS.getTaskKey()).setValue(""+status.getId()); //$NON-NLS-1$
        root.getAttribute(RedmineAttribute.STATUS_CHG.getTaskKey()).setValue(""+status.getId()); //$NON-NLS-1$
      } else if(conf.getIssueStatuses().getAll().size()>0){
        root.getAttribute(RedmineAttribute.STATUS.getTaskKey()).setValue(""+conf.getIssueStatuses().getAll().get(0)); //$NON-NLS-1$
        root.getAttribute(RedmineAttribute.STATUS_CHG.getTaskKey()).setValue(""+conf.getIssueStatuses().getAll().get(0)); //$NON-NLS-1$
      }
     
    } catch (RedmineStatusException e) {
      throw new CoreException(RedmineCorePlugin.toStatus(e, e.getMessage()));
    }
View Full Code Here

  @Override
  public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {
    String taskId = taskData.getTaskId();
    try {
      IClient client = connector.getClientManager().getClient(repository);
      Configuration cfg = connector.getRepositoryConfiguration(repository);

      if(taskData.isNew() || taskId.isEmpty()) {
        Issue issue = IssueMapper.createIssue(repository, taskData, oldAttributes, cfg);
        taskId += client.createIssue(issue, monitor);
      } else {
View Full Code Here

TOP

Related Classes of net.sf.redmine_mylyn.api.model.Configuration

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.