I am extremely glad to see someone contributing work towards a viable D8 Biblio module. Thanks!

It occurs to me that the entity class Bibliography actually represents a Citation, not a bibliography. This is also referenced in the interface. This is leading to a lot of confusion browsing the codebase.

Am I incorrect?

Understanding that this would be a lot of string pulling and testing to broadly change namespaces I wonder if this change is something you'd be interested in exploring? It seems like something that should be handled sooner than later if you consider it an issue.

Regards,

Comments

JacobSanford created an issue. See original summary.

JacobSanford’s picture

Issue summary: View changes
JacobSanford’s picture

Issue summary: View changes
kruhak’s picture

Hello Jacob,

You're right. Bibliography is not appropriate name for the main entity. I want to initiate a process of renaming this entity to something more suitable and will be really helpful if you can help me with it. It will be very good to do it before alpha1 release.
I think that a good names is "Citation" and "Reference". Reference is a more common word. What do you think?

Before renaming:
Bibliography - bibliography
Contributor - bibcite_contributor
Keyword - bibcite_keyword

After renaming:
Reference - bibcite_reference or Citation - bibcite_citation
Contributor - bibcite_contributor
Keyword - bibcite_keyword

bibdoc’s picture

Dear all,

to my knowledge, citation is the formatted expression of a reference. A reference could be from a simple code (a book signature, for instance) , or an hypertext link to a complex and detailed MARC record expressed in ISBD, as long as it allow us de-reference it and find the bibliographic information, thus the document.

Therefore, I find reference more suitable to a bibliographic record than citation, that would be this reference put down on letters and numbers and punctuation, i.e., formatted.

Let me know if I can give a hand and how (user from D6, never contributed). I'm finishing Librarianship degree, FYI.

Regards,

mg

marqpdx’s picture

I too believe Reference is the correct choice in this case.

Just a quick glimpse, we'll need to update about 30 files.

Now, i just tied the following, and it actually seems to work. Have not done extensive testing, but my website and the bibcite module both appear to work correctly.

cd YOURSITE/modules
grep -rl Bibliography bibcite | xargs sed -i '' -e 's/Bibliography/Reference/g'
cd bibcite
find . -name *Bibliography* | sed -e "p;s/Bibliography/Reference/" | xargs -n2 mv

The `grep -irl` command changes every instance of "Bibliography" to "Reference" (case-sensitive) and the `find` command renames every file in the bibcite directory that contains "Bibliography" to "Reference", also case-sensitive.

I am on a Mac, so if on Linux or Windows, the above might be different, but this brings us much closer.

Thanks,
m

ps, this doesn't change the machine_name (bibcite_bibliography etc), that would be an update function perhaps. we still need to look into that.

pps, ok, yes, we'll likely need to replace "bibliography" with "reference" (lower case) using variations of the above, but too sleepy to do today. will try tomorrow.

kruhak’s picture

Thanks for you comments! It's a very helpful.

It will be good if we can find and rename all confusing things in the code.
We have decide that "Bibliography" and "BibliographyType" should be renamed to "Reference" and "ReferenceType".

I want discuss with all about another confusing names in the code:

  • Theme hook "bibliography": It's theme element for rendering CSL data as citation, so let's rename it to "citation".
  • Theme hook "bibliography_table": Let's rename it to "reference" and it will be a default view for "Reference" entity.
  • Service "Styler": It's a main service of the module. It used to render CSL data using Processor plugin. Anyone have an ideas how we can name it?

It will be good if you can comment this potential changes.

marqpdx’s picture

hi kruhak,

OK, have been giving this some thought and i have one concern about using the term Reference.

In Drupal there are lots of kinds of reference, like Entity Reference, View Reference, Node Reference etc... We might cause confusion.

perhaps we consider BibReference instead. I don't like it as much, but it will be much more uniquely identifiable in the Drupal ecosystem then Reference would.

Thoughts?

kruhak’s picture

I think name "Reference" should not cause any confusion.
Machine name will be "bibcite_reference". Class name "Reference" will be protected by namespace of the module. In the interface this name will appear with context.

So, I'm not see any troubles to rename entity to "Reference".

marqpdx’s picture

kruhak, you are correct. i was thinking w/ a Drupal 7 mind.

bibcite_reference and the tight Namespace makes it fine. good call!

bibdoc’s picture

Hi,
regarding to "Styler", citation style (APA, Vancouver, etc ...) is a common naming, so if you want to put it more specific, citation styler could be a good candidate.

kruhak’s picture

Based on the discussion, these changes will be applied to module components:

  1. Service "Styler" will be renamed to "CitationStyler"
  2. Main theme hook "bibliography" will be renamed to "bibcite_citation"
  3. Theme hook "bibliography_table" will be renamed to "bibcite_reference_table"
  4. Entity "Bibliography" (bibliography) will be renamed to "Reference" (bibcite_reference)
  5. Entity "BibliographyType" (bibliography_type) will be renamed to "ReferenceType" (bibcite_reference_type)

All of these changes will cause many troubles for the existing installations of bibcite module. So, all configuration and database changes should be covered by update hook.

  • kruhak committed d7e9338 on 8.x-1.x
    Issue #2811279 by JacobSanford, marqpdx, bibdoc: NameSpace Confusion
    
kruhak’s picture

Category: Plan » Task
Status: Active » Fixed

Updates from the latest comment have been applied. Changes in a database covered by update hook but additional configuration (like a reference fields) can be broken.
Let's close this issue for now. If anyone have a comments about latest changes or ideas about additional improvements then please create a new issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.