nl.gx.webmanager.taglib
Class DocumentLinkTag

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

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

Implements the wm:documentlink tag. Returns an HTML link to a document in the Meetings & Papers component and checks for webuser authorization. Example of usage:

 <wm:documentLink var="docLink" contentId="${productInfo.document}" dataSource="jdbc/internaldb" />
 ${docLink}
 


Constructor Summary
DocumentLinkTag()
           
 
Method Summary
 void doTag()
           
protected  java.lang.String getClassName()
          Rreturn the class name to be used in the 'class=�...�' attribute of the resulting HTML link.
protected  int getContentId()
          Return the content id of the document to which a link should be returned.
protected  javax.sql.DataSource getDataSource()
          Return the data source name which can be queried to retrieve more information about the document.
protected  java.lang.String getLinkText()
          Return the text to be used in building the link.
protected  java.lang.String getMouseOverText()
          Return the text to be used in the 'title=�...�' attribute of the resulting HTML link.
protected  java.lang.String getOutputFormat()
          Returns the selected output format for the link code.
protected  boolean getShowDocumentTypeIcon()
          Return whether the documenttype icon should be shown left of the link.
protected  boolean getShowTitleOnly()
          Return whether the linkText should be shown as an HTML link, or as normal text.
protected  java.lang.String getTarget()
          Return the name of the HTML frame to be used in the 'target=�...�' attribute of the resulting link.
protected  java.lang.String getVar()
          Return the variable to which the text will be assigned or null.
protected  java.lang.String getWebUserGroups()
          Return the webuser groups who are granted access to the document.
 boolean isMimeTypeOnly()
          Returns whether the mime type of the document should be returned ("true") or an HTML link to the document itself ("false").
 void setClassName(java.lang.String className)
          Specifies the class name to be used in the 'class=�...�' attribute of the resulting HTML link.
 void setContentId(int contentId)
          Sets the content id of the document to which a link should be returned.
 void setDataSource(javax.sql.DataSource dataSource)
          Sets the data source name which can be queried to retrieve more information about the document.
 void setLinkText(java.lang.String linkText)
          Sets the text to be used in building the link.
 void setMimeTypeOnly(boolean mimeTypeOnly)
          Sets whether the mime type of the document should be returned (set to "true") or an HTML link to the document itself (set to "false").
 void setMouseOverText(java.lang.String mouseOverText)
          Specifies the text to be used in the 'title=�...�' attribute of the resulting HTML link.
 void setOutputFormat(java.lang.String outputFormat)
          Sets the output format of the link code produced.
 void setShowDocumentTypeIcon(boolean showDocumentTypeIcon)
          Sets whether the documenttype icon should be shown left of the link.
 void setShowTitleOnly(boolean showTitleOnly)
          Sets whether the linkText should be shown as an HTML link, or as normal text.
 void setTarget(java.lang.String target)
          Specifies the name of the HTML frame to be used in the 'target=�...�' attribute of the resulting link.
 void setVar(java.lang.String var)
          Specifies the JSP variable to store the result in.
 void setWebUserGroups(java.lang.String webUserGroups)
          Sets the webuser groups who are granted access to the document.
 
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

DocumentLinkTag

public DocumentLinkTag()
Method Detail

setContentId

public void setContentId(int contentId)
Sets the content id of the document to which a link should be returned.

Parameters:
contentId -

getContentId

protected int getContentId()
Return the content id of the document to which a link should be returned.

Returns:
the content id of the document to which a link should be returned.

setLinkText

public void setLinkText(java.lang.String linkText)
Sets the text to be used in building the link. Default value is the title of the document that is referred to.

Parameters:
linkText -

getLinkText

protected java.lang.String getLinkText()
Return the text to be used in building the link. Default value is the title of the document that is referred to. Note that the link text can also be an image tag, so it is not escaped. You have to escape the link text within the call to the tag from your jsp if necessary.

Returns:
the text to be used in building the link. Default value is the title of the document that is referred to.

setWebUserGroups

public void setWebUserGroups(java.lang.String webUserGroups)
Sets the webuser groups who are granted access to the document.

