Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Nlm30CitationSchemaFilter Class Reference
Inheritance diagram for Nlm30CitationSchemaFilter:
PersistableFilter Filter DataObject CrossrefNlm30CitationSchemaFilter FreeciteRawCitationNlm30CitationSchemaFilter IsbndbNlm30CitationSchemaFilter ParaciteRawCitationNlm30CitationSchemaFilter ParscitRawCitationNlm30CitationSchemaFilter PubmedNlm30CitationSchemaFilter RegexRawCitationNlm30CitationSchemaFilter WorldcatNlm30CitationSchemaFilter

Public Member Functions

 _guessPublicationType (&$metadataArray)
 
_recursivelyTrimPunctuation (&$metadataArray)
 
callWebService ($url, &$params, $returnType=XSL_TRANSFORMER_DOCTYPE_DOM, $method= 'GET')
 
 constructSearchStrings (&$searchTemplates, &$citationDescription)
 
fixPublisherNameAndLocation (&$metadata)
 
 getIsOptional ()
 
getNlm30CitationDescriptionFromMetadataArray (&$metadataArray)
 
 getSupportedPublicationTypes ()
 
 Nlm30CitationSchemaFilter (&$filterGroup, $supportedPublicationTypes=array())
 
postProcessMetadataArray (&$preliminaryNlm30Array)
 
 supports (&$input, &$output)
 
transformWebServiceResults (&$xmlResult, $xslFileName)
 
- Public Member Functions inherited from PersistableFilter
 addSetting (&$setting)
 
 getClassName ()
 
getFilterGroup ()
 
 getInternalSettings ()
 
 getIsTemplate ()
 
 getLocalizedSettingNames ()
 
 getParentFilterId ()
 
getSetting ($settingName)
 
 getSettingNames ()
 
getSettings ()
 
 hasSetting ($settingName)
 
 hasSettings ()
 
 PersistableFilter ($filterGroup)
 
 setIsTemplate ($isTemplate)
 
 setParentFilterId ($parentFilterId)
 
- Public Member Functions inherited from Filter
 addError ($message)
 
 clearErrors ()
 
execute (&$input)
 
 Filter ($inputType, $outputType)
 
 getDisplayName ()
 
 getErrors ()
 
getInputType ()
 
getLastInput ()
 
getLastOutput ()
 
getOutputType ()
 
getRuntimeEnvironment ()
 
 getSeq ()
 
 hasErrors ()
 
 isCompatibleWithRuntimeEnvironment ()
 
process (&$input)
 
 setDisplayName ($displayName)
 
 setRuntimeEnvironment (&$runtimeEnvironment)
 
 setSeq ($seq)
 
 setTransformationType (&$inputType, &$outputType)
 
 supports (&$input, &$output)
 
 supportsAsInput (&$input)
 
- Public Member Functions inherited from DataObject
 addSupportedMetadataAdapter ($metadataAdapter)
 
 DataObject ()
 
 extractMetadata ($metadataSchema)
 
 getAdditionalMetadataFieldNames ()
 
getAllData ()
 
getData ($key, $locale=null)
 
 getHasLoadableAdapters ()
 
 getId ()
 
 getLocaleMetadataFieldNames ()
 
getLocalizedData ($key)
 
 getMetadataFieldNames ($translated=true)
 
 getSetMetadataFieldNames ($translated=true)
 
 getSupportedExtractionAdapters ()
 
 getSupportedInjectionAdapters ()
 
 getSupportedMetadataSchemas ()
 
 hasData ($key, $locale=null)
 
 injectMetadata ($metadataDescription)
 
 removeSupportedMetadataAdapter ($metadataSchemaName)
 
 setAllData (&$data)
 
 setData ($key, $value, $locale=null)
 
 setHasLoadableAdapters ($hasLoadableAdapters)
 
 setId ($id)
 
 upcastTo ($targetObject)
 

Static Public Member Functions

static _allowedPublicationTypes ()
 
- Static Public Member Functions inherited from PersistableFilter
static tempGroup ($inputType, $outputType)
 
- Static Public Member Functions inherited from Filter
static supportedRuntimeEnvironmentSettings ()
 

Additional Inherited Members

- Public Attributes inherited from PersistableFilter
 $_settings = array()
 
- Public Attributes inherited from Filter
 $_errors = array()
 
 $_runtimeEnvironment = false
 
- Public Attributes inherited from DataObject
 $_data = array()
 
 $_extractionAdaptersLoaded = false
 
 $_hasLoadableAdapters = false
 
 $_injectionAdaptersLoaded = false
 
 $_metadataExtractionAdapters = array()
 
 $_metadataInjectionAdapters = array()
 

Detailed Description

Abstract base class for all filters that transform NLM citation metadata descriptions.

Definition at line 32 of file Nlm30CitationSchemaFilter.inc.php.

Member Function Documentation

