Merge pull request 'feature_23491' (#2) from feature_23491 into master

Reviewed-on: #2
This commit is contained in:
Francesco Mangiacrapa 2022-06-14 16:54:39 +02:00
commit edee985a39
5 changed files with 568 additions and 549 deletions

View File

@ -4,101 +4,105 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.1.0-SNAPSHOT] - 2022-06-13
**Enhancements**
- [#23491] The final URL provided to go to the item is the "Catalogue Portlet URL"
## [v2.0.1] - 2021-05-24
**Bug fixes**
[#21470] Fixing: publishing widget uses the orgTitle instead of orgName
- [#21470] Fixing: publishing widget uses the orgTitle instead of orgName
**New**
Moved to maven-portal-bom 3.6.2
- Moved to maven-portal-bom 3.6.2
## [v2.0.0] - 2021-04-12
**Enhancements**
[#19764] Porting ckan-metadata-publisher-widget to catalogue-util-library
[#20680] Ported to SHUB
[#19568] Unify and extend the tags allowed values
[#20828] Revisited title size and format
[#20868] Redesigned the "Manage Resources" user experience
[#21068] Add Resources facility: only HTTPS URLs must be allowed
[#21153] Upgrade the maven-portal-bom to 3.6.1 version
- [#19764] Porting ckan-metadata-publisher-widget to catalogue-util-library
- [#20680] Ported to SHUB
- [#19568] Unify and extend the tags allowed values
- [#20828] Revisited title size and format
- [#20868] Redesigned the "Manage Resources" user experience
- [#21068] Add Resources facility: only HTTPS URLs must be allowed
- [#21153] Upgrade the maven-portal-bom to 3.6.1 version
## [v1.6.2] - 2021-02-08
**Bug Fixes**
[#20446] Catalogue Publishing Widget: field value unexpectedly added in case of optional field
[#20663] Fixing Time_Interval placeholder
- [#20446] Catalogue Publishing Widget: field value unexpectedly added in case of optional field
- [#20663] Fixing Time_Interval placeholder
## [v1.6.1] [r4.24.0] - 2020-06-18
## [v1.6.1] - 2020-06-18
**New Features**
[#18700] Do not skip regex validation on catalogue item when a field is empty (UI side)
- [#18700] Do not skip regex validation on catalogue item when a field is empty (UI side)
## [v1.6.0] - 2019-09-25
[Feature #11331] Field repeatability: support for catalogue widget
- [Feature #11331] Field repeatability: support for catalogue widget
[Task #12480] Data Catalogue Publishing widget: filter the VREs for the working gateway widget
- [Task #12480] Data Catalogue Publishing widget: filter the VREs for the working gateway widget
[Feature #17577] Modify ckan-metadata-publisher-widget posts to cite people with @username
- [Feature #17577] Modify ckan-metadata-publisher-widget posts to cite people with @username
[Support #13188] Fixed some logs
- [Support #13188] Fixed some logs
## [v1.5.0] - 2019-06-11
[Feature #13074] Integrated with 'openlayer-basic-widgets'
- [Feature #13074] Integrated with 'openlayer-basic-widgets'
## [v1.4.1] - 2018-11-20
[Bug #12914] The form to add/choice the resources to publishing remains frozen
- [Bug #12914] The form to add/choice the resources to publishing remains frozen
## [v1.4.0] - 2018-09-28
[Incident #12563] Error when trying to publish the content of a workspace folder into the catalogue
- [Incident #12563] Error when trying to publish the content of a workspace folder into the catalogue
## [v1.3.3] - 2018-03-02
Minor update
- Minor update
## [v1.3.2] - 2018-02-26
Minor update due to interface changed
- Minor update due to interface changed
## [v1.3.1] - 2017-06-26
External Url files are properly managed as resources
- External Url files are properly managed as resources
## [v1.3.0] - 2017-05-05
Metadata model v.3 supported
- Metadata model v.3 supported
## [v1.2.3] - 2017-04-05
Some bug fixes
- Some bug fixes
## [v1.2.2] - 2017-02-27
Some minor terms changed
- Some minor terms changed
added support for ticket #7207
- added support for ticket #7207
## [v1.2.1] - 2017-02-02

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan-metadata-publisher-widget</artifactId>
<version>2.0.1</version>
<version>2.1.0-SNAPSHOT</version>
<name>gCube Ckan metadata publisher widget</name>
<description>
@ -42,7 +42,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.2</version>
<version>3.6.2-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -58,20 +58,19 @@ public class AddResourceToDataset extends Composite{
@UiField ControlGroup urlControlGroup;
@UiField ControlGroup nameControlGroup;
public AddResourceToDataset(HandlerManager eventBus, String datasetId, String datasetOrg, String owner, final String datasetUrl) {
public AddResourceToDataset(HandlerManager eventBus, String datasetId, String datasetTitle, String datasetOrg, String owner, final String datasetUrl) {
initWidget(uiBinder.createAndBindUi(this));
// save bus
this.eventBus = eventBus;
// save dataset id (it is needed when we will add resources)
this.datasetId = datasetId;
this.datasetOrg = datasetOrg;
goToDatasetButton.setText(
(datasetUrl.length() > 100 ?
datasetUrl.substring(0, 100) + "..." : datasetUrl)
);
String title = datasetTitle;
String link = "";
link += title.length() > 90 ? title.substring(0, 90) + "..." : title;
goToDatasetButton.setTitle("Go to the item: "+title);
goToDatasetButton.setText(link);
// goToDatasetButton.setHref(datasetUrl);
goToDatasetButton.addClickHandler(new ClickHandler() {

View File

@ -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");