davidswelt
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: HTML bibliography generatorZot/Bib/Web v1.0.0 has now been released and is available for download from:
Forum: Plugins
In reply to: Excesse DB use with ZotpressOh, sorry. Done.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyI see. That explains the strange effects.
I have turned off JavaScript for the time being. I get a mix of styles on my page now.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyAnd no, it’s not on the same page, but it could be.
Even if it is on separate pages, I don’t understand how your plugin distinguishes between different concurrent or nearly concurrent page views. One visitor might view the BibTeX version, while another views the APA version.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyPerhaps you want to look at the site.
I think I explained in the post just above that I display the items in APA style once, and then, on a separate page, as BibTeX.
That seems to me like a normal thing to do.
Forum: Plugins
In reply to: [Zotpress] Excessive DB use with ZotpressYou’ve seen my bibliography. My guess is that it’s going to be 200-300 items. I may split it up into separate pages, but a single page view shouldn’t trigger even 50 separate SELECTs if a single one returning more than one row should do the job.
Why not put item entries in the for each collection (and style)?
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyFWIW, the SELECT statements that go to the DB look like this:
SELECT item_key, citation, json, linkMode FROM wp_zotpress_zoteroItems WHERE api_user_id=’160464′
AND parent = ‘6CBJZA4M’ AND linkMode IN ( ‘imported_file’, ‘linked_url’ ) ORDER BY linkMode ASC LIMIT 1So, you’re not selecting by style in the first place.
And then your update goes by item_keyUPDATE
wp_zotpress_zoteroItems
SETstyle
= ‘bibtex’,citation
= ‘…bibtex…\n’ WHEREitem_key
= ‘6CBJZA4M’ ANDapi_user_id
= ‘160464’… and does not distinguish between different uses of the item.
So, if the design behind this is correct, i don’t understand the logic.
Methinks… if you cache the “citation” of an item, you need to do it separately for each style. (And you should think about caching the whole collection citation text as well – see my new post in this forum.)
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographySo, AJAX may explain why I often see the wrong version (e.g., BibTeX) displayed first, and then, after a second or two in the browser, the text changes to the correct version (e.g., plain APA – although not for all entries).
The shortcode for the first collection is
<h3>ACT-R</h3>
[zotpress collection=”MWXM72N2″ style=”apa” sortby=”date” order=”desc” download=”yes”]On the BibTeX page, it’s the same except for style=”bibtex”:
<h3>ACT-R</h3>
[zotpress collection=”MWXM72N2″ style=”bibtex” sortby=”date” order=”desc” download=”yes”]If I look at one of the items, e.g., 6CBJZA4M, I only see one entry. I wonder if you correctly distinguish between difference occurrences of the same item.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyOne more thing. I’m looking at the database.
In response to browser requests it appears that the table wp_zotpress_zoteroItems changes content. The same row (HUVVSUQ6 in this case) is either style=apa or style=bibtex, and the “citation” field changes accordingly.
Is there supposed to be a write db access every time it is loaded? Are all the bibliography entries re-generated with every client access? I’m not sure if this is intentional, which is why I mention it here.
This is designed to scale well with number of page requests, right?
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyIn the browser?
The URL displayed is my short WordPress URL.I can’t see an iframe or anything else – it seems to me that what goes on on the server is fully opaque to the browser. (I even assumed that the content itself is static!)
Either way, even with the shorter collections do I see the bug now.
I have a page that contains numerous separate collections with style=apa, and another one with style=bibtex (at most 33 items in a single included collection).
However, many of the items do not appear in the right style. It is a mix of BibTeX and APA, and there is no consistency. You reload the page, and they appear in a different style.The pages in question is here and here.
My impression is that I can reproduce the problem if I retrieve the BibTeX pages and regular bibliography in quick succession. Is there some caching (or concurrency) problem?
I’m rather convinced this is a server-side issue. I can retrieve the BibTeX page in Chrome and then produce the problem by retrieving the plaintext page with Curl. I still see a mix of BibTeX and plain references on the Curl side.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyYou’re right, this does make a difference. With limit=50, it works fine.
Can you add some code that retrieves the bibliography in batches?(I’m surprised you have to give individual record IDs to make the retrieval, rather than the collection.)
I seem to remember that the Zotero API limits BibTex retrievals to 100 at a time anyway.
Forum: Plugins
In reply to: [Zotpress] BibTex bibliographyI think what’s happening here is that I have multiple bibliographies on different pages. When updating the database (sync with Zotero), I notice that other pages (showing APA format) get corrupted as well.
Is it possible that WordPress or Zotpress updates the two pages in parallel, and some portions of Zotpress can’t handle the concurrency?