|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.hp.hpl.swade.portal.NodeWrapper
|
+--com.hp.hpl.swade.portal.ResourceWrapper
A bean wrapper round an RDFNode used to communicate model information to the rendering templates.
| Field Summary | |
protected java.util.Map |
cache
Cache of properties values stored as a map from Property to MultiStatementWrapper |
| Fields inherited from class com.hp.hpl.swade.portal.NodeWrapper |
datasource, name, node |
| Constructor Summary | |
ResourceWrapper(com.hp.hpl.jena.rdf.model.Resource node,
DataSource datasource)
Constructor. |
|
| Method Summary | |
void |
checkCache()
Ensure the cache is loaded with property values for this resource. |
protected java.util.Collection |
findProperties(com.hp.hpl.jena.util.iterator.Filter filter,
java.util.Collection exclude)
Helper function, find all properties of the resource which pass the given filter and return a collection of MulitStatementWrappers over those values. |
java.util.Collection |
findProperties(java.lang.String prop)
Locates a subset of the properties of a resource as a collection suitable for traversal and rendering. |
java.util.Collection |
findProperties(java.lang.String prop,
java.util.Collection exclude)
Locates a subset of the properties of a resource as a collection suitable for traversal and rendering. |
java.util.Collection |
findPropertiesByClass(java.lang.String markerType)
Locates a subset of the properties of a resource as a collection suitable for traversal and rendering. |
java.util.Collection |
findPropertiesByClass(java.lang.String markerType,
java.util.Collection exclude)
Locates a subset of the properties of a resource as a collection suitable for traversal and rendering. |
java.util.Collection |
findPropertiesByPrefix(java.lang.String prefix,
java.util.Collection exclude)
Locates a subset of the properties of a resource as a collection suitable for traversal and rendering. |
void |
flushCache()
Flush the cache of property values (because some internal state has changed) |
java.lang.String |
getActionLink(java.lang.String action,
javax.servlet.http.HttpServletRequest request)
Return the link address which can be used apply the given action to the resource |
java.lang.String |
getInstancesLink(javax.servlet.http.HttpServletRequest request)
The resource is assumed to a concept in a search facet and this call returns the html link address which can be used to search for all instances of the concept. |
java.lang.String |
getPageLink(javax.servlet.http.HttpServletRequest request)
Return the link address which can be used for rendering this resource to link to a page view |
NodeWrapper |
getPrimarySource()
Return the primary source for the properties of this "object". |
java.util.Collection |
getProperties()
Return all the properties of this node as a list of MultiStatementWrappers |
MultiStatementWrapper |
getProperty(java.lang.String prop)
Return the values of the given property using the appropriate wrapper class. |
java.lang.String |
getPropertyValue(java.lang.String prop)
Return a render of a single valued property as a single string. |
com.hp.hpl.jena.rdf.model.Resource |
getResource()
Return the wrapped resource |
java.lang.String |
getTrucatedTextPropertyValue(java.lang.String prop,
int words)
Return a render of a single valued property as a single string, truncated to the given number of space-separated words. |
java.lang.String |
getUri()
Return the URI for this node. |
boolean |
hasProperty(java.lang.String prop)
Return true if there is at least one value for the property |
boolean |
hasType(java.lang.String type)
Return true if one of the rdf:types of this resource is the given resource. |
java.lang.String |
render(java.lang.String context,
javax.servlet.http.HttpServletRequest request)
Return the HMTL rendering of this resource as a string. |
| Methods inherited from class com.hp.hpl.swade.portal.NodeWrapper |
compareTo, getDataSource, getEncoding, getName, getNode, isLiteral |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map cache
| Constructor Detail |
public ResourceWrapper(com.hp.hpl.jena.rdf.model.Resource node,
DataSource datasource)
| Method Detail |
public java.lang.String getUri()
public com.hp.hpl.jena.rdf.model.Resource getResource()
public void checkCache()
public void flushCache()
public MultiStatementWrapper getProperty(java.lang.String prop)
prop - the name of the property which might use prefix
notation (with the prefix map of the model in which this node sits)
or a full URL.public boolean hasProperty(java.lang.String prop)
public boolean hasType(java.lang.String type)
public java.lang.String getPropertyValue(java.lang.String prop)
public java.lang.String getTrucatedTextPropertyValue(java.lang.String prop,
int words)
public java.util.Collection getProperties()
public java.util.Collection findProperties(java.lang.String prop)
public java.util.Collection findProperties(java.lang.String prop,
java.util.Collection exclude)
exclude - an optional collection of properties which have already been
rendered elsewhere and should be excluded from this find, will be updated
by the find, can be null.public java.util.Collection findPropertiesByClass(java.lang.String markerType)
markerType - the Class name which is used to mark properties to retain
public java.util.Collection findPropertiesByClass(java.lang.String markerType,
java.util.Collection exclude)
markerType - the Class name which is used to mark properties to retainexclude - an optional collection of properties which have already been
rendered elsewhere and should be excluded from this find, will be updated
by the find, can be null.
public java.util.Collection findPropertiesByPrefix(java.lang.String prefix,
java.util.Collection exclude)
exclude - an optional collection of properties which have already been
rendered elsewhere and should be excluded from this find, will be updated
by the find, can be null.
protected java.util.Collection findProperties(com.hp.hpl.jena.util.iterator.Filter filter,
java.util.Collection exclude)
public java.lang.String render(java.lang.String context,
javax.servlet.http.HttpServletRequest request)
render in class NodeWrapperpublic NodeWrapper getPrimarySource()
public java.lang.String getPageLink(javax.servlet.http.HttpServletRequest request)
public java.lang.String getInstancesLink(javax.servlet.http.HttpServletRequest request)
public java.lang.String getActionLink(java.lang.String action,
javax.servlet.http.HttpServletRequest request)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||