Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IAdminPage.GetContent Method 

Gets the content for the page in string form.

string GetContent(
   int errorCode,
   NamedValueMap pageInfo
);

Parameters

errorCode
error code from previous page if ValidationException is thrown or null if no exception was thrown
pageInfo
NamedValueMap of page contents. If this is from an existing set of pages (i.e. IAdminEditor has previously called Finalize()), then the names in the
NamedValueMap
will be uppercased.

Return Value

content of the page as a String

Example

Example for selecting a filter for a newsgroup:

   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();

See Also

IAdminPage Interface | Plumtree.Remote.Sci Namespace