com.ibm.designer.domino.scripting.api.published
Interface PublishedObjectProvider

All Known Implementing Classes:
AbstractDataContainerPublishedProvider, AbstractDataPublishedProvider, DataContextPublishedProvider

public interface PublishedObjectProvider

Instances of this interface are provided using the com.ibm.designer.domino.scripting.publishedProvider extension point. This interface may be implemented directly. For convenience, base abstract implementations have been provided which provide a framework for contributing to the Domino Designer data tooling.

Class name Description
com.ibm.designer.domino.xsp.api.published.AbstractDataContainerPublishedProvider Provides a default implementation for XPages tags that are data container tags. i.e. tags that can have a this.data as its child.
When getPublishedObjects is called on this class it also searches for child tags with the name this.data. If any this.data tags are found their children are examine and PublishedObjectProvider.getPublishedObject(......) is called recursively for all children.
com.ibm.designer.domino.xsp.api.published.AbstractDataPublishedProvider Provides a default implementation for XPages tags that are document provider tags. i.e. tags that publish data to the JSF model.

Since:
8.5.3

Field Summary
static java.lang.String CURRENT_DOC_VAR
           
 
Method Summary
 void getPublishedObject(java.util.Map<java.lang.String,IScriptData.PublishedObject> map, org.w3c.dom.Node selection, DesignerProject project, boolean addCurrentData)
          Gets called by the XPage Editor data tooling framework.
 

Field Detail

CURRENT_DOC_VAR

static final java.lang.String CURRENT_DOC_VAR
See Also:
Constant Field Values
Method Detail

getPublishedObject

void getPublishedObject(java.util.Map<java.lang.String,IScriptData.PublishedObject> map,
                        org.w3c.dom.Node selection,
                        DesignerProject project,
                        boolean addCurrentData)
                        throws com.ibm.designer.prj.resources.commons.DesignerProjectException
Gets called by the XPage Editor data tooling framework. Each time selection changes in the XPage editor this method will be called. It is the responsibility of this method to ensure that a PublishedObject is added to the map as is appropriate based on the selection parameter. The selection parameter is the currently selected tag in the XPages Editor.

Example:
Using the following XPage xml markup as an example we can see how the data tooling examines the XPage DOM:
<xp:view>
     <xp:this.data>
          <my:myRelationalDataSource var="db2" server="mydb2serverB" db="mydb" ...../>
     </xp:this.data>
     <xp:panel>
         <xp:this.data>
              <my:myRelationalDataSource var="db1" server="mydb2serverA" db="mydb" ...../>
         </xp:this.data>
         ........
         
         <xp:inputText id="inputText1"></xp:inputText>
     </xp:panel>
</xp:view> 
 
As a use case we will assume that the user has selected the inputText tag in the XPage above. At this point the Domino Designer data tooling framework must find out what data is available to the inputText tag.
The data tooling framework recursively walks 'up' through the XPage's DOM hierarchy. In this example <xp:panel> is the first parent tag of <xp:inputText>. <xp:panel> is defined in the runtime as a data container tag, meaning it can have a <xp:this.data> tag as a child. As a result of this the <xp:panel> tag provides a concrete implementation of com.ibm.designer.domino.xsp.api.published.AbstractDataContainerPublishedProvider using the com.ibm.designer.domino.scripting.publishedProvider extension point. This concrete implementation searches through the children of <xp:panel> for instances of the this.data tag.
In this case a this.data tag is found. The <xp:panel> implementation next searches through the children of the this.data tag. It finds a tag called myRelationalDataSource.

It is the responsibility of myRelationalDataSource to provide an implementation of com.ibm.designer.domino.scripting.api.published.PublishedObjectProvider using the com.ibm.designer.domino.scripting.publishedProvider extension point so that the Domino Designer data tooling code can interpret the data being contributed by the myRelationalDataSource tag. In this case myRelationalDataSource has contributed a concrete implementation of com.ibm.designer.domino.xsp.api.published.AbstractDataPublishedProvider. This implementation reads the relational database that is defined in its attributes and provides a schema representation of the database to the Domino Designer data tooling framework via its PublishedObject.
Once all children of this.data have contributed their PublishedObjects to the map the data tooling will once again walk upwards through the DOM hierarchy.

The next parent is the <xp:view>. Once again this tag is a data container, and similar to what happened when the <xp:panel> tag was encountered the children of the view will be examined for instances of the this.data tag.
Again the myRelationalDataSource tag is encountered and it PublishedObjectProvider is queried to add a PublishedObject to the map via the getPublishedObject(Map, Node, ICommonDesignerProject, boolean) method.
Once the Domino Designer data tooling framework code has walked through the XPage's DOM hierarchy it uses the information collected to populate the XPages tooling with information from the PublishedObject map. The string that corresponds to the PublishedObject in the map is assumed to be the PublishedObject's name. The name is shown in the list of Data Sources in both the properties panels and also in the Data Palette view. Once the user selects that name in the data panel or in the data palette view the PublishedObject is queried for information that is required to further populate the tooling. Specifically the PublishedObject is queried for objects that correspond to the properties defined in IScriptData

Parameters:
map - a map of PublishedObjects. Items are contributed to the map on a key - value pair basis where the key is typically the string returned by IScriptData.PublishedObject.getName() and the value is an instance of IScriptData.PublishedObject.
The keys of the map are typically used for data binding and represent the data source names. The values in the map resolve to PublishedObects which are in turn queried for further information about the data source.
selection - the currently selected DOM node on the XPage.
project - an interface used to describe the currently selected IBM Lotus Notes application.
Throws:
com.ibm.designer.prj.resources.commons.DesignerProjectException - an error was encountered when accessing the db.
See Also:
IScriptData, IScriptData.PublishedObject, DesignerPublishedObject, IScriptData.PublishedObject.getProperty(String)