Menu

Where to extract record title during import?

Help
2007-07-09
2013-05-28
  • Nobody/Anonymous

    Hello,

    I would like crate a list/text file of the titles for the article imported.  Where should I look so that I may add my code during the import process?
    Thanks!

     
    • Matthias Steffens

      I'm not sure I understand you correctly. Do you want refbase to add article information about each imported article to a text file during import?

      Since all imported records are displayed after import, can't you simply display all of these records on one page, then click on "Select all" and user either the "Export" or "Cite" functionality to generate a list/file of imported records?

      refbase can also send email notifications to inform you about any imported records. If you enable this feature (set variable  '$sendEmailAnnouncements' in file 'initialize/ini.inc.php' to "yes" and provide a valid email for '$mailingListEmail'), you'll get a list of links to all imported records via email. Yet another way would be to subscribe to a refbase RSS feed that matches your imported records (e.g. all records added by a particular user, etc.). Or you could always include a unique comment in the note field of each imported record...

      If this isn't what you're after, see the code at the bottom of file 'import_modify.php', below the comment line that says "// DISPLAY RESULTS".

      Matthias

       
    • Matthias Steffens

      > I would like crate a list/text file of the titles for the article imported.

      If you really only want to export the article title for each of your imported records, you can:

      1. Go to Options > Cite Options, and enable the checkbox next to "Use custom text citation format".
      2. Edit your custom text citation format so that it just reads "<:title[|_]:>" (w/o the quotes).

      Then, after import:

      1. Display all of your imported records on one page.
      2. Click on "Select all" to select all records.
      3. Choose "Text Citation" from the citation style popup and click the "Cite" button.

      If necessary, you can add other placeholders to your your custom text citation format so that other bits from the imported records are included in the text citation. More info about the refbase placeholder syntax is given at:

      http://placeholders.refbase.net/

      Matthias

       
    • Nobody/Anonymous

      Sorry for not being more specific about my idea.  I do thank you for your quick reply and help though!

      I'd like to programmatically create a new web page for each record that is imported.  To uniquely name the webpage, i want to use information from the record.

      For example:
      1. Smith J. E. and Jones M. W., The New Hybrid Plant, APL, 88, 2007.
      2. Crocker W. N. and Kaeding L. F., Floor Tiles for Buildings, JAP, 121, 2007.

      would create webpages with titles as
      1. Smith_APL_2007_TheNewHybridPlant
      2. Crocker_JAP_2007_FloorTilesforBuildings

      I'm interested in the location of the actual value extraction for individual record fields so that I may use those variables to make my unique filenames.  Then I can learn php so I can achieve what I'd like!

      Please let me know if you have more questions.
      Thanks!

       
      • Matthias Steffens

        > I'd like to programmatically create a new web page for each record that is imported. To uniquely name the webpage, i want to use information from the record.

        Thanks for clarifying. May I ask what you're trying to accomplish? I mean what do you want to do with the generated pages?

        refbase can display each record in detail on its own page, and each record page has a stable & unique URL that's made from the record's serial number, e.g:

        http://demo.refbase.net/show.php?record=5

        Isn't this what you're after? For each record, this permanent URL is given in details view below the record data in a link named "Permanent link to this record".

        > I'm interested in the location of the actual value extraction for individual record fields so that I may use those variables to make my unique filenames.

        The easiest way is probably to use a refbase placeholder string (see my previous post). File 'cite/styles/cite_TextCitation.php' shows you how placeholders get used within refbase (it makes use of function 'parsePlaceholderString()' in file 'includes/include.inc.php').

        > would create webpages with titles as
        > 1. Smith_APL_2007_TheNewHybridPlant
        > 2. Crocker_JAP_2007_FloorTilesforBuildings

        The appropriate placeholder string (that would generate output like in your examples above) would look like this:

        <:firstAuthor:><_:abbrevJournal[0|]:><_:year:><_:title[0|]:>

        You can easily try this using the instructions given in my previous post. As mentioned before, our wiki has detailed information about the refbase placeholder syntax:

        http://placeholders.refbase.net/

        Hope this helps -- if not, please explain in more detail what you're trying to accomplish and why. Then we may be able to help you further.

        Matthias

         
    • Nobody/Anonymous

      Matthias,

      My idea is for a mashup of refbase and a wiki.  Since I have neither much time or php/sql/java coding experience I thought implementing refbase within a wiki would be easiest for me to demonstrate the capabilities of both refbase and wikis.

      Pretty much, I am focused on the "sharing" part of refbase's Planned Features (esp tags and user comments).

      I'll think about using the refbase page and how that fits into what I'm imagining.  I'll also check out placeholders.
      Thanks again!

       
      • Matthias Steffens

        The upcoming version of refbase will allow to dynamically include results from the refbase database into foreign web pages.

        Here are thre example HTML pages:

        http://beta.refbase.net/include_test.html
        http://beta.refbase.net/javascript/include_test2.html
        http://beta.refbase.net/javascript/include_test3.html

        The first example ('include_test.html') uses an <iframe> tag to dynamically include results from a refbase database within the HTML page. This allows for browsing of results.

        The second and thirs example ('include_test2.html' and 'include_test2.html') use an AJAX-style Javascript to asynchronously query a refbase database and include the returned results within the HTML page.

        I *think* that this could be adopted to work from within a wiki page.

        FYI, below follows an excerpt of an email which I've send to the refbase developer list a while ago (introducing this "include feature"):

        --- begin email excerpt ---

        I've modified the refbase code so that it's possible to dynamically include results from an online refbase database within other web pages.

        There are two methods:

        1. Include refbase results within an <iframe>. A life example can be seen here:

        <http://beta.refbase.net/include_test.html>

        If you checkout the HTML source of that page, you'll see the refbase iframe at the very bottom of the HTML code. Note that this dummy page is just a static HTML page and it could be located everywhere on the net, i.e. it does not need to be located in a refbase script directory.

        The iframe takes a regular 'show.php' URL as source URL but includes the "client" parameter with "inc-refbase-1.0" as its value. This is the trigger which causes refbase to return a stripped-down HTML page that only includes the upper browse links as well as the actual results.

        2. Include refbase results via an AJAX-style JavaScript. Two life examples can be seen here:

        <http://beta.refbase.net/javascript/include_test2.html>
        <http://beta.refbase.net/javascript/include_test3.html>

        These dummy web pages simply contain a HTML form that calls JavaScript(s) to generate & send a 'show.php' query based on the form elements chosen by the user. Upon success, the JavaScripts write found results back to the web page.

        Both examples show slightly different ways of accomplishing the same thing. The second example ("include_test3.html") degrades gracefully if JavaScript isn't available and also shows what happens if nothing was found (try author "D. Piepenburg").

        To facilitate this second (JavaScript) method, a new parameter ("wrapResults") has been added to the 'show.php' API. If it is set to "0", refbase will only output a partial document structure containing solely the search results.

        Currently, only citation view ("submit=Cite") is properly supported, but that may be the most (only?) useful display form anyhow.

        If you're interested, you can download the source of the example HTML pages and JavaScripts here:

        <http://store.extracts.de/refbase_include_test.zip>

        The examples and script code were adopted from sample code by Neil Saunders:

        <http://nsaunders.wordpress.com/2007/02/20/my-first-ajax-for-bioinformatics-page/>

        I think that these methods for inclusion of refbase results into foreign web pages are potentially very useful since they can be adopted to many different applications.

        --- end email excerpt ---

        The refbase 'show.php' API is explained at these wiki pages:

        http://linking.refbase.net/
        http://bibliographies.refbase.net/

        Let me know if you've got further questions or suggestions,

        Matthias

         

Log in to post a comment.