BulkPublish so erweitert dass es bereits publizierte Items auch republizieren kann. Dafür muss die Option -r angegeben werden.
git-svn-id: https://svn.libreccm.org/ccm/trunk@949 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
dfa1d01ea3
commit
4b4198dccc
|
|
@ -83,6 +83,11 @@ public class BulkPublish extends Program {
|
|||
"Restrict publishing to items with the specified langauge").
|
||||
create("l"));
|
||||
|
||||
options.addOption(
|
||||
OptionBuilder.hasArg(false).withLongOpt("republish").
|
||||
withDescription(
|
||||
"Republish items which are already live.").create("r"));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,6 +100,7 @@ public class BulkPublish extends Program {
|
|||
final int folderId;
|
||||
final String language;
|
||||
final boolean ignoreErrors = cmdLine.hasOption("i");
|
||||
final boolean republish = cmdLine.hasOption("r");
|
||||
|
||||
if (cmdLine.hasOption("t")) {
|
||||
types = cmdLine.getOptionValues("t");
|
||||
|
|
@ -195,7 +201,22 @@ public class BulkPublish extends Program {
|
|||
}
|
||||
|
||||
if (item.isLive()) {
|
||||
if (republish) {
|
||||
s_log.info("Item is already live, republishing...");
|
||||
|
||||
ContentBundle bundle = item.getContentBundle();
|
||||
Collection<String> langs = bundle.getLanguages();
|
||||
|
||||
for (String lang : langs) {
|
||||
ContentItem toPublish = bundle.getInstance(lang);
|
||||
toPublish.republish();
|
||||
}
|
||||
|
||||
} else {
|
||||
s_log.info("Skipping because its already live");
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +241,7 @@ public class BulkPublish extends Program {
|
|||
}
|
||||
|
||||
/*
|
||||
* Fix by jensp 2011-04-18: Bulk publish was aware of
|
||||
* Fix by jensp 2011-04-18: Bulk publish was not aware of
|
||||
* content bundles and different languages...
|
||||
*/
|
||||
ContentBundle bundle = item.getContentBundle();
|
||||
|
|
|
|||
Loading…
Reference in New Issue