Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 30 → Rev 31

/sbm4mylyn/trunk/src/net/brutex/mylyn/sbmconnector/core/SBMTicketAttributeMapper.java
19,6 → 19,8
*/
package net.brutex.mylyn.sbmconnector.core;
 
import net.brutex.mylyn.sbmconnector.core.model.SBMFieldTypes;
 
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
40,7 → 42,40
@Override
public TaskAttribute getAssoctiatedAttribute(TaskAttribute taskAttribute) {
// TODO Auto-generated method stub
return super.getAssoctiatedAttribute(taskAttribute);
}
/**
* Map SBM field type to task field type. This mapping is a hint only because
* SBM allows fields to have a type and subtype, but the subtype is not returned
* by the SBM web service.
*
* @param sbmtype the SBM field type (unfortunately without field subtype)
* @return the mylyn task field type
*/
public String mapToTaskKey(SBMFieldTypes sbmtype) {
String tasktype = TaskAttribute.TYPE_SHORT_TEXT;
switch(sbmtype) {
case NUMERIC: tasktype = TaskAttribute.TYPE_LONG; break;
case TEXT: tasktype = TaskAttribute.TYPE_LONG_TEXT; break;
case DATETIME: tasktype = TaskAttribute.TYPE_DATETIME; break;
case SELECTION: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
case BINARY: tasktype = TaskAttribute.TYPE_BOOLEAN; break;
case STATE: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
case USER: tasktype = TaskAttribute.TYPE_PERSON; break;
case PROJECT: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
case SUMMATION: tasktype = TaskAttribute.TYPE_INTEGER; break;
case MULTIPLE_SELECTION: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
case CONTACT: tasktype = TaskAttribute.TYPE_PERSON; break;
case INCIDENT: tasktype = TaskAttribute.TYPE_TASK_DEPENDENCY; break;
case FOLDER: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
case RELATIONAL: tasktype = TaskAttribute.TYPE_SINGLE_SELECT; break;
case SUBRELATIONAL: tasktype = TaskAttribute.TYPE_SHORT_TEXT; break;
case SYSTEM: tasktype = TaskAttribute.TYPE_SHORT_TEXT; break;
case MULTIPLE_RELATIONAL: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
case MULTIPLE_GROUP: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
case MULTIPLE_USERGROUP: tasktype = TaskAttribute.TYPE_MULTI_SELECT; break;
}
return tasktype;
}
}