minor fixes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/grsf-manage-widget@163066 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
869421bad1
commit
cf872c6d87
|
@ -35,6 +35,7 @@ import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.github.gwtbootstrap.client.ui.TextArea;
|
import com.github.gwtbootstrap.client.ui.TextArea;
|
||||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.github.gwtbootstrap.client.ui.event.HiddenEvent;
|
import com.github.gwtbootstrap.client.ui.event.HiddenEvent;
|
||||||
import com.github.gwtbootstrap.client.ui.event.HiddenHandler;
|
import com.github.gwtbootstrap.client.ui.event.HiddenHandler;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -203,11 +204,14 @@ public class ManageProductWidget extends Composite{
|
||||||
|
|
||||||
// async request to fetch the product
|
// async request to fetch the product
|
||||||
retrieveProductBean(productIdentifier);
|
retrieveProductBean(productIdentifier);
|
||||||
|
|
||||||
listenEvents(this.eventBus);
|
listenEvents(this.eventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste events
|
||||||
|
* @param eventBus
|
||||||
|
*/
|
||||||
private void listenEvents(HandlerManager eventBus) {
|
private void listenEvents(HandlerManager eventBus) {
|
||||||
eventBus.addHandler(EnableConfirmButtonEvent.TYPE, new EnableConfirmButtonEventHandler() {
|
eventBus.addHandler(EnableConfirmButtonEvent.TYPE, new EnableConfirmButtonEventHandler() {
|
||||||
|
|
||||||
|
@ -281,9 +285,7 @@ public class ManageProductWidget extends Composite{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -319,7 +321,7 @@ public class ManageProductWidget extends Composite{
|
||||||
listBoxStatus.addItem("Select a new status");
|
listBoxStatus.addItem("Select a new status");
|
||||||
listBoxStatus.getElement().<SelectElement>cast().getOptions().getItem(0).setDisabled(true);
|
listBoxStatus.getElement().<SelectElement>cast().getOptions().getItem(0).setDisabled(true);
|
||||||
for (Status availableStatus : statusToShow) {
|
for (Status availableStatus : statusToShow) {
|
||||||
listBoxStatus.addItem(availableStatus.toString());
|
listBoxStatus.addItem(availableStatus.toString(), availableStatus.toString());
|
||||||
}
|
}
|
||||||
listBoxStatus.setSelectedIndex(0);
|
listBoxStatus.setSelectedIndex(0);
|
||||||
|
|
||||||
|
@ -327,9 +329,7 @@ public class ManageProductWidget extends Composite{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
|
|
||||||
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -337,9 +337,7 @@ public class ManageProductWidget extends Composite{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
|
|
||||||
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
eventBus.fireEvent(new EnableConfirmButtonEvent());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -388,17 +386,6 @@ public class ManageProductWidget extends Composite{
|
||||||
String report = "";
|
String report = "";
|
||||||
Set<String> hashtags = new HashSet<>();
|
Set<String> hashtags = new HashSet<>();
|
||||||
|
|
||||||
// if the status has not be changed ...
|
|
||||||
if(listBoxStatus.getSelectedIndex() <= 0){
|
|
||||||
bean.setNewStatus(bean.getCurrentStatus());
|
|
||||||
report = "- The Status is unchanged";
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
bean.setNewStatus(Status.fromString(listBoxStatus.getSelectedItemText()));
|
|
||||||
report = "- The Status has been changed to " + bean.getNewStatus().getOrigName();
|
|
||||||
hashtags.add(bean.getNewStatus().getOrigName());
|
|
||||||
}
|
|
||||||
|
|
||||||
manageProductModal.setCloseVisible(false);
|
manageProductModal.setCloseVisible(false);
|
||||||
cancelButton.setEnabled(false);
|
cancelButton.setEnabled(false);
|
||||||
confirmButton.setEnabled(false);
|
confirmButton.setEnabled(false);
|
||||||
|
@ -446,38 +433,53 @@ public class ManageProductWidget extends Composite{
|
||||||
if(!bean.getSimilarGrsfRecords().isEmpty()){
|
if(!bean.getSimilarGrsfRecords().isEmpty()){
|
||||||
report += "\n- Suggested merges:";
|
report += "\n- Suggested merges:";
|
||||||
for(SimilarGRSFRecord sR: bean.getSimilarGrsfRecords()){
|
for(SimilarGRSFRecord sR: bean.getSimilarGrsfRecords()){
|
||||||
|
|
||||||
if(sR.isSuggestedMerge()){
|
if(sR.isSuggestedMerge()){
|
||||||
bean.setMergesInvolved(true);
|
bean.setMergesInvolved(true);
|
||||||
report += "\n\t - merge the current record with record " + sR.getKnowledgeBaseId() + ";";
|
report += "\n\t - merge the current record with record " + sR.getKnowledgeBaseId() + ";";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(bean.isMergesInvolved()){
|
if(bean.isMergesInvolved()){
|
||||||
report += "\n- The update involves a merge operation.";
|
report += "\n- The update involves a merge operation;";
|
||||||
hashtags.add(HashTagsOnUpdate.MERGE.getString());
|
hashtags.add(HashTagsOnUpdate.MERGE.getString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// set new values
|
// set new values
|
||||||
bean.setAnnotation(new HTML(annotationArea.getText().trim()).getText());
|
bean.setAnnotation(new HTML(annotationArea.getText().trim()).getText());
|
||||||
|
|
||||||
if(bean.getAnnotation() != null && !bean.getAnnotation().isEmpty())
|
if(bean.getAnnotation() != null && !bean.getAnnotation().isEmpty())
|
||||||
report += "\n- Annotation message is: " + bean.getAnnotation();
|
report += "\n- Annotation message is: " + bean.getAnnotation() + ";";
|
||||||
|
|
||||||
// traceability flag
|
// traceability flag
|
||||||
Boolean traceabilityNewValue = traceabilityFlag.getValue();
|
Boolean traceabilityNewValue = traceabilityFlag.getValue();
|
||||||
boolean currentTraceabilitFlag = bean.isTraceabilityFlag();
|
boolean currentTraceabilitFlag = bean.isTraceabilityFlag();
|
||||||
if(!traceabilityNewValue.equals(currentTraceabilitFlag)){
|
if(!traceabilityNewValue.equals(currentTraceabilitFlag)){
|
||||||
report += "\n- Traceability flag has been changed to: " + traceabilityNewValue;
|
report += "\n- Traceability flag has been changed to: '" + traceabilityNewValue + "';";
|
||||||
|
|
||||||
if(traceabilityNewValue)
|
if(traceabilityNewValue)
|
||||||
hashtags.add(HashTagsOnUpdate.TRACEABILITY_FLAG_SET.getString());
|
hashtags.add(HashTagsOnUpdate.TRACEABILITY_FLAG_SET.getString());
|
||||||
else
|
else
|
||||||
hashtags.add(HashTagsOnUpdate.TRACEABILITY_FLAG_UNSET.getString());
|
hashtags.add(HashTagsOnUpdate.TRACEABILITY_FLAG_UNSET.getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update the traceability flag
|
||||||
bean.setTraceabilityFlag(traceabilityNewValue);
|
bean.setTraceabilityFlag(traceabilityNewValue);
|
||||||
|
|
||||||
|
// force the new status in the listbox
|
||||||
|
if(bean.isMergesInvolved()){
|
||||||
|
bean.setNewStatus(Status.To_be_Merged);
|
||||||
|
report += "\n- The Status has been changed to '" + bean.getNewStatus().getOrigName() + "'.";
|
||||||
|
}
|
||||||
|
else if(listBoxStatus.getSelectedIndex() <= 0){
|
||||||
|
// if the status has not be changed ...
|
||||||
|
bean.setNewStatus(bean.getCurrentStatus());
|
||||||
|
report += "\n- The Status is unchanged.";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
bean.setNewStatus(Status.fromString(listBoxStatus.getSelectedItemText()));
|
||||||
|
report += "\n- The Status has been changed to '" + bean.getNewStatus().getOrigName() + "'.";
|
||||||
|
hashtags.add(bean.getNewStatus().getOrigName());
|
||||||
|
}
|
||||||
|
|
||||||
// set the report
|
// set the report
|
||||||
bean.setReport(report);
|
bean.setReport(report);
|
||||||
|
|
||||||
|
@ -496,6 +498,8 @@ public class ManageProductWidget extends Composite{
|
||||||
formUpdate.setVisible(false);
|
formUpdate.setVisible(false);
|
||||||
manageProductModal.setCloseVisible(true);
|
manageProductModal.setCloseVisible(true);
|
||||||
cancelButton.setEnabled(true);
|
cancelButton.setEnabled(true);
|
||||||
|
cancelButton.setText("Ok");
|
||||||
|
cancelButton.setType(ButtonType.INFO);
|
||||||
loaderIcon.setVisible(false);
|
loaderIcon.setVisible(false);
|
||||||
updateSucceeded = true;
|
updateSucceeded = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.github.gwtbootstrap.client.ui.Image;
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.github.gwtbootstrap.client.ui.TextArea;
|
import com.github.gwtbootstrap.client.ui.TextArea;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.FontWeight;
|
import com.google.gwt.dom.client.Style.FontWeight;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
|
@ -94,7 +95,7 @@ public class ManageRevertOperationWidget extends Composite {
|
||||||
revertOperationModal.addStyleName("management-metadata-modal-style");
|
revertOperationModal.addStyleName("management-metadata-modal-style");
|
||||||
// revertOperationModal.getElement().getStyle().setWidth(60, Unit.PCT);
|
// revertOperationModal.getElement().getStyle().setWidth(60, Unit.PCT);
|
||||||
revertOperationModal.show();
|
revertOperationModal.show();
|
||||||
|
loaderIcon.getElement().getStyle().setMarginRight(10, Unit.PX);
|
||||||
moreInfoAboutOperation.getElement().getStyle().setMarginBottom(50, Unit.PX);
|
moreInfoAboutOperation.getElement().getStyle().setMarginBottom(50, Unit.PX);
|
||||||
|
|
||||||
// async request to fetch the product
|
// async request to fetch the product
|
||||||
|
@ -152,6 +153,7 @@ public class ManageRevertOperationWidget extends Composite {
|
||||||
|
|
||||||
loaderIcon.setVisible(true);
|
loaderIcon.setVisible(true);
|
||||||
revertButton.setEnabled(false);
|
revertButton.setEnabled(false);
|
||||||
|
cancelButton.setEnabled(false);
|
||||||
|
|
||||||
service.performRevertOperation(revertableOperation, new AsyncCallback<Boolean>() {
|
service.performRevertOperation(revertableOperation, new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
|
@ -168,7 +170,9 @@ public class ManageRevertOperationWidget extends Composite {
|
||||||
infoBlock.setType(AlertType.SUCCESS);
|
infoBlock.setType(AlertType.SUCCESS);
|
||||||
infoBlock.setText("The request has been processed successfully!");
|
infoBlock.setText("The request has been processed successfully!");
|
||||||
revertButton.removeFromParent();
|
revertButton.removeFromParent();
|
||||||
cancelButton.removeFromParent();
|
cancelButton.setText("Ok");
|
||||||
|
cancelButton.setType(ButtonType.INFO);
|
||||||
|
cancelButton.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,13 @@ public class GRSFNotificationService extends RemoteServiceServlet implements GRS
|
||||||
throw new Exception("This operation can no longer be reverted (link expired)!");
|
throw new Exception("This operation can no longer be reverted (link expired)!");
|
||||||
|
|
||||||
DataCatalogue catalogue = getCatalogue(context);
|
DataCatalogue catalogue = getCatalogue(context);
|
||||||
String recordUrl = catalogue.getDataset(uuid, catalogue.getApiKeyFromUsername(username)).getExtrasAsHashMap().get(Constants.ITEM_URL_FIELD);
|
Map<String, String> extras = catalogue.getDataset(uuid, catalogue.getApiKeyFromUsername(username)).getExtrasAsHashMap();
|
||||||
|
String recordUrl = extras.get(Constants.ITEM_URL_FIELD);
|
||||||
|
String currentStatus = extras.get(Constants.STATUS_OF_THE_GRSF_RECORD_CUSTOM_KEY);
|
||||||
|
|
||||||
|
// check current record status
|
||||||
|
if(!currentStatus.equals(Status.To_be_Merged.getOrigName()))
|
||||||
|
throw new Exception("This record is no longer involved in a merge operation!");
|
||||||
|
|
||||||
// check if it is a reviewer, than he can do what he wants (no matter the admin)
|
// check if it is a reviewer, than he can do what he wants (no matter the admin)
|
||||||
if(isReviewer){
|
if(isReviewer){
|
||||||
|
@ -522,7 +528,7 @@ public class GRSFNotificationService extends RemoteServiceServlet implements GRS
|
||||||
private boolean isReviewer(String username, List<GCubeTeam> teamRolesByUser){
|
private boolean isReviewer(String username, List<GCubeTeam> teamRolesByUser){
|
||||||
|
|
||||||
for (GCubeTeam team : teamRolesByUser) {
|
for (GCubeTeam team : teamRolesByUser) {
|
||||||
if(team.getTeamName().equals(team.getTeamName().equals(Constants.GRSF_CATALOGUE_REVIEWER_ROLE))){
|
if(team.getTeamName().equals(Constants.GRSF_CATALOGUE_REVIEWER_ROLE)){
|
||||||
logger.info("User " + username + " is allowed to modify GRSF records as reviewer");
|
logger.info("User " + username + " is allowed to modify GRSF records as reviewer");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class RevertOperationUrl {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(RevertOperationUrl.class);
|
private static final Logger logger = LoggerFactory.getLogger(RevertOperationUrl.class);
|
||||||
|
|
||||||
// parameters for reverting operations
|
// parameters for reverting operations
|
||||||
public static final String MANAGE_QUERY_PARAM = "manage=true&";
|
public static final String MANAGE_QUERY_PARAM = "manage=true";
|
||||||
public static final String ADMIN_QUERY_PARAM = "admin";
|
public static final String ADMIN_QUERY_PARAM = "admin";
|
||||||
public static final String TIMESTAMP_QUERY_PARAM = "t";
|
public static final String TIMESTAMP_QUERY_PARAM = "t";
|
||||||
public static final String UUID_QUERY_PARAM = "uuid";
|
public static final String UUID_QUERY_PARAM = "uuid";
|
||||||
|
@ -49,7 +49,7 @@ public class RevertOperationUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a crypted, encoded and shortened url
|
* Build an encrypted, encoded and shortened url
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@ -59,8 +59,9 @@ public class RevertOperationUrl {
|
||||||
logger.info("Query is " + query);
|
logger.info("Query is " + query);
|
||||||
String encryptedQuery = StringEncrypter.getEncrypter().encrypt(query);
|
String encryptedQuery = StringEncrypter.getEncrypter().encrypt(query);
|
||||||
encryptedQuery = URLEncoder.encode(encryptedQuery, "UTF-8");
|
encryptedQuery = URLEncoder.encode(encryptedQuery, "UTF-8");
|
||||||
|
logger.debug("Encrypted part looks like " + encryptedQuery);
|
||||||
String encryptedUrl =
|
String encryptedUrl =
|
||||||
baseUrl
|
baseUrl + "?"
|
||||||
+ MANAGE_QUERY_PARAM + "&"
|
+ MANAGE_QUERY_PARAM + "&"
|
||||||
+ encryptedQuery;
|
+ encryptedQuery;
|
||||||
UrlShortener shortener = new UrlShortener();
|
UrlShortener shortener = new UrlShortener();
|
||||||
|
@ -91,8 +92,7 @@ public class RevertOperationUrl {
|
||||||
|
|
||||||
String decoded = URLDecoder.decode(params, "UTF-8");
|
String decoded = URLDecoder.decode(params, "UTF-8");
|
||||||
String decrypted = StringEncrypter.getEncrypter().decrypt(decoded);
|
String decrypted = StringEncrypter.getEncrypter().decrypt(decoded);
|
||||||
|
logger.debug("Decrypted part looks like " + decrypted);
|
||||||
logger.info("Decrypted is " + decrypted);
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
String[] splittedQuery = decrypted.split("&");
|
String[] splittedQuery = decrypted.split("&");
|
||||||
|
@ -113,7 +113,7 @@ public class RevertOperationUrl {
|
||||||
this.uuid = value;
|
this.uuid = value;
|
||||||
break;
|
break;
|
||||||
case OPERATION_REVERT_QUERY_PARAM:
|
case OPERATION_REVERT_QUERY_PARAM:
|
||||||
this.operation = RevertableOperations.valueOf(value);
|
this.operation = RevertableOperations.valueOf(value.toUpperCase());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -126,7 +126,7 @@ public class RevertOperationUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTimestampValid() {
|
public boolean isTimestampValid() {
|
||||||
return TTL + this.timestamp < System.currentTimeMillis();
|
return (TTL + this.timestamp) > System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBaseUrl() {
|
public String getBaseUrl() {
|
||||||
|
|
|
@ -169,7 +169,6 @@ public class SocialCommunications {
|
||||||
// ask token application
|
// ask token application
|
||||||
HttpPost postRequest = new HttpPost(basePath + SOCIAL_SERVICE_APPLICATION_TOKEN + "?gcube-token=" + tokenUser);
|
HttpPost postRequest = new HttpPost(basePath + SOCIAL_SERVICE_APPLICATION_TOKEN + "?gcube-token=" + tokenUser);
|
||||||
JSONObject requestToken = new JSONObject();
|
JSONObject requestToken = new JSONObject();
|
||||||
// requestToken.put("app_id", APPLICATION_ID_CATALOGUE_MANAGER.split("\\.")[APPLICATION_ID_CATALOGUE_MANAGER.split("\\.").length - 1]); // TODO
|
|
||||||
requestToken.put("app_id", APPLICATION_ID_CATALOGUE_MANAGER);
|
requestToken.put("app_id", APPLICATION_ID_CATALOGUE_MANAGER);
|
||||||
StringEntity input = new StringEntity(requestToken.toJSONString());
|
StringEntity input = new StringEntity(requestToken.toJSONString());
|
||||||
input.setContentType(MEDIATYPE_JSON);
|
input.setContentType(MEDIATYPE_JSON);
|
||||||
|
@ -529,6 +528,9 @@ public class SocialCommunications {
|
||||||
replace("ORIGINAL_USER", rInfo.getFullNameOriginalAdmin());
|
replace("ORIGINAL_USER", rInfo.getFullNameOriginalAdmin());
|
||||||
String subject = "Revert merge request on GRSF Record";
|
String subject = "Revert merge request on GRSF Record";
|
||||||
|
|
||||||
|
messageToEditor = messageToEditor.replace("<br>", "\n");
|
||||||
|
messageToReviewer = messageToReviewer.replace("<br>", "\n");
|
||||||
|
|
||||||
// send email to the editor
|
// send email to the editor
|
||||||
logger.info("The message that is going to be send to the editor is\n" + messageToEditor);
|
logger.info("The message that is going to be send to the editor is\n" + messageToEditor);
|
||||||
HttpPost postRequest = new HttpPost(basePath + SOCIAL_SEND_EMAIL + "?gcube-token=" + applicationToken);
|
HttpPost postRequest = new HttpPost(basePath + SOCIAL_SEND_EMAIL + "?gcube-token=" + applicationToken);
|
||||||
|
|
|
@ -139,8 +139,6 @@ public class Utils {
|
||||||
|
|
||||||
toReturn.put(replacedKey, values);
|
toReturn.put(replacedKey, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +266,7 @@ public class Utils {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
// write post about this
|
// write post about this
|
||||||
SocialCommunications.writePostOnRevert(baseUrlSocial, rInfo, true);
|
SocialCommunications.writePostOnRevert(baseUrlSocial, rInfo, false);
|
||||||
|
|
||||||
// alert who's involved
|
// alert who's involved
|
||||||
SocialCommunications.sendEmailAdministratorsOnOperationReverted(baseUrlSocial, rInfo, groupId);
|
SocialCommunications.sendEmailAdministratorsOnOperationReverted(baseUrlSocial, rInfo, groupId);
|
||||||
|
@ -301,18 +299,14 @@ public class Utils {
|
||||||
for(SimilarGRSFRecord s: bean.getSimilarGrsfRecords()){
|
for(SimilarGRSFRecord s: bean.getSimilarGrsfRecords()){
|
||||||
if(s.isSuggestedMerge()){
|
if(s.isSuggestedMerge()){
|
||||||
String productId = s.getKnowledgeBaseId();
|
String productId = s.getKnowledgeBaseId();
|
||||||
Map<String, List<String>> extrasMap = getExtrasAsHashMap(catalogue.getDataset(productId, sysApi).getExtras());
|
// CkanDataset dataset = catalogue.getDataset(productId, sysApi);
|
||||||
extrasMap.put(Constants.STATUS_OF_THE_GRSF_RECORD_CUSTOM_KEY, Arrays.asList(Status.To_be_Merged.getOrigName()));
|
// Map<String, List<String>> extrasMap = getExtrasAsHashMap(dataset.getExtras());
|
||||||
catalogue.patchProductCustomFields(productId, sysApi, extrasMap);
|
Map<String, List<String>> updateStatus = new HashMap<String, List<String>>(1);
|
||||||
|
updateStatus.put(Constants.STATUS_OF_THE_GRSF_RECORD_CUSTOM_KEY, Arrays.asList(Status.To_be_Merged.getOrigName()));
|
||||||
|
catalogue.patchProductCustomFields(productId, sysApi, updateStatus, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the current status record
|
|
||||||
String productId = bean.getKnowledgeBaseId();
|
|
||||||
Map<String, List<String>> extrasMap = getExtrasAsHashMap(catalogue.getDataset(productId, sysApi).getExtras());
|
|
||||||
extrasMap.put(Constants.STATUS_OF_THE_GRSF_RECORD_CUSTOM_KEY, Arrays.asList(Status.To_be_Merged.getOrigName()));
|
|
||||||
catalogue.patchProductCustomFields(productId, sysApi, extrasMap);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,8 +29,10 @@ public class RevertableOperationInfo implements Serializable{
|
||||||
this.fullNameCurrentAdmin = fullNameCurrentAdmin;
|
this.fullNameCurrentAdmin = fullNameCurrentAdmin;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.fullNameOriginalAdmin = fullNameOriginalAdmin;
|
this.fullNameOriginalAdmin = fullNameOriginalAdmin;
|
||||||
|
this.userNameOriginalAdmin = userNameOriginalAdmin;
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTimestamp() {
|
public long getTimestamp() {
|
||||||
|
|
Loading…
Reference in New Issue