Please keep any code updates, bug reports, feature enhancements, etc in JIRA.  This is all too important to get lost in the vast ocean we call email.  Sorry to be a pain :)

I know this is not a patch - but it's much easier for someone to find the code or enhancement in JIRA.

Andrew

On Wed, Dec 17, 2008 at 3:55 PM, Jessie Keck <jkeck@stanford.edu> wrote:
Hello all,
I am posting this to the vuFind-Tech list as this seems to be more of a
technical issue instead of a general issue.  I don't have a diff
available because we're pretty out of Sync with the vuFind trunk.

In services/Record/Export.php I have added the following function to the
Export class:
   function displayMARC()
   {
       header('Content-type: application/text');
       $temp = '';
         foreach ($this->marcRecord->getFields() as $tag => $field) {
           if(is_a($field, 'File_MARC_Data_Field') && $tag != '999' &&
$tag != '940') { //In the Stanford instance we remove these tags due to
the fact that it can hold local and personal information.  Not sure if
that is true across all institutions
             $list = $field->getSubfields();
             $temp .= $tag . "    ";
             foreach ($list as $subfield) {
               $temp .= $subfield->getData() . " ";
             }
             $temp .= "\n";
           }
     }
       echo $temp;
   }

In the launch function you can change the refworks case in the style
switch to be this:
           case 'refworks':
               $this->displayMARC();
               break;

Then on the record view (Record/view.tpl) you need this in your RefWorks
link href attribute:
http://www.refworks.com/express/expressimport.asp?vendor=[PUT YOUR
INSTALLATION NAME HERE]&filter=MARC
Format&encoding=65001&url={$url}/Record/{$id}/Export?style=refworks

That should get you directly exporting to RefWorks.  I think EndNote
could use this same method, but we haven't done that.  (Don't fix it if
it ain't broken)
This basically loops through the entire MARC record and echoes each MARC
tag on a line with all of its subfields displayed in the order that they
come in the MARC.  So it's just a big string that RefWorks can
interpret.  In the URL, the filter=MARC Format is important so the user
does not have to pick MARC from a drop down of formats.  Also, the
reason that I'm taking out the 999 and 940 fields is because while
RefWorks should not display this data, a savvy user would know that they
can right click on the link as save the link location to get the file.
This would potentially but the confidentiality of our users at risk, so
I'm removing those tags from even being processed.

I'm sure that the displayMARC function could be spiffied up a bit, but
as I said it my previous email, it's quick, it's dirty, and it works.
With the exception of some diacritics issues, I haven't heard of too
much problems that people have been having with this.

Hope this helps anybody out there struggling with RefWorks exports.  The
way that the vuFind trunk is doing RefWorks exports (the last time I
checked) seems to depend on the RefWorks login form to have a full URL
in the action, which it doesn't.  So while I think it may work for the
RefWorks authenticated user, if you need to login to RefWorks you will
get a 404 because the form is being passed to a non-existent .asp file
in the vuFind installation while it should be passed to that .asp file
in the RefWorks software.

Please let me know if you have any questions or if any of this is unclear.

Thanks,
-Jessie Keck
Stanford University


Bill Dueber wrote:
> Please, share with the rest of us! :-)
>
>  -Bill-
>
>
> On Wed, Dec 17, 2008 at 2:25 PM, Jessie Keck <jkeck@stanford.edu
> <mailto:jkeck@stanford.edu>> wrote:
>
>     Phil,
>     I have done some work with the RefWorks exports and would be more than
>     happy to share what we have done with you and the (tech list?) as a
>     whole. Our implementation of RefWorks exports is not perfect (I've
>     heard
>     there can be an issue with diacritics), but it's pretty simple and
>     dirty.
>     ( see any record at http://searchworks.stanford.edu/ )
>
>     Let me know if your interested.
>
>     -Jessie Keck
>     Stanford University
>
>     Philip Shafer wrote:
>     > It seems as if some of the vufind functionality is not working
>     in RC1.
>     > Please advise the best solution to handling some of these issues:
>     >
>     > 1.) Submitting favorites doesn't seem to be completely
>     implemented. I
>     > had to manually update the code in order to get this to work. Also,
>     > when tagging items when submitting a 'favorite' it doesn't like keep
>     > multiple tags, it will only take the first tag and add it to the
>     database.
>     >
>     > When viewing 'My Favorites' I cannot use multiple filters from
>     my tags.
>     >
>     > 2.) Export to RefWorks does not work. Does any one have any
>     solutions?
>     >
>     > 3.) How will the update process work? We are looking at running
>     a live
>     > beta of RC1, when RC2 or the Production version is release I don't
>     > want to loose any of the user data stored in the database. Are the
>     > table stuctures changing between any of the RC releases? If so, will
>     > these be a way to install the new versions with out loosing any
>     of the
>     > user data?
>     >
>     > Thanks,
>     >
>     > Phil
>     > ------------------------------
>     >
>     > Philip Shafer
>     > Library System Services
>     > Rowan University Library
>     > 201 Mullica Hill Rd
>     > Glassboro, NJ 08028
>     > 856-256-4418
>     > 856-256-4924 Fax
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     >
>     ------------------------------------------------------------------------------
>     > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las
>     Vegas, Nevada.
>     > The future of the web can't happen without you.  Join us at
>     MIX09 to help
>     > pave the way to the Next Web now. Learn more and register at
>     >
>     http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > VuFind-General mailing list
>     > VuFind-General@lists.sourceforge.net
>     <mailto:VuFind-General@lists.sourceforge.net>
>     > https://lists.sourceforge.net/lists/listinfo/vufind-general
>     >
>
>     ------------------------------------------------------------------------------
>     SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las
>     Vegas, Nevada.
>     The future of the web can't happen without you.  Join us at MIX09
>     to help
>     pave the way to the Next Web now. Learn more and register at
>     http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>     _______________________________________________
>     VuFind-General mailing list
>     VuFind-General@lists.sourceforge.net
>     <mailto:VuFind-General@lists.sourceforge.net>
> Bill Dueber
> Library Systems Programmer
> University of Michigan Library

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Vufind-tech mailing list
Vufind-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-tech