|
|
|
@ -431,57 +431,12 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|
|
|
|
toCreate.setId(datasetId);
|
|
|
|
|
|
|
|
|
|
// retrieve the url
|
|
|
|
|
String datasetUrl = utils.getUnencryptedUrlFromDatasetIdOrName(datasetId);
|
|
|
|
|
toCreate.setSource(datasetUrl);
|
|
|
|
|
|
|
|
|
|
// add also this information as custom field
|
|
|
|
|
/**
|
|
|
|
|
* TODO NEEDED TO BE CHECK
|
|
|
|
|
*
|
|
|
|
|
* OLD CODE NOT NEEDED. NOW IT IS PERFORMED BY gCAT
|
|
|
|
|
Map<String, List<String>> addField = new HashMap<String, List<String>>();
|
|
|
|
|
addField.put(ITEM_URL_FIELD, Arrays.asList(datasetUrl));
|
|
|
|
|
utils.patchProductCustomFields(datasetId, userApiKey, addField, false);
|
|
|
|
|
//String datasetUrl = utils.getUnencryptedUrlFromDatasetIdOrName(datasetId);
|
|
|
|
|
//toCreate.setSource(datasetUrl);
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//TODO SHOULD BE NOTIFIED by gCAT
|
|
|
|
|
|
|
|
|
|
// start a thread that will associate this dataset with the group
|
|
|
|
|
// if(/*toCreate.getChosenType() != null ||*/ toCreate.getGroups() != null){
|
|
|
|
|
//
|
|
|
|
|
// AssociationToGroupAndNotifyThread threadAssociationToGroup =
|
|
|
|
|
// new AssociationToGroupAndNotifyThread(
|
|
|
|
|
// toCreate.getGroups(),
|
|
|
|
|
// toCreate.getGroupsForceCreation(),
|
|
|
|
|
// null, //toCreate.getChosenType(), TODO
|
|
|
|
|
// datasetUrl,
|
|
|
|
|
// datasetId,
|
|
|
|
|
// toCreate.getTitle(),
|
|
|
|
|
// GenericUtils.getCurrentUser(getThreadLocalRequest()).getFullname(),
|
|
|
|
|
// userName,
|
|
|
|
|
// utils,
|
|
|
|
|
// organizationNameOrId,
|
|
|
|
|
// getThreadLocalRequest()
|
|
|
|
|
// );
|
|
|
|
|
// threadAssociationToGroup.start();
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // launch notification thread
|
|
|
|
|
// WritePostCatalogueManagerThread threadWritePost =
|
|
|
|
|
// new WritePostCatalogueManagerThread(
|
|
|
|
|
// userName,
|
|
|
|
|
// scope,
|
|
|
|
|
// toCreate.getTitle(),
|
|
|
|
|
// datasetUrl,
|
|
|
|
|
// false, // send notification to other people
|
|
|
|
|
// toCreate.getTags(),
|
|
|
|
|
// GenericUtils.getCurrentUser(getThreadLocalRequest()).getFullname(),
|
|
|
|
|
// GenericUtils.getCurrentClientUrl(getThreadLocalRequest())
|
|
|
|
|
// );
|
|
|
|
|
// threadWritePost.start();
|
|
|
|
|
|
|
|
|
|
//#23491 Building the go to the item to "Catalogue Portlet URL" (instead of URI Resolver URL)
|
|
|
|
|
String catalogueURL = utils.getPortletUrl();
|
|
|
|
|
toCreate.setSource(String.format("%s?path=/dataset/%s", catalogueURL,datasetId));
|
|
|
|
|
return toCreate;
|
|
|
|
|
}else{
|
|
|
|
|
logger.error("Failed to create the dataset");
|
|
|
|
|