We have studied the orbital ordering (OO) in La0.5Sr1.5MnO4 and its soft x-ray resonant diffraction spectroscopic signature at the Mn L2, L3 edges. We have modelled the system in second quantization as a small planar cluster consisting of a central Mn atom, with the first neighbouring shells of oxygen and Mn atoms. For the effective Hamiltonian we consider Slater-Koster parameters, charge transfer and electron correlation energies obtained from previous measurements on manganites. We calculate the OO as a function of oxygen distortion and spin correlation used as adjustable parameters. Their contribution as a function of temperature is clearly distinguished with a good spectroscopic agreement.