/** * Updates the current users context dates with the given resource.<p> * * This checks the date information of the resource based on * {@link CmsResource#getDateLastModified()} as well as * {@link CmsResource#getDateReleased()} and {@link CmsResource#getDateExpired()}. * The current users request context is updated with the the "latest" dates found.<p> * * This is required in order to ensure proper setting of <code>"last-modified"</code> http headers * and also for expiration of cached elements in the Flex cache. * Consider the following use case: Page A is generated from resources x, y and z. * If either x, y or z has an expiration / release date set, then page A must expire at a certain point * in time. This is ensured by the context date check here.<p> * * @param dbc the current database context * @param resource the resource to get the date information from */ private void updateContextDates(CmsDbContext dbc, CmsResource resource) { CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); if (info != null) { info.updateFromResource(resource); } }
/** * Updates the current users context dates with each {@link CmsResource} object in the given list.<p> * * The given input list is returned unmodified.<p> * * Please see {@link #updateContextDates(CmsDbContext, CmsResource)} for an explanation of what this method does.<p> * * @param dbc the current database context * @param resourceList a list of {@link CmsResource} objects * * @return the original list of CmsResources with the full resource name set */ private List<CmsResource> updateContextDates(CmsDbContext dbc, List<CmsResource> resourceList) { CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); if (info != null) { for (int i = 0; i < resourceList.size(); i++) { CmsResource resource = resourceList.get(i); info.updateFromResource(resource); } } return resourceList; }
/** * Updates the current users context dates with each {@link CmsResource} object in the given list.<p> * * The given input list is returned unmodified.<p> * * Please see {@link #updateContextDates(CmsDbContext, CmsResource)} for an explanation of what this method does.<p> * * @param dbc the current database context * @param resourceList a list of {@link CmsResource} objects * * @return the original list of CmsResources with the full resource name set */ private List updateContextDates(CmsDbContext dbc, List resourceList) { CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); if (info != null) { for (int i = 0; i < resourceList.size(); i++) { CmsResource resource = (CmsResource)resourceList.get(i); info.updateFromResource(resource); } } return resourceList; }
/** * Updates the current users context dates with the given resource.<p> * * This checks the date information of the resource based on * {@link CmsResource#getDateLastModified()} as well as * {@link CmsResource#getDateReleased()} and {@link CmsResource#getDateExpired()}. * The current users request context is updated with the the "latest" dates found.<p> * * This is required in order to ensure proper setting of <code>"last-modified"</code> http headers * and also for expiration of cached elements in the Flex cache. * Consider the following use case: Page A is generated from resources x, y and z. * If either x, y or z has an expiration / release date set, then page A must expire at a certain point * in time. This is ensured by the context date check here.<p> * * @param dbc the current database context * @param resource the resource to get the date information from */ private void updateContextDates(CmsDbContext dbc, CmsResource resource) { CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); if (info != null) { info.updateFromResource(resource); } }
CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); List<CmsResource> result = new ArrayList<CmsResource>(resourceList.size()); for (int i = 0; i < resourceList.size(); i++) {
CmsFlexRequestContextInfo info = dbc.getFlexRequestContextInfo(); ArrayList result = new ArrayList(resourceList.size()); for (int i = 0; i < resourceList.size(); i++) {