PubdbBibTexImporter - JoomlaPubDB/PubDB GitHub Wiki

Class: \PubdbBibTexImporter

Namespace: [](../namespaces/default)


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.


Constants

  • No constants found

Properties


Methods


Details


Tags

Tag Version Description
since 0.0.7

Properties

private $parser : \RenanBr\BibTexParser\Parser()


Type: \RenanBr\BibTexParser\Parser() BibTex Parser instance Details:

Tags
Tag Version Description
since v0.0.7

private $listener : \RenanBr\BibTexParser\Listener()


Type: \RenanBr\BibTexParser\Listener() BibTex Listener instance Details:

Tags
Tag Version Description
since v0.0.7

private $latexMapping : array


Type: array mapping table for umlauts Details:

Tags
Tag Version Description
since v0.0.7

private $fieldMapping : array


Type: array mapping table for database and BibTex format Details:

Tags
Tag Version Description
since v0.0.7

private $json_file : String


Type: String json file path for latex mapping Details:

Tags
Tag Version Description
since v0.0.7

Methods

public __construct()

public __construct(  $file_string) 

Summary

PubdbBibTexImporter constructor.

Details:

Parameters:
Type Name Description
$file_string String file path of the import file
Throws:
Type Description
\RenanBr\BibTexParser\Exception\ParserException
Tags
Tag Version Description
since v0.0.7

public startImport() : array

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:

Returns: array

Tags
Tag Version Description
since 0.0.7

private importLiterature() : array

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:

Parameters:
Type Name Description
$literature_list

Returns: array

Tags
Tag Version Description
since 0.0.7

private insertLiterature() : mixed

private insertLiterature(  $literature) : mixed

Summary

Insert the given literature to the database after reformatting all fields.

Description

return the id of the literature

Details:

Parameters:
Type Name Description
$literature

Returns: mixed

Tags
Tag Version Description
since 0.0.7

private checkRelationAuthor() : mixed|string

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:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private checkRelationEditor() : mixed|string

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:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private getPersonIDFromDB() : mixed

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:

Parameters:
Type Name Description
$first_name
$last_name

Returns: mixed

Tags
Tag Version Description
since v0.0.7

private checkRelationType() : mixed|string

private checkRelationType(  $params) : mixed|string

Summary

Check if literature typ exists and return id or misc id as fallback

Details:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private checkRelationPublisher() : mixed|string

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:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private getPublisherIDFromDB() : integer

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:

Parameters:
Type Name Description
$name publisher name

Returns: integer - publisher id

Tags
Tag Version Description
since v0.0.7

private checkRelationJournal() : mixed|string

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:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private checkRelationSeries() : mixed|string

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:

Parameters:
Type Name Description
$params

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private checkRelationKeywords() : mixed|string

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:

Parameters:
Type Name Description
$item

Returns: mixed|string

Tags
Tag Version Description
since v0.0.7

private formatAuthor() : string

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:

Parameters:
Type Name Description
$authors

Returns: string

Tags
Tag Version Description
since v0.0.7

private updateState() : mixed

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:

Parameters:
Type Name Description
$table String table name of the element
$id int id of the element

Returns: mixed

Tags
Tag Version Description
since v0.0.7

private formatMonth() : String

private formatMonth(  $month) : String

Summary

Format BibTex month String to numeric value jan => 1

Details:

Parameters:
Type Name Description
$month String month to format

Returns: String - formatted month string

Tags
Tag Version Description
since v0.0.7

private formatIsbn() : string&#124;array<mixed,string>

private formatIsbn(  $isbn) : string&amp;#124;array&lt;mixed,string&gt;

Summary

Remove "-" from isbn to fit database format

Details:

Parameters:
Type Name Description
$isbn isbn number to format

Returns: string|array<mixed,string> - formatted string

Tags
Tag Version Description
since v0.0.7

private removeBracketsFromString() : string

private removeBracketsFromString(  $string) : string

Summary

remove BibTex standard formatting Brackets from String

Details:

Parameters:
Type Name Description
$string String with brackets

Returns: string - formatted String

Tags
Tag Version Description
since v0.0.7

private cleanUpString() : string

private cleanUpString(  $string) : string

Summary

clean up whitespaces and replace umlauts

Details:

Parameters:
Type Name Description
$string String to format

Returns: string - formatted String

Tags
Tag Version Description
since v0.0.7

Top Namespaces


Reports


This document was automatically generated from source code comments on 2020-07-13 using phpDocumentor and fr3nch13/phpdoc-markdown

⚠️ **GitHub.com Fallback** ⚠️