Trackballs (and other optical controls) are pretty simple beasts in general. There will be 4 wires per axis on almost all of them, with the red and black being 5V and ground respectively.
The remaining two wires will be the data pair. On interface inputs, they may be labeled X1/X2, A1/A2, etc..., but they all do the same thing. Connecting those remaining two wires to these inputs should result in cursor movement. If they operate in reverse, simply swapping the position of those two wires will correct it.
On the trackball, the Purple/Blue are the Y axis, and the Yellow/Green the X-Axis.
The external shell ground wire is an optional connection, but connecting it to an earth ground (metal PC case, etc) will help to discharge the shell and ball to mitigate the build up of static energy, which would cause it to attract dust and dirt, which would then collect on the rollers and eventually affect performance.
RandyT