static Nlm30CitationSchemaFilter::_allowedPublicationTypes ( )
static

Static method that returns a list of permitted publication types.

Returns
array

Definition at line 518 of file Nlm30CitationSchemaFilter.inc.php.

Nlm30CitationSchemaFilter::_guessPublicationType ( $metadataArray)

Try to guess a citation's publication type based on detected elements

Parameters
$metadataArrayarray

Definition at line 436 of file Nlm30CitationSchemaFilter.inc.php.

& Nlm30CitationSchemaFilter::_recursivelyTrimPunctuation ( $metadataArray)

Recursively trim punctuation from a metadata array.

Parameters
$metadataArrayarray

Definition at line 494 of file Nlm30CitationSchemaFilter.inc.php.

Nlm30CitationSchemaFilter::constructSearchStrings ( $searchTemplates,
$citationDescription 
)

Construct an array of search strings from a citation description and an array of search templates. The templates may contain the placeholders aulast%: the first author's surname au%: the first author full name title%: the article-title (if it exists), otherwise the source date%: the publication year isbn%: ISBN

Parameters
$searchTemplatesan array of templates
$citationDescriptionMetadataDescription
Returns
array

Definition at line 139 of file Nlm30CitationSchemaFilter.inc.php.

Referenced by IsbndbNlm30CitationSchemaIsbnFilter\process(), and WorldcatNlm30CitationSchemaFilter\process().

& Nlm30CitationSchemaFilter::fixPublisherNameAndLocation ( $metadata)

Take an NLM preliminary meta-data array and fix publisher-loc and publisher-name entries:

  • If there is a location but no name then try to extract a publisher name from the location string.
  • Make sure that location and name are not the same.
  • Copy institution to publisher if no publisher is set, otherwise leave the institution.
    Parameters
    $metadataarray
    Returns
    array

Definition at line 398 of file Nlm30CitationSchemaFilter.inc.php.

References String\regexp_replace().

Referenced by FreeciteRawCitationNlm30CitationSchemaFilter\process(), and ParscitRawCitationNlm30CitationSchemaFilter\process().

Nlm30CitationSchemaFilter::getIsOptional ( )

Whether this filter is optional within its context (journal, conference, press, etc.)

Returns
boolean

Definition at line 82 of file Nlm30CitationSchemaFilter.inc.php.

& Nlm30CitationSchemaFilter::getNlm30CitationDescriptionFromMetadataArray ( $metadataArray)
Nlm30CitationSchemaFilter::getSupportedPublicationTypes ( )

Get the supported publication types

Returns
array

Definition at line 73 of file Nlm30CitationSchemaFilter.inc.php.

References DataObject\getData().

Referenced by supports().

Nlm30CitationSchemaFilter::Nlm30CitationSchemaFilter ( $filterGroup,
  $supportedPublicationTypes = array() 
)

Constructor

Parameters
$filterGroupFilterGroup
$supportedPublicationTypesarray

Definition at line 44 of file Nlm30CitationSchemaFilter.inc.php.

& Nlm30CitationSchemaFilter::postProcessMetadataArray ( $preliminaryNlm30Array)

Post processes an NLM meta-data array

Parameters
$preliminaryNlm30Arrayarray
Returns
array

Definition at line 274 of file Nlm30CitationSchemaFilter.inc.php.

Referenced by WorldcatNlm30CitationSchemaFilter\_lookupXIsbn(), and RegexRawCitationNlm30CitationSchemaFilter\process().

Nlm30CitationSchemaFilter::supports ( $input,
$output 
)
See Also
Filter::supports()
Parameters
$inputmixed
$outputmixed
$fromStringboolean true if the filter accepts a string as input.
$toStringboolean true if the filter produces a string as output.
Returns
boolean

Definition at line 98 of file Nlm30CitationSchemaFilter.inc.php.

References getSupportedPublicationTypes().

& Nlm30CitationSchemaFilter::transformWebServiceResults ( $xmlResult,
  $xslFileName 
)

Takes the raw xml result of a web service and transforms it via XSL to a (preliminary) XML similar to NLM which is then re-encoded into an array. Finally some typical post-processing is performed. FIXME: Rewrite parser/lookup filter XSL to produce real NLM element-citation XML and factor this code into an NLM XML to NLM description filter.

Parameters
$xmlResultstring or DOMDocument
$xslFileNamestring
Returns
array a metadata array

Definition at line 245 of file Nlm30CitationSchemaFilter.inc.php.

Referenced by WorldcatNlm30CitationSchemaFilter\_lookupWorldcat(), ParscitRawCitationNlm30CitationSchemaFilter\process(), FreeciteRawCitationNlm30CitationSchemaFilter\process(), IsbndbIsbnNlm30CitationSchemaFilter\process(), and CrossrefNlm30CitationSchemaFilter\process().


The documentation for this class was generated from the following file: