Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi Experts,
I am using Publishing engine with arbortext editor to publish document. My problem is I am not able to use custom stylesheet while publishing. How to use custom .style stylesheet for publishing?
Publishing engine always use the default style sheet to publish. As a work around I am replacing default stylesheet with custom.
Please help me know the proper way of doing this task.
Thanks in Advance.
Solved! Go to Solution.
Hi,
There are 2 different ways to achieve this. First of all you should define an attribute on your bookmap that the authors set to define the desired output type (Service, Technical). You could use the standard DITA attribute "outputclass" on the bookmap element for example. Based on this attribute's value you could do
Approach 1:
When doing "Save As Server Object" you need to map this attribute to a Windchill attribute on your Dynamic Document. You can then use this Windchill attribute in the Publishing Rules to tell PE to use a different stylesheet.
Approach 2:
You handle the outputclass attribute value in your stylesheet. That means you merge the stylesheets into one and define your layout based on the value of the outputclass attribute on the bookmap.
Approach 1 is probably easier to handle as it keeps your stylesheets separate and easier to maintain.
A variant of this would be to define 2 publishing rules for manual publishing from Windchill where you can select the desired output type. If this is working depends on whether you want to do a manual or automatic publishing in Windchill. If you are only doing manual publishing from Windchill that would probably be the easiest way and would not even require the attribute on the bookmap.
To point your publishing rules to use a different stylesheet you need to add this worker parameter to your ruleset (using the standard dita stylesheet as an example here):
<worker name="stylesheet">D:\ptc\PE\custom\doctypes\ditabase\ditabase.style</worker>
Please note that the path to the stylesheet must be an absolute path to the stylesheet file on the Publishing Engine server.
I hope this helps.
Sirko
Hi there,
Publishing Engine must be configured to use a stylesheet other than the default.
The stylesheet must be placed in the doctype folder of the custom folders you are using on PE. The stylesheet will be an option in the dropdown on the publish dialog. If you want your stylesheet to be the default, you'll need to configure the custom folders to point to your stylesheet as the default.
Thanks jeff,
let me tell you my current senario.
When I save document as "Save As Server Object" from Editor, my document gets published as PDF in Windchill as per the publishing rules I have written.
My question is, if I want to publish different types of manuals (Service, Technical) using same Doctype (Bookmap) but with different Stylesheets, do I need to define different Doctypes or is there any altenative way?
Hi,
There are 2 different ways to achieve this. First of all you should define an attribute on your bookmap that the authors set to define the desired output type (Service, Technical). You could use the standard DITA attribute "outputclass" on the bookmap element for example. Based on this attribute's value you could do
Approach 1:
When doing "Save As Server Object" you need to map this attribute to a Windchill attribute on your Dynamic Document. You can then use this Windchill attribute in the Publishing Rules to tell PE to use a different stylesheet.
Approach 2:
You handle the outputclass attribute value in your stylesheet. That means you merge the stylesheets into one and define your layout based on the value of the outputclass attribute on the bookmap.
Approach 1 is probably easier to handle as it keeps your stylesheets separate and easier to maintain.
A variant of this would be to define 2 publishing rules for manual publishing from Windchill where you can select the desired output type. If this is working depends on whether you want to do a manual or automatic publishing in Windchill. If you are only doing manual publishing from Windchill that would probably be the easiest way and would not even require the attribute on the bookmap.
To point your publishing rules to use a different stylesheet you need to add this worker parameter to your ruleset (using the standard dita stylesheet as an example here):
<worker name="stylesheet">D:\ptc\PE\custom\doctypes\ditabase\ditabase.style</worker>
Please note that the path to the stylesheet must be an absolute path to the stylesheet file on the Publishing Engine server.
I hope this helps.
Sirko
Sirko,
Great response Sirko!
Can you post the syntax for Approach 1 to reference the attribute in publish rules?
I'd also like to add a point that you don't need to specify an absolute path for the stylesheet if you declare the stylesheet in your catalog file on PE like this...
SYSTEM "ditabase\ditabase.style" "ditabase.style"
Then your publish rule can simply be the stylesheet name.
<worker name="stylesheet">ditabase.style</worker>
Jeff, good point with the catalog file.
Here a sample excerpt of a simple publishing rule to use different stylesheets depending on an attribute value:
<param-set name="Technical PDF">
...
<worker name="stylesheet">technical.style</worker>
</param-set>
<param-set name="Service PDF">
...
<worker name="stylesheet">service.style</worker>
</param-set>
<epm-iba iba="outputclass" value="Service">
<publish on="create-representation" output="pdf" param-set="Service PDF"/>
</epm-iba>
<epm-iba iba="outputclass" value="Technical">
<publish on="create-representation" output="pdf" param-set="Technical PDF"/>
</epm-iba>
This is working with other types of "publish on=" as well. For this to work there must be an iba with internal name "outputclass" on the Dynamic Document object type used in Windchill.
Rules are checked in order of appearance. So the first rule matching will be used. Therefore always put the most restrictive rules first. It's good practice to have a default (fallback) rule at the end when none of the previous rules match.
Kind regards
Sirko
Many thanks, Sirko!
I'll keep this in mind for the future! Very helpful.
Thank You so much guys!!!!!!!!