Debugging -

Dermot Butterfield - 06 September 2015

tl;dr

Debugging

At any and all stages of development debug text in useful for locating & resolving errors or simply tracking progress.  FatWire's main log is called the FutureTense.txt.  This log can be written to from either the JSP or XML classes using the ics library.
To output debug text to FutureTense.txt you can use ics:logmsg

Important
If there are multiple developers developing at the same time it is advisable to enable Browser Based logging which output all enabled output to a user specific file based on the users ip address. eg. futuretense_ip_address.txt > futuretense_192.168.1.20.txt.  This allows each user to work with their own errors and ignore the errors of other developers.  To enable user specific debugging open the Property editor and edit futuretense.ini setting ft.dbl=yes.  This process applies when enabling all debugging settings, find the property in futuretense.ini and change the value associated.  The opposite is true for disabling debugging.  To disable set the value of the property to no.

To enable debugging in java files and JSPs files open the Property editor and edit futuretense.ini setting ft.debug=yes. 

boolean isDebugEnabled = ftMessage.truestr(ics.GetProperty("ft.debug");
if (isDebugEnabled){
    ics.LogMsg("Your Debug Text Here");
}

It is important to note that ics.LogMsg will output your log msg regardless of the value in the property file unless it is wrapped in the code above.  This is not true for the rest of the debug messages ics.logMsg is the only one that requires wrapping as it is the only one that is entered directly into the code.  This is not always necessary, if it is a simple debug job then putting ics.LogMsg directly would be fine (but this is not best practise).  This tag is now depreciated but it is still useful.

There are a range of further logging options available in the futuretense.ini which when set to yes will output the debugging information for that element.  These include

  • ft.cachedebug outputs cache status messages.
  • ft.dbdebug outputs database status messages.
  • ft.ssdebug ouputs session debug messages.
  • ft.timedebug outputs request performance info.
  • ft.xmldebug outputs the structure of processed pages.
  • ft.logsize specifies the maximum size of the log file.

ics:geterrno

This tag is useful when placed after a functional section, such as a search or save. This outputs the error number to the screen so it is easier to identify an error and where it exists. It is necessary to clear the error number before calling this tag as it may refer to a separate error or older error. This is achieved using the ics:clearerrno tag.

<ics:clearerrno/>
<ics:xxx some action />
<ics:geterrno/>

Other

This tutorial explains how to FatWire Find all available variables on a page. This can reduce the burden by returning all variables at once and aid in identifying if the correct value is contained or it the variable is available at all.

Contact Us

I hope you found this useful or if you have any questions don't hesitate to leave a comment or contact support[@]tomred[.]net

Articles

Java

This what I have spent most of my time working in over the years and these are the little bits of logic or snippets I have come across. Some of these are things I have needed to search for or I have found I needed to feedback on code reviews.

Oracle WebCenter (FatWire)

During my time working in consulting I was tasked many times with delivering FatWire sites. I took notes due to the lack of useful documentation at the time. These are the results of those notes made and shared.

CSS HTML JS

I believe the majority of time on a project is spent with the UI. Web is no exception. I have compiled a set of articles covering HTML, CSS and JS with the intention of taking the sting out of this work.

DevOps

A space dedicated to all those things you need to know beyond writing code. This covers Linux, Windows, Git and SVN among other hopefully useful nuggets.

Security

I picked up some pointers over the years consulting for government and banking sectors before entering a PCI DSS development environment. This section covers aspects like coding, testing, code review and best practice.

Apps

Apps is a section which offers access to bits and pieces I have put together over the last few years. This includes Random Password Generator and Base64 Encoder.