[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 DISCARDED = "discarded";
public static final String OPENAIRE_SOURCE = "openaire"; 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; private String source;
@@ -197,7 +197,7 @@ public class QAEvent {
switch (getSource()) { switch (getSource()) {
case OPENAIRE_SOURCE: case OPENAIRE_SOURCE:
return OpenaireMessageDTO.class; return OpenaireMessageDTO.class;
case INTERNAL_ITEM_SOURCE: case DSPACE_USERS_SOURCE:
return CorrectionTypeMessageDTO.class; return CorrectionTypeMessageDTO.class;
default: default:
throw new IllegalArgumentException("Unknown event's source: " + getSource()); throw new IllegalArgumentException("Unknown event's source: " + getSource());

View File

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

View File

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

View File

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