just added a patch code to run the catlaogue portlet by Eclipse

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@179744 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-06-10 08:31:43 +00:00
parent b0189baff8
commit d762ae0da1
4 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.6.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -20,7 +20,7 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.6.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -36,5 +36,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.6.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.6.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,4 +1,4 @@
eclipse.preferences.version=1
lastWarOutDir=/home/francesco-mangiacrapa/eclipse-workspace/gcube-ckan-datacatalog-TRUNK/target/gcube-ckan-datacatalog-1.6.0-SNAPSHOT
lastWarOutDir=/home/francesco-mangiacrapa/eclipse-workspace/gcube-ckan-datacatalog-TRUNK/target/gcube-ckan-datacatalog-1.6.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="gcube-ckan-datacatalog-1.6.0-SNAPSHOT">
<wb-module deploy-name="gcube-ckan-datacatalog-1.6.1-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>

View File

@ -14,6 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.codec.binary.Base64;
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
@ -204,8 +205,14 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
String token = null;
try{
logger.debug("Checking if token for user " + username + " in context " + context + " already exists...");
token = authorizationService().resolveTokenByUserAndContext(username, context);
logger.debug("It exists!");
//ADDED by Francesco Mangiacrapa
if(SessionUtil.isIntoPortal()) {
token = authorizationService().resolveTokenByUserAndContext(username, context);
logger.debug("It exists!");
}else {
logger.debug("Out of portal, I'm reading the user token from PortalContext");
token = PortalContext.getConfiguration().getCurrentUserToken(username,context);
}
}catch(ObjectNotFound e){
logger.info("Creating token for user " + username + " and context " + context);
token = authorizationService().generateUserToken(new UserInfo(username, new ArrayList<String>()), context);