Publish to Drupal plug-in for Enterprise

motherlamentationInternet και Εφαρμογές Web

7 Δεκ 2013 (πριν από 3 χρόνια και 8 μήνες)

227 εμφανίσεις


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


1









Publish to
Drupal
plug
-
in for Enterprise











The Publish to
Drupal

plug
-
in for WoodWing Enterprise is a Content Station plug
-
in which provides a publishing target for the
Drupal 7+ CMS platform
. Th
is

plug
-
in is copyright
©
2012 by Aysling Digital Media Solutions.




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


2


Contents

Requirements

................................
................................
................................
................................
................................
...................

3

Installation

................................
................................
................................
................................
................................
........................

3

Installing the Aysling Common Library

................................
................................
................................
................................
.........

3

Software License

................................
................................
................................
................................
................................
..........

3

ionCube Encoding

................................
................................
................................
................................
................................
........

3

Woodwing’s Drupal Plug
-
in

................................
................................
................................
................................
..........................

3

Plug
-
in Configuration

................................
................................
................................
................................
................................
........

4

Default Options ($options)

................................
................................
................................
................................
..........................

4

Default Mappings ($mapping)

................................
................................
................................
................................
.....................

6

Drupal Site Settings ($sites)

................................
................................
................................
................................
.........................

7

Switching the WCML Text Converter

................................
................................
................................
................................
...........

8

Site

Configuration Association ($config)

................................
................................
................................
................................
......

8

Enterprise Configuration

................................
................................
................................
................................
................................
...

9

Setting up a Publication Channel

................................
................................
................................
................................
.................

9

Creating an Issue

................................
................................
................................
................................
................................
..........

9

Drupal
Installation

................................
................................
................................
................................
................................
..........

11

Recommended Drupal Modules

................................
................................
................................
................................
................

11

Supported Drupal Modules

................................
................................
................................
................................
........................

11

Slideshows in Drupal

................................
................................
................................
................................
................................
.......

11

Flex Slider Module

................................
................................
................................
................................
................................
.....

11

Sources

................................
................................
................................
................................
................................
.......................

12

Setting Up

................................
................................
................................
................................
................................
..................

12

Publishing to Drupal
................................
................................
................................
................................
................................
........

13

Setting up a Login Application

................................
................................
................................
................................
...................

14

Creating an Article Template

................................
................................
................................
................................
..........................

15

Using the Aysling WCML Converter

................................
................................
................................
................................
................

19

Setting up Tag Mapping

................................
................................
................................
................................
.............................

19

<tag name=”bold” mapto=”strong”/>

................................
................................
................................
................................
..

19

<tag name=”br” mapto=”br” emptyrepeat=”true”/>

................................
................................
................................
...........

19

<tag name=”pullquote” mapto=”div” class=”quote”/>

................................
................................
................................
........

19

<tag name=”characterstylerange” skip=”true”/>

................................
................................
................................
.................

19

Troubleshooting

................................
................................
................................
................................
................................
..............

21

Revision History

................................
................................
................................
................................
................................
..............

22





230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


3


Requirements



WoodWing Enterprise Server v7.5+



Content Station v7.5+



Drupal 7+



PHP v5.3+

o

Requires the
XML module

The Aysling Publish to
Drupal

plug
-
in is used with Enterprise to
publish articles and images to the Drupal
CMS platform
.

Support exists for multiple Drupal sites, each with their own configuration to automate
the publication of documents with t
axonomy references and some additional Drupal module support.

Installation

Follow the installation instructions for all of the required applications and supporting systems, as
outlined in their manuals. Once the supporting systems are created, extract the

plug
-
in from its ZIP
archive into

a temporary folder. You should now have an
“AyslingDrupal”

folder and an
“aysling_pub”

folder in the temporary folder. Copy
the

“AyslingDrupal”

folder into

the
“{Enterprise}/config/plugins/”

folder.
The
“aysling_pub”

f
older should be copied into
“{Drupal}/sites/all/modules/custom/”
.

Installing the Aysling Common Library

This plug
-
in requires the Aysling Common Library which contains the WCML to HTML converter, among
other things. The library should be installed in the

