\name{writeWIxml} \alias{writeWIxml} \alias{readWIxml} \title{Functions to read and write widgetInvoke XML files} \description{ These functions are used to serialize object of class \code{wFun} to and from XML files. } \usage{ writeWIxml(wFun, file = paste(funName(wFun), "xml", sep = ".")) readWIxml(file) } \arguments{ \item{wFun}{An object of class \code{\link{wFun}} to serialize.} \item{file}{The filename to use for reading or writing.} } \details{ The class \code{\link{wFun}} is used to create the user interface in the \code{\link{widgetInvoke}} function. These \code{\link{wFun}} objects must be precreated for any given function, and then stored in XML format in the \code{inst/wFun} directory of the appropriate package, and are then read in with \code{readWIxml} when the user calls \code{\link{widgetInvoke}} for that function. The XML format used first defines the primary tag of \code{wFun}, which indicates the start of a \code{wFun} definition. There are two main sub-fields in the \code{wFun} block: \code{funName} and \code{funArgList}. The former simply contains a string indicating the name of this function. The \code{funArgList} block itself contains a series of smaller blocks, each representing an argument to the function. Within the \code{funArgList} are a series of \code{funArg} blocks. Within each \code{funArg} are six tags. The first is \code{argName}, detailing the argument's name. The second is \code{argDefault}, which if not empty is the default value of the argument. Next is \code{argType}, which describes the type of the argument (e.g. character, numeric, logical, or ANY for an untyped argument). The \code{argLocation} field specifies which tab this argument appears on in the \code{\link{widgetInvoke}} notebook, and \code{argWidgetType} describes the type of widget to use in displaying this argument. Finally, the \code{argRequired} field is a logical value specifying if this argument is required to be filled in by the user (or a default) before evaluation of the function. As an example, the following is an example for the function \code{\link{apropos}}: \preformatted{ apropos what ANY main TypeIn FALSE where FALSE logical main Radio FALSE mode "any" character main TypeIn FALSE } } \value{ The \code{readWIxml} will return an object of class \code{\link{wFun}} representing the data stored in the specified XML file. The \code{writeWIxml} function has no return value. } \author{Jeff Gentry} \seealso{\code{\link{createWF}}, \code{\link{widgetInvoke}}} \examples{ z <- readWIxml(system.file("wFun-example", "apropos.xml", package="widgetInvoke")) writeWIxml(z, file=tempfile()) } \keyword{utilities}