*/
public Resource getResource (String uri )
throws JetspeedCMSException
{
SlideResource resource = null;
try
{
String userNode = this.getSlideUserNode();
// Get the last NodeRevisionDescriptor
SlideToken slideToken = this.getSlideToken( userNode );
// uri parameter can be point to a linkNode => retrieve its target
// objectnode
ObjectNode objectNode = structure.retrieve(slideToken, uri, true);
// Get the last Node revision descriptor
NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, objectNode.getUri());
NodeRevisionDescriptor revisionDescriptor =
content.retrieve(slideToken, revisionDescriptors);
// Check if the resource is a Catalog or an ContentItem
// (based on the property class name) & an create an object for this resource
NodeProperty p = revisionDescriptor.getProperty(PROPERTY_CLASS_NAME);
String className = (String) p.getValue();
resource = (SlideResource) Class.forName( className ).newInstance();
resource.setUri(uri);
// Populate the resource properties
resource.setDescriptor(revisionDescriptor);
// populate Security info
resource.setPermissions(this.getSecurity(uri));
return resource;
}
catch (AccessDeniedException e)
{
JetspeedCMSException e1 = new JetspeedCMSException("Impossible to get the content resource");