|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.informatica.ui.DataView
info.informatica.ui.html.HTTPDataEntryForm
public class HTTPDataEntryForm
Encapsulation of HTML data entry form.
SYNOPSIS / EXAMPLE:
// initialize
Properties p = ...
DataDict dict = new PropertyDataDict(p);
HTMLViewDatabase viewDb = ...
MetaData md = dict.getMetaData(datasrc_name);
DataViewConfig vc = viewDb.getDataViewConfig(form_name);
ViewSecurity vsec = ... [optional]
DataView form = new HTTPDataEntryForm(form_name);
// Set the metadata
form.setMetaData(md);
try {
// feed the form with data view configuration
form.setDataViewConfig(vc);
// Set the security constraints
form.setSecurity(vsec);
// initialize
form.init();
} catch(DataException e){
...
}
form.setValues(req);
// Validate the form
try {
form.validate();
} catch(DataFieldException e){
...
}
// Do something with values
DataControl control = form.getValue("field1");
String value = (String)control.getValue();
...
form.close();
| Constructor Summary | |
|---|---|
HTTPDataEntryForm(String id)
Builds a form with name id |
|
| Method Summary | |
|---|---|
static HTTPDataEntryForm |
createForm(DataDict dict,
String metadata_name,
String ui_spec_filename)
Creates a sample HTML form from a data dictionary and, optionally, an user interface specification file. |
DataViewMap |
createViewMap(HTTPDataEntryForm form,
LocalLabels labels)
Generates a sample view map starting from a form (that does not have a DataViewConfig). |
static void |
defaultMetaData(MetaData md,
javax.servlet.http.HttpServletRequest req)
Adds default metadata to a metadata object. |
static DataViewMap |
formToViewMap(info.informatica.html.HTMLFragment html,
String form_id,
DataDict dict,
MetaData md)
Deprecated. |
String |
getAction()
Gets the form action |
String |
getEncType()
Gets the form encoding |
String |
getMethod()
Gets the HTTP method |
void |
load(javax.servlet.http.HttpServletRequest req)
Convenience method to load config from request |
static void |
main(String[] args)
Testdrive method used to read a data dictionary from a properties file, and print the corresponding form. |
void |
setAction(String action)
Sets the Action of the form |
void |
setAction(URL action)
Sets the Action of the form |
void |
setMethod(String method)
Sets the HTTP form method |
void |
setValues(javax.servlet.http.HttpServletRequest req)
Sets the values of the fields from request |
void |
setValues(javax.servlet.http.HttpServletRequest req,
Map<String,? extends Object> environment)
Sets the values of the fields from request |
String |
toString()
|
| Methods inherited from class info.informatica.ui.DataView |
|---|
close, createDataControl, dataToUI, dataToUI, equals, fieldCount, getAllowedRoles, getDataControl, getDataControls, getDataViewConfig, getId, getMetaData, getSecurity, getValue, hashCode, init, setDataViewConfig, setMetaData, setSecurity, validate, validate, validate |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HTTPDataEntryForm(String id)
id
| Method Detail |
|---|
public final void load(javax.servlet.http.HttpServletRequest req)
throws DataViewException
DataViewExceptionpublic final void setMethod(String method)
method - metodopublic final void setAction(String action)
action - form's actionpublic final void setAction(URL action)
action - form's action URL
public void setValues(javax.servlet.http.HttpServletRequest req)
throws DataFieldException
req - the HTTP request
DataFieldException - if an error occurs setting the values.
public void setValues(javax.servlet.http.HttpServletRequest req,
Map<String,? extends Object> environment)
throws DataFieldException
req - the HTTP request
DataFieldException - if an error occurs setting the values.public final String getMethod()
public final String getAction()
public String getEncType()
public static void defaultMetaData(MetaData md,
javax.servlet.http.HttpServletRequest req)
md - the initial metadata object, which can be emptyreq - the Servlet Request used to fill the MetaDatapublic String toString()
toString in class DataView
public static HTTPDataEntryForm createForm(DataDict dict,
String metadata_name,
String ui_spec_filename)
throws DataException,
DataViewException,
IOException
This "Documentation method" shows the use of a data dictionary and, optionally, a User Interface specification (ViewConfig) to produce a sample HTML form.
dict - the data dictionarymetadata_name - the name of the form data as recognized by data
dictionary.ui_spec_filename - Filename of a ViewMap user interface specification. May be
null.
DataException
DataViewException
IOException
public DataViewMap createViewMap(HTTPDataEntryForm form,
LocalLabels labels)
For cases where we do not have a ViewConfig.
public static DataViewMap formToViewMap(info.informatica.html.HTMLFragment html,
String form_id,
DataDict dict,
MetaData md)
throws info.informatica.html.HTMLDocumentException,
DataException
html - form_id - dict - md -
info.informatica.html.HTMLDocumentException
DataExceptionHTMLViewDatabase#parseView(String, String)public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||