{Enterprise}/config/
” folder.

If it wasn’t
included with your distribution, please contact an Aysling support representative to get you a copy.

Software License

You should have received a license file along with your installation files. This file needs
to be placed into
the “/license” folder within the plug
-
in’s folder. A license is required to use this software. If you don’t
have a license, please contact an Aysling support representative.

ionCube Encoding

This software is encoded with the ionCube enc
oding software and, as such, requires that you download
the latest decoders from their website at
http://www.ioncube.com/loaders.php

Woodwing’s Drupal Plug
-
in

It is important that you remove the reference Drupal plug
-
in from Enterprise. The two plug
-
ins will
conflict with each other. Remove the
“Drupal”

folder from the
“{Enterprise}/server/plugins/”

folder. You might want to archive it before doing so so that

you can revert if needed.



230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


4


Plug
-
in
Configuration

To configure the plug
-
in, you will need to modify the
“config.php”

file.

A template of this file exists in
the
“/config”

folder called
“default
-
config.php”
. Make a copy of this file and rename it to
“conf
ig.php”
.

If you only have one Drupal site, or for setting the defaults, you will modify these
sections:

Default
Options ($options)

layout_rendition

This is the rendition (from Enterprise) that is used for each object that is
exported from Enterprise. You

can select:
thumb
,
preview
,
native
, or
output

(
output
)

writer

This setting determines
how Drupal sets the user which posts the article
.

Note
that the user in Enterprise
must exist

in Drupal, as well, or Drupal will post the
content as the “Anonymous” user.

Possible settings:



p
ublisher



the
user, which is logged into Content Station, and
publishes the content.



w
riter



the Enterprise user that
created

the content



m
odifier



the Enterprise user the last modified the content



[n
one
]



uses the Drupal user name

which Enterprise connects as

(
[none]
)

title_fallback

If the title element isn’t defined for the content, it can fall back to one of these
other fields (or combinations

thereof):



description



the Content metadata description



name



the
Dossier

name in Enterprise



name/description



a combination of the above two



description/name



a combination of the above two



[none]



No value

(
[none]
)

explicit_publish

On Drupal, a
content type can be configured to be saved as “un
-
published” by
default. Setting this to true will override the content type’s configuration.
(
false
)

c
omponents

(Required)

This is a mapping between the Drupal field names and the
Enterprise elements
.
The value on the left side of ‘=>’ is the Drupal field name. The value on the right
is the
element name
. One special case is supported which is used to define the
content as being the summary of an existing Drupal field. This is denoted by

“{fieldnam
e}.summary”
.

‘title’ => ‘head’,


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


5


‘body.summary’ => ‘intro’,

‘body’ => ‘body’

You should put all of the Drupal field to com
ponent mappings here that could

occur

for all Drupal content types which are mapped
, even if the particular
content
type
doesn’t specif
y all of them. If an article has only “head” and
“body”, it will not try to publish the “intro” because it doesn’t contain it, thus
the “body.summary” on Drupal won’t be set.


However, if your content has a “subtitle” component, yet no mapping has been
established, that content will not be present on the Drupal side because there
was no mapping defined.


field_map

(Required)

This table defines the
canonical names

of components and how they map to
Drupal field names. The definition of “canonical” is:
in

simplest or standard
form
. Thus, the “title” is always the title, headline, topic, etc. “body” is the
body, copy, content, etc. So when the plug
-
in needs to determine which field is
the title, it can find it. Th
e values on the left
-
side of the

table
s
hould not be
modified
, other than to add additional canonical representations. In
all

situations, only the Drupal field names need to be
represented
.

‘title’ => ‘
title
’,


teaser
’ => ‘
body.summary
’,

‘body’ => ‘body’

field_type

(Required)

In Drupal, textua
l fields typically have a formatter associated with them. This
defines what is allowed to be displayed in the content.
Two supported values
are
:

plain_text
,
or

full_html
.

Some content doesn’t have a formatter, so
the empty string ‘’ should be used.



‘title’ => ‘
plain_text
’,