Parameters:
webUserGroups -

getWebUserGroups

protected java.lang.String getWebUserGroups()
Return the webuser groups who are granted access to the document.

Returns:
the webuser groups who are granted access to the document

setClassName

public void setClassName(java.lang.String className)
Specifies the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

Parameters:
className -

getClassName

protected java.lang.String getClassName()
Rreturn the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

Returns:
the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

setTarget

public void setTarget(java.lang.String target)
Specifies the name of the HTML frame to be used in the 'target=�...�' attribute of the resulting link. If the link is clicked, the document is opened in this frame. If no frame with this name can be found the link is opened in a new browser window. Default value for this attribute is empty, so the link will open in the same window.

Parameters:
target -

getTarget

protected java.lang.String getTarget()
Return the name of the HTML frame to be used in the 'target=�...�' attribute of the resulting link. If the link is clicked, the document is opened in this frame. If no frame with this name can be found the link is opened in a new browser window. Default value for this attribute is empty, so the link will open in the same window

Returns:
the target for the link

setShowTitleOnly

public void setShowTitleOnly(boolean showTitleOnly)
Sets whether the linkText should be shown as an HTML link, or as normal text. Default value is true (normal text).

Parameters:
showTitleOnly -

getShowTitleOnly

protected boolean getShowTitleOnly()
Return whether the linkText should be shown as an HTML link, or as normal text. Default value is true (normal text).

Returns:
true if the title should be shown when you are only allowed to see the title

setShowDocumentTypeIcon

public void setShowDocumentTypeIcon(boolean showDocumentTypeIcon)
Sets whether the documenttype icon should be shown left of the link. Default value is false (no icon).

Parameters:
showDocumentTypeIcon -

getShowDocumentTypeIcon

protected boolean getShowDocumentTypeIcon()
Return whether the documenttype icon should be shown left of the link. Default value is false (no icon).

Returns:
true if the documenttype icon should be shown for the link

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
Sets the data source name which can be queried to retrieve more information about the document.

Parameters:
dataSource -

getDataSource

protected javax.sql.DataSource getDataSource()
Return the data source name which can be queried to retrieve more information about the document.

Returns:
the data source name which can be queried to retrieve more information about the document.

setVar

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

Parameters:
var - specifies the JSP variable to store the result in.

getVar

protected java.lang.String getVar()
Return the variable to which the text will be assigned or null.

Returns:
the variable to which the text will be assigned or null if not set.

setMouseOverText

public void setMouseOverText(java.lang.String mouseOverText)
Specifies the text to be used in the 'title=�...�' attribute of the resulting HTML link. This text is usually shown as a tooltip if the mouse cursor is placed over the link. Default is the value of the linkText attribute.

Parameters:
the - text to be used in the 'title=�...�' attribute of the resulting HTML link

getMouseOverText

protected java.lang.String getMouseOverText()
Return the text to be used in the 'title=�...�' attribute of the resulting HTML link. This text is usually shown as a tooltip if the mouse cursor is placed over the link. Default is the value of the linkText attribute.

Returns:
the text to be used in the 'title=�...�' attribute of the resulting HTML link

setOutputFormat

public void setOutputFormat(java.lang.String outputFormat)
Sets the output format of the link code produced. Options are HTML or XHTML. HTML is backwards compatible HTML, and XHTML is strict XHTML with proper escaping for URLs etc.

Parameters:
outputFormat - "HTML" or "XHTML". Default is "HTML".

getOutputFormat

protected java.lang.String getOutputFormat()
Returns the selected output format for the link code.

Returns:
The selected output format.

doTag

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

isMimeTypeOnly

public boolean isMimeTypeOnly()
Returns whether the mime type of the document should be returned ("true") or an HTML link to the document itself ("false").

Returns:
true if the tag should only return the mimetype of the linked document

setMimeTypeOnly

public void setMimeTypeOnly(boolean mimeTypeOnly)
Sets whether the mime type of the document should be returned (set to "true") or an HTML link to the document itself (set to "false"). Default value is false.

Parameters:
mimeTypeOnly -


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