nl.gx.webmanager.taglib
Class ObjectTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by nl.gx.webmanager.taglib.ObjectTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class ObjectTag
extends javax.servlet.jsp.tagext.SimpleTagSupport

Implements the wm:object tag. Retrieves an object from the content database. In GX WebManager, the content database is filled with objects that have an id and a type. For GX WebManager objects that are exposed through the Java API, wrapper classes are available that encapsulate the data that is stored in the content database. The public API of these wrapper classes is defined in interfaces. The < wm:object > tag can be used as a factory for creating wrapper objects based on the type and objectid. The type is the fully qualified class name of the wrapper interface. If no wrapper object can be created (either the id or the type is wrong), the value null is used.
Example of usage:

 < wm:object var="message" objectId="${param.message}"
 objectType="nl.gx.webmanager.cms.forum.ForumMessage" />
 < wm:render object="${message}" />
 
The example above assigns a ForumMessage object to the variable 'message'. Some tags like, for example, < wm:render > have an attribute object. The variable may be used in such tags.


Constructor Summary
ObjectTag()
           
 
Method Summary
 void doTag()
           
protected  int getObjectId()
          Return the numerical id of the object to retrieve.
protected  java.lang.String getObjectType()
          Return the Java class of the object to retrieve.
protected  java.lang.String getVar()
          Return the JSP variable to store the result in.
 void setObjectId(int objectId)
          Sets the numerical id of the object to retrieve.
 void setObjectType(java.lang.String objectType)
          Specifies the Java class of the object to retrieve.
 void setVar(java.lang.String var)
          Specifies the JSP variable to store the result in.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectTag

public ObjectTag()
Method Detail

setVar

public void setVar(java.lang.String var)
Specifies the JSP variable to store the result in.

Parameters:
var - name of the jsp variable to which the object will be assigned.

getVar

protected java.lang.String getVar()
Return the JSP variable to store the result in.

Returns:
name of the jsp variable to which the object will be assigned.

setObjectId

public void setObjectId(int objectId)
Sets the numerical id of the object to retrieve.

Parameters:
objectId - the numerical id of the object to retrieve.

getObjectId

protected int getObjectId()
Return the numerical id of the object to retrieve.

Returns:
objectid of the object

setObjectType

public void setObjectType(java.lang.String objectType)
Specifies the Java class of the object to retrieve. The objectType should be a fully qualified classname. Note there are some deprecated abbreviations for some classes which are still supported. You should always use the fully qualified classname. In future releases, support for the abbreviations may be dropped.

Parameters:
objectType - the objecttype of the object

getObjectType

protected java.lang.String getObjectType()
Return the Java class of the object to retrieve. The objectType is a fully qualified classname.

Returns:
the objecttype of the object

doTag

public void doTag()
Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport


Copyright © 2007-2011 GX Software BV. All Rights Reserved.