These are the methods exported by the GN4-Wordpress DLL and that can be invoked by a GN4 workflow:
Method ExportToWordpress
public static string ExportToWordpress(string xmlRpcUrl,
string userName,
string password,
System.Xml.XmlDocument gn4xml,
string GN4Ticket,
int id, out string newId)
Summary
Publishes a story to Wordpress-compatible blog, by using XML-RPC protocol. The article is published immediately. If the deadline tag is defined in the gn4xml parameter, that will be the publication date, otherwise will be the server's current date and time
Parameters
•xmlRpcUrl: URL site, being the XML-RPC page
•userName: Blog user name
•password: Blog password
•gn4xml: GN4 article (possibly in HTML format) to post on blog
•id: Wordpress Id of the story created. May be 0 (if new story)
•newId: If a new story is created, will return its Id here (as string due to a GN4 1.4 bug)
Returns
Empty string if the publication is successful; error string otherwise. The parameter Id is updated with the id of the new blog article.
Method UploadMediaToWP
public static string UploadMediaToWP(string xmlRpcUrl,
string userName,
string password,
string fPath,
string mediaName,
string mediaType,
out string sErrorMsg)
Summary
Uploads a media file to WordPress.
Parameters
•xmlRpcUrl: URL site, being the XML-RPC page
•userName: Blog user name
•password: Blog password
•fPath: Full path of the file to be uploaded.
•mediaName: Name of the media file in WordPress. If Empty, will use the file name.
•mediaType: Type of the media file (like image/jpeg).
•sErrorMsg: Will contain the error message of any exception. Otherwise, empty.
Returns
The URL of the uploaded media file in WordPress
Method DeleteWPStory
public static string DeleteWPStory(string xmlRpcUrl,
string userName,
string password,
int WPId,
bool bDelete,
out string errCo)
Summary
Un-publishes (possibly by deletion) an article published on a Wordpress-compatible blog, by using the XML-RPC protocol.
Parameters
•xmlRpcUrl: URL site, being the XML-RPC page
•userName: Blog user name
•password: Blog password
•WPId: Id of the Wordpress story
•bDelete: True: delete the story altogether; false, just un-publish it
Returns
Empty string if the operation completed successfully, error message otherwise.