Structure hostStructure = StructureCache.getStructureByVelocityVarName("Host");
if ((contentlet != null) && InodeUtils.isSet(contentlet.getIdentifier()) && contentlet.getStructureInode().equals(hostStructure.getInode())) {
HostAPI hostAPI = APILocator.getHostAPI();
hostAPI.updateCache(new Host(contentlet));
ContentletCache cc = CacheLocator.getContentletCache();
Identifier ident=APILocator.getIdentifierAPI().find(contentlet);
List<Contentlet> contentlets = findAllVersions(ident, sysuser, respectFrontendRoles);
for (Contentlet c : contentlets) {
Host h = new Host(c);
cc.remove(h.getHostname());
cc.remove(h.getIdentifier());
}
hostAPI.updateVirtualLinks(new Host(workingContentlet), new Host(contentlet));//DOTCMS-5025
hostAPI.updateMenuLinks(new Host(workingContentlet), new Host(contentlet));