Added getType function to identify document source