Copy link to clipboard
Copied
I'm using FrameMaker 2020 (v16.0.2) just long enough to build output templates for the FMPS and AEM XML. I need to be able to hide all <draft-comments> in the PDF output (and eventually all outputs). In our current system, these were automatically hidden in outputs so we've made extensive use of them as notes between authors that are not deleted.
I can see that <data> or <data-about> may have been the better choice for this sort of thing, but that ship has sailed. 🙂 Is there any way to hide draft-comments in all outputs? I'm assuming that's handled somewhere in the EDD.FM file. I found where the draft-comments are defined, but I'm not seeing any place obvious to set the output to "hide". Is it in the outputclass setting?
Copy link to clipboard
Copied
Hi,
I am not an expert for structured FrameMaker.
However, what I learned is that you should use attributes to filter what is shown or hidden:
https://help.adobe.com/en_US/framemaker/using/using-framemaker/user-guide/topic_create-filters.html
It could be that you can use XSLT to change your elements.
Best regards
Winfried
Copy link to clipboard
Copied
You can use FrameMaker's Filter by Attribute functionality. Open the EDD to find the exact string for class attribute of the draft-comment element. Copy that value, then go back to your DITA document and select View > Filter by Attribute. Add a new expression, select the class attribute and the Equal option, then paste the value. Make sure the expression has NOT before the attribute expression. Select Show All to have the draft comments shown, Show as per Expression to have the draft comments hidden. Producing PDF should work for the currently visible content. I have not tested that but if the hidden content does show up in your PDF that is a bug and should be addressed to the dev team.
Copy link to clipboard
Copied
The name of the expression in the dialog box relates to my first trial to use the outputclass attribute, but that would require you to set that attribute on all existing content, which would be a hassle. So I tried with the class attribute and then forgot to rename the expression. It still works of course but it might be better to choose HideDraftComments or something similar.
Copy link to clipboard
Copied
Do let us know if this worked for you. Marking something as a correct answer makes it show up immediately below the original posted question and helps others to quickly find the solution.
Copy link to clipboard
Copied
I'm sorry, I haven't had a chance to test this. We're in the middle of upgrading AEM XML's add-on version and the FMPS version to match and work with the UUID release of XML Add-on so I cannot test any FMPS outputs. I can only test the output templates on my computer using structured Frame. I'll try to give this a try soon.
Copy link to clipboard
Copied
Yes and no.
Yes, this process hid the draft-comment in both the view of the topic and in the output, but this procedure doesn't appear to be anything that can be applied at the output template level.
Copy link to clipboard
Copied
It just means that you work with the Show All option, so you can see all the draft comments, then as part of the publishing process you select Hide Draft Comments. You can also have a simple script apply the filter before publishing. That can be made to run automatically when the Publish event fires. But it should not be such a problem to perform 2 simple actions instead of 1 when publishing the content...
Of course you can also start tampering with the output process but that would be much more work (as it would have to be done for each output format).
Copy link to clipboard
Copied
Yes, I would think it would have to be done within the output templates for each output, just like it is done for DITA-OT templates.
I'll have to wait to test the FMPS outputs until after IT gets the XML Editor and FMPS versions aligned.
Copy link to clipboard
Copied
As you are using FMPS you could use the built-in capabilies of FM to remove any draft-comment from the files before they are published. There is no need to make that change in all templates. Just have a very simple XSL that removes the draft-comment before the file is opened in FMPS for publishing. The structured application that handles the XML file allows adding such an XSL to be executed just before loading the XML into FM. These changes are not saved back to the XML file, as FMPS will not perform a save on files to be published.
The XSL is a very straightforward identity transform with one extra template removing the draft-comment.
Copy link to clipboard
Copied
Be careful, when you just delete text with a condition or an attribute.
When the text is a paragraph at the end of a text flow (e.g. in a table cell or in the table title), then you might end up with an empty paragraph which you do not want to have.
Just take this into account.
Copy link to clipboard
Copied
If the content to be deleted is inside a <draft-comment> the remaining content after filtering remains valid DITA. So there should be no danger of running into the problems you indicate. It is a different matter when using filters that remove a table cell from the structure, of course. Using FM Conditional Tags is less reliable in this respect.
Copy link to clipboard
Copied
Yes, this is likely what I'll have to do. However, I'm going to have to wait until the AEM server and FMPS is back online to test to see if the existing XSL already does this or not. In the mean time, I can probably try to locate the similar files on the Structured Frame installation on my computer and see if I can make the change there.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more