public class GoogleMetadata extends Object
| Constructor and Description |
|---|
GoogleMetadata(Context context,
Item item)
Wrap the item, parse all configured fields and generate metadata field
values.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAggregateValues(String field,
String delimiter) |
protected void |
addMultipleValues(String FIELD)
If metadata field contains multiple values, then add each value to the map separately
|
protected boolean |
addSingleField(String fieldName)
Add a single metadata value to the Google field, defaulting to the
first-encountered instance of the field for this Item.
|
protected String |
buildFieldName(MetadataValue v)
Construct metadata field name out of Metadatum components
|
List<org.jdom.Element> |
disseminateList()
Produce meta elements that can easily be put into the head.
|
protected Bitstream |
findLinkableFulltext(Item item)
A bitstream is considered linkable fulltext when it is either
the item's only bitstream (in the ORIGINAL bundle); or
the primary bitstream
Additionally, this bitstream must be publicly viewable.
|
List<String> |
getAbstractHTMLURL() |
List<String> |
getAuthors() |
List<String> |
getConference() |
List<String> |
getDate() |
List<String> |
getDissertationInstitution() |
List<String> |
getDissertationName() |
List<String> |
getDOI() |
List<String> |
getFirstpage() |
List<String> |
getFulltextHTMLURL() |
List<String> |
getISBN() |
List<String> |
getISSN() |
List<String> |
getIssue() |
List<String> |
getJournalTitle() |
List<String> |
getKeywords() |
List<String> |
getLanguage() |
List<String> |
getLastpage() |
Collection<Map.Entry<String,String>> |
getMappings()
Fetch retaining the order of the values for any given key in which they
where added (like authors).
|
List<String> |
getPatentCountry() |
List<String> |
getPatentNumber() |
protected String |
getPDFSimpleUrl(Item item)
Gets the URL to a PDF using a very basic strategy by assuming that the PDF
is in the default content bundle, and that the item only has one public bitstream
and it is a PDF.
|
List<String> |
getPDFURL() |
List<String> |
getPmid() |
List<String> |
getPublisher() |
List<String> |
getTechnicalReportInstitution() |
List<String> |
getTechnicalReportNumber() |
List<String> |
getTitle() |
List<String> |
getVolume() |
protected boolean |
identifyItemType(String dConfig)
Identifies if this item matches a particular configuration of fields and
values for those fields to identify the type based on a type- cataloging
metadata practice.
|
protected boolean |
isPublic(Bitstream bitstream) |
protected boolean |
itemIsDissertation()
Determine, based on config values, if this item is a dissertation.
|
protected boolean |
itemIsPatent()
Determine, based on config values, if this item is a patent.
|
protected boolean |
itemIsTechReport()
Determine, based on config values, if this item is a tech report.
|
static void |
logConfiguration()
Dump Metadata field mapping to log
|
protected String[] |
parseComponents(String field)
Pull apart an individual field structure.
|
protected ArrayList<String> |
parseFields(String configString)
Build a Vector of fields that can be added to when expanding wildcards.
|
protected void |
parseItem()
Using metadata field mappings contained in the loaded configuration,
parse through configured metadata fields, building valid Google metadata
value strings.
|
protected ArrayList<ArrayList<String>> |
parseOptions(String configFilter)
Parse first-match path of metadata field-group options for the given
configuration.
|
protected ArrayList<String> |
parseWildcard(String field)
Expand any wildcard characters to an array of all matching fields for
this item.
|
protected ArrayList<MetadataValue> |
resolveMetadata(String configFilter,
int returnType)
Aggregate an array of DCValues present on the current item that pass the
configuration filter.
|
protected MetadataValue |
resolveMetadataField(String configFilter)
A singular version of resolveMetadata to return only one field value
instead of an aggregate.
|
protected ArrayList<MetadataValue> |
resolveMetadataFields(String configFilter)
A plural version of resolveMetadata for aggregate fields.
|
protected static final String GOOGLE_PREFIX
protected ItemService itemService
protected Item item
protected String itemURL
protected final String TITLE
protected final String JOURNAL_TITLE
protected final String PUBLISHER
protected final String AUTHORS
protected final String DATE
protected final String VOLUME
protected final String ISSUE
protected final String FIRSTPAGE
protected final String LASTPAGE
protected final String DOI
protected final String PMID
protected final String ABSTRACT
protected final String FULLTEXT
protected final String PDF
protected final String ISSN
protected final String ISBN
protected final String LANGUAGE
protected final String KEYWORDS
protected final String CONFERENCE
protected final String DISSERTATION_ID
protected final String DISSERTATION_NAME
protected final String DISSERTATION_INSTITUTION
protected final String PATENT_ID
protected final String PATENT_NUMBER
protected final String PATENT_COUNTRY
protected final String TECH_REPORT_ID
protected final String TECH_REPORT_NUMBER
protected final String TECH_REPORT_INSTITUTION
protected final int SINGLE
protected final int MULTI
protected final int ALL_FIELDS_IN_OPTION
public GoogleMetadata(Context context, Item item) throws SQLException
context - contextitem - The item being viewed to extract metadata fromSQLException - if database errorpublic static void logConfiguration()
protected boolean addSingleField(String fieldName)
fieldName - protected MetadataValue resolveMetadataField(String configFilter)
configFilter - protected ArrayList<MetadataValue> resolveMetadataFields(String configFilter)
configFilter - protected ArrayList<MetadataValue> resolveMetadata(String configFilter, int returnType)
configFilter - returnType - protected ArrayList<ArrayList<String>> parseOptions(String configFilter)
configFilter - protected ArrayList<String> parseFields(String configString)
configString - - Value of one metadata field configurationprotected String[] parseComponents(String field)
field - The configured field for one metadata field mapprotected ArrayList<String> parseWildcard(String field)
field - The field identifier containing a wildcard character.protected String buildFieldName(MetadataValue v)
v - The Metadatum to construct a name for.protected void parseItem()
public Collection<Map.Entry<String,String>> getMappings()
GoogleMetadata gmd = new GoogleMetadata(item); for(Entry<String,
String> mapping : googlemd.getMappings()) ...public List<org.jdom.Element> disseminateList()
public List<String> getDissertationName()
public List<String> getDissertationInstitution()
public List<String> getTechnicalReportNumber()
public List<String> getTechnicalReportInstitution()
protected String getPDFSimpleUrl(Item item)
item - protected Bitstream findLinkableFulltext(Item item) throws SQLException
item - SQLException - if database errorprotected boolean isPublic(Bitstream bitstream)
protected void addAggregateValues(String field, String delimiter)
field - to aggregate all values of in a matching optiondelimiter - to delimit field values withprotected void addMultipleValues(String FIELD)
FIELD - protected boolean itemIsDissertation()
protected boolean itemIsPatent()
protected boolean itemIsTechReport()
protected boolean identifyItemType(String dConfig)
dConfig - Copyright © 2022 LYRASIS. All rights reserved.