teaser
’ => ‘
full_html
’,

‘body’ => ‘
full_html


metadata_to_taxonomy

To map content into Drupal taxonomies in the most flexible manner, this is used
to specify how a certain metadata field’s content can be used to
create a term
reference
. The key is the name of the custom metadata field

on Enterprise

(in
lower case) which contains the values to use. The value is split into two parts:
the taxonomy’s
machine name

(from Drupal) and the reference property within
the term use
d

to
cr
eate

the
reference
.

For example, let’s say you have a metadata field called “
article_type
” which
can have any, or all, of the values:
sports
,
news
, and
entertainment
. On
Drupal,
there is

a taxonomy with the machine name “
article_types
” and it
has those sa
me terms

as its “
name
” property. You would use:

‘article_type’ => array(‘taxonomy_machine_name’ =>



‘article_types’, ‘reference’ => ‘name’),



230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


6


When the content, on Enterprise, has the “
article_type
” metadata with the
values: “
sports
” and “
news
”, on the
Drupal side, the taxonomy with the
machine name “
article_types
” would create two term references for

sports
” and “
news
” on the content.

Using this capability, it is possible to
create a number of term references across many taxonomies, for the node
being created on Drupal.

Default Mappings ($mapping)

pagetitle

If you have the “page_title” module installed on Drupal, this value is the
metadata field

(on Enterprise)

which contains the page title to be used for the
node. If you do not have the module installed,

or wish to let Drupal assign a
value
,
leave this blank
.

This value can only come from a custom metadata field.

(
[none]
)


See:
http://drupal.org/project/page_title

urlpath

If you have the “pathauto” module installed, this will be the path value assigned
to the node. If you do not have the module installed, leave this blank.

This value
can only come from a custom metadata field.


(
[none]
)

See:
http://drupal.org/project/pathauto

description

If you have the

“metatags_quick” module installed, this can be used to assign
the meta
data field that contains the meta
-
description value

(for SEO purposes)
.

You need to specify the custom metadata field which contains the value and the
name of the Drupal field which is defined
for
the “Meta” type. If the module is
not installed, leave th
e two values blank.

This value can only come from a
custom metadata field.


See:
http://drupal.org/project/metatags_quick

keywords

Drupal 7 has the concept of autocompleted fields for tagging, using a taxonomy
field type. Specifying the
machine name

of the

Drupal

taxonomy field

here

will
automatically create term references for each of the keywords in content
passed from Enterprise.

If the term reference doesn’t exist in Drupal, it will be
created. Leaving this field blank will skip this type of association.

comments

The default for what type of comments will be set for the node. The default
(empty) will use the Drupal default fo
r
the content type
. If you specify a value
here, it is a custom metadata field
, for articles in Enterprise,

which can be one of
the following:
disable
,
read
, or
read/write

sticky

The default for whether or not nodes are sticky (stay at the top of the
listing).
The default (empty) will use the Drupal default for stickiness

for the content
type
. If you specify a value here it is a Boolean custom metadata field

for
articles in Enterprise
.

promote

The default for whether or not nodes are promoted to the

home page. The
default (empty) will use the Drupal default for promotion

for the content type
.

230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


7


If you specify a value here, it is a Boolean custom metadata field

for articles in
Enterprise
.

images

Allows for mapping metadata fields to media file fields
. Requires the
“file_entity” module.

See:
http://drupal.org/project/file_entity

summary

Allows for mapping a summary metadata field to either a summary of another
field (via “.summary”) or as its own field. You need to specify the
Enterprise
metadata field and the Drupal field it will map to.

This value can only come from
a custom metadata f
ield.

drupal_source_id

(Required)

Setting this value will allow Drupal to keep track of articles which have been
published from a dossier in a much more consistent way. On the Drupal side,
the field name specified here will need to be added to each
content type as a

Text
’ field type

(non
-
displaying).


Drupal Site Settings ($sites)

The sites array defines unique Drupal sites, by name, which can be associated with
a

brand, and
subsequently,
the

brand’s publication channel
s
. This allows for a very hi
gh level of configurability on a
per
-
site basis. The first site specified is always the default site and is used when no brand mapping can
be determined.

