I have successfully modified the Export sub-module in Views Bonus Pack to generate ISO 19139 metadata records (XML implementation of ISO 19115). I am following the USGIN Profile for ISO 19139 but it is relative easy to follow any XML metadata schema to create, for example, FGDC or CSW Records (Dublin Core) XML files.

The Views integration is a kludge were you have to give the (CCK, etc.) field labels the same name as specified in the /export/views-bonus-export-iso.tpl.php file. I also had to add some code to deal with multi-record CCK fields. Views returns the multi-record values in one value with cocatenated tags or whatever the Views or CCK templates suggest. I had to strip all HTML/XML tags in field values (there shouldn't be any in the metadata anyways) and separated the multi-record values by semi-colon (;) or pipe (|). I then exploded the multi-record value by the delimiter character in the views-bonus-export-iso.tpl.php file.

I am new to module development and am very interested in your suggestions on and support with further developing this XML metadata (or complex XML) generation capability as part of this module or as a separate module..

Attached is my patch generated in Eclipse.

CommentFileSizeAuthor
#1 views_bonus_iso19139-6.x-dev_1.1.patch63.29 KBwgrunberg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wgrunberg’s picture

It looks like I failed to submit my patch. Here it goes again.

neclimdul’s picture

That looks amazing. I'm going to be honest though, I don't believe I can maintain something like that, especially since I have no knowledge or experience with the ISO spec. It might be a good idea to build this on a module that extends the tools provided by views bonus.

wgrunberg’s picture

Yes, I am in favor of a generic solution (XML Export Builder?) that works with any complex XML template. A simplified version could just have a text field where you paste in your XML and use Tokens to enter values - very similar to the Global Text field in Views. However, I don't how how to incorporate conditional logic (if, else, case) and multi-values (explode) without relaying on PHP.

I have put up some documentation for the current hack here: Creating ISO 19139 metadata through Drupal Views and Views Bonus Pack. This should help setting up your own hack.

BTW: What metadata standards are people interested in?

wgrunberg’s picture

Status: Active » Postponed

I am using the Views Datasource module now (http://drupal.org/project/views_datasource). It's advantage is that one does not have to hack the module because the metadata templates (or any other XML, JSON, or RDF template) are independently stored in the active theme's folder (#805902: How do I set up multiple views-views-xml-style-raw.tpl.php templates?).

neclimdul’s picture

This has always been possible with views bonus pack.

neclimdul’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)