Completed Feature #17577

Commented code for Task #12480

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@181846 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-09-24 15:21:30 +00:00
parent b1ec83dda6
commit c9eac5b05c
5 changed files with 12 additions and 9 deletions

View File

@ -5,8 +5,10 @@
<Change>[Feature #11331] Field repeatability: support for catalogue <Change>[Feature #11331] Field repeatability: support for catalogue
widget widget
</Change> </Change>
<Change>[Task #12480] Data Catalogue Publishing widget: filter the VREs for the working gateway <Change>[Task #12480] Data Catalogue Publishing widget: filter the
widget VREs for the working gateway widget
</Change>
<Change>[Feature #17577] Modify ckan-metadata-publisher-widget posts to cite people with @username
</Change> </Change>
</Changeset> </Changeset>
<Changeset <Changeset

View File

@ -21,7 +21,7 @@
} }
@external .form-horizontal .input-large; @external .form-horizontal .input-large;
.form-horizontal .input-large { .form-horizontal .input-large .input-prepend {
width: 95%; width: 95%;
} }

View File

@ -410,8 +410,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
return resource; return resource;
}else{ }else{
ResourceBean resourceBean = new ResourceBean( ResourceBean resourceBean = new ResourceBean(
resource.getUrl(), resource.getUrl(),
resource.getName(), resource.getName(),

View File

@ -2,13 +2,10 @@ package org.gcube.portlets.widgets.ckandatapublisherwidget.server.threads;
import java.io.IOException; import java.io.IOException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.util.Base64;
import java.util.List; import java.util.List;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.portal.GCubePortalConstants;
import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portal.databook.client.GCubeSocialNetworking;
import org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.GCoreEndPointReaderSocial; import org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.GCoreEndPointReaderSocial;
import org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.GenericUtils; import org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.GenericUtils;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@ -94,12 +91,16 @@ public class WritePostCatalogueManagerThread extends Thread {
ScopeProvider.instance.set(scope); ScopeProvider.instance.set(scope);
SecurityTokenProvider.instance.set(token); SecurityTokenProvider.instance.set(token);
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(userCurrentUrl) + GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; //see Feature #17577
/*final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(userCurrentUrl) + GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
userFullName = "<a class=\"link\" href=\"" + profilePageURL + "?"+ userFullName = "<a class=\"link\" href=\"" + profilePageURL + "?"+
Base64.getEncoder().encodeToString(GCubeSocialNetworking.USER_PROFILE_OID.getBytes())+"="+ Base64.getEncoder().encodeToString(GCubeSocialNetworking.USER_PROFILE_OID.getBytes())+"="+
Base64.getEncoder().encodeToString(username.getBytes())+"\">"+userFullName+ Base64.getEncoder().encodeToString(username.getBytes())+"\">"+userFullName+
"</a> "; "</a> ";
*/
userFullName = "@"+username;
// write // write
writeProductPost( writeProductPost(

View File

@ -61,6 +61,7 @@ public class CatalogueRoleManager {
logger.debug("Group id is " + currentGroupId + " and scope is " + currentScope + "and gateway is "+gatewayHostname); logger.debug("Group id is " + currentGroupId + " and scope is " + currentScope + "and gateway is "+gatewayHostname);
Set<GCubeGroup> groups; Set<GCubeGroup> groups;
//Updated by Francesco see Task #12480
if(gatewayHostname!=null && !gatewayHostname.isEmpty()) { if(gatewayHostname!=null && !gatewayHostname.isEmpty()) {
// retrieve the list of organizations for the current user filtered for gateway // retrieve the list of organizations for the current user filtered for gateway
groups = groupManager.listGroupsByUserAndSite(userid, gatewayHostname); groups = groupManager.listGroupsByUserAndSite(userid, gatewayHostname);