Most installati
ons will use this kind of setup and do not require further customization.

You give th
e site a unique name within the “$sites” array and then specify the following parameters:

url

(Required)

The URL where the Drupal server can be located. This is the root path of the
server.

u
sername

(Required)

This is the name of the user which will be
used, by Enterprise, to connect to the
Drupal server to perform all actions.

p
assword

(Required)

The password which is associated with the username from above.

local_cert

For an SSL installation, this is the full file path to the local CA certificate fil
e (in
PEM format). See the SSL SDK for how to generate certificates.

options

Site
-
specific overrides for the
$options

array from above. (not required for
the default site)

mapping

Site
-
specific overrides for the
$mapping

array from above. (not require
d for
the default site)


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


8


Switching
the
WCML Text Converter

The built
-
in WCML to HTML converter can be swapped with a more customizable converter which
handles InDesign tagging properly. Setting the “
DRUPAL_WCML_CONVERTER
” to “
Aysling
” will use the
updated

version. Setting it to “
WW
” will revert to the old converter.

See the section “



230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


9


Using the Aysl
ing WCML

Converter
”.

Site Configuration Association ($config)

This array is used to associate a brand, and its publication channel, with a site configuration from the
$sites

table above. If you only have the o
ne site, there is no need to even put anything in this variable.
Note that in the example below, you do not actually add the curly braces. To add a brand mapping, you
should add the following:

$config[] = array(‘brand’ => ‘
{Brand Name}
’, ‘channel’ => ‘
{C
hannel Name}
’, ‘site’ =>

{Site Name}
’),




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


10


Enterprise Configuration

Setting up a Publication Channel

Log into Enterprise and navigate to the “Brands” setup screen.
Select the brand
,

and then

l
ocate the
section for “Publication Channe
l
”.


Figure
1

-

Add Publication Channel

Click the “Add” button and enter the following:

Name:

Drupal7

Description
:
Publish to
Drupal

Publication Channel Type:

web

Publish System:

Aysling
Drupal Connector

Click the “CREATE” button to create the

channel. You should now see it in the “Publication Channel”
listing. Set the order how you would like it to appear in the list.

Click on the “
Drupal
” channel to be
taken to the “Publication Channel Maintenance” page where you can set up the issues whic
h will include
the
Drupal

channel type.

Creating an Issue

In order to publish an issue to
Drupal
, you will need to create an issue and configure it for
Drupal CMS

publication. On the “Publication Channel Maintenance” page, under the section “Issues”, clic
k the “Add
Issue” button to be taken to the “Issue Maintenance” page.


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


11



Figure
2

-

Issue Maintenance

Set the name of your issue (required) and optionally the subject and description of the issue. The

Content Type
” is
the content
type (bundle) from Drupal. These values are supplied by Drupal, as long
as it is properly configured. One type “WoodWing Enterprise Story” is provided by the Drupal module.
You are not required to use this content type, but it’s what the plug
-
in and mod
ule are initially
configured to publish to.

After you select the content type, press the “Update” button and the screen will refresh with the
taxonomy vocabularies defined for that content type. If you want a default association with all content
published

to this issue, select a vocabulary and press the “Update” button again. The screen will
refresh with all of the taxonomy term references available for the vocabulary.

If you want a default association with all content publish
ed

to this issue, select a t
erm and press
“Update” again. These last two associations are not necessary. You do not have to associate all content
for the issue with any taxonomy’s term. You can leave that up to the keywords or special metadata
fields from the configuration.


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


12


You ma
y also select the text components which are required to be filled in for the content which is being
published. And finally, you can select if an image is required to publish content. These last two values
may be deprecated in a later release of the plug
-
in, so be cautious when using them.

Drupal Installation

Installing the Drupal module is as simple as putting the module into the custom modules folder and then
goin
g into the administrative tools

for Modules, and enabling “WoodWing Publishing” under the
“A
ysling Digital Media Solutions” heading.

It is possible to create customizations to the functionality provided by the Drupal module through a set
of hooks which are invoked by the module. See the “
client_example_stub.
module
” file in the
module’s “
/client


