+ protected static class ModifyArticleFieldOperation extends ArticleModifyingOperation {
+ private String field;
+ private String value;
+
+ public ModifyArticleFieldOperation(String aName, String aField, String aValue, boolean aLogOperation) {
+ super(aName, aLogOperation);
+
+ field = aField;
+ value = aValue;
+ }
+
+ protected boolean isAvailable(EntityContent anArticle) {
+ return anArticle.getValue(field) == null || !anArticle.getValue(field).equals(value);
+ }
+
+ protected void performModification(EntityAdapter aUser, EntityContent anArticle) throws StorageObjectFailure {
+ anArticle.setValueForProperty(field, value);
+ }
+ }
+
+ protected static class ChangeArticleFieldOperation extends ArticleModifyingOperation {
+ private String field;
+ private String oldValue;
+ private String newValue;
+
+ public ChangeArticleFieldOperation(String aName, String aField, String anOldValue, String aNewValue, boolean aLogOperation) {
+ super(aName, aLogOperation);
+
+ field = aField;
+ newValue = aNewValue;
+ oldValue = anOldValue;
+ }
+