File file = (File) APILocator.getVersionableAPI().findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false);
PublishFactory.publishAsset(file, user, false, isNewVersion);
}
} catch ( Exception ex ) {
Logger.debug( this, ex.getMessage(), ex );
throw new DotStateException( "Problem occurred while publishing file", ex );
}
}
}
// gets all not live file children
List<File> files = getRelatedFiles(contentlet, user, false);
for (File file : files) {
Logger.debug(this, "*****I'm a Contentlet -- Publishing my File Child=" + file.getInode());
try {
PublishFactory.publishAsset(file, user, false, isNewVersion);
} catch (DotSecurityException e) {
Logger.debug(this, "User has permissions to publish the content = " + contentlet.getIdentifier()
+ " but not the related file = " + file.getIdentifier());
} catch (Exception e) {
throw new DotStateException("Problem occured while publishing file");
}
}
// gets all not live link children
Logger.debug(this, "IM HERE BEFORE PUBLISHING LINKS FOR A CONTENTLET!!!!!!!");
List<Link> links = getRelatedLinks(contentlet, user, false);
for (Link link : links) {
Logger.debug(this, "*****I'm a Contentlet -- Publishing my Link Child=" + link.getInode());
try {
PublishFactory.publishAsset(link, user, false, isNewVersion);
} catch (DotSecurityException e) {
Logger.debug(this, "User has permissions to publish the content = " + contentlet.getIdentifier()
+ " but not the related link = " + link.getIdentifier());
throw new DotStateException("Problem occured while publishing link");
} catch (Exception e) {
throw new DotStateException("Problem occured while publishing file");
}
}
// writes the contentlet object to a file
indexAPI.addContentToIndex(contentlet);