PubdbBibTexImporter - JoomlaPubDB/PubDB GitHub Wiki
Summary:
Class PubdbBibTexImporter Class to import BibTex files to the database. For the parsing process of the BibTex format a external library is used.
Description:
The parsed data will be checked with the data in the database and new entries will be imported.
- No constants found
- public __construct()
- public startImport()
- private importLiterature()
- private insertLiterature()
- private checkRelationAuthor()
- private checkRelationEditor()
- private getPersonIDFromDB()
- private checkRelationType()
- private checkRelationPublisher()
- private getPublisherIDFromDB()
- private checkRelationJournal()
- private checkRelationSeries()
- private checkRelationKeywords()
- private formatAuthor()
- private updateState()
- private formatMonth()
- private formatIsbn()
- private removeBracketsFromString()
- private cleanUpString()
- File: administrator/helpers/PubdbBibTexImporter.php
- Package: Default
- Class Hierarchy:
- \PubdbBibTexImporter
Tag | Version | Description |
---|---|---|
since | 0.0.7 |
Type: \RenanBr\BibTexParser\Parser() BibTex Parser instance Details:
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
Type: \RenanBr\BibTexParser\Listener() BibTex Listener instance Details:
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
Type: array mapping table for umlauts Details:
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
Type: array mapping table for database and BibTex format Details:
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
Type: String json file path for latex mapping Details:
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
public __construct( $file_string)
Summary
PubdbBibTexImporter constructor.
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$file_string | String file path of the import file |
Type | Description |
---|---|
\RenanBr\BibTexParser\Exception\ParserException |
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
public startImport() : array
Summary
Start the import process by calling the BibTex parser After parsing go through the elements list and remove unnecessary fields and format fields.
Details:
- Inherited From: \PubdbBibTexImporter
Returns: array
Tag | Version | Description |
---|---|---|
since | 0.0.7 |
private importLiterature( $literature_list) : array
Summary
Go though the literature list and format each.
Description
After chechking all relations call database insert function to insert the literature to the database. return an array of IDs of the imported literatures
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$literature_list |
Returns: array
Tag | Version | Description |
---|---|---|
since | 0.0.7 |
private insertLiterature( $literature) : mixed
Summary
Insert the given literature to the database after reformatting all fields.
Description
return the id of the literature
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$literature |
Returns: mixed
Tag | Version | Description |
---|---|---|
since | 0.0.7 |
private checkRelationAuthor( $params) : mixed|string
Summary
Check if authors already exist and return the the id.
Description
If not create new one and return the id of the new inserted author. Return multiple Ids as comma separated list when there are more then one author
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationEditor( $params) : mixed|string
Summary
Check if person or editor already exist and return the the id.
Description
If not create new one and return the id of the new inserted person. Return multiple Ids as comma separated list when there are more then one author
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private getPersonIDFromDB( $first_name, $last_name) : mixed
Summary
Query database to get author ids by first and last name create new one if none is found
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$first_name | |
|
$last_name |
Returns: mixed
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationType( $params) : mixed|string
Summary
Check if literature typ exists and return id or misc id as fallback
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationPublisher( $params) : mixed|string
Summary
Check if publisher already exists and return id of the exists or create new one and return the new id
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private getPublisherIDFromDB( $name) : integer
Summary
Check database for existing publisher or insert new one by name.
Description
In both cases return the id of the publisher.
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$name | publisher name |
Returns: integer - publisher id
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationJournal( $params) : mixed|string
Summary
Check if journal already exists and return id of the exists or create new one and return the new id
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationSeries( $params) : mixed|string
Summary
Check if series title already exists and return id of the exists or create new one and return the new id
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$params |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private checkRelationKeywords( $item) : mixed|string
Summary
Check if the keywords of the literature already exist.
Description
If not insert a new keyword into the database and return a list of IDs.
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$item |
Returns: mixed|string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private formatAuthor( $authors) : string
Summary
Reformat BibTex Author String, explode Author String by "and".
Description
Reformat Author names end remove escaping from BibTex format.
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$authors |
Returns: string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private updateState( $table, $id) : mixed
Summary
Update the State of an Element to 1 so it's published.
Description
Joomla! won't delete elements instead, they are changing states with this the unpublished state will be updated and the element ist active again
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$table | String table name of the element |
|
$id | int id of the element |
Returns: mixed
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private formatMonth( $month) : String
Summary
Format BibTex month String to numeric value jan => 1
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$month | String month to format |
Returns: String - formatted month string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private formatIsbn( $isbn) : string&#124;array<mixed,string>
Summary
Remove "-" from isbn to fit database format
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$isbn | isbn number to format |
Returns: string|array<mixed,string> - formatted string
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private removeBracketsFromString( $string) : string
Summary
remove BibTex standard formatting Brackets from String
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$string | String with brackets |
Returns: string - formatted String
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
private cleanUpString( $string) : string
Summary
clean up whitespaces and replace umlauts
Details:
- Inherited From: \PubdbBibTexImporter
Type | Name | Description |
---|---|---|
|
$string | String to format |
Returns: string - formatted String
Tag | Version | Description |
---|---|---|
since | v0.0.7 |
This document was automatically generated from source code comments on 2020-07-13 using phpDocumentor and fr3nch13/phpdoc-markdown