Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PersistableFilter Class Reference
Inheritance diagram for PersistableFilter:
Filter DataObject CompositeFilter Mods34DescriptionXmlFilter NativeImportExportFilter Nlm30CitationSchemaFilter PersistableTestFilter TemplateBasedFilter XSLTransformationFilter GenericMultiplexerFilter GenericSequencerFilter NativeExportFilter NativeImportFilter CrossrefNlm30CitationSchemaFilter FreeciteRawCitationNlm30CitationSchemaFilter IsbndbNlm30CitationSchemaFilter ParaciteRawCitationNlm30CitationSchemaFilter ParscitRawCitationNlm30CitationSchemaFilter PubmedNlm30CitationSchemaFilter RegexRawCitationNlm30CitationSchemaFilter WorldcatNlm30CitationSchemaFilter Nlm30CitationSchemaCitationOutputFormatFilter TemplateBasedReferencesListFilter

Public Member Functions

 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 tempGroup ($inputType, $outputType)
- Static Public Member Functions inherited from Filter
static supportedRuntimeEnvironmentSettings ()

Public Attributes

 $_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

A filter that can be persisted to the database.

See Also

Persisted filters are attributed to a filter group so that all filters of the same kind can be discovered from the database.

Persisted filters also can provide a list of FilterSetting objects which represent persistable filter configuration parameters.

Persisted filters are templatable. This means that a non-parameterized copy of the filter can be persisted as a template for actual filter instances. The end user can discover such templates and use them to configure personalized transformations.

The filter template can provide default settings for all filter settings.

Persistable filters can be accessed via the FilterDAO which acts as a filter registry.

Filters can be organized hierarchically into filter networks or filter pipelines. The hierarchical relation is represented via parent- child relationships. See CompositeFilter for more details.

Definition at line 44 of file

Member Function Documentation

PersistableFilter::getClassName ( )

Return the fully qualified class name of the filter class. This information must be persisted when saving a filter so that the filter can later be reconstructed from the information in the database.

(This must be hard coded by sub-classes for PHP4 compatibility. PHP4 always returns class names lowercase which we cannot tolerate as we need this path to find the class on case sensitive file systems.)

Definition at line 205 of file

References getSettings().

& PersistableFilter::getFilterGroup ( )

Get the filter group


Definition at line 93 of file

PersistableFilter::getInternalSettings ( )

Returns names of settings which are in use by the filter class and therefore cannot be set as filter settings.


Definition at line 292 of file

PersistableFilter::getIsTemplate ( )

Is this a transformation template rather than an actual transformation?


Definition at line 121 of file

PersistableFilter::getLocalizedSettingNames ( )

Return an array with the names of localized filter settings.

This will be used by the FilterDAO for filter setting persistence.


Definition at line 240 of file

PersistableFilter::getParentFilterId ( )

Get the parent filter id


Definition at line 137 of file

& PersistableFilter::getSetting (   $settingName)

Get a filter setting


Definition at line 162 of file

PersistableFilter::getSettingNames ( )

Return an array with the names of non-localized filter settings.

This will be used by the FilterDAO for filter setting persistence.


Definition at line 221 of file

& PersistableFilter::getSettings ( )

Get all filter settings

array a list of FilterSetting objects

Definition at line 171 of file

Referenced by getClassName().

PersistableFilter::hasSetting (   $settingName)

Check whether a given setting is present in this filter.

Definition at line 179 of file

PersistableFilter::hasSettings ( )

Can this filter be parameterized?


Definition at line 187 of file

PersistableFilter::PersistableFilter (   $filterGroup)


NB: Sub-classes of this class must not add additional mandatory constructor arguments. Sub-classes that implement additional optional constructor arguments must make these also accessible via setters if they are required to fully parameterize the transformation. Filter parameters must be stored as data in the underlying DataObject.

This is necessary as the FilterDAO does not support constructor configuration. Filter parameters will be configured via DataObject::setData(). Only parameters that are available in the DataObject will be persisted.


Definition at line 74 of file

PersistableFilter::setIsTemplate (   $isTemplate)

Set whether this is a transformation template rather than an actual transformation.

Transformation templates are saved to the database when the filter is first registered. They are configured with default settings and will be used to let users identify available transformation types.

There must be exactly one transformation template for each supported filter group.


Definition at line 112 of file

PersistableFilter::setParentFilterId (   $parentFilterId)

Set the parent filter id


Definition at line 129 of file

static PersistableFilter::tempGroup (   $inputType,

There are certain generic filters (e.g. CompositeFilters) that sometimes need to be persisted and sometimes are instantiated and used in code only.

As we don't have multiple inheritance in PHP we'll have to use the more general filter type (PersistableFilter) as the base class of these "hybrid" filters.

This means that we carry around some structure (e.g. filter groups) that do only make sense when a filter is actually being persisted and otherwise create unnecessary code.

We provide this helper function to instantiate a temporary filter group on the fly with only an input and an output type which takes away at least some of the cruft.


Definition at line 274 of file

Referenced by TemplateBasedReferencesListFilter\getCitationOutputFilterInstance(), MetadataDescriptionDummyAdapter\MetadataDescriptionDummyAdapter(), ParscitRawCitationNlm30CitationSchemaFilterTest\testAllCitationsWithThisParser(), FreeciteRawCitationNlm30CitationSchemaFilterTest\testAllCitationsWithThisParser(), ParaciteRawCitationNlm30CitationSchemaFilterTest\testAllCitationsWithThisParser(), RegexRawCitationNlm30CitationSchemaFilterTest\testAllCitationsWithThisParser(), Nlm30Nlm23CrosswalkFilterTest\testExecute(), PKPSubmissionNlm30XmlFilterTest\testExecute(), FreeciteRawCitationNlm30CitationSchemaFilterTest\testExecute(), RegexRawCitationNlm30CitationSchemaFilterTest\testExecute(), ParaciteRawCitationNlm30CitationSchemaFilterTest\testExecute(), ParscitRawCitationNlm30CitationSchemaFilterTest\testExecute(), IsbndbNlm30CitationSchemaIsbnFilterTest\testExecute(), IsbndbIsbnNlm30CitationSchemaFilterTest\testExecute(), WorldcatNlm30CitationSchemaFilterTest\testExecuteWithDoi(), CrossrefNlm30CitationSchemaFilterTest\testExecuteWithDoi(), CrossrefNlm30CitationSchemaFilterTest\testExecuteWithOpenurl10Search(), PubmedNlm30CitationSchemaFilterTest\testExecuteWithPmid(), PubmedNlm30CitationSchemaFilterTest\testExecuteWithSearch(), ParscitRawCitationNlm30CitationSchemaFilterTest\testExecuteWithWebServiceError(), FreeciteRawCitationNlm30CitationSchemaFilterTest\testExecuteWithWebServiceError(), Mods34DescriptionXmlFilterTest\testMods34DescriptionXmlFilter(), and Nlm30CitationSchemaCitationAdapterTest\testNlm30CitationSchemaCitationAdapter().

Member Data Documentation

array PersistableFilter::$_settings = array()

a list of FilterSetting objects

Definition at line 55 of file

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