Subversion Repositories XServices

Rev

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

Rev 31 Rev 34
Line 128... Line 128...
128
		throws CoreException {
128
		throws CoreException {
129
		SBMClient client = SBMRepositoryConnector.getClient(repository);
129
		SBMClient client = SBMRepositoryConnector.getClient(repository);
130
		TaskData data = new TaskData(new SBMTicketAttributeMapper(repository),
130
		TaskData data = new TaskData(new SBMTicketAttributeMapper(repository),
131
				SBMConnectorPlugin.CONNECTOR_KIND, 
131
				SBMConnectorPlugin.CONNECTOR_KIND, 
132
				repository.getRepositoryUrl(), 
132
				repository.getRepositoryUrl(), 
-
 
133
				ttitem.getGenericItem().getValue().getItemName().getValue()+" ["+
133
				ttitem.getGenericItem().getValue().getItemID().getValue());
134
				ttitem.getGenericItem().getValue().getItemID().getValue()+"]");
134
		initializeTaskData(repository, data, null, monitor);
135
		initializeTaskData(repository, data, null, monitor);
135
		// Create Fields for all the generic SBM (system) fields
136
		// Create Fields for all the generic SBM (system) fields
136
		for (SBMTicketAttribute f : SBMTicketAttribute.values()) {
137
		for (SBMTicketAttribute f : SBMTicketAttribute.values()) {
137
			TaskAttribute attr;
138
			TaskAttribute attr;
138
			if(f.getTaskName()!=null) {
139
			if(f.getTaskName()!=null) {
Line 151... Line 152...
151
			if(f.isVisible()) {
152
			if(f.isVisible()) {
152
				attr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
153
				attr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
153
			} else {
154
			} else {
154
				attr.getMetaData().setKind(null);
155
				attr.getMetaData().setKind(null);
155
			}
156
			}
-
 
157
			/*
-
 
158
			if(f.getTaskType()==TaskAttribute.TYPE_SINGLE_SELECT) {
-
 
159
				List<SBMFieldValue> options = 
-
 
160
					client.getValidSet(client.getTableName(ttitem), f.getSBMName());
-
 
161
				for( SBMFieldValue optionvalue: options) {
-
 
162
					attr.putOption(optionvalue.getValue(), optionvalue.getValue());
-
 
163
				}
-
 
164
			}
-
 
165
			*/
156
			attr.setValue(client.getStaticFieldValue(ttitem, f.getSBMName()));
166
			attr.setValue(client.getStaticFieldValue(ttitem, f.getSBMName()));
-
 
167
			
157
		}
168
		}
Line 158... Line 169...
158
		
169
		
159
		//Custom fields		
170
		//Custom fields		
160
		List<SBMField> customfields = client.getFields(client.getTableName(ttitem));
171
		List<SBMField> customfields = client.getFields(client.getTableName(ttitem));
Line 165... Line 176...
165
			TaskAttribute custom = data.getRoot().createAttribute(f.getName());
176
			TaskAttribute custom = data.getRoot().createAttribute(f.getName());
166
			custom.getMetaData().setType(
177
			custom.getMetaData().setType(
167
					new SBMTicketAttributeMapper(repository).mapToTaskKey(f.getType()));
178
					new SBMTicketAttributeMapper(repository).mapToTaskKey(f.getType()));
168
			custom.getMetaData().setLabel(f.getLabel());
179
			custom.getMetaData().setLabel(f.getLabel());
169
			custom.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
180
			custom.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
170
			custom.getMetaData().setReadOnly(true);
181
			custom.getMetaData().setReadOnly(false);
171
			if(f.getType()==SBMFieldTypes.SELECTION &&
182
			if(f.getType()==SBMFieldTypes.SELECTION &&
172
					client.getFieldValue(ttitem, f.getName())!=null) {
183
					client.getFieldValue(ttitem, f.getName())!=null) {
-
 
184
				List<SBMFieldValue> options = 
-
 
185
					client.getValidSet(client.getTableName(ttitem), f.getName());
-
 
186
				for( SBMFieldValue optionvalue: options) {
-
 
187
					custom.putOption(optionvalue.getInternalValue(), optionvalue.getValue());
-
 
188
				}
173
				String val = client.getFieldValue(ttitem, f.getName()).getValue();
189
				String val = client.getFieldValue(ttitem, f.getName()).getValue();
174
				custom.putOption(val, val);
-
 
175
				custom.setValue(val);
190
				custom.setValue(val);
176
			} else if(f.getType()==SBMFieldTypes.MULTIPLE_SELECTION 
191
			} else if(f.getType()==SBMFieldTypes.MULTIPLE_SELECTION 
177
					|| f.getType()==SBMFieldTypes.MULTIPLE_RELATIONAL
192
					|| f.getType()==SBMFieldTypes.MULTIPLE_RELATIONAL
178
					|| f.getType()==SBMFieldTypes.MULTIPLE_GROUP
193
					|| f.getType()==SBMFieldTypes.MULTIPLE_GROUP
179
					|| f.getType()==SBMFieldTypes.MULTIPLE_USERGROUP) {
194
					|| f.getType()==SBMFieldTypes.MULTIPLE_USERGROUP) {