resource.setPermissions(this.getSecurity(uri));
return resource;
}
catch (AccessDeniedException e)
{
JetspeedCMSException e1 = new JetspeedCMSException("Impossible to get the content resource");
e1.setIsAccessDenied(true);
throw e1;
}
catch (NullPointerException e)
{
// Trigger when the objectNode has not the correct properties
// eg. : for a User or Action node in Slide. These type of node are mapped to Catalog
Catalog catalog = (Catalog) CmsFactory.getCmsOmInstance("Catalog");
catalog.setUri(uri);
catalog.setLogicalName(uri);
catalog.setTitle(uri);
return catalog;
}
catch (RevisionDescriptorNotFoundException e)
{
// if no revision descriptor => create an empty catalog object which
// contains the uri data, a default title and a default logical name
// This case arrives when the descriptor stores are not init by the
// method Slide.createResource(...)
// For example, after reading domain.xml, Slide will add all
// namespace defined in the "scoop" xml tag in the target store
// But in our case, we need different properties defined via the
// NodeRevisionDescriptor like the title, logical name, ...
if (uri.equals(TurbineResources.getString("services.CmsService.catalog.root.uri")))
{
Catalog catalog = (Catalog) CmsFactory.getCmsOmInstance("Catalog");
catalog.setUri(uri);
catalog.setLogicalName(TurbineResources.getString("services.CmsService.catalog.root.logicalname"));
catalog.setTitle(TurbineResources.getString("services.CmsService.catalog.root.title"));
return catalog;
}
else
{
// getResource called for a user/action ...
Catalog catalog = (Catalog) CmsFactory.getCmsOmInstance("Catalog");
catalog.setUri(uri);
catalog.setLogicalName(uri);
catalog.setTitle(uri);
return catalog;
//e.printStackTrace();
//return null;
}
}
catch ( Exception e)
{
throw new JetspeedCMSException("Impossible to get the content resource");
}
}