Skip to content

Commit

Permalink
#12716 something like this - unteseted
Browse files Browse the repository at this point in the history
  • Loading branch information
wezell committed Nov 17, 2017
1 parent 82f4a8e commit 72177c1
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.dotmarketing.factories;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.dotmarketing.beans.Identifier;
import com.dotmarketing.beans.Inode;
Expand All @@ -23,6 +26,7 @@
import com.dotmarketing.services.PageServices;
import com.dotmarketing.util.InodeUtils;
import com.dotmarketing.util.Logger;
import com.google.common.collect.Lists;

/**
* This class provides utility routines to interact with the Multi-Tree
Expand Down Expand Up @@ -674,11 +678,17 @@ private static void updateHTMLPageVersionTS(String id) throws DotDataException,
*
*/
private static void refreshPageInCache(String pageIdentifier) throws DotDataException, DotSecurityException {
Identifier ident = APILocator.getIdentifierAPI().find(pageIdentifier);
List<Contentlet> allPageVersions = APILocator.getContentletAPI()
.findAllVersions(ident, APILocator.getUserAPI().getSystemUser(), false);
Set<String> inodes = new HashSet<String>();
List<ContentletVersionInfo> infos = APILocator.getVersionableAPI().findContentletVersionInfos(pageIdentifier);
for (ContentletVersionInfo versionInfo : infos) {
inodes.add(versionInfo.getWorkingInode());
if(versionInfo.getLiveInode() != null){
inodes.add(versionInfo.getLiveInode());
}
}

for (Contentlet pageContent : allPageVersions) {
List<Contentlet> cons = APILocator.getContentletAPIImpl().findContentlets(Lists.newArrayList(inodes));
for (Contentlet pageContent : cons) {
IHTMLPage htmlPage = APILocator.getHTMLPageAssetAPI().fromContentlet(pageContent);
PageServices.invalidateAll(htmlPage);
}
Expand Down

0 comments on commit 72177c1

Please sign in to comment.