[CST-12108] minor refactoring

This commit is contained in:
Mykhaylo
2023-11-21 16:03:30 +01:00
parent d822b24a78
commit a959ba2bbb
4 changed files with 9 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ public class QAEvent {
public static final String DISCARDED = "discarded";
public static final String OPENAIRE_SOURCE = "openaire";
public static final String INTERNAL_ITEM_SOURCE = "internal-item";
public static final String DSPACE_USERS_SOURCE = "DSpaceUsers";
private String source;
@@ -197,7 +197,7 @@ public class QAEvent {
switch (getSource()) {
case OPENAIRE_SOURCE:
return OpenaireMessageDTO.class;
case INTERNAL_ITEM_SOURCE:
case DSPACE_USERS_SOURCE:
return CorrectionTypeMessageDTO.class;
default:
throw new IllegalArgumentException("Unknown event's source: " + getSource());

View File

@@ -7,7 +7,7 @@
*/
package org.dspace.correctiontype;
import static org.dspace.content.QAEvent.INTERNAL_ITEM_SOURCE;
import static org.dspace.content.QAEvent.DSPACE_USERS_SOURCE;
import java.sql.SQLException;
import java.util.Date;
@@ -57,8 +57,8 @@ public class ReinstateCorrectionType implements CorrectionType, InitializingBean
@Override
public QAEvent createCorrection(Context context, Item targetItem, QAMessageDTO reason) {
CorrectionTypeMessageDTO mesasge = (CorrectionTypeMessageDTO) reason;
QAEvent qaEvent = new QAEvent(INTERNAL_ITEM_SOURCE,
"handle:" + targetItem.getHandle(),
QAEvent qaEvent = new QAEvent(DSPACE_USERS_SOURCE,
context.getCurrentUser().getID().toString(),
targetItem.getID().toString(),
targetItem.getName(),
this.getTopic(),

View File

@@ -7,7 +7,7 @@
*/
package org.dspace.correctiontype;
import static org.dspace.content.QAEvent.INTERNAL_ITEM_SOURCE;
import static org.dspace.content.QAEvent.DSPACE_USERS_SOURCE;
import static org.dspace.core.Constants.READ;
import java.sql.SQLException;
@@ -51,8 +51,8 @@ public class WithdrawnCorrectionType implements CorrectionType, InitializingBean
@Override
public QAEvent createCorrection(Context context, Item targetItem, QAMessageDTO reason) {
CorrectionTypeMessageDTO mesasge = (CorrectionTypeMessageDTO) reason;
QAEvent qaEvent = new QAEvent(INTERNAL_ITEM_SOURCE,
"handle:" + targetItem.getHandle(),
QAEvent qaEvent = new QAEvent(DSPACE_USERS_SOURCE,
context.getCurrentUser().getID().toString(),
targetItem.getID().toString(),
targetItem.getName(),
this.getTopic(), 1.0,

View File

@@ -1086,7 +1086,7 @@ webui.preview.brand.fontpoint = 12
# ItemCountDAO.class = org.dspace.browse.ItemCountDAOSolr
###### QAEvent source Configuration ######
qaevent.sources = openaire, internal-item
qaevent.sources = openaire, DSpaceUsers
###### Browse Configuration ######
#