/** * Reads the dependency object for the given root path in the OpenCms runtime context.<p> * * @param cms the current OpenCms user context * @param rootPath the root path to look up the dependency object for * * @return the deps */ private static CmsDocumentDependency readFromContext(CmsObject cms, String rootPath) { return (CmsDocumentDependency)cms.getRequestContext().getAttribute(getAttributeKey(rootPath)); }
/** * Removes the dependency object for a published resource from the OpenCms * runtime context.<p> * * <b>Please note:</b> This must be used with caution since the information * may be required to generate documents for several configured indexes. It * must be ensured that this is called only when all indexes have been * updated.<p> * * @param cms the current OpenCms user context * @param pubRes the published resource info * * @see #storeInContext(CmsObject) */ protected static void removeFromContext(CmsObject cms, CmsPublishedResource pubRes) { cms.getRequestContext().removeAttribute(getAttributeKey(pubRes.getRootPath())); }
/** * Stores this dependency object for a published resource in the OpenCms runtime context.<p> * * This done to optimize indexing speed. When the index update information is calculated, * all dependencies for a resource must be calculated also. The same information is later needed when * the Lucene document is created, for example in order to store the list of other available languages.<p> * * @param cms the current OpenCms user context */ public void storeInContext(CmsObject cms) { cms.getRequestContext().setAttribute(getAttributeKey(getResource().getRootPath()), this); }