ARSperl

 view release on metacpan or  search on metacpan

html/manual/OO/form.html  view on Meta::CPAN

<DT><A NAME="query"><B>query()</B></A>
<PRE>
  @matches =  $f->query(-query         =&gt; scalar string,
                        -maxhits       =&gt; scalar string,
                        -firstretrieve =&gt; scalar string);
</PRE>

    This function allows you to run a query against a Form. Both parameters 
    are optional. If you specify neither, you will get a list of all
    available records upto the limit imposed on the server. If you specify
    a qualifier and a maxhits number, you will get matching records upto
    the maximum number of hits you specified. <P> 
    This method returns a list of matching Record IDs. It does not
    currently return a "query list". 

<P>
<DT><A NAME="getFieldID"><B>getFieldID()</B></A>
<PRE>
  $id = $f->getFieldID(-field =&gt; scalar string);
</PRE>

    This an "internal" function that is used to translate a field name to a 
    field ID. Eventually, it will obey the VUI you specified. 
<P>

<DT><A NAME="getFieldName"><B>getFieldName()</B></A>
<PRE>
  $name = $f->getFieldName(-id =&gt; scalar string);
</PRE>

    This an "internal" function that is used to translate a field ID to a 
    field nameD. Eventually, it will obey the VUI you specified. 
<P>

<DT><A NAME="getEnumValues"><B>getEnumValues()</B></A>
<PRE>
  @vals = $f->getEnumValues(-field =&gt; scalar string);
</PRE>

   This function returns a list of enumeration values (labels)
   for a given field. If the field is not an enumeration field,
   an exception is thrown (type=ERROR, num=81006).
<P>

<DT><A NAME="getFieldType"><B>getFieldType()</B></A>
<PRE>
  $type = $f->getFieldType(-name =&gt; scalar string,
                           -id =&gt; scalar string);
</PRE>

    This an "internal" function that is used to retrieve the datatype of a
    particular field. You must specify one of the parameters. If you
    specify both, the -id parameter is ignore in favor of the -name
    parameer. Eventually, it will obey the VUI you specified. 
<P>
<DT><A NAME="create"><B>create()</B></A>
<PRE>
  $id = $f->create(-values =&gt; { field1 =&gt; value1, ... });
</PRE>
    This function allows you to create a new entry in this form. You can
    specify field name to field value mappings with out regard for the
    field ID or enumeration types. Behind the scenes magic occurs to hide
    this from you. <P>
    Eventually, it will obey the VUI you specified. 
    <P>

      In order to create an entry with an attachment, you should use the 
      following format:

<PRE>
  $id = $f->create(-values =&gt; { 
               "Attachment Field Name" =&gt; { file =&gt; scalar filename, 
                                            OR
                                            buffer =&gt; scalar,
                                            AND
                                            size =&gt; scalar
                                          }
                              });
</PRE>

    Note that the size field must correspond to either the length of the
    in-core buffer or the size of the file you wish to attach. Specifying
    and incorrect length will result in a truncated attachment. See the
    <code>t/entry.t</code> file in the source distribution for an example
    of adding attachments to records.

<P>
<DT><A NAME="delete"><B>delete()</B></A>
<PRE>
   $f->delete(-entry =&gt; scalar string);
</PRE>

    This method will delete a given entry from the form. It does not "pad
    out" the entry id for you currently. So if there are leading zeros, you 
    must add them.

<P>
<DT><A NAME="set"><B>set()</B></A>
<PRE>
   $f->set(-entry =&gt; scalar string,
           -gettime =&gt; scalar timestamp,
           -value =&gt; { field1 =&gt; value1, ...});
</PRE>

    This method allows you to set the field values of an existing entry. It 
    currently does not obey the VUI setting. You may specify the
    enumeration field text instead of the enumeration value. In the future, 
    you will have the option of specifying either.

<P>
<DT><A NAME="merge"><B>merge()</B></A>
<PRE>
   $f->merge(-type   =&gt; numeric value,
             -values =&gt; { field1 =&gt; value1, ...});
</PRE>

    This method allows you to "merge" the given fields/values into 
    a form. The merge operation is fairly powerful, allowing you
    to bypass the usual pattern, "not-null", etc, checks that are 
    enforced on set() and create() operations. In addition,
    the merge() operation allows you to over-write existing entries



( run in 1.079 second using v1.01-cache-2.11-cpan-39bf76dae61 )