Reorganized function order

This commit is contained in:
Luca Frosini 2021-11-18 16:54:17 +01:00
parent 904e475f2f
commit f00127a82a
1 changed files with 11 additions and 10 deletions

View File

@ -31,8 +31,8 @@ import org.gcube.gcat.oldutils.Validator;
import org.gcube.gcat.profile.MetadataUtility; import org.gcube.gcat.profile.MetadataUtility;
import org.gcube.gcat.social.PortalUser; import org.gcube.gcat.social.PortalUser;
import org.gcube.gcat.social.SocialPost; import org.gcube.gcat.social.SocialPost;
import org.gcube.gcat.social.ZulipStream;
import org.gcube.gcat.utils.URIResolver; import org.gcube.gcat.utils.URIResolver;
import org.gcube.gcat.zulip.ZulipStream;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -647,14 +647,6 @@ public class CKANPackage extends CKAN {
return cmItemStatus; return cmItemStatus;
} }
protected boolean isModerationEnabled() {
boolean moderationEnabled = ckanInstance.isModerationEnabled();
if(moderationEnabled && zulipStream==null) {
zulipStream = new ZulipStream("user@zulip.com", "apikey");
}
return moderationEnabled;
}
@Override @Override
public String read() { public String read() {
try { try {
@ -965,7 +957,16 @@ public class CKANPackage extends CKAN {
* ---------------------------------------------------------------------------------------- * ----------------------------------------------------------------------------------------
* *
*/ */
private void createNewStream() {
protected boolean isModerationEnabled() {
boolean moderationEnabled = ckanInstance.isModerationEnabled();
if(moderationEnabled && zulipStream==null) {
zulipStream = new ZulipStream("user@zulip.com", "apikey");
}
return moderationEnabled;
}
private void createNewStream() throws Exception {
String itemName = result.get(name).asText(); String itemName = result.get(name).asText();
zulipStream.setItemCoordinates(itemID, itemName); zulipStream.setItemCoordinates(itemID, itemName);
zulipStream.setCKANUser(ckanUser); zulipStream.setCKANUser(ckanUser);