com.hp.hpl.swade.portal
Class VMRenderManager

java.lang.Object
  |
  +--com.hp.hpl.swade.portal.VMRenderManager

public class VMRenderManager
extends java.lang.Object

Render manager version for the velocity subsystem. Through this templates get access to global model state information and useful formatting utilities.

Version:
$Revision: 1.4 $ on $Date: 2004/07/09 15:15:03 $
Author:
Dave Reynolds

Nested Class Summary
static class VMRenderManager.LinkDef
          Structure used to hold a link definition, contains a name and a link address.
 
Field Summary
protected  FilterState context
          The filter context for the data source being rendered.
protected  javax.servlet.http.HttpServletRequest request
          The request being processed - useful for finding context paths
 
Constructor Summary
VMRenderManager(FilterState context, javax.servlet.http.HttpServletRequest request)
          Constructor
 
Method Summary
 java.lang.Integer asInt(java.lang.String s)
          This is stupid but I can't see how velocity converts from strings to ints so do it here.
 RelationGraph createRelationGraph(ResourceWrapper resource, int depthLimit)
          Return a RelationGraph object on the current resource and relation set that can, in turn, be used to render a display of the relations graph.
 DataSource getDataSource()
          Return the data source which this instance is rendering.
 java.util.Collection getDataSources()
          Return a collection of all available data sources.
 FilterState getFilterContext()
          Return the current filter context for the data source being rendered.
 java.lang.String getLinkFor(ResourceWrapper rw)
          Return the link address to use for viewing a single resource in the current data source.
 ResourceWrapper getLinkTarget()
          Return the wrapped resource that is to be linked to or null if there is none
 java.lang.String getMapRectFor(ResourceWrapper resource, RelationGraph graph)
          Return the coordinates of the rectangle for the given resources in the given visualization graph, formatted for using in an HTML image map.
 java.util.Collection getRelations()
          Return a list of wrapper resources representing the available relations
 NodeWrapper getResourceParam(java.lang.String key)
          Return an encoded parameter as a wrapped resource or null if it does not exist.
 java.lang.String getStyleSheet()
          Return the path name for the style sheet used for view of the data source.
 java.util.Collection getVertices(RelationGraph graph)
          Return the list of resources visualized in this map as a collection of ResourceWrappers
 java.lang.String getViewer()
          Return the base pathname for the main viewing servlet, with action appropriate for viewing the current datasource
 java.lang.String getViewerPath(java.lang.String action)
          Return the base pathname for the main viewing servlet with the given action parameter.
 java.lang.String getViewerPathWithDS(java.lang.String action)
          Return the base pathname for the main viewing servlet with the given action parameter along with a current data source.
 java.util.Collection getVisibleRelations()
          Return a collection of relations to be visualized
 java.util.List getVisits()
          Return a list of LinkDef objects giving the recent visits recorded for this session.
 void recordVisit(java.lang.String name, java.lang.String link)
          Note the a resource link in the session context.
 java.lang.String renderFacetBrowse(ResourceWrapper facet, java.lang.String annotation)
          Renders a facet definition in nanotree-compatible javascript form.
 java.lang.String renderRelationGraph(RelationGraph graph)
          Render a relation graph into a temporary image file and return the URL through which that file can be found.
 void setLinkTarget(ResourceWrapper target)
          Note a wrapped resource that is to be linked to.
 boolean shouldShowRelation(ResourceWrapper relation)
          Test whether the given relation is set to be visualized according to the current session state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected FilterState context
The filter context for the data source being rendered.


request

protected javax.servlet.http.HttpServletRequest request
The request being processed - useful for finding context paths

Constructor Detail

VMRenderManager

public VMRenderManager(FilterState context,
                       javax.servlet.http.HttpServletRequest request)
Constructor

Method Detail

getStyleSheet

public java.lang.String getStyleSheet()
Return the path name for the style sheet used for view of the data source.


getDataSource

public DataSource getDataSource()
Return the data source which this instance is rendering.


getFilterContext

public FilterState getFilterContext()
Return the current filter context for the data source being rendered.


getViewerPath

public java.lang.String getViewerPath(java.lang.String action)
Return the base pathname for the main viewing servlet with the given action parameter.


getViewerPathWithDS

public java.lang.String getViewerPathWithDS(java.lang.String action)
Return the base pathname for the main viewing servlet with the given action parameter along with a current data source.


getViewer

public java.lang.String getViewer()
Return the base pathname for the main viewing servlet, with action appropriate for viewing the current datasource


getLinkFor

public java.lang.String getLinkFor(ResourceWrapper rw)
Return the link address to use for viewing a single resource in the current data source.


getDataSources

public java.util.Collection getDataSources()
Return a collection of all available data sources.


getResourceParam

public NodeWrapper getResourceParam(java.lang.String key)
Return an encoded parameter as a wrapped resource or null if it does not exist.


recordVisit

public void recordVisit(java.lang.String name,
                        java.lang.String link)
Note the a resource link in the session context. Used for recording recently visited links.


getVisits

public java.util.List getVisits()
Return a list of LinkDef objects giving the recent visits recorded for this session.


setLinkTarget

public void setLinkTarget(ResourceWrapper target)
Note a wrapped resource that is to be linked to. Set to null to cancel the linking.


getLinkTarget

public ResourceWrapper getLinkTarget()
Return the wrapped resource that is to be linked to or null if there is none


asInt

public java.lang.Integer asInt(java.lang.String s)
This is stupid but I can't see how velocity converts from strings to ints so do it here.


renderFacetBrowse

public java.lang.String renderFacetBrowse(ResourceWrapper facet,
                                          java.lang.String annotation)
Renders a facet definition in nanotree-compatible javascript form.

Parameters:
annotation - set to "enc" for including the encoding of the node resource, "comment" to include the rdfs comment of the node or "both" to include and array of both encoding and comment.

getRelations

public java.util.Collection getRelations()
Return a list of wrapper resources representing the available relations


shouldShowRelation

public boolean shouldShowRelation(ResourceWrapper relation)
Test whether the given relation is set to be visualized according to the current session state.


getVisibleRelations

public java.util.Collection getVisibleRelations()
Return a collection of relations to be visualized


createRelationGraph

public RelationGraph createRelationGraph(ResourceWrapper resource,
                                         int depthLimit)
Return a RelationGraph object on the current resource and relation set that can, in turn, be used to render a display of the relations graph.


renderRelationGraph

public java.lang.String renderRelationGraph(RelationGraph graph)
Render a relation graph into a temporary image file and return the URL through which that file can be found.


getVertices

public java.util.Collection getVertices(RelationGraph graph)
Return the list of resources visualized in this map as a collection of ResourceWrappers


getMapRectFor

public java.lang.String getMapRectFor(ResourceWrapper resource,
                                      RelationGraph graph)
Return the coordinates of the rectangle for the given resources in the given visualization graph, formatted for using in an HTML image map.



Copyright © 2004 Hewlett-Packard. All Rights Reserved.