Configuring Wordpress integration

Wordpress publication feature automatically publish contents from OpenKM to Wordpress. OpenKM Wordpress publication feature can upload HTML contents and related images from OpenKM to Wordpress.

More information at Wordpress publication extension.

Configuration

Register parameters

Check if parameters are registered at Administration > Configuration parameters otherwise goto to Administration > Utilities > Database query and register it:

INSERT INTO OKM_CONFIG (CFG_KEY, CFG_TYPE, CFG_VALUE) VALUES ('wordpress.url', 'string', 'http://localhost/openkmblog/xmlrpc.php');
INSERT INTO OKM_CONFIG (CFG_KEY, CFG_TYPE, CFG_VALUE) VALUES ('wordpress.user', 'string', 'user');
INSERT INTO OKM_CONFIG (CFG_KEY, CFG_TYPE, CFG_VALUE) VALUES ('wordpress.pass', 'string', 'password');

Configure parameters

Field / PropertyTypeDescription

wordpress.url

String

The Wordpress XML-RPC URL

http://yoursite/blogname/xmlrpc.php

wordpress.user

String

The Wordpress user.

User must have publish grants.

wordpress.pass

String

The password of the user.

These parameters are set at Administration > Configuration parameters.

Register metadata group

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.3//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.3.dtd">
<property-groups>
  <property-group label="WP Publication" name="okg:wordpress_publication">
    <input label="Id" type="text" name="okp:wordpress_publication.id" readonly="true"/>
    <input label="Title" type="text" name="okp:wordpress_publication.title" width="300px">
      <validator type="req"/>   
    </input>       
    <select label="Category" name="okp:wordpress_publication.category" type="multiple">
      <option label="OpenKM Features" value="OpenKM Features"/>
      <option label="OpenKM Blog" value="OpenKM Blog"/>
    </select>  
    <textarea label="Tag" name="okp:wordpress_publication.tag" />
    <input label="Date" type="date" name="okp:wordpress_publication.date" >
      <validator type="req"/>
    </input>      
    <select label="Type" name="okp:wordpress_publication.type" type="simple">
      <option label="Post" value="post"/>
      <option label="Page" value="page"/>          
      <validator type="req"/>
    </select>
    <select label="Status" name="okp:wordpress_publication.status" type="simple">
      <option label="Draft" value="draft"/>
      <option label="Public" value="publish"/>
      <option label="Pending" value="pending"/>
      <option label="Future" value="future"/>
      <option label="Password protected" value="protected" /> 
      <option label="Private" value="private"/> 
      <validator type="req"/>
    </select>      
    <input label="Password" type="text" name="okp:wordpress_publication.password"/>      
    <select label="Synchronized" name="okp:wordpress_publication.synchronized" type="simple">
      <option label="True" value="true"/>
      <option label="False" value="false"/>
      <validator type="req"/>
    </select>  
    <input label="Related media" type="text" name="okp:wordpress_publication.related.media" readonly="true"/>    
  </property-group>
  <property-group label="WP Media" name="okg:wordpress_media" readonly="true">
    <input label="Id" type="text" name="okp:wordpress_media.id"/>
    <input label="Name" type="text" name="okp:wordpress_media.filename"/>  
    <input label="URL" type="link" name="okp:wordpress_media.url"/>
    <input label="Related docs" type="text" name="okp:wordpress_media.related.docs"/>     
  </property-group>
</property-groups>

More information at Administration > Metadata.

Metadata group "WP Publication" fields description:

FieldDescription

Id

The Wordpress post id.

Title

The Wordpress tittle.

Category

The Wordpress categories.

Tag

The Wordpress tags.

Type

The publication type

Available values:

  • Post.
  • Page.

Status

The Wordpress publication status.

Available values:

  • Draft.
  • Public.
  • Pending.
  • Future.
  • Password protected.
  • Private.

Password

Password when the publication is protected.

Related media

List of OpenKM document UUID related into the HTML contents.

Metadata group "WP Media" fields description:

FieldDescription

Id

The Wordpress media id.

Name

The unique Wordpress filename.

URL

The Wordpress media url.

Related doc

List of OpenKM related document UUID what references media.

Configure automation task

You must configure two automation tasks:

NameEventAtValidationActionDescription

Wordpress metadata

Set metadata group

Post

Optional.

Wordpress publication for setProperties

Create or update contents based on metadata group changes.

Wordpress content and media

Document update

Post

Optional.

Wordpress publication for content

Update content or media.