Monday, June 22, 2015

DITA OT PDF Customization - Tables with Alternate Row Background Colors

Share to Facebook Share to Twitter Email This Share on Google Plus Share on Tumblr

Based on this forum thread I will try to give some steps in which you can create your own DITA Open Toolkit PDF customization folder for customizing a table to have alternate row background colors.

  1. First of all you need to know the XSLT template that you need to override.
    • You can open a DITA topic which has a table inside it and select in the Outline view the table row. The Attributes view will show you its @class attribute value which is - topic/row .
    • Use the Find/Replace in Files tool to search in the PDF plugin folder (for example DITA-OT-DIR/plugins/org.dita.pdf2/) for the string topic/row.
    • In the XSLT stylesheet DITA-OT-DIR/plugins/org.dita.pdf2/xsl/fo/tables.xsl you will find a template which matches all rows from a table body:
          <xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
              <fo:table-row xsl:use-attribute-sets="tbody.row">
                  <xsl:call-template name="commonattributes"/>
                  <xsl:apply-templates/>
              </fo:table-row>
          </xsl:template>
      That is the template which you will need to overwrite in your customization.
  2. Copy the entire folder DITA-OT-DIR/plugins/org.dita.pdf2/Customization to an external location. For example in my case I copied it to my Desktop.
  3. Renamed in that copied folder the catalog.xml.orig file to catalog.xml, edit it and uncomment the line:
      <uri name="cfg:fo/xsl/custom.xsl" uri="fo/xsl/custom.xsl"/>
    This custom catalog file will be automatically used to contribute in the PDF publishing process with high priority the XSLT stylesheet located in Customization/fo/xsl/custom.xsl.
  4. Rename in the Customization/fo/xsl folder the custom.xsl.orig file to custom.xsl. This stylesheet will contain all your template overrides.
  5. Overwrite in the custom.xsl the original template like:
        <xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
            <fo:table-row xsl:use-attribute-sets="tbody.row">
                <xsl:choose>
                    <xsl:when test="(count(preceding-sibling::*[contains(@class, ' topic/row ')]) mod 2) = 0">
                        <!-- Even row, light blue -->
                        <xsl:attribute name="background-color">rgb(210, 222, 253)</xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
                        <!-- Odd row, white -->
                        <xsl:attribute name="background-color">white</xsl:attribute>
                    </xsl:otherwise>
                </xsl:choose>
                <xsl:call-template name="commonattributes"/>
                <xsl:apply-templates/>
            </fo:table-row>
        </xsl:template>
  6. If you want the table frame border colors to have a custom color you can override some attribute sets defined in the DITA-OT-DIR/plugins/org.dita.pdf2/cfg/fo/attrs/tables-attr.xsl:
        <xsl:attribute-set name="table__tableframe__top" use-attribute-sets="common.border__top">
            <xsl:attribute name="border-top-color">blue</xsl:attribute>
        </xsl:attribute-set>
        <xsl:attribute-set name="table__tableframe__bottom" use-attribute-sets="common.border__bottom">
            <xsl:attribute name="border-bottom-color">blue</xsl:attribute>
        </xsl:attribute-set>
        <xsl:attribute-set name="table__tableframe__right" use-attribute-sets="common.border__right">
            <xsl:attribute name="border-right-color">blue</xsl:attribute>
        </xsl:attribute-set>
        <xsl:attribute-set name="table__tableframe__left" use-attribute-sets="common.border__left">
            <xsl:attribute name="border-left-color">blue</xsl:attribute>
        </xsl:attribute-set>ou
  7. Edit your PDF transformation scenario and set the parameter customization.dir to point to your customization folder.
  8. Publish and enjoy :)

If you want to create a DITA Open Toolkit plugin to achieve the same result you can use the dita.xsl.xslfo plugin extension to contribute your own XSLT stylesheet to the publishing process:
http://blog.oxygenxml.com/2013/12/creating-simple-dita-open-toolkit.html

Wednesday, June 03, 2015

How to Host a Webinar

Share to Facebook Share to Twitter Email This Share on Google Plus Share on Tumblr

We periodically host webinars using the GotoWebinar platform. We have two main actors, the host and the presenter and for any other company or consultant who wants to host webinars I'm attaching below a general set of things the host needs to do during the webinar:

  • Half an hour before the start time the host starts the webbinar from the Go To Webinar panel → My Webinars

  • The host (main organizer) and the secondary actors (presenter and members of staff) log in, they are all made organizers.
  • The organizer and presenter test the sound.
  • All presenters need to:
    • Set resolution to 1280 x 800. (Good for recording the webinar).
    • The windows start-up menu needs to be in auto hide mode.
    • The Desktop needs to be cleaned of clutter in order not to distract watchers.
    • All useless applications need to be closed. For example the email application could show email notifications during the presentation.
    • If you are presenting things in the web browser, please make sure you have no extra tabs opened in it.
    • The host opens the power point and goes to full screen.
  • Exactly at the scheduled hour the host presses the Start Broadcast button and presses the Show my screen option. The staff member in charge for recording will start it on his computer.
  • The first presentation slide can have the names of the host and the presenter and the title of the webinar.
  • Host starts speaking: "Hello everybody, my name is X and I will be this webinar's host. I invited my coleague Y to present this webinar covering Z support in Oxygen. This webinar will focus mainly on ... "
  • The second slide is the Agenda.
  • Host continues to speak: "Our agenda today starts with an introduction followed by Y's presentation then we will have a dedicated Q&A section at the end followed by a quick overview of upcoming events, webinars and conferences. "
  • The third slide is presented, the Questions slide.
  • Host speaks: "You do not need to wait until the dedicated Q&A section to ask questions. You can ask questions at any time during the webinar using the Questions panel from the Go to Webinar interface. Some of my coleagues who have already joined the webinar will answer your questions. At the end we'll go over some of the relevant questions. This webinar is recorded and a recording as well as sample files used during the webinar will be made available in a couple of days. "

  • Fourth slide. Host continues to speak: "Before Y will start his presentation I would like you yo answer the following questions..."
  • And the host releases the pre-created polls. He presses Start on a poll, talks about choices, waits a little then closes the poll and shares the results, closes the poll and then shares the results. Then the results are discusses and then the poll is hidden. And so on for each poll.
  • The fifth slide, the host makes Y the presenter, Y will start presenting for about 45 minutes.
  • During the presentation the host looks over questions, he answers some of them.
  • Y has finished the presentation and thanks for the attendance.
  • The host un-mutes himself and starts speaking without sharing his screen: "Thank you Y for this very nice presentation on Z. We covered a lot of ground today. Let's go over some of the questions.... "
  • Host takes the screen and talks over the last two slides, the one about future seminars and the one about future conferences.
  • Host asks Y if he has anything else to add, then they both thank the audience, then mute all. The webinar is left opened a little bit more in order for attendees to be able to ask additional questions.
  • End webinar. File -> Leave Webinar.

  • Eat a slice of pizza and relax, talk about what went wrong, something always does :)