writeWIxml           package:widgetInvoke           R Documentation

_F_u_n_c_t_i_o_n_s _t_o _r_e_a_d _a_n_d _w_r_i_t_e _w_i_d_g_e_t_I_n_v_o_k_e _X_M_L _f_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions are used to serialize object of class 'wFun' to
     and from XML files.

_U_s_a_g_e:

     writeWIxml(wFun, file = paste(funName(wFun), "xml", sep = "."))
     readWIxml(file)

_A_r_g_u_m_e_n_t_s:

    wFun: An object of class 'wFun' to serialize.

    file: The filename to use for reading or writing.

_D_e_t_a_i_l_s:

     The class 'wFun' is used to create the user interface in the
     'widgetInvoke' function.  These 'wFun' objects must be precreated
     for any given function, and then stored in XML format in the
     'inst/wFun' directory of the appropriate package, and are then
     read in with 'readWIxml' when the user calls 'widgetInvoke' for
     that function.

     The XML format used first defines the primary tag of 'wFun', which
     indicates the start of a 'wFun' definition.  There are two main
     sub-fields in the 'wFun' block: 'funName' and 'funArgList'.  The
     former simply contains a string indicating the name of this
     function.  The 'funArgList' block itself contains a series of
     smaller blocks, each representing an argument to the function.

     Within the 'funArgList' are a series of 'funArg' blocks. Within
     each 'funArg' are six tags.  The first is 'argName', detailing the
     argument's name.  The second is 'argDefault', which if not empty
     is the default value of the argument.  Next is 'argType', which
     describes the type of the argument (e.g. character, numeric,
     logical, or ANY for an untyped argument). The 'argLocation' field
     specifies which tab this argument appears on in the 'widgetInvoke'
     notebook, and 'argWidgetType' describes the type of widget to use
     in displaying this argument.  Finally, the '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
     'apropos':


         <?xml version="1.0"?>
         <wFun xmlns:bt="http://www.bioconductor.org/WINVOKE">
             <funName>apropos</funName>
             <funArgList>
                     <funArg>
                             <argName>what</argName>
                             <argDefault></argDefault>
                             <argType>ANY</argType>
                             <argLocation>main</argLocation>
                             <argWidgetType>TypeIn</argWidgetType>
                             <argRequired>FALSE</argRequired>
                     </funArg>
                     <funArg>
                             <argName>where</argName>
                             <argDefault>FALSE</argDefault>
                             <argType>logical</argType>
                             <argLocation>main</argLocation>
                             <argWidgetType>Radio</argWidgetType>
                             <argRequired>FALSE</argRequired>
                     </funArg>
                     <funArg>
                             <argName>mode</argName>
                             <argDefault>"any"</argDefault>
                             <argType>character</argType>
                             <argLocation>main</argLocation>
                             <argWidgetType>TypeIn</argWidgetType>
                             <argRequired>FALSE</argRequired>
                     </funArg>
             </funArgList>
         </wFun>


_V_a_l_u_e:

     The 'readWIxml' will return an object of class 'wFun' representing
     the data stored in the specified XML file.

     The 'writeWIxml' function has no return value.

_A_u_t_h_o_r(_s):

     Jeff Gentry

_S_e_e _A_l_s_o:

     'createWF', 'widgetInvoke'

_E_x_a_m_p_l_e_s:

        z <- readWIxml(system.file("wFun-example", "apropos.xml",
                       package="widgetInvoke"))
        writeWIxml(z, file=tempfile())

