KBlog::WordpressBuggy

KBlog::WordpressBuggy Class Reference

#include <wordpressbuggy.h>

Inheritance diagram for KBlog::WordpressBuggy:

Public Member Functions

 WordpressBuggy (const QUrl &server, QObject *parent=nullptr)
 
virtual ~WordpressBuggy ()
 
void createPost (KBlog::BlogPost *post) override
 
QString interfaceName () const override
 
void modifyPost (KBlog::BlogPost *post) override
 
- Public Member Functions inherited from KBlog::MovableType
 MovableType (const QUrl &server, QObject *parent=nullptr)
 
virtual ~MovableType ()
 
void fetchPost (KBlog::BlogPost *post) override
 
void listRecentPosts (int number) override
 
virtual void listTrackBackPings (KBlog::BlogPost *post)
 
- Public Member Functions inherited from KBlog::MetaWeblog
 MetaWeblog (const QUrl &server, QObject *parent=nullptr)
 
virtual ~MetaWeblog ()
 
virtual void createMedia (KBlog::BlogMedia *media)
 
virtual void listCategories ()
 
- Public Member Functions inherited from KBlog::Blogger1
 Blogger1 (const QUrl &server, QObject *parent=nullptr)
 
virtual ~Blogger1 ()
 
virtual void fetchUserInfo ()
 
virtual void listBlogs ()
 
void removePost (KBlog::BlogPost *post) override
 
void setUrl (const QUrl &server) override
 
- Public Member Functions inherited from KBlog::Blog
 Blog (const QUrl &server, QObject *parent=nullptr, const QString &applicationName=QString(), const QString &applicationVersion=QString())
 
virtual ~Blog ()
 
QString blogId () const
 
QString password () const
 
virtual void setBlogId (const QString &blogId)
 
virtual void setPassword (const QString &password)
 
virtual void setTimeZone (const QTimeZone &timeZone)
 
void setUserAgent (const QString &applicationName, const QString &applicationVersion)
 
virtual void setUsername (const QString &username)
 
QTimeZone timeZone ()
 
QUrl url () const
 
QString userAgent () const
 
QString username () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

 WordpressBuggy (const QUrl &server, WordpressBuggyPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from KBlog::MovableType
 MovableType (const QUrl &server, MovableTypePrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from KBlog::MetaWeblog
 MetaWeblog (const QUrl &server, MetaWeblogPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from KBlog::Blogger1
 Blogger1 (const QUrl &server, Blogger1Private &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from KBlog::Blog
 Blog (const QUrl &server, BlogPrivate &dd, QObject *parent=nullptr, const QString &applicationName=QString(), const QString &applicationVersion=QString())
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Types inherited from KBlog::Blog
enum  ErrorType {
  XmlRpc, Atom, ParsingError, AuthenticationError,
  NotSupported, Other
}
 
- Properties inherited from QObject
 objectName
 
- Signals inherited from KBlog::MovableType
void listedTrackBackPings (KBlog::BlogPost *post, const QList< QMap< QString, QString > > &pings)
 
- Signals inherited from KBlog::MetaWeblog
void createdMedia (KBlog::BlogMedia *media)
 
void listedCategories (const QList< QMap< QString, QString > > &categories)
 
- Signals inherited from KBlog::Blogger1
void fetchedUserInfo (const QMap< QString, QString > &userInfo)
 
void listedBlogs (const QList< QMap< QString, QString > > &blogsList)
 
- Signals inherited from KBlog::Blog
void createdPost (KBlog::BlogPost *post)
 
void error (KBlog::Blog::ErrorType type, const QString &errorMessage)
 
void errorComment (KBlog::Blog::ErrorType type, const QString &errorMessage, KBlog::BlogPost *post, KBlog::BlogComment *comment)
 
void errorMedia (KBlog::Blog::ErrorType type, const QString &errorMessage, KBlog::BlogMedia *media)
 
void errorPost (KBlog::Blog::ErrorType type, const QString &errorMessage, KBlog::BlogPost *post)
 
void fetchedPost (KBlog::BlogPost *post)
 
void listedRecentPosts (const QList< KBlog::BlogPost > &posts)
 
void modifiedPost (KBlog::BlogPost *post)
 
void removedPost (KBlog::BlogPost *post)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Attributes inherited from KBlog::Blog
BlogPrivate *const d_ptr
 

Detailed Description

A class that can be used for access to blogs (Wordpress, Drupal <5.6 and most likely many more) which simply use the yyyyMMddThh:mm:ss dateTime.iso8601 format stated on http://www.xmlrpc.com.

This is only an example for an ISO-8601 compatible format, but many blogs seem to assume exactly this format. This class is needed because KXmlRpc::Client only has support for the extended format yyyy-MM-ddThh:mm:ss which is also standard conform and makes more sense than the mixture above. This class reimplements createPost and modifyPost from scratch to send the dateTime in a compatible format (yyyyMMddThh:mm:ss).

The rest of the code is inherited from MovableType, as it does not use the dateTime format. The name is because this problem was first discovered with Wordpress.

Blog* myblog = new WordpressBuggy("http://example.com/xmlrpc/gateway.php");
myblog->setUsername( "some_user_id" );
myblog->setPassword( "YoURFunnyPAsSwoRD" );
myblog->setBlogId( "1" ); // can be caught by listBlogs()
KBlog::BlogPost *post = new BlogPost();
post->setTitle( "This is the title." );
post->setContent( "Here is some the content..." );
myblog->createPost( post );
Author
Christian Weilbach <[email protected]>

Definition at line 69 of file wordpressbuggy.h.

Constructor & Destructor Documentation

WordpressBuggy::WordpressBuggy ( const QUrl server,
QObject parent = nullptr 
)
explicit

Create an object for WordpressBuggy.

Parameters
serveris the url for the xmlrpc gateway.
parentis the parent object.

Definition at line 36 of file wordpressbuggy.cpp.

WordpressBuggy::~WordpressBuggy ( )
virtual

Destroy the object.

Definition at line 49 of file wordpressbuggy.cpp.

WordpressBuggy::WordpressBuggy ( const QUrl server,
WordpressBuggyPrivate &  dd,
QObject parent = nullptr 
)
protected

Constructor needed for private inheritance.

Definition at line 42 of file wordpressbuggy.cpp.

Member Function Documentation

void WordpressBuggy::createPost ( KBlog::BlogPost post)
overridevirtual

Create a new post on server.

Parameters
postis send to the server.

Reimplemented from KBlog::MovableType.

Definition at line 54 of file wordpressbuggy.cpp.

QString WordpressBuggy::interfaceName ( ) const
overridevirtual

Returns the of the inherited object.

Reimplemented from KBlog::MovableType.

Definition at line 271 of file wordpressbuggy.cpp.

void WordpressBuggy::modifyPost ( KBlog::BlogPost post)
overridevirtual

Modify a post on server.

Parameters
postThe post to be modified on the server. You need to set its id correctly.
See also
BlogPost::setPostId( const QString& )
modifiedPost( KBlog::BlogPost* )

Reimplemented from KBlog::MovableType.

Definition at line 167 of file wordpressbuggy.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jun 4 2020 23:07:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.