folder for more information.

Recommended Drupal Modules

There are two modules which are recommended to enhance the workflow of node revisions within
Drupal. These allow a Drupal admin to moderate nodes, but also provide a method to have nodes which
are i
n a published state to have draft revisions which exist and can be previewed without disrupting the
live content on a site.

Workbench

Core

http://drupal.org/project/workbench

Workbench Moderation

http://drupal.org/project/workbench_moderation

Supported Drupal Modules

In addition to those modules listed in the settings, the Aysling Drupal module supports additional
modules which provide
additional field types:

Address Field

http://drupal.org/project/addressfield

Date

http://drupal.org/project/date

Media

http://drupal.org/project/media

Slideshows in Drupal

One of the most commonly requested features in Drupal is the ability to display images in a slideshow.
Since Drupal supports over 10,000 modules, here is a recommendation for setting up
a simple slideshow
module with nice results.

Flex Slider Module

There is a module for Drupal 7 known as Flex Slider which works with a jQuery library of the same name.
This module and library provide a nice foundation upon which to build your own slideshow. There are

230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


13


three possibilities for displaying a slideshow and

we’ll look at the simplest one to get you started.
Be
aware that you’ll need to make a code change, but it’s minor.

Sources

You can download the Flex Slider module for Drupal from
http://drupal.org/pro
ject/flexslider
. The Flex
Slider jQuery library can be attained by going to
http://www.woothemes.com/flexslider/
. Additionally,
you might want to grab Adaptive Image Styles from
http://drupal.org/project/ais

to assist with the
multitude of image sizes and styles for static images.

Within the README.txt file in the Drupal Flex Slider project, it says to extract the jQuery library’s folder
into “
{Drupal}/sit
es/all/libraries
” (you’ll probably need to create the latter) and rename the
folder to “
flexslider
” (mind the case!).

Just so you know, these instructions have been adapted from
http://coldfrontlabs.ca/blog/using
-
flex
-
slider
-
drupal
-
7
. It may be a good time to read through this to familiarize yourself with the section on
“Flex Slider Fields”.

Setting Up

Within your content type, you should have a field of type “Image” and it shoul
d be set to the maximum
number of slides you want to allow per article (this may be unlimited). For the field’s display, you’ll
want to set it to “flexslider” and select the option set for slide display. If you’re using the “File Entity”
module for field
-
able files so you can assign an image fields, you’ll need to make a minor code change to
the Drupal Flex Sider module.

In the file “
{Drupal}/sites/all/modules/flexslider/theme/flexsider
-
container.tpl.php
”, you’ll
need to add the following code. You’ll se
e a conditional section which has the option to display the
image’s “alt” or “title” as the caption for the image. I added the following directly after the closing

<?php endif; ?>
”:

