|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An interface for an individual SCI page.
| Method Summary | |
java.lang.String |
getContent(int errorCode,
NamedValueMap pageInfo)
Gets the content for this page in string form. Example for selecting a filter for a newsgroup: |
java.lang.String |
getHelpURI()
Gets the help page URI for the page. |
java.lang.String |
getImageURI()
Gets the editor icon. |
java.lang.String |
getInstructions()
Gets the editor instructions, displayed below the title in the editor page. |
java.lang.String |
getTitle()
Gets the title for this page. |
void |
validatePage(NamedValueMap pageInfo)
Validates the current page and throws a ValidationException to report an error. |
| Method Detail |
public java.lang.String getTitle()
throws ServiceException
ServiceException - if a SOAP error occurs
public java.lang.String getInstructions()
throws ServiceException
ServiceException - if a SOAP error occurs
public java.lang.String getImageURI()
throws ServiceException
ServiceException - if a SOAP error occurs
public java.lang.String getHelpURI()
throws ServiceException
ServiceException - if a SOAP error occurs
public java.lang.String getContent(int errorCode,
NamedValueMap pageInfo)
throws ServiceException
SciPage sciPage = new SciPage();
//deal with any validation exceptions- i.e. if errorCode != 0
SciLabelElement errorElement = null;
//the errorCode was defined when throwing the validation exception- 2 is for illustration only
if (errorCode == 2)
{
//if we got an errorCode, we can assume that filter is not null as we have already filled in this page
errorElement = new SciLabelElement(
"No groups match filter " + filter + " select another filter",
TypeStyle.STYLE_IMPORTANT);
}
//add a label element
SciLabelElement labelElement = new SciLabelElement("Add a filter to restrict the list of groups, e.g. comp.lang.java.*. Only the first fifty matching groups will be listed.",
TypeStyle.STYLE_NORMAL);
// add a text box for the filter
SciTextElement filterElement = new SciTextElement("Filter",
"Enter a filter");
filterElement.setMandatoryValidation("You must enter a filter");
filterElement.setSize(40);
//if we already have a filter, set the value of the text control
String filter = pageInfo.get("Filter");
if (null != filter)
{
filterElement.setValue(filter);
}
if (null != errorElement)
{
sciPage.add(errorElement);
}
sciPage.add(labelElement);
sciPage.add(filterElement);
return sciPage.toString();
errorCode - the error code from previous page if ValidationException is thrown, or null if no exception was thrownpageInfo - the NamedValueMap of incoming page values. If this is from an existing set of pages (IAdminEditor has previously called finalize()), then the names in the NamedValueMap will be uppercased.
ServiceException - if a SOAP error occurs
public void validatePage(NamedValueMap pageInfo)
throws ValidationException,
ServiceException
ValidationException to report an error.
Used to provide validition that cannot be accomplished using regular expressions; for example, validating a user name and password
for a database.
The error code in a thrown ValidationException is used as the
pageInfo - the NamedValueMap of values from the page. If this is from an existing set of pages (IAdminEditor has previously called finalize()), then the names in the NamedValueMap will be uppercased.
ValidationException - if any setting values are invalid
ServiceException - if a SOAP error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©2008 Oracle® Corporation. All Rights Reserved.