Changeset 2087
- Timestamp:
- Nov 7, 2011, 12:12:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy
r2065 r2087 285 285 } 286 286 if(type=="templatefields"){ 287 fields << [ "id": createFieldId( id: collectionOfFields.id , name: collectionOfFields.name, source: source, type: category ), "source": source, "category": category, "name": collectionOfFields.name ]287 fields << [ "id": createFieldId( id: collectionOfFields.id.toString(), name: collectionOfFields.name, source: source, type: category ), "source": source, "category": category, "name": collectionOfFields.name ] 288 288 } 289 289 return fields … … 1087 1087 protected Map parseFieldId( String fieldId ) { 1088 1088 def attrs = [:] 1089 1090 def parts = fieldId.split("," )1089 1090 def parts = fieldId.split(",",5) 1091 1091 1092 1092 attrs = [ 1093 "id": parts[ 0 ], 1094 "name": parts[ 1 ], 1095 "source": parts[ 2 ], 1096 "type": parts[ 3 ] 1093 "id": new String(parts[ 0 ].decodeBase64()), 1094 "name": new String(parts[ 1 ].decodeBase64()), 1095 "source": new String(parts[ 2 ].decodeBase64()), 1096 "type": new String(parts[ 3 ].decodeBase64()), 1097 "unit": parts.length>4? new String(parts[ 4 ].decodeBase64()) : null 1097 1098 ] 1099 1100 return attrs 1098 1101 } 1099 1102 … … 1110 1113 def source = attrs.source; 1111 1114 def type = attrs.type ?: "" 1112 1113 return id + "," + name + "," + source + "," + type; 1115 def unit = attrs.unit ?: "" 1116 1117 return id.bytes.encodeBase64().toString() + "," + 1118 name.bytes.encodeBase64().toString() + "," + 1119 source.bytes.encodeBase64().toString() + "," + 1120 type.bytes.encodeBase64().toString() + "," + 1121 unit.bytes.encodeBase64().toString(); 1114 1122 } 1115 1123
Note: See TracChangeset
for help on using the changeset viewer.