Subversion Repositories XServices

Rev

Rev 30 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30 Rev 31
Line 17... Line 17...
17
 *   Serena, TeamTrack and Serena Business Mashup are 
17
 *   Serena, TeamTrack and Serena Business Mashup are 
18
 * 	 registered trademarks of SERENA Software Inc.
18
 * 	 registered trademarks of SERENA Software Inc.
19
 */
19
 */
20
package net.brutex.mylyn.sbmconnector.core;
20
package net.brutex.mylyn.sbmconnector.core;
Line -... Line 21...
-
 
21
 
-
 
22
import net.brutex.mylyn.sbmconnector.core.model.SBMFieldTypes;
21
 
23
 
22
import org.eclipse.mylyn.tasks.core.TaskRepository;
24
import org.eclipse.mylyn.tasks.core.TaskRepository;
23
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
25
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
Line 24... Line 26...
24
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
26
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
Line 38... Line 40...
38
		return super.mapToRepositoryKey(parent, key); //just returns key
40
		return super.mapToRepositoryKey(parent, key); //just returns key
39
	}
41
	}
Line 40... Line 42...
40
	
42
	
41
	@Override
43
	@Override
42
	public TaskAttribute getAssoctiatedAttribute(TaskAttribute taskAttribute) {
-
 
43
		// TODO Auto-generated method stub
44
	public TaskAttribute getAssoctiatedAttribute(TaskAttribute taskAttribute) {
44
		return super.getAssoctiatedAttribute(taskAttribute);
45
		return super.getAssoctiatedAttribute(taskAttribute);
-
 
46
	}
-
 
47
	
-
 
48
	/**
-
 
49
	 * Map SBM field type to task field type. This mapping is a hint only because
-
 
50
	 * SBM allows fields to have a type and subtype, but the subtype is not returned
-
 
51
	 * by the SBM web service.
-
 
52
	 *
-
 
53
	 * @param sbmtype the SBM field type (unfortunately without field subtype)
-
 
54
	 * @return the mylyn task field type
-
 
55
	 */
-
 
56
	public String mapToTaskKey(SBMFieldTypes sbmtype) {
-
 
57
		String tasktype = TaskAttribute.TYPE_SHORT_TEXT;
-
 
58
		switch(sbmtype) {
-
 
59
			case NUMERIC: tasktype = TaskAttribute.TYPE_LONG; break;
-
 
60
			case TEXT: tasktype = TaskAttribute.TYPE_LONG_TEXT; break;
-
 
61
			case DATETIME: tasktype = TaskAttribute.TYPE_DATETIME; break;
-
 
62
			case SELECTION: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
-
 
63
			case BINARY: tasktype = TaskAttribute.TYPE_BOOLEAN; break;
-
 
64
			case STATE: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
-
 
65
			case USER: tasktype = TaskAttribute.TYPE_PERSON; break;
-
 
66
			case PROJECT: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
-
 
67
			case SUMMATION: tasktype = TaskAttribute.TYPE_INTEGER; break;
-
 
68
			case MULTIPLE_SELECTION: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
-
 
69
			case CONTACT: tasktype = TaskAttribute.TYPE_PERSON; break;
-
 
70
			case INCIDENT: tasktype = TaskAttribute.TYPE_TASK_DEPENDENCY; break;
-
 
71
			case FOLDER: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
-
 
72
			case RELATIONAL: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
-
 
73
			case SUBRELATIONAL: tasktype = TaskAttribute.TYPE_SHORT_TEXT; break;
-
 
74
			case SYSTEM: tasktype = TaskAttribute.TYPE_SHORT_TEXT; break;
-
 
75
			case MULTIPLE_RELATIONAL: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
-
 
76
			case MULTIPLE_GROUP: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
-
 
77
			case MULTIPLE_USERGROUP: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
-
 
78
		}
-
 
79
		return tasktype;
45
	}
80
	}