1011015: Check if definitions are publishable server side

Check if definitions are publishable before publishing. Also check if views are
refreshable before refreshing. Fixes #2857.
Merge pull request #3063 from daviddavis/temp/20131001090029

1011015: Check if definitions are publishable server side