com.plumtree.remote.sci
Interface ISciElement

All Known Implementing Classes:
SciCheckboxElement, SciHiddenElement, SciLabelElement, SciPasswordElement, SciRadioElement, SciSelectElement, SciTextElement, SciTreeElement

public interface ISciElement

Root interface for all SciElements. This includes SciCheckboxElement, SciPasswordElement, SciRadioElement, SciSelectElement and SciTreeElement. Developers wanting to add other elements to an SCI page should implement this interface and set the xmlns attribute on the root xml node to "http://www.w3.org/1999/xhtml"


Method Summary
 org.w3c.dom.Node getRootNode()
          Gets the root Node of this control to add to the SCI page.
 

Method Detail

getRootNode

public org.w3c.dom.Node getRootNode()
Gets the root Node of this control to add to the SCI page.

Returns:
the root Node
 //Simple Example Code to make a link to Google:
 //nested class implementing ISciElement
 class LinkElement implements ISciElement
 {
  private org.w3c.dom.Document m_doc;
  public Node getRootNode()
  {
   return m_doc.getDocumentElement();
  }
  public LinkElement()
  {
     m_doc = new CoreDocumentImpl();
   //make an anchor element
   Element link = m_doc.createElement("a");
   //set the correct namespace so the portal will treat it as raw html
   link.setAttribute("xmlns","http://www.w3.org/1999/xhtml");
   //set the href
   link.setAttribute("href", "http://www.google.com");
   //create a text node for the link text
   Node textNode = m_doc.createTextNode("google");
   link.appendChild(textNode);
   m_doc.appendChild(link);
  }
 }
 // use this in getPageContent:
 public String getContent(int pageNumber, NamedValueMap pageInfo) throws ServiceException
 {
  SciPage page = new SciPage();
  ISciElement linkElement = new LinkElement();
  page.add(linkElement);
  return page.toString();
 }
 


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.