<?php if(!empty($item['#item']['
field_caption
'])) : ?>


<div class="fl
ex
-
caption"><strong>


<?php print $item['#item']['
field_caption
'][LANGUAGE_NONE][0]['value']; ?>


</strong></div>

<?php endif; ?>


You’ll notice the “
field_caption
” in red above. This is the name of the field you assigned for holding the
caption
fo
r

image file types. Make sure you change this to reflect the name of the field you assigned.

Save the file and also
remember that you will need to make this change again should you update the Flex
Slider module
.





230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


14


Publishing to
Drupal

When all of your l
ayouts
, articles, and images

have been added to the dossier, you will need to assign
them all to the publication channel by checking the box for it in Content Station. This will add your
layouts to the channel so you can preview, publish, update, and un
-
p
ublish
the content
.

Within Content
Station

the channel will be listed in the dossier view as long as you
’ve

set it in the dossier’s properties:

In the dossier properties window, click the “add issue” button

to add a new issue to the dossier.
Select the issue you’ve configured for the “publish to
Drupal
” channel type. If your issue, for example,
was named “OutTo
Drupal
”, your
dossier’s
properties might look something like the following:


Figure
3

-

Associate Dossier with Channel

Click the “Save” button and you should see the publication channel appear on the right side in the
“Publication Channels” area:


Figure
4

-

The Publication Channel




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


15


Make sure that you assign your
content

to the channel in the dossier view:



Figure
5

-

Associating Content with Publication Channel

Click the publish button

to start the publication process. You will
see

the publish dialog whe
re you
can
review

the versions of the files which are going to be published. Click the “Ok” button and the
content

will be published. After some time, you should get a dialog stating that the
content

was
successfully published. If you make any changes t
o the layouts, or
any other content
, the button in the
publication channel will change to the update button

allowing you to modify the contents and re
-
publish it. To get a preview of the
content
, without publishing it, click the preview button

and you
will be presented with a preview of the
content from your Drupal site

in another tab.

Setting up a Login Application

To preview articles within Content Station, it will be necessary to log into the Drupal server at least
once. To simplify this, y
ou could add the following to your WWSettings.xml file to add an application to
the “Home” tab. Add this to the <Apps> section:

<App name="Drupal Log
-
in" allowmultipleinstances="false"
icon="{SERVER_URL}config/plugins/AyslingDrupal/config/drupal.png"
url=
"http://
{Drupal Server}
/user"/>

Make sure to change the
blue text

to refer to your own Drupal server. When you close and re
-
open
Content Station, you should have a new application called “Drupal Log
-
in”. Double
-
click on it to open a
tab which will take y
ou to the login page.




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


16


Creating an Article Template

To publish from Enterprise to Drupal, you will need an article template. To make one of these, you will
need to open Adobe InDesign and create a Layout with text areas. Each area will need to be assign
ed a
label corresponding to the content that will be inside it. For example, you might have a simple Layout
with two text areas for the headline and body. Within the Smart Connection panel, you’ll need to assign
the elements, so select the “Elements” tab

and assign each text frame:


Figure
6

-

The Headline Element (head)


Figure
7

-

The Body Element (body)

After creating this simple layout and assigning the element labels, you will need to create an arti
cle
template from the document. Open the Smart Connection menu and select “Create Article from
Document…”:


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


17



Figure
8

-

Create Article from Document



This will bring up a dialog which has a checkbox at the bottom so you can save
the document as an
article template. You can also name the template, assign it to a dossier (if you want), and set other
options:


Figure
9

-

Save as Article Template


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


18


If you saved the template into a dossier, you should see it in

Content Station or in Smart Connection.
Here is a view of the template above in Content Station:


Figure
10

-

Article Template in Dossier


Now, if you open Adobe InCopy with Smart Connection installed, you should be able to brow
se for the
Article Templates, or as is the case here, find it in its dossier:


Figure
11

-

Article Template in Dossier

Double
-
clicking on the template will open a new article which can be edited from within InCopy and
saved back i
nto Enterprise:


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


19



Figure
12

-

New Article from Template in InCopy

When
you

originally configured the plug
-
in using the
“config.php”

file,
you

associated these element
labels with Drupal fields. If you remember:


‘title’ => ‘head’,

‘body.summary’ => ‘intro’,

‘body’ => ‘body’


The article template we created will map the “head” element to the Drupal “title” field and the “body”
element to the Drupal “body” field. This completes the mapping from Enterprise to Drupal.




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


20


Using the Aysl
ing WCML Converter

The
WCML t
o

HTML

converter that ships with WoodWing Enterprise is limited in its functionality. While
it will attempt to convert InDesign styles to CSS, it also assigns in
-
line styles in the generated output.
Many designers want better control over the conversion proces
s and instead will use InDesign tagging to
denote headers, text that should be bold, and so forth. Due to this requirement, there is another
WCML
to HTML

converter which has been written by Aysling to handle just such a situation. It has been shown
to pr
ovide better formatting and flexibility when compared to the WoodWing version. To enable it, set
the “DRUPAL_WCML_CONVERTER” to “Aysling” in the “
config.php
” file.

Setting up Tag Mapping

The Aysling Wcml

t
o

Html converter requires a tag mapping file which

tells the converter how to map
from an InDesign/InCopy tag to an HTML tag. These mappings are in the plug
-
in’s

config/tagconversions.xml
” file. There is a default (for when the converter runs across a tag that
isn’t explicitly defined) which is on the
mapping element. For the remainder of the tags, the following
options are available:

<tag name=”
bold
” mapto=”
strong
”/>

This will map an occurrence of a tag “
bold
” to an HTML tag “
strong
”. When the tag is either explicitly
<
Bold
> or is <XMLElement MarkupT
ag=”XMLTag/
Bold
”>.

<tag name=”br” mapto=”br” emptyrepeat=”true”/>

This will map an occurrence of a tag “br” to an HTML tag “br”, and if the tag is empty it will emit the tag
a second time, thus emitting: “<br/><br/>”.

<tag name=”
pullquote” mapto=”div” clas
s=”quote”/>

This will do the same as the tag above, however, it will create an HTML “div” tag with the “class”
attribute set to “quote”.

<tag name=”characterstylerange” skip=”true”/>

This will skip converting the tag <CharacterStyleRange> and instead conti
nue processing the content
within it as if it were attached to its valid parent. It is best to see an example:

<XMLElement Self="di2i3" MarkupTag="XMLTag/Root" XMLContent="u761">


<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Body Text">



<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[
None
]">


<Content>
Your content here.
</Content>


</CharacterStyleRange>


</ParagraphStyleRange>

</XMLElement>


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


21



If the tag <ParagraphStyleRange> is also set to “skip” and the
“Root” tag is set to <div class=”root”>, the
output would look like so:

<div class=”root”>


Your content here.

</div>




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


22


Troubleshooting

Enterprise plug
-
in

The Enterprise “Server Plug
-
ins” page is blank.

The license file is missing. Put the license file

into the “/license” folder of the plug
-
in.

The configuration file is missing.

The file “config.php” is missing from the plug
-
in’s “/config” folder. There is a “default
-
config.php” file which should be used as a template. Copy and rename this file to

config.php”.

One or more sites have an invalid URL,
username, or password.

In the configuration file’s
$sites

configuration, one (or more) of the sites has an invalid
URL (it must begin with “http://” or “https://” and end with a forward slash “/”. The
username and password must be provided so that the Enterprise server can log in as an
administrative user on th
e Drupal server.

The value for “drupal_source_id” is not set in
“config/config.php”

Each content type, in Drupal, needs to have a field which will hold the source Id used to
create the link between Enterprise and Drupal. This field should be the same nam
e for
all
content types

which Enterprise will publish to. It should be a simple “Text” type field and
the display should be set to “hidden”.

The Aysling Commons library set is not installed
at “{Enterprise}/config/Aysling_commons/”

This plug
-
in depends o
n the WcmlToHtml converter in the Aysling Commons library. The
library should have been delivered with this plug
-
in. If it was not, contact Aysling to get a
copy of this library. It needs to be installed at the specified location.

Configuration of fiel
d mappings is incorrect or
missing.

The mapping of Enterprise elements to Drupal fields is either missing or is incorrect.
Please check the “components”, “fieldmap”, and “fieldtype” settings in the
$options

configuration. See the section on
Installation

for more information.

Site: ‘{Site Name}’


Not Found

The Drupal server for the given site name could not be reached. Check the URL t
o make
sure it is accessible from the Enterprise machine.

Site: ‘{Site Name}’


Drupal module version X.X.X
is incompatible with Enterprise plug
-
in version
Y.Y.Y

The Enterprise plug
-
in and Drupal module must be the same major and minor version.
Revision
numbers do not affect compatibility.

Site: ‘{Site Name}’


Drupal module didn’t report
a version!

The Drupal site could be reached, but the module didn’t respond with a version number.
Possibly the Drupal module is out of date or isn’t installed properly
/at all.

The license has expired, please contact Aysling
support.

The license file has expired. You will need to contact Aysling to obtain a new license.

This plug
-
in is not licensed to run on this
machine. Please contact Aysling support.

This plug
-
in has been licensed to run on a specific machine. Trying to run the plug
-
in on a
different machine will cause this error. If you needed to reinstall the plug
-
in or move it to
another server, contact Aysling to get
the license updated.




230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


23


Revis
ion History

1.6.00

Fixed several bugs which would cause duplicate images, in two situations, on the
Drupal side. Changed file scheme swap to use FILE_EXISTS_REPLACE on Drupal.

1.5.03

Fixed a bug which would not pass metadata values which are considered
empty
because they contain any representation of zero. Fixed a bug in the module which
would override the validation type with the content type.

1.5.01

Fixed a bug which occurred during a fresh install and prevented the plug
-
in from
initializing. Reorga
nized the documentation.

1.5.
0

Fixed several minor issues. Added support for uploading PDF images and handling as
files on Drupal.

1.4.08

Fixed a minor bug which may cause images to be re
-
uploaded every other preview.
Updated test for installation to be

revision independent.

1.4.
0
7

Fixed a bug in image clean up. Added a test to validate the Drupal module version
against the Enterprise plug
-
in version.

1.4.
0
6

Finished rewriting all calls to use source Id on Drupal rather than Dossier External Id.

1.4.
0
5

Added content type to lookup Id so that multiple pub channels can be used per
dossier.

Removed all references to dossier’s “ExternalId”.

1.4.
0
4

Fixed an issue with removing multiple images from a published (or previewed) node.
Added documentation for s
etting up a slideshow in Drupal.

1.4.
0
3

Added support for XMP data attached to images.

1.4.
0
2

Changed Drupal module to allow “pass by reference” when invoking hooks.

1.4.
0
1

Added an “explicit_publish” option to allow overriding the default setting of
pu
blication for a content type. The module now honors the default setting.

1.4.0

Fixed a bug in removing images which were already attached to an article. Fixed a
couple of issues in WCML converter which lead to extra tags

and spaces
.

1.3.
0
5

Refactored
“WoodWing Enterprise Story” as a sub
-
module. Refactored client
extensions as sub
-
modules. Folded source node lookup into core. Cleaned up some
miscellaneous issues with image handling.

1.3.0

Added

support

for Drupal revisions.


230 Huronview Blvd


Ann Arbor, MI 48103


www.aysling.com



(734) 997
-
9500


24


1.2.
0
4

Added hook_enterp
rise_find_node() to allow extension to lookup node
s

and prevent
dup
licates
.
Added hook_enterprise_cleanup()
.

1.2.
0
3

Added an example client extension stub file
. Fixed a bug which would check the
wrong field for attached files.

Added missing node 'languag
e' field
.

1.2.
0
2

Added support for oEmbed sources
. Fixed a bug when searching for an existing node
in Drupal.

1.2.
0
1

Added a way to validate content against Drupal before publication. Fixed up the
preview deletion method which would inadvertently
delete a published node.

1.2.0

Added method to re
-
use previews to minimize the number of nodes created on
Drupal server.

Reduced passive preview deletion time to 10 minutes.

1.1.0
1

Updated URL handler to skip if the reference does not exist. Changed fi
le upload to
rename rather than replace on Drupal.

1.1.0

Added new AyslingWcmlToHtml converter to handle InDesign/InCopy tagging better.
Updated error handling in several situations.

1.0.
0
3

Fixed linkage to Drupal configuration for content type defaults
: ‘promote’, ‘sticky’,
and ‘comments’. Added support for ‘summary’ metadata field to Drupal field.

1.0.
0
2

Added support for the “media” and “file_entity” modules. Now supporting metadata
on images as fields on files in Drupal.

1.0.
0
1

Fixed critical bug

in image and file attachment.

Refactored code to clean up
references.

Fixed a bug when mapping fields other than title, intro, & body.

1.0.0

First full release. Fixed bugs in handling of pagetitle and urlpath values.

Corrected an
issue in auto
-
tagging

taxonomy support.

0.
1.
0
2

Added support for the “metatags_quick” module’s “description” field type using an
extra (custom) metadata field. Added support for the “page_title” module using a
custom metadata field. Added support for auto
-
tagging taxonomy
field types via
keywords from Enterprise. Fixed an issue with the number of parameters passed via
XMLRPC.