| java.lang.Object org.sakaiproject.content.impl.ContentHostingHandlerResolverImpl
ContentHostingHandlerResolverImpl | public class ContentHostingHandlerResolverImpl implements BaseContentHostingHandlerResolver(Code) | |
Implementation of the Handler Resolver. This class chains back to the storage to get local entities but then resolves the IDs through to virtual content entities based on the name ContentHostingHandlers. The primary 3 methods are getRealParent(),
getVirtualEntity(), and getVirtualChild(). The remaining methods are largely plumbing, proxying the Storage mechanism that is being used. The Storage mechanims must be aware that this code will cause re-entry into the Sotrage methods and so the Storage
must implement some sort of call stack advisor to prevent recursion.
The getRealParent() method takes the current Id, and finds the closest ancestor that exists in the main Storage area.
The getVirtualEntity() converts a ContentEntity into a ContentEntity managed by the ContentHostingHandler named in that entity. If no ContentHostingHandler is named, then the ContentEntity is returned unchanged.
The getVirtualChild() method takes a ContentEntity that is a parent of the target ContentEntity and tried to find the target ContentEntity by navigating to children and resolving ContentEntity via ContentHostingHandlers where appropriate. If the target
does not exist, null is returned.
To make this navigation process efficient there needs to be some form of Cache in place, ideally this would be a cluster wide cache with event based expiry.
author: ieb (initial version), johnf (substantial edits) |
Method Summary | |
public void | cancelCollection(Storage storage, ContentCollectionEdit edit) Cancel collection, using storage if real, or the ContentHostingHandler if present. | public void | cancelResource(Storage storage, ContentResourceEdit edit) | public boolean | checkCollection(Storage storage, String id) | public boolean | checkResource(Storage storage, String id) | public void | commitCollection(Storage storage, ContentCollectionEdit edit) | public void | commitDeleteResource(Storage storage, ContentResourceEdit edit, String uuid) | public void | commitResource(Storage storage, ContentResourceEdit edit) | public ContentCollectionEdit | editCollection(Storage storage, String id) | public ContentResourceEdit | editResource(Storage storage, String id) | public ContentCollection | getCollection(Storage storage, String id) | public List | getCollections(Storage storage, ContentCollection collection) | public List | getFlatResources(Storage storage, String id) | public int | getMemberCount(Storage storage, String id) | public ContentEntity | getRealParent(Storage storage, String id) | public ContentResource | getResource(Storage storage, String id) | public byte[] | getResourceBody(Storage storage, ContentResource resource) | public List | getResources(Storage storage, ContentCollection collection) | public ContentEntity | getVirtualChild(String finalId, ContentEntity ce, boolean exact) Locate the ContentEntity with the final Id, or null if can't be found, resolving virtual content entities as part of the resolution process. | public ContentEntity | getVirtualEntity(ContentEntity ce, String finalId) Convert the ContentEntity into its virtual shadow via its ContentHostingHandler bean. | public Edit | newCollectionEdit(String id) | public Edit | newResourceEdit(String id) | public ContentCollectionEdit | putCollection(Storage storage, String id) | public ContentResourceEdit | putDeleteResource(Storage storage, String id, String uuid, String userId) | public ContentResourceEdit | putResource(Storage storage, String id) | public void | removeCollection(Storage storage, ContentCollectionEdit edit) | public void | removeResource(Storage storage, ContentResourceEdit edit) | public void | setCollectionUser(org.sakaiproject.util.StorageUser csu) | public void | setResourceUser(org.sakaiproject.util.StorageUser rsu) | public InputStream | streamResourceBody(Storage storage, ContentResource resource) |
cancelCollection | public void cancelCollection(Storage storage, ContentCollectionEdit edit)(Code) | | Cancel collection, using storage if real, or the ContentHostingHandler if present.
|
cancelResource | public void cancelResource(Storage storage, ContentResourceEdit edit)(Code) | | Cancel collection, using storage if real, or the ContentHostingHandler if present
|
checkCollection | public boolean checkCollection(Storage storage, String id)(Code) | | |
checkResource | public boolean checkResource(Storage storage, String id)(Code) | | |
getMemberCount | public int getMemberCount(Storage storage, String id)(Code) | | |
getRealParent | public ContentEntity getRealParent(Storage storage, String id)(Code) | | Find the closest real ancestor to the requested id, this recurses into itself
Parameters: id - the closest ancestor or null if not found (bit unlikely) |
getVirtualChild | public ContentEntity getVirtualChild(String finalId, ContentEntity ce, boolean exact)(Code) | | Locate the ContentEntity with the final Id, or null if can't be found, resolving virtual content entities as part of the resolution process. Will return a real content entity if that is what the finalId represents.
Parameters: finalId - Parameters: ce - Parameters: exact - -if true, the exact match otherwise the nearest ancestor |
getVirtualEntity | public ContentEntity getVirtualEntity(ContentEntity ce, String finalId)(Code) | | Convert the ContentEntity into its virtual shadow via its ContentHostingHandler bean. If no bean is defined for the ContentEntity, no resolution is performed. If the ContentEntity is null, no resolution is performed.
Parameters: ce - a resolved ContentEntity where appropriate, otherwise the orginal |
|
|