This patch is an addition to views_service.module which adds an interface to the views import and export functionality. One use of this would be for deploying views between servers without having to get into the code base. It might also be useful for verifying that the version of a view on two servers are the same. It adds two new services:

- views.importView
- views.exportView

I wrote this as part of my server staging and deployment project (http://drupal.org/project/deploy)

Let me know if you have any questions or whatnot.

CommentFileSizeAuthor
#4 views_service.patch3.41 KBgdd
#2 views_service.patch3.4 KBgdd
views_service.patch3.17 KBgdd

Comments

wim leers’s picture

Status: Needs review » Needs work

- null => NULL
- // Comments like this.
-
/**
* Doxygen like this.
*/

Otherwise looks good.

gdd’s picture

Status: Needs work » Needs review
StatusFileSize
new3.4 KB

Patch re-rolled. It is slightly over-topic now because I did the following:

- fixed comment style throughout the module, not just in my additions.
- changed "$view == NULL" to "is_null($view)" throughout the module, not just in my additions. This is the proper way to check for NULL.

Thanks for the review.

wim leers’s picture

Status: Needs review » Needs work

One more minor thing:

+ // _views_save_view will treat this as an insert rather than
should be
+ // _views_save_view() will treat this as an insert rather than

P.S.: I didn't know about is_null(). Thanks!

gdd’s picture

Status: Needs work » Needs review
StatusFileSize
new3.41 KB

Rerolled.

wim leers’s picture

Coding style: perfect. Now you'll need somebody to test this.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I tested this and it worked. It is committable as is. We really do need standardized return values from callbacks. This only returns a vid upon successful deployment. Thats not quite enough to feel good about.

marcingy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to D5 and D6

marcingy’s picture

Status: Fixed » Closed (fixed)