• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • Nepomuk2
  • ExtractorPlugin
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Nepomuk2::ExtractorPlugin Class Referenceabstract

#include <extractorplugin.h>

Inheritance diagram for Nepomuk2::ExtractorPlugin:
Inheritance graph
[legend]

Public Types

enum  ExtractingCritera { BasicMimeType = 1, Custom = 2 }
 

Public Member Functions

 ExtractorPlugin (QObject *parent)
 
virtual ~ExtractorPlugin ()
 
virtual ExtractingCritera criteria ()
 
virtual SimpleResourceGraph extract (const QUrl &resUri, const QUrl &fileUrl, const QString &mimeType)=0
 
virtual QStringList mimetypes ()
 
virtual bool shouldExtract (const QUrl &url, const QString &mimeType)
 

Static Public Member Functions

static QList< SimpleResource > contactsFromString (const QString &string)
 
static QDateTime dateTimeFromString (const QString &dateString)
 
static int maxPlainTextSize ()
 
static void resetMaxPlainTextSize ()
 
static void setMaxPlainTextSize (int size)
 

Detailed Description

The ExtractorPlugin is the base class for all file metadata extractors.

It is responsible for extracting the metadata and providing it to Nepomuk.

Make sure to implement either mimetypes or the shouldExtract function and update the indexingCriteria accordingly

Author
Vishesh Handa me@vh.nosp@m.anda.nosp@m..in

Definition at line 60 of file extractorplugin.h.

Member Enumeration Documentation

enum Nepomuk2::ExtractorPlugin::ExtractingCritera

Each Plugin provides an extracting critera which determines when the plugin should be called.

Enumerator
BasicMimeType 

This is a simple plugin that just has a list of mimetypes that it supports.

Custom 

The plugin implements the determineMimeType function and uses that to determine if the url and mimetype are supported.

Definition at line 71 of file extractorplugin.h.

Constructor & Destructor Documentation

Nepomuk2::ExtractorPlugin::ExtractorPlugin ( QObject *  parent)

Definition at line 31 of file extractorplugin.cpp.

Nepomuk2::ExtractorPlugin::~ExtractorPlugin ( )
virtual

Definition at line 35 of file extractorplugin.cpp.

Member Function Documentation

QList< SimpleResource > Nepomuk2::ExtractorPlugin::contactsFromString ( const QString &  string)
static

Creates a list of nco:Contacts from a list of strings which are separated by a number of different separators.

It sets the contact's nco:fullname.

Definition at line 88 of file extractorplugin.cpp.

ExtractorPlugin::ExtractingCritera Nepomuk2::ExtractorPlugin::criteria ( )
virtual

Returns the critera that is being used for determining if this plugin can index the files provided to it.

By default this returns BasicMimeType

See also
mimetypes
shouldExtract

Reimplemented in Nepomuk2::PlainTextExtractor.

Definition at line 39 of file extractorplugin.cpp.

QDateTime Nepomuk2::ExtractorPlugin::dateTimeFromString ( const QString &  dateString)
static

Tries to extract a valid date time from the string provided.

Definition at line 59 of file extractorplugin.cpp.

virtual SimpleResourceGraph Nepomuk2::ExtractorPlugin::extract ( const QUrl &  resUri,
const QUrl &  fileUrl,
const QString &  mimeType 
)
pure virtual

The main function of the plugin that is responsible for extracting the data from the file url and returning a SimpleResourceGraph.

It does so on the basis of the mimetype provided.

Parameters
resUriThe resource uri of the fileUrl which should be used in the SimpleResource
fileUrlThe url of the file being indexed
mimeTypethe mimetype of the file url

Implemented in Nepomuk2::PopplerExtractor, Nepomuk2::Office2007Extractor, Nepomuk2::PlainTextExtractor, Nepomuk2::Exiv2Extractor, Nepomuk2::OdfExtractor, Nepomuk2::OfficeExtractor, Nepomuk2::EPubExtractor, Nepomuk2::FFmpegExtractor, Nepomuk2::MobiExtractor, and Nepomuk2::TagLibExtractor.

int Nepomuk2::ExtractorPlugin::maxPlainTextSize ( )
static

Virtuoso does not support streaming operators, and does not accept queries above a certain size.

Since the plain text has to go in a query, there is no point extracting more than this plain text

Definition at line 124 of file extractorplugin.cpp.

QStringList Nepomuk2::ExtractorPlugin::mimetypes ( )
virtual

Provide a list of mimetypes which are supported by this plugin.

Only files with those mimetypes will be provided to the plugin via the extract function.

Returns
A StringList containing the mimetypes.
See also
extract

Reimplemented in Nepomuk2::PopplerExtractor, Nepomuk2::Exiv2Extractor, Nepomuk2::Office2007Extractor, Nepomuk2::EPubExtractor, Nepomuk2::FFmpegExtractor, Nepomuk2::MobiExtractor, Nepomuk2::TagLibExtractor, Nepomuk2::OdfExtractor, and Nepomuk2::OfficeExtractor.

Definition at line 44 of file extractorplugin.cpp.

void Nepomuk2::ExtractorPlugin::resetMaxPlainTextSize ( )
static

Definition at line 129 of file extractorplugin.cpp.

void Nepomuk2::ExtractorPlugin::setMaxPlainTextSize ( int  size)
static

Definition at line 134 of file extractorplugin.cpp.

bool Nepomuk2::ExtractorPlugin::shouldExtract ( const QUrl &  url,
const QString &  mimeType 
)
virtual

By default this returns true if mimetype is in the list of mimetypes provided by the plugin.

If this function has been reimplemented then the ExtractingCritera should be changed.

Reimplemented in Nepomuk2::PlainTextExtractor.

Definition at line 49 of file extractorplugin.cpp.


The documentation for this class was generated from the following files:
  • extractorplugin.h
  • extractorplugin.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal