com.acesoft.aceoffix
Class WordRequest

java.lang.Object
  extended by com.acesoft.aceoffix.WordRequest

public class WordRequest
extends java.lang.Object

Extracts data from the Word document submitted by AceoffixCtrl.

WordRequest is a important class. WordRequest object contains the data submitted by AceoffixCtrl. If you need to extract data from Word document you have to create WordRequest object. Make sure that WordRequest object is created and some DataRegions are specified to be submitted before you call AceoffixCtrl.openDocument method. Only the submitted DataRegions can be extracted from WordRequest object. WordRequest object only can be created in the server page specified by AceoffixCtrl.setSaveDataPage.

Version:
3.0
Author:
Acesoft Corporation

Constructor Summary
WordRequest(HttpServletRequest request, HttpServletResponse response)
          Initializes a new instance of the WordRequest class.
 
Method Summary
 void close()
          Returns a success message to AceoffixCtrl.
 java.lang.String getFormField(java.lang.String name)
          Gets the value with the specified name in the form fields of the page with AceoffixCtrl.
 WordReqDataRegion openDataRegion(java.lang.String dataRegionName)
          Opens the specified DataRegion and returns a WordReqDataRegion object.
 void showPage(int width, int height)
          Prompt a custom dialog box to show the saving result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordRequest

public WordRequest(HttpServletRequest request,
                   HttpServletResponse response)
            throws java.lang.Exception,
                   java.io.IOException
Initializes a new instance of the WordRequest class. WordRequest object only can be created in the server page specified by AceoffixCtrl.setSaveDataPage.

Throws:
java.lang.Exception
java.io.IOException
Method Detail

openDataRegion

public WordReqDataRegion openDataRegion(java.lang.String dataRegionName)
                                 throws java.io.IOException,
                                        java.lang.Exception
Opens the specified DataRegion and returns a WordReqDataRegion object.

The following code example shows how to use the openDataRegion method to get data of the specified DataRegion.

 WordRequest wreq = new WordRequest(request, response);
 String strCompanyName = wreq.openDataRegion("CompanyName").getValue();
 String strProductName = wreq.openDataRegion("ProductName").getValue();
 
 // After you get the values, you can save them to the database.
 
 wreq.Close();
 

Parameters:
dataRegionName - The name of DataRegion.
Throws:
java.io.IOException
java.lang.Exception

close

public void close()
           throws java.io.IOException
Returns a success message to AceoffixCtrl.

If the code for saving document executes successfully, you should call this method to return a success message to AceoffixCtrl. Typically, the close method should be called at the end of code in SaveDataPage.

Throws:
java.io.IOException

showPage

public void showPage(int width,
                     int height)
              throws java.io.IOException
Prompt a custom dialog box to show the saving result.

After save document, if you want to prompt a custom dialog box to show the saving result, you can call this method. The message page shown in the dialog box is the current SaveDataPage. By default, the SaveDataPage will display nothing. You can add friendly messages in the SaveDataPage.

Parameters:
width - The width of custom dialog, in pixels.
height - The height of custom dialog, in pixels.
Throws:
java.io.IOException

getFormField

public java.lang.String getFormField(java.lang.String name)
                              throws java.io.IOException,
                                     java.lang.Exception
Gets the value with the specified name in the form fields of the page with AceoffixCtrl.

When AceoffixCtrl is saving document, you can call this method to get the values of form fields posted from the page with AceoffixCtrl. To be able to capture the value, the form field must have a name attribute.

This form field does not support the form collection with the same name. This form field only supports the HTML INPUT tags currently.

Parameters:
name - The name of form field in the page.
Throws:
java.io.IOException
java.